wordpress/wp-content/plugins/sqlite-integration/utilities/utility.php
/**
	 * Method to replace the old db.php with the new one.
	 *
	 * @return boolean
	 * @access private
	 */
Method to replace the old db.php with the new one.
@return boolean
@access private
Method to replace the old db . php with the new one . @return boolean @access private
private function update_db_file() {
		$new_file = PDODIR . 'db.php';
		if (file_exists($new_file) && is_readable($new_file)) {
			$contents = file_get_contents($new_file);
		} else {
			return false;
		}
		if (defined('WP_CONTENT_DIR')) {
			$path = WP_CONTENT_DIR . '/db.php';
		} else {
			$path = ABSPATH . 'wp-content/db.php';
		}
		if (($handle = @fopen($path, 'w+')) && flock($handle, LOCK_EX)) {
			if (fwrite($handle, $contents) == false) {
				flock($handle, LOCK_UN);
				fclose($handle);
				return false;
			}
			flock($handle, LOCK_UN);
			fclose($handle);
		} else {
			return false;
		}
		return true;
	}
private function update_db_file ( ) { $ new_file = PDODIR . 'db.php' ; if ( file_exists ( $ new_file ) && is_readable ( $ new_file ) ) { $ contents = file_get_contents ( $ new_file ) ; } else { return false ; } if ( defined ( 'WP_CONTENT_DIR' ) ) { $ path = WP_CONTENT_DIR . '/db.php' ; } else { $ path = ABSPATH . 'wp-content/db.php' ; } if ( ( $ handle = @ fopen ( $ path , 'w+' ) ) && flock ( $ handle , LOCK_EX ) ) { if ( fwrite ( $ handle , $ contents ) == false ) { flock ( $ handle , LOCK_UN ) ; fclose ( $ handle ) ; return false ; } flock ( $ handle , LOCK_UN ) ; fclose ( $ handle ) ; } else { return false ; } return true ; }
Method to replace the old db.php with the new one.
Method to replace the old db . php with the new one .