File "Migrate.php"
Full Path: /home/jovision/public_html/wp/wp-content/plugins/host-webfonts-local/src/DB/Migrate.php
File size: 2.01 KB
MIME-type: text/x-php
Charset: utf-8
<?php
/* * * * * * * * * * * * * * * * * * * * *
*
* ██████╗ ███╗ ███╗ ██████╗ ███████╗
* ██╔═══██╗████╗ ████║██╔════╝ ██╔════╝
* ██║ ██║██╔████╔██║██║ ███╗█████╗
* ██║ ██║██║╚██╔╝██║██║ ██║██╔══╝
* ╚██████╔╝██║ ╚═╝ ██║╚██████╔╝██║
* ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝
*
* @package : OMGF
* @author : Daan van den Bergh
* @copyright: © 2026 Daan van den Bergh
* @url : https://daan.dev
* * * * * * * * * * * * * * * * * * * */
namespace OMGF\DB;
use OMGF\Admin\Settings;
use OMGF\Helper as OMGF;
/**
* @codeCoverageIgnore
*/
class Migrate {
/** @var string */
private $current_version = '';
/**
* DB Migration constructor.
*/
public function __construct() {
/**
* Can be used to block migration scripts that shouldn't be run on a fresh installation.
*/
$this->current_version = OMGF_CURRENT_DB_VERSION;
if ( $this->should_run_migration( '5.3.3' ) ) {
new Migrate\V533();
}
if ( $this->should_run_migration( '5.3.4' ) ) {
new Migrate\V534();
}
if ( $this->should_run_migration( '5.6.0' ) ) {
new Migrate\V560();
}
if ( $this->should_run_migration( '5.8.1' ) ) {
new Migrate\V581();
}
if ( $this->should_run_migration( '6.0.0' ) ) {
new Migrate\V600();
}
if ( $this->should_run_migration( '6.2.0' ) ) {
new Migrate\V620();
}
if ( $this->should_run_migration( '6.3.0' ) ) {
new Migrate\V630();
}
if ( $this->should_run_migration( '6.3.1' ) ) {
new Migrate\V631();
}
}
/**
* Checks whether the migration script should run.
*
* @param mixed $version
*
* @return bool
*/
private function should_run_migration( $version ) {
return version_compare( $this->current_version, $version ) < 0;
}
}