From 5edd13c6bb89c7434d8437f8cc74c038371fdbf8 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 21 Oct 2022 11:20:23 +0200 Subject: fix various issues --- Zotlabs/Module/Admin/Dbsync.php | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'Zotlabs/Module/Admin/Dbsync.php') diff --git a/Zotlabs/Module/Admin/Dbsync.php b/Zotlabs/Module/Admin/Dbsync.php index 183834301..b68e7bbc2 100644 --- a/Zotlabs/Module/Admin/Dbsync.php +++ b/Zotlabs/Module/Admin/Dbsync.php @@ -5,11 +5,11 @@ namespace Zotlabs\Module\Admin; class Dbsync { - + function get() { $o = ''; - + if(argc() > 3 && intval(argv(3)) && argv(2) === 'mark') { // remove the old style config if it exists del_config('database', 'update_r' . intval(argv(3))); @@ -29,7 +29,7 @@ class Dbsync { if(method_exists($c,'verify')) { $retval = $c->verify(); if($retval === UPDATE_FAILED) { - $o .= sprintf( t('Verification of update %s failed. Check system logs.'), $s); + $o .= sprintf( t('Verification of update %s failed. Check system logs.'), $s); } elseif($retval === UPDATE_SUCCESS) { $o .= sprintf( t('Update %s was successfully applied.'), $s); @@ -44,20 +44,8 @@ class Dbsync { } else $o .= sprintf( t('Update function %s could not be found.'), $s); - - return $o; - - - - - // remove the old style config if it exists - del_config('database', 'update_r' . intval(argv(3))); - set_config('database', '_' . intval(argv(3)), 'success'); - if(intval(get_config('system','db_version')) < intval(argv(3))) - set_config('system','db_version',intval(argv(3))); - info( t('Update has been marked successful') . EOL); - goaway(z_root() . '/admin/dbsync'); + return $o; } if(argc() > 2 && intval(argv(2))) { @@ -68,7 +56,7 @@ class Dbsync { $c = new $cls(); $retval = $c->run(); if($retval === UPDATE_FAILED) { - $o .= sprintf( t('Executing update procedure %s failed. Check system logs.'), $s); + $o .= sprintf( t('Executing update procedure %s failed. Check system logs.'), $s); } elseif($retval === UPDATE_SUCCESS) { $o .= sprintf( t('Update %s was successfully applied.'), $s); @@ -79,10 +67,10 @@ class Dbsync { } else $o .= sprintf( t('Update function %s could not be found.'), $s); - + return $o; } - + $failed = array(); $r = q("select * from config where cat = 'database' "); if(count($r)) { @@ -107,7 +95,7 @@ class Dbsync { else { return '

' . t('No failed updates.') . '

'; } - + return $o; } -} \ No newline at end of file +} -- cgit v1.2.3