From 3f95076b817a8806d62b6aa7ad295b52425fe167 Mon Sep 17 00:00:00 2001 From: Abdulrahman Date: Mon, 13 May 2019 00:03:24 +0300 Subject: [PATCH] improve update system --- includes/adm/p_check_update.php | 57 ++++-- includes/style.php | 20 +- includes/version.php | 4 + install/includes/Plugins.php | 28 --- install/includes/functions_install.php | 70 ++++--- install/includes/update_files/index.html | 1 - .../1.7_to_2.0.php => update_schema.php} | 46 ++--- install/index.php | 22 +-- install/install.php | 61 +++--- install/quick.php | 15 +- install/style/check.html | 26 ++- install/style/check_all.html | 18 +- install/style/configs.html | 11 -- install/style/header.html | 4 +- install/style/lang.html | 4 +- install/style/plugins_done.html | 31 --- install/style/plugins_options.html | 38 ---- install/style/style.css | 4 +- install/update.php | 185 ++++++------------ lang/ar/install.php | 12 +- lang/en/install.php | 11 +- 21 files changed, 253 insertions(+), 415 deletions(-) delete mode 100644 install/includes/Plugins.php delete mode 100755 install/includes/update_files/index.html rename install/includes/{update_files/1.7_to_2.0.php => update_schema.php} (68%) mode change 100644 => 100755 delete mode 100755 install/style/plugins_done.html delete mode 100755 install/style/plugins_options.html diff --git a/includes/adm/p_check_update.php b/includes/adm/p_check_update.php index 3c623cd..ba87135 100755 --- a/includes/adm/p_check_update.php +++ b/includes/adm/p_check_update.php @@ -15,7 +15,7 @@ if (! defined('IN_ADMIN')) set_time_limit(0); -$current_version = '3.0'; +$current_version = KLEEJA_VERSION; $new_version = unserialize($config['new_version']); $new_version = empty($new_version['version_number']) ? KLEEJA_VERSION @@ -167,13 +167,13 @@ elseif ($current_smt == 'update2') } // let's check if there any update files in install folder - $update_file = PATH . "cache/kleeja-{$new_version}/install/includes/update_files/{$old_version}_to_{$new_version}.php"; + $update_file = PATH . "cache/kleeja-{$new_version}/install/includes/update_schema.php"; if (file_exists($update_file)) { // move the update file from install folder to cache folder to include it later and delete install folder // becuse if install folder is exists , it can make some problems if dev mode is not active - rename($update_file, PATH . "cache/update_{$old_version}_to_{$new_version}.php"); + rename($update_file, PATH . "cache/update_schema.php"); } // skip some folders @@ -299,36 +299,51 @@ elseif ($current_smt == 'update3') else { // we will include what we want to do in this file , and kleeja will done - if (file_exists($db_update_file = PATH . "cache/update_{$old_version}_to_{$new_version}.php")) + if (file_exists($db_update_file = PATH . "cache/update_schema.php")) { require_once $db_update_file; - if($config['db_version'] < UPDATE_DB_VERSION) + $all_db_updates = array_keys($update_schema); + + $available_db_updates = array_filter($all_db_updates, function ($v) use ($config) { + return $v > $config['db_version']; + }); + + sort($available_db_updates); + + if(sizeof($available_db_updates)) { - $SQL->show_errors = false; - if (isset($update_sqls) && sizeof($update_sqls) > 0) + foreach ($available_db_updates as $db_update_version) { - foreach ($update_sqls as $name=>$sql_content) - { - $SQL->query($sql_content); - } - } + $SQL->show_errors = false; - if (isset($update_functions) && sizeof($update_functions) > 0) - { - foreach ($update_functions as $n) + if (isset($update_schema[$db_update_version]['sql']) + && sizeof($update_schema[$db_update_version]['sql']) > 0) { - if (is_callable($n)) + foreach ($update_schema[$db_update_version]['sql'] as $name=>$sql_content) { - $n(); + $SQL->query($sql_content); } } - } - $SQL->query( - "UPDATE `{$dbprefix}config` SET `value` = '" . UPDATE_DB_VERSION . "' WHERE `name` = 'db_version'" - ); + if (isset($update_schema[$db_update_version]['functions']) + && sizeof($update_schema[$db_update_version]['functions']) > 0) + { + foreach ($update_schema[$db_update_version]['functions'] as $n) + { + if (is_callable($n)) + { + $n(); + } + } + } + + + $SQL->query( + "UPDATE `{$dbprefix}config` SET `value` = '" . $db_update_version . "' WHERE `name` = 'db_version'" + ); + } } } diff --git a/includes/style.php b/includes/style.php index 12f410c..bd1a1d5 100755 --- a/includes/style.php +++ b/includes/style.php @@ -140,7 +140,7 @@ class kleeja_style $html = preg_replace_callback('//i', ['kleeja_style', '_loop_callback'], $html); $html = preg_replace_callback(kleeja_style::reg('var'), ['kleeja_style', '_vars_callback'], $html); - $rep = + $rep = [ '/<\/(LOOP|IF|END|IS_BROWSER|UNLESS)>/i' => '', '//iU' => 'display("\\2"); ?>', @@ -364,8 +364,24 @@ class kleeja_style { $this->vars = &$GLOBALS; + $eval_on = false; + eval('$eval_on = true;'); + + $parsed_html = trim($this->_parse($html)); + ob_start(); - eval(' ?' . '>' . trim($this->_parse($html)) . '<' . '?php '); + + if($eval_on) + { + eval(' ?' . '>' . $parsed_html . '<' . '?php '); + } + else + { + $path = PATH . 'cache/tpl_' . md5($parsed_html) . '.php'; + file_put_contents($path, $parsed_html); + include_once $path; + } + $page = ob_get_contents(); ob_end_clean(); diff --git a/includes/version.php b/includes/version.php index 63de316..2449241 100755 --- a/includes/version.php +++ b/includes/version.php @@ -19,3 +19,7 @@ if (! defined('IN_COMMON')) define('KLEEJA_VERSION', '3.0.3'); define('KLEEJA_DB_VERSION', '9'); + +// Kleeja min requirements +define('MIN_PHP_VERSION', '7.0'); +define('MIN_MYSQL_VERSION', '4.2.2'); diff --git a/install/includes/Plugins.php b/install/includes/Plugins.php deleted file mode 100644 index dabe8a1..0000000 --- a/install/includes/Plugins.php +++ /dev/null @@ -1,28 +0,0 @@ -', file_get_contents('style/' . $tplname)); + ob_start(); - eval('?> ' . $tpl . ' ' . $tpl . 'Powered by Kleeja


403 - Access forbidden!


Powered by Kleeja >>> the best uploader ... >> Bugs | Plugins | Styles |
\ No newline at end of file diff --git a/install/includes/update_files/1.7_to_2.0.php b/install/includes/update_schema.php old mode 100644 new mode 100755 similarity index 68% rename from install/includes/update_files/1.7_to_2.0.php rename to install/includes/update_schema.php index 312bd5d..24aae7d --- a/install/includes/update_files/1.7_to_2.0.php +++ b/install/includes/update_schema.php @@ -1,12 +1,24 @@ "ALTER TABLE `{$dbprefix}files` CHANGE `size` `size` BIGINT(20) NOT NULL DEFAULT '0';", 'group_size_big' => "ALTER TABLE `{$dbprefix}groups_exts` CHANGE `size` `size` BIGINT(20) NOT NULL DEFAULT '0';", 'files_index_type' => "ALTER TABLE `{$dbprefix}files` ADD INDEX `type` (`type`);", @@ -14,19 +26,9 @@ $update_sqls = ]; -//$update_functions = array -//( -// function () { -// -// }, -// function () { -// -// }, -//); - - -//$update_notes = array -//( -// 'note .......', -// 'note 2 .......', -//); +// $update_schema[9]['functions'] = [ +// function () { +// }, +// function () { +// }, +// ]; diff --git a/install/index.php b/install/index.php index e879e27..04d5387 100755 --- a/install/index.php +++ b/install/index.php @@ -17,8 +17,7 @@ error_reporting(E_ALL ^ E_NOTICE); define('IN_COMMON', true); //path to this file from Kleeja root folder -$_path = '../'; -define('PATH', $_path); +define('PATH', '../'); //before anything check PHP version compatibility @@ -42,14 +41,14 @@ if (! function_exists('mysqli_connect')) -if (file_exists($_path . 'config.php')) +if (file_exists(PATH . 'config.php')) { - include_once $_path . 'config.php'; + include_once PATH . 'config.php'; } -include_once $_path . 'includes/functions.php'; +include_once PATH . 'includes/functions.php'; -include_once $_path . 'includes/mysqli.php'; +include_once PATH . 'includes/mysqli.php'; include_once 'includes/functions_install.php'; @@ -72,10 +71,9 @@ switch (g('step', 'str')) default: case 'language': - if (ig('ln') && g('ln', 'str', '') !== '') + if (ig('ln')) { - // header('Location: ./?step=official&lang=' . g('ln')); - echo ''; + echo ''; exit; } @@ -100,16 +98,16 @@ case 'choose' : $install_or_no = $php_ver = true; - //check version of PHP + //check version of PHP if (! function_exists('version_compare') || version_compare(PHP_VERSION, MIN_PHP_VERSION, '<')) { $php_ver = false; } - if (file_exists($_path . 'config.php')) + if (file_exists(PATH . 'config.php')) { - include_once $_path . 'config.php'; + include_once PATH . 'config.php'; if (! empty($dbuser) && ! empty($dbname)) { diff --git a/install/install.php b/install/install.php index 676a09e..0e0b707 100755 --- a/install/install.php +++ b/install/install.php @@ -16,19 +16,21 @@ * include important files */ define('IN_COMMON', true); -$_path = '../'; -define('PATH', $_path); +define('STOP_PLUGINS', true); +define('PATH', '../'); -if (file_exists($_path . 'config.php')) +if (file_exists(PATH . 'config.php')) { - include_once $_path . 'config.php'; + include_once PATH . 'config.php'; } -include_once 'includes/plugins.php'; -include_once $_path . 'includes/functions_display.php'; -include_once $_path . 'includes/functions_alternative.php'; -include_once $_path . 'includes/functions.php'; -include_once $_path . 'includes/mysqli.php'; +include_once PATH . 'includes/plugins.php'; +include_once PATH . 'includes/functions_display.php'; +include_once PATH . 'includes/functions_alternative.php'; +include_once PATH . 'includes/functions.php'; + + +include_once PATH . 'includes/mysqli.php'; include_once 'includes/functions_install.php'; @@ -60,7 +62,7 @@ if (! empty($dbuser) && ! empty($dbname) && ! (ig('step') && in_array(g('step'), /** * Print header */ -if (ip('dbsubmit') && ! is_writable($_path)) +if (ip('dbsubmit') && ! is_writable(PATH)) { // soon } @@ -97,20 +99,14 @@ break; case 'f': $check_ok = true; - $advices = $register_globals = $get_magic_quotes_gpc = false; + $advices = $ziparchive_lib = false; - if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') + if(! class_exists( 'ZipArchive')) { - $register_globals = true; + $ziparchive_lib = true; } - if ( (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) || - (@ini_get('magic_quotes_sybase') && (strtolower(@ini_get('magic_quotes_sybase')) != 'off')) ) - { - $get_magic_quotes_gpc = true; - } - - if ($register_globals || $get_magic_quotes_gpc) + if ($ziparchive_lib) { $advices = true; } @@ -124,18 +120,13 @@ case 'c': // after submit, generate config file if (ip('dbsubmit')) { - //lets do it - do_config_export( - p('db_server'), - p('db_user'), - p('db_pass'), - p('db_name'), - p('db_prefix') - ); + //create config file, or export it to browser on failure + do_config_export(p('db_server'), p('db_user'), p('db_pass'), p('db_name'), p('db_prefix')); } - $no_config = ! file_exists($_path . 'config.php') ? false : true; - $writeable_path = is_writable($_path) ? true : false; + + $no_config = ! file_exists(PATH . 'config.php') || ig('force') ? false : true; + $writeable_path = is_writable(PATH) ? true : false; echo gettpl('configs.html'); @@ -168,9 +159,9 @@ case 'check': //try to chmod them if (function_exists('chmod')) { - @chmod($_path . 'cache', 0755); - @chmod($_path . 'uploads', 0755); - @chmod($_path . 'uploads/thumbs', 0755); + @chmod(PATH . 'cache', 0755); + @chmod(PATH . 'uploads', 0755); + @chmod(PATH . 'uploads/thumbs', 0755); } echo gettpl('check_all.html'); @@ -213,8 +204,8 @@ case 'data' : //connect .. for check $SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname); - include_once $_path . 'includes/usr.php'; - include_once $_path . 'includes/functions_alternative.php'; + include_once PATH . 'includes/usr.php'; + include_once PATH . 'includes/functions_alternative.php'; $usrcp = new usrcp; $user_salt = substr(kleeja_base64_encode(pack('H*', sha1(mt_rand()))), 0, 7); diff --git a/install/quick.php b/install/quick.php index 47f5792..a376ea1 100644 --- a/install/quick.php +++ b/install/quick.php @@ -16,16 +16,15 @@ * include important files */ define('IN_COMMON', true); -$_path = '../'; +define('STOP_PLUGINS', true); define('PATH', __DIR__ . '/../'); define('CLI', PHP_SAPI === 'cli'); -include_once 'includes/plugins.php'; +include_once PATH . 'includes/plugins.php'; include_once PATH . 'includes/functions_display.php'; include_once PATH . 'includes/functions_alternative.php'; include_once PATH . 'includes/functions.php'; - include_once PATH . 'includes/mysqli.php'; include_once 'includes/functions_install.php'; @@ -45,15 +44,9 @@ if (file_exists(PATH . 'config.php')) } else { - do_config_export( - 'localhost', - 'root', - '', - 'kleeja', - 'klj_' - ); + do_config_export('localhost', 'root', '', 'kleeja', 'klj_'); - exit('`config.php` was missing! so we created one for you, now go fill it with database information.'); + exit('`config.php` was missing! so we created one for you, kindly edit the file with database information.'); } $SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname); diff --git a/install/style/check.html b/install/style/check.html index 6c960e7..64b1753 100755 --- a/install/style/check.html +++ b/install/style/check.html @@ -1,7 +1,7 @@
-

 {{echo $lang['FUNCTIONS_CHECK']}} :

+

 {{echo $lang['FUNCTIONS_CHECK']}} :

    {{if(function_exists('unlink')):}}
  • @@ -26,11 +26,11 @@

    [ {{echo $lang['FUNCTION_DISC_GD']}} ]

  • {{endif;}} - + {{if(function_exists('fopen')):}}
  •  {{echo sprintf($lang['FUNCTION_IS_EXISTS'], 'fopen')}}

    -

    [ {{echo $lang['FUNCTION_DISC_FOPEN']}} ]

    +

    [ {{echo $lang['FUNCTION_DISC_FOPEN']}} ]

  • {{else: $GLOBALS['check_ok'] = false;}}
  • @@ -53,21 +53,17 @@
- - {{if($GLOBALS['advices']):}} -

 {{echo $lang['ADVICES_CHECK']}} :

-
    - {{if($GLOBALS['register_globals']):}} -
  •  {{echo $lang['ADVICES_REGISTER_GLOBALS']}}

  • - {{endif;}} - {{if($GLOBALS['get_magic_quotes_gpc']):}} -
  •  {{echo $lang['ADVICES_MAGIC_QUOTES']}}

  • + {{if($GLOBALS['advices']):}} +

     {{echo $lang['ADVICES_CHECK']}} :

    +
      + {{if($GLOBALS['ziparchive_lib']):}} +
    •  {{echo $lang['ZIPARCHIVE_LIB']}}

    • {{endif;}}
    {{endif;}} - +
    {{if($GLOBALS['check_ok']):}}
    @@ -82,5 +78,5 @@ {{endif;}}
    -
    -
\ No newline at end of file +
+
diff --git a/install/style/check_all.html b/install/style/check_all.html index 630d487..1a714f8 100755 --- a/install/style/check_all.html +++ b/install/style/check_all.html @@ -8,32 +8,32 @@ {{endif}} - + {{if($GLOBALS['no_connection']): $GLOBALS['submit_disabled'] = true;}}

 {{echo $lang['INST_CONNCET_ERR']}}

{{endif}} - + {{if($GLOBALS['mysql_ver']): $GLOBALS['submit_disabled'] = true;}}

 {{echo sprintf($lang['INST_MYSQL_LESSMIN'], MIN_MYSQL_VERSION, $GLOBALS['mysql_ver'])}}

{{endif}} - {{if(!is_writable($_path . 'cache')) : $GLOBALS['submit_disabled'] = true;}} + {{if(!is_writable(PATH . 'cache')) : $GLOBALS['submit_disabled'] = true;}}

 [ cache ] : {{echo $lang['INST_NO_WRTABLE']}}

{{endif}} - - {{if(!is_writable($_path . 'uploads')) : $GLOBALS['submit_disabled'] = true;}} + + {{if(!is_writable(PATH . 'uploads')) : $GLOBALS['submit_disabled'] = true;}}

 [ uploads ] : {{echo $lang['INST_NO_WRTABLE']}}

{{endif}} - {{if(!is_writable($_path . 'uploads/thumbs')) : $GLOBALS['submit_disabled'] = true;}} + {{if(!is_writable(PATH . 'uploads/thumbs')) : $GLOBALS['submit_disabled'] = true;}}

 [ uploads/thumbs ] : {{echo $lang['INST_NO_WRTABLE']}}

@@ -51,10 +51,10 @@ {{else:}}
- + -
+ {{endif}} -
+
diff --git a/install/style/configs.html b/install/style/configs.html index e706ef8..a9fd344 100755 --- a/install/style/configs.html +++ b/install/style/configs.html @@ -5,17 +5,6 @@

!{{echo $lang['DB_INFO']}}

- diff --git a/install/style/header.html b/install/style/header.html index af67afa..8db7f58 100755 --- a/install/style/header.html +++ b/install/style/header.html @@ -23,7 +23,7 @@ var PATH_SPACER = 'style/images/spacer.gif'; {{if(((ig('step') && g('step') != 'language') && (strpos('index.php', $_SERVER['PHP_SELF'])=== false && ig('step'))) OR (ig('step') && g('step') == 'license' || g('step') == 'action_file') ):}}
{{echo $lang['DB_SERVER']}}
- - - {{foreach($GLOBALS['installed_plugins'] as $plugin):}} - - {{endforeach;}} - - - - {{foreach($GLOBALS['installed_plugins'] as $plugin):}} - - {{endforeach;}} - - - - {{foreach($GLOBALS['installed_plugins'] as $plugin):}} - - {{endforeach;}} - -
{{echo $lang['PLUGINS_NAME']}}{{echo $plugin['p_name']}}
{{echo $lang['PLUGINS_DES']}}{{echo $plugin['p_des']}}
{{echo $lang['PLUGINS_VER']}}{{echo $plugin['p_ver']}}
-
- - -
- -
-
\ No newline at end of file diff --git a/install/style/plugins_options.html b/install/style/plugins_options.html deleted file mode 100755 index a85c3f4..0000000 --- a/install/style/plugins_options.html +++ /dev/null @@ -1,38 +0,0 @@ -
-
- -
-

{{echo $lang['PLUGINS_KLEEJA'];}}

-

{{echo $lang['PLUGINS_BUILT_IN'];}}

- - - - {{foreach($GLOBALS['plugins'] as $plugin):}} - - {{endforeach;}} - - - - {{foreach($GLOBALS['plugins'] as $plugin):}} - - {{endforeach;}} - - - - {{foreach($GLOBALS['plugins'] as $plugin):}} - - {{endforeach;}} - - - - {{foreach($GLOBALS['plugins'] as $plugin):}} - - {{endforeach;}} - -
{{echo $lang['PLUGINS_NAME']}}{{echo $plugin['p_name']}}
{{echo $lang['PLUGINS_DES']}}{{echo $plugin['p_des']}}
{{echo $lang['PLUGINS_VER']}}{{echo $plugin['p_ver']}}
-
- -
- -
-
\ No newline at end of file diff --git a/install/style/style.css b/install/style/style.css index f34cff7..ee562ad 100755 --- a/install/style/style.css +++ b/install/style/style.css @@ -604,7 +604,7 @@ li.NoCheck { .ins_klj { -{{if($GLOBALS['IN_DEV']): echo " +{{if(defined('DEV_STAGE')): echo " width: 50px; height: 350px; position: fixed; @@ -612,4 +612,4 @@ li.NoCheck { left: 10px; background: url('style/images/dev_mode.gif') no-repeat left center; ";endif;}} -} \ No newline at end of file +} diff --git a/install/update.php b/install/update.php index ee0db7a..4194835 100755 --- a/install/update.php +++ b/install/update.php @@ -16,31 +16,28 @@ * include important files */ define('IN_COMMON', true); -$_path = '../'; -define('PATH', $_path); +define('STOP_PLUGINS', true); +define('PATH', '../'); -if (file_exists($_path . 'config.php')) +if (file_exists(PATH . 'config.php')) { - include_once $_path . 'config.php'; + include_once PATH . 'config.php'; } -include_once $_path . 'includes/functions.php'; -include_once $_path . 'includes/functions_alternative.php'; +include_once PATH . 'includes/plugins.php'; +include_once PATH . 'includes/functions.php'; +include_once PATH . 'includes/functions_alternative.php'; -include_once $_path . 'includes/mysqli.php'; +include_once PATH . 'includes/mysqli.php'; include_once 'includes/functions_install.php'; +include_once 'includes/update_schema.php'; -$order_update_files = [ - '1.7_to_2.0' => 9, - // filename => db_version -]; - $SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname); // -// Is current db is up-to-date ? +// fix missing db_version // $config['db_version'] = inst_get_config('db_version'); @@ -62,121 +59,69 @@ if (! ip('action_file_do')) } - /** * Navigation .. */ switch (g('step', 'str', 'action_file')) { default: -case 'action_file': - - if (ip('action_file_do')) - { - if (p('action_file_do', 'str', '') !== '') - { - echo ''; - } - } - else - { - //get fles - $s_path = 'includes/update_files'; - $dh = opendir($s_path); - $upfiles = []; - - while (($file = readdir($dh)) !== false) - { - if (substr($file, -3) == 'php') - { - $file = str_replace('.php', '', $file); - $db_ver = $order_update_files[$file]; - - // var_dump($db_ver); - - if ((empty($config['db_version']) || $db_ver > $config['db_version'])) - { - $upfiles[$db_ver] = $file; - } - } - } - @closedir($dh); - - ksort($upfiles); - - echo gettpl('update_list.html'); - } - -break; - case 'update_now': - if (! ig('action_file_do')) + $complete_update = true; + $update_msgs_arr = []; + $current_db_version = $config['db_version']; + + $all_db_updates = array_keys($update_schema); + + $available_db_updates = array_filter($all_db_updates, function ($v) use ($current_db_version) { + return $v > $current_db_version; + }); + + sort($available_db_updates); + + if (! sizeof($available_db_updates)) + { + $update_msgs_arr[] = '' . $lang['INST_UPDATE_CUR_VER_IS_UP'] . ''; + $complete_update = false; + } + + // + //is there any sqls + // + if ($complete_update) + { + //loop through available updates + foreach ($available_db_updates as $db_update_version) { - echo ''; + $SQL->show_errors = false; - exit(); - } - - if (ig('complet_up_func')) - { - define('C_U_F', true); - } - - $file_for_up = 'includes/update_files/' . preg_replace('/[^a-z0-9_\-\.]/i', '', g('action_file_do')) . '.php'; - - if (! file_exists($file_for_up)) - { - echo '' . $lang['INST_ERR_NO_SELECTED_UPFILE_GOOD'] . ' [ ' . $file_for_up . ' ]
'; - } - else - { - //get it - require $file_for_up; - $complete_update = true; - $update_msgs_arr = []; - - - if ($config['db_version'] >= UPDATE_DB_VERSION && ! defined('DEV_STAGE')) + //sqls + if (isset($update_schema[$db_update_version]['sql']) + && sizeof($update_schema[$db_update_version]['sql']) > 0) { - $update_msgs_arr[] = '' . $lang['INST_UPDATE_CUR_VER_IS_UP'] . ''; - $complete_update = false; - } + $err = ''; - // - //is there any sqls - // - if (($complete_update || (defined('DEV_STAGE')) && ! defined('C_U_F'))) - { - $SQL->show_errors = false; + $complete_update = true; - if (isset($update_sqls) && sizeof($update_sqls) > 0) + foreach ($update_schema[$db_update_version]['sql'] as $name=>$sql_content) { $err = ''; + $SQL->query($sql_content); + $err = $SQL->get_error(); - foreach ($update_sqls as $name=>$sql_content) + if (strpos($err[1], 'Duplicate') !== false || $err[0] == '1062' || $err[0] == '1060') { - $err = ''; - $SQL->query($sql_content); - $err = $SQL->get_error(); - - if (strpos($err[1], 'Duplicate') !== false || $err[0] == '1062' || $err[0] == '1060') - { - $update_msgs_arr[] = '' . $lang['INST_UPDATE_CUR_VER_IS_UP'] . ''; - $complete_update = false; - } + $complete_update = false; } } } - // - //is there any functions - // - if ($complete_update || defined('DEV_STAGE') || defined('C_U_F')) + //functions + if ($complete_update) { - if (isset($update_functions) && sizeof($update_functions) > 0) + if (isset($update_schema[$db_update_version]['functions']) && sizeof($update_schema[$db_update_version]['functions']) > 0) { - foreach ($update_functions as $n) + foreach ($update_schema[$db_update_version]['functions'] as $n) { if (is_callable($n)) { @@ -186,31 +131,13 @@ case 'update_now': } } - // - //is there any notes - // - $NOTES_CUP = false; - - if ($complete_update || defined('DEV_STAGE')) - { - if (isset($update_notes) && sizeof($update_notes) > 0) - { - $i =1; - $NOTES_CUP = []; - - foreach ($update_notes as $n) - { - $NOTES_CUP[$i] = $n; - ++$i; - } - } - - $sql = "UPDATE `{$dbprefix}config` SET `value` = '" . UPDATE_DB_VERSION . "' WHERE `name` = 'db_version'"; - $SQL->query($sql); - } - - echo gettpl('update_end.html'); + $sql = "UPDATE `{$dbprefix}config` SET `value` = '" . UPDATE_DB_VERSION . "' WHERE `name` = 'db_version'"; + $SQL->query($sql); } + } + + + echo gettpl('update_end.html'); break; } diff --git a/lang/ar/install.php b/lang/ar/install.php index 9867029..ade7856 100755 --- a/lang/ar/install.php +++ b/lang/ar/install.php @@ -37,7 +37,7 @@ return [ 'INST_FINISH_SQL' => 'تم تثبيت كليجا بنجاح', 'INST_NOTES' => 'ملاحظات التثبيت', 'INST_END' => 'معالج التثبيت انتهى، يجب الآن حذف مجلد INSTALL (الموقع لن يعمل في حال وجود المجلد)', - 'INST_NOTE_D' => 'أي ملاحظات أو مشاكل تتعلق بأداء كليجا، نرجوا التواصل مع مطوري كليجا!', + 'INST_NOTE_D' => 'أي ملاحظات أو مشاكل تتعلق بأداء كليجا، نرجو التبليغ عبر مركز الأخطاء', 'INST_FINISH_ERRSQL' => 'هناك مشكلة تعيق التثبيت، تأكد من حساب مستخدم القاعدة وحاول مجدداً او استفسر من مطوري كليجا', 'INST_KLEEJADEVELOPERS' => 'شكراً لإستخدامك كليجا ... مع أحلى و أطيب التمنيات .. من فريق عمل كليجا', 'SITENAME' => 'اسم الموقع', @@ -85,16 +85,10 @@ return [ 'FUNCTION_DISC_MUF' => 'دالة move_uploaded_file تستخدم لتحميل الملفات وهي اهم دالة في السكربت.', 'ADVICES_CHECK' => 'فحص متقدم (يمكن تثبيت كليجا بدون تحقق هذا الفحص , لكنه مجرد معلومات لك)', - 'ADVICES_REGISTER_GLOBALS' => 'خاصية register_globals مفعلة !
هذه الخاصية غير محبب تفعيلها ويفضل تعطيلها , ومع هذا فكليجا تحاول تعطيل أثارها برمجياً .', - 'ADVICES_MAGIC_QUOTES' => 'خاصية magic_quotes مفعله !
هذه الخاصية غير محبب تفعيلها ويفضل تعطيلها , ومع هذا فكليجا تحاول تعطيل أثارها برمجياً ..', + 'ZIPARCHIVE_LIB' => 'مكتبة ZipArchive غير متوفرة في خادمك !
هذه المكتبة مهمة لفك الإضافات والترقية لنسخ جديدة من كليجا!', //UPDATOR - 'INST_CHOOSE_UPDATE_FILE' => 'قم بإختيار التحديث المناسب لك ومن ثم تابع التحديث ..', - 'INST_ERR_NO_SELECTED_UPFILE_GOOD' => 'ملف التحديث غير مناسب أو أنه غير موجود من الأساس ! ..', - 'INST_UPDATE_CUR_VER_IS_UP' => 'نسختك الحالية محدثة لهذا التحديث المحدد.', - - 'INST_NOTES_UPDATE' => 'ملاحظات التحديث', - + 'INST_UPDATE_CUR_VER_IS_UP' => 'نسختك الحالية محدثة لآخر نسخة ... رائع!', 'INST_UPDATE_IS_FINISH' => 'معالج التحديث انتهى .. يجب الآن حذف مجلد INSTALL و متابعة عملك في كليجا .', diff --git a/lang/en/install.php b/lang/en/install.php index d1a5763..016af63 100755 --- a/lang/en/install.php +++ b/lang/en/install.php @@ -85,15 +85,10 @@ return [ 'FUNCTION_DISC_MUF' => 'The function move_uploaded_file is used to upload files and it\'s the most important function in the script.', 'ADVICES_CHECK' => 'Advanced check (Optional)', - 'ADVICES_REGISTER_GLOBALS' => 'register_globals function is enabled ..!
its recommended that you disable it.', - 'ADVICES_MAGIC_QUOTES' => 'magic_quotes function is enabled ..!
it is recommended that you disable it.', + 'ZIPARCHIVE_LIB' => 'ZipArchive Lib is not available..!
It is required to install plugins, styles and to upgrade to newer Kleeja versions!', //UPDATE - 'INST_CHOOSE_UPDATE_FILE' => 'Choose the appropriate update file', - 'INST_ERR_NO_SELECTED_UPFILE_GOOD' => 'Inappropriate update file, or it is missing!', - 'INST_UPDATE_CUR_VER_IS_UP' => 'Your current version is newer than this update.', - - 'INST_NOTES_UPDATE' => 'Update Notes', + 'INST_UPDATE_CUR_VER_IS_UP' => 'Your current version database is up-to-date ... hooray!', 'INST_UPDATE_IS_FINISH' => 'Installation completed! you can now delete the INSTALL directory...', @@ -112,6 +107,6 @@ return [ 'NO' => 'No', 'KLEEJA_TEAM_MSG_NAME' => 'Kleeja Development Team', - 'KLEEJA_TEAM_MSG_TEXT' => "Thank you for choosing Kleeja to empower your website,\n We really hope you enjoy the unique experience that Kleeja offers to you.\nDon't forget to visit http://kleeja.com for future updates.", + 'KLEEJA_TEAM_MSG_TEXT' => "Thank you for choosing Kleeja to empower your website,\n We really hope you enjoy the unique experience that Kleeja offers to you.\nDon't forget to visit http://kleeja.com for future updates, to report bugs/issues kindly visit our Issues page", ];