/** * {@inheritdoc} */ public function save() { $contents = $this->getForStorage(); if ($this->adapter->has($this->file)) { $this->adapter->update($this->file, $contents); } else { $this->adapter->write($this->file, $contents); } }
/** * Update a file * * @param string $path path to file * @param string $contents file contents * @param mixed $config Config object or visibility setting * @throws FileNotFoundException * @return boolean success boolean */ public function update($path, $contents, $config = null) { $path = Util::normalizePath($path); $this->assertPresent($path); $object = $this->adapter->update($path, $contents, $config); if ($object === false) { return false; } $this->cache->updateObject($path, $object, true); return true; }