wordpress/wp-content/plugins/sqlite-integration/utilities/utility.php
/**
	 * Method to create backup database file.
	 *
	 * @return string array
	 * @access private
	 */
Method to create backup database file.
@return string array
@access private
Method to create backup database file . @return string array @access private
private function backup_db() {
		$domain = $this->text_domain;
		$result = array();
		$database_file = FQDB;
		$db_name = basename(FQDB);
		if (!file_exists($database_file)) {
			return false;
		}
		$today = date("Ymd");
		if (!extension_loaded('zip')) {
			$backup_file = $database_file . '.' . $today . '.back';
			if (copy($database_file, $backup_file)) {
				$result['success'] = basename($backup_file) . __(' was created.', $domain);
			} else {
				$result['error'] = basename($backup_file) . __(' was not created.', $domain);
			}
		} else {
			$backup_file = $database_file . '.' . $today . '.zip';
			$zip = new ZipArchive();
			$res = $zip->open($backup_file, ZipArchive::CREATE | ZipArchive::OVERWRITE);
			if ($res === true) {
				$zip->addFile($database_file, $db_name);
				$result['success'] = basename($backup_file) . __(' was created.', $domain);
			} else {
				$result['error'] = basename($backup_file) . __(' was not created.', $domain);
			}
			$zip->close();
		}
		return $result;
	}
private function backup_db ( ) { $ domain = $ this -> text_domain ; $ result = array ( ) ; $ database_file = FQDB ; $ db_name = basename ( FQDB ) ; if ( ! file_exists ( $ database_file ) ) { return false ; } $ today = date ( " Ymd " ) ; if ( ! extension_loaded ( 'zip' ) ) { $ backup_file = $ database_file . '.' . $ today . '.back' ; if ( copy ( $ database_file , $ backup_file ) ) { $ result [ 'success' ] = basename ( $ backup_file ) . __ ( ' was created.' , $ domain ) ; } else { $ result [ 'error' ] = basename ( $ backup_file ) . __ ( ' was not created.' , $ domain ) ; } } else { $ backup_file = $ database_file . '.' . $ today . '.zip' ; $ zip = new ZipArchive ( ) ; $ res = $ zip -> open ( $ backup_file , ZipArchive :: CREATE | ZipArchive :: OVERWRITE ) ; if ( $ res === true ) { $ zip -> addFile ( $ database_file , $ db_name ) ; $ result [ 'success' ] = basename ( $ backup_file ) . __ ( ' was created.' , $ domain ) ; } else { $ result [ 'error' ] = basename ( $ backup_file ) . __ ( ' was not created.' , $ domain ) ; } $ zip -> close ( ) ; } return $ result ; }
Method to create backup database file.
Method to create backup database file .