diff options
author | Mario <mario@mariovavti.com> | 2024-07-06 11:05:22 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-07-06 11:05:22 +0000 |
commit | 45275910e606a02b12393714ea3b0409da440d61 (patch) | |
tree | 10b2d173d58cb930f8df28fe75af73dd4974c08c /Zotlabs/Lib/DB_Upgrade.php | |
parent | 0c1d0f7498661fb34dcca6f3c6566e757af310a7 (diff) | |
parent | c04e781926a78e514cdf211fa24930a331149072 (diff) | |
download | volse-hubzilla-45275910e606a02b12393714ea3b0409da440d61.tar.gz volse-hubzilla-45275910e606a02b12393714ea3b0409da440d61.tar.bz2 volse-hubzilla-45275910e606a02b12393714ea3b0409da440d61.zip |
Merge branch '9.2RC'master
Diffstat (limited to 'Zotlabs/Lib/DB_Upgrade.php')
-rw-r--r-- | Zotlabs/Lib/DB_Upgrade.php | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/Zotlabs/Lib/DB_Upgrade.php b/Zotlabs/Lib/DB_Upgrade.php index b6e3f7b7b..981c354a4 100644 --- a/Zotlabs/Lib/DB_Upgrade.php +++ b/Zotlabs/Lib/DB_Upgrade.php @@ -2,6 +2,7 @@ namespace Zotlabs\Lib; +use Zotlabs\Lib\Config; class DB_Upgrade { @@ -13,9 +14,9 @@ class DB_Upgrade { $this->config_name = 'db_version'; $this->func_prefix = '_'; - $build = get_config('system', 'db_version', 0); + $build = Config::Get('system', 'db_version', 0); if(! intval($build)) - $build = set_config('system', 'db_version', $db_revision); + $build = Config::Set('system', 'db_version', $db_revision); if($build == $db_revision) { // Nothing to be done. @@ -27,7 +28,7 @@ class DB_Upgrade { logger('Critical: check_config unable to determine database schema version'); return; } - + $current = intval($db_revision); if($stored < $current) { @@ -38,7 +39,7 @@ class DB_Upgrade { for($x = $stored + 1; $x <= $current; $x ++) { $s = '_' . $x; $cls = '\\Zotlabs\Update\\' . $s ; - if(! class_exists($cls)) { + if(! class_exists($cls)) { return; } @@ -52,10 +53,10 @@ class DB_Upgrade { Config::Load('database'); - if(get_config('database', $s)) + if(Config::Get('database', $s)) break; - set_config('database',$s, '1'); - + Config::Set('database',$s, '1'); + $c = new $cls(); @@ -65,10 +66,10 @@ class DB_Upgrade { $source = t('Source code of failed update: ') . "\n\n" . @file_get_contents('Zotlabs/Update/' . $s . '.php'); - + // Prevent sending hundreds of thousands of emails by creating - // a lockfile. + // a lockfile. $lockfile = 'store/[data]/mailsent'; @@ -77,7 +78,7 @@ class DB_Upgrade { @unlink($lockfile); //send the administrator an e-mail file_put_contents($lockfile, $x); - + $r = q("select account_language from account where account_email = '%s' limit 1", dbesc(\App::$config['system']['admin_email']) ); @@ -86,7 +87,7 @@ class DB_Upgrade { [ 'toEmail' => \App::$config['system']['admin_email'], 'messageSubject' => sprintf( t('Update Error at %s'), z_root()), - 'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'), + 'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'), [ '$sitename' => \App::$config['system']['sitename'], '$siteurl' => z_root(), @@ -104,11 +105,11 @@ class DB_Upgrade { pop_lang(); } else { - set_config('database',$s, 'success'); + Config::Set('database',$s, 'success'); } } } - set_config('system', 'db_version', $db_revision); + Config::Set('system', 'db_version', $db_revision); } } -}
\ No newline at end of file +} |