wordpress/wp-content/plugins/sqlite-integration/utilities/utility.php
/**
	 * Method to get the textarea content and write it to db.php file.
	 *
	 * @param string $contents
	 * @return boolean
	 * @access private
	 */
Method to get the textarea content and write it to db.php file.
@param string $contents
@return boolean
@access private
Method to get the textarea content and write it to db . php file . @param string $contents @return boolean @access private
private function save_db_php($contents) {
		if (defined('WP_CONTENT_DIR')) {
			$file = WP_CONTENT_DIR . '/db.php';
		} else {
			$file = ABSPATH . 'wp-content/db.php';
		}
		$fh = fopen($file, "w+");
		if ($fh) {
			if (flock($fh, LOCK_EX)) {
				if (fwrite($fh, $contents) === false) {
					return false;
				}
				flock($fh, LOCK_UN);
			} else {
				return false;
			}
		}
		fclose($fh);
		return true;
	}
private function save_db_php ( $ contents ) { if ( defined ( 'WP_CONTENT_DIR' ) ) { $ file = WP_CONTENT_DIR . '/db.php' ; } else { $ file = ABSPATH . 'wp-content/db.php' ; } $ fh = fopen ( $ file , " w+ " ) ; if ( $ fh ) { if ( flock ( $ fh , LOCK_EX ) ) { if ( fwrite ( $ fh , $ contents ) === false ) { return false ; } flock ( $ fh , LOCK_UN ) ; } else { return false ; } } fclose ( $ fh ) ; return true ; }
Method to get the textarea content and write it to db.php file.
Method to get the textarea content and write it to db . php file .