src/WPConfigTransformer.php
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;
	}
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;
	}
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 ; }
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
Saves new contents to the wp - config . php file .