wordpress/wp-content/plugins/sqlite-integration/utilities/database_maintenance.php
/**
	 * Method to create a back up file of the database.
	 *
	 * It returns true if success, false if failure.
	 *
	 * @return boolean
	 */
Method to create a back up file of the database.
It returns true if success, false if failure.

@return boolean
Method to create a back up file of the database . It returns true if success false if failure . @return boolean
private function maintenance_backup() {
		$result = array();
		$database_file = FQDB;
		$db_name = basename(FQDB);
		if (!file_exists($database_file)) {
			return false;
		}
		$today = date("Ymd-His");
		if (!extension_loaded('zip')) {
			$backup_file = $database_file . '.' . $today . '.maintenance-backup';
			if (copy($database_file, $backup_file)) {
				$result = true;
			} else {
				$result = false;
			}
		} else {
			$backup_file = $database_file . '.' . $today . '.maintenance-backup.zip';
			$zip = new ZipArchive();
			$res = $zip->open($backup_file, ZipArchive::CREATE | ZipArchive::OVERWRITE);
			if ($res === true) {
				$zip->addFile($database_file, $db_name);
				$result = true;
			} else {
				$result = false;
			}
			$zip->close();
		}
		return $result;
	}
private function maintenance_backup ( ) { $ result = array ( ) ; $ database_file = FQDB ; $ db_name = basename ( FQDB ) ; if ( ! file_exists ( $ database_file ) ) { return false ; } $ today = date ( " Ymd-His " ) ; if ( ! extension_loaded ( 'zip' ) ) { $ backup_file = $ database_file . '.' . $ today . '.maintenance-backup' ; if ( copy ( $ database_file , $ backup_file ) ) { $ result = true ; } else { $ result = false ; } } else { $ backup_file = $ database_file . '.' . $ today . '.maintenance-backup.zip' ; $ zip = new ZipArchive ( ) ; $ res = $ zip -> open ( $ backup_file , ZipArchive :: CREATE | ZipArchive :: OVERWRITE ) ; if ( $ res === true ) { $ zip -> addFile ( $ database_file , $ db_name ) ; $ result = true ; } else { $ result = false ; } $ zip -> close ( ) ; } return $ result ; }
Method to create a back up file of the database.
Method to create a back up file of the database .