Saves new contents to the wp-config.php file.

@throws Exception If the config file content provided is empty.
@throws Exception If there is a failure when saving the wp-config.php file.

@param string $contents New config contents.

@return bool
329176
protected function save( $contents ) {
		if ( ! trim( $contents ) ) {
			throw new Exception( 'Cannot save the config file with empty contents.' );
		}

		if ( $contents === $this->wp_config_src ) {
			return false;
		}

		$result = file_put_contents( $this->wp_config_path, $contents, LOCK_EX );

		if ( false === $result ) {
			throw new Exception( 'Failed to update the config file.' );
		}

		return true;
	}
45174
protected function save($contents)
    {
        $fp = fopen($this->fileName, $this->openMode);
        fwrite($fp, $contents);
        fclose($fp);

        chmod($this->fileName, $this->getPermission());
    }
391649
public function write( $key, $contents ) {
		$filename = $this->prepare_write( $key );

		if ( $filename ) {
			return file_put_contents( $filename, $contents ) && touch( $filename );
		}

		return false;
	}
290273
public function save($chmod = null)
    {
        if ($this->modified) {
            if (false === @file_put_contents($this->filename, $this->generateIni())) {
                throw new \Exception('Impossible to write into '.$this->filename);
            } elseif ($chmod) {
                chmod($this->filename, $chmod);
            }
            $this->modified = false;
        }
    }
379086
public function write(string $contents) : void
    {
        file_put_contents($this->filename, $contents);
        $this->timestamp = time();
    }
727553
public function create_lockfile($contents=null) {
		if(!$this->is_lockfile_present()) {
			$retval = $this->fsObj->create_file($this->get_lockfile());
			
			if(!is_null($contents)) {
				$this->fsObj->write($contents);
			}
		}
		else {
			throw new exception(__METHOD__ .": lockfile (". $this->lockFile .") already present");
		}
		
		return($retval);
	}
1170729
public function save($file, $content)
    {
        $dir = dirname($file);

        if (!is_dir($dir)) {
            mkdir($dir, 0777);
        }

        if (file_put_contents($file, $content)) {
            chmod($file, 0777);

            return true;
        } else {
            $message = "Cannot open cache file for writing: ";
            //			if (!Nip_Staging::instance()->isPublic()) {
            //				$message .= " [ ".$this->cache_file." ] ";
            //			}
            die($message);
        }
    }
407320
public function put($path, $contents)
    {
        $directory = dirname($path);
        $this->createDir($directory);
        $path = $this->getPath($path);
        if (!file_exists($path) && !is_writable(dirname($path))) {
            throw new RuntimeException(dirname($path) . ' is not writable');
        }

        if (file_exists($path) && !is_writable($path)) {
            throw new RuntimeException($path . ' is not writable');
        }

        return file_put_contents($path, $contents);
    }
53203
protected function save()
    {
        if (false === ($result = @file_put_contents($this->getFilename(), $this->token))) {
            throw new \Exception(sprintf('Token could not be saved to "%s"', $this->getFilename()));
        }
    }
747374
public function save($contents)
    {
        $result = (string)file_put_contents($this->file, $contents, LOCK_EX | FILE_TEXT);
        $log = "[BEAR.Ace] saved:{$this->file} result:{$result}";

        return $log;
    }
1271307
public function put($path, $contents, array $config = [])
    {
        $path = Util::normalizePath($path);
        $config += $this->config;

        if (!$this->adapter->canOverwrite() && $this->has($path)) {
            return (bool) $this->adapter->update($path, $contents, $config);
        }

        return (bool) $this->adapter->write($path, $contents, $config);
    }
108796
public function appendToFile($content)
    {
        $result = @fwrite($this->_file, $content);

        if ($result === false) {
            throw new Exception("I'm can not wrtite to file");
        }

        return $result;
    }
798290
public function save($content)
    {
        $this->_isSaved = true;
        $this->_contentSaved = (string) $content;
        $this->_block->updateContent($this->_contentSaved);
        return $this;
    }
174363
private static function write($content)
	{
		self::lock();
		if ( is_null( self::$authFileP ) ) throw new Exception( 'No lock has been requested' );
		ftruncate( self::$authFileP , 0 );
		fwrite( self::$authFileP , $content );

		return fflush( self::$authFileP );
	}
200279
private function saveCache($section) {
    $content = serialize($this->cache[$section]);
    $file = $this->getCacheFile($section);
    $this->fileUtil->mkdirRec(dirname($file));
    $fh = fopen($file, "w");
    if ($fh !== false) {
      fwrite($fh, $content);
      fclose($fh);
    }
    else {
      throw new ConfigurationException("The cache path is not writable: ".$file);
    }
  }
257254
public function saveTemporary()
    {
        $this->applyFilters();

        if (!$this->hasTranslations() || !$this->isValid()) {
            throw new Exception('unable to save empty or invalid translations');
        }

        $path = $this->getTemporaryTranslationPath();

        Filesystem::mkdir(dirname($path));

        return file_put_contents($path, $this->__toString());
    }
1237154
public function write($path, $contents, array $config = [])
    {
        [$prefix, $path] = $this->getPrefixAndPath($path);

        return $this->getFilesystem($prefix)->write($path, $contents, $config);
    }