first commit
This commit is contained in:
28
wp-content/plugins/brizy/admin/migrations/global-storage.php
Normal file
28
wp-content/plugins/brizy/admin/migrations/global-storage.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
class Brizy_Admin_Migrations_GlobalStorage extends Brizy_Admin_Migrations_AbstractStorage {
|
||||
|
||||
/**
|
||||
* Save run migrations
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function storeData() {
|
||||
update_option( Brizy_Admin_Migrations_AbstractStorage::KEY, $this->data );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed|void
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function loadData() {
|
||||
$this->data = get_option( Brizy_Admin_Migrations_AbstractStorage::KEY, array() );
|
||||
|
||||
|
||||
foreach ( $this->data as $i => $migration ) {
|
||||
if ( $migration instanceof __PHP_Incomplete_Class ) {
|
||||
throw new Brizy_Admin_Migrations_UpgradeRequiredException( 'Please update the plugin to the latest version' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user