@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // ------------------------------------------------------------------------------------------------------------------------------ |
| 4 | 4 | function sn_sys_load_php_files($dir_name, $load_extension = '.php', $modules = false) { |
| 5 | - if(!file_exists($dir_name) || !is_dir($dir_name)) { |
|
| 5 | + if (!file_exists($dir_name) || !is_dir($dir_name)) { |
|
| 6 | 6 | return; |
| 7 | 7 | } |
| 8 | 8 | |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | function init_update() { |
| 41 | 41 | $update_file = SN_ROOT_PHYSICAL . "includes/update" . DOT_PHP_EX; |
| 42 | - if(!file_exists($update_file)) { |
|
| 42 | + if (!file_exists($update_file)) { |
|
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | - if( |
|
| 45 | + if ( |
|
| 46 | 46 | filemtime($update_file) <= classSupernova::$config->db_loadItem('var_db_update') |
| 47 | 47 | && |
| 48 | 48 | classSupernova::$config->db_loadItem('db_version') >= DB_VERSION |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if(defined('IN_ADMIN')) { |
|
| 53 | + if (defined('IN_ADMIN')) { |
|
| 54 | 54 | sn_db_transaction_start(); // Для защиты от двойного запуска апдейта - начинаем транзакцию. Так запись в базе будет блокирована |
| 55 | - if(SN_TIME_NOW >= classSupernova::$config->db_loadItem('var_db_update_end')) { |
|
| 55 | + if (SN_TIME_NOW >= classSupernova::$config->db_loadItem('var_db_update_end')) { |
|
| 56 | 56 | classSupernova::$config->db_saveItem('var_db_update_end', SN_TIME_NOW + (classSupernova::$config->upd_lock_time ? classSupernova::$config->upd_lock_time : 300)); |
| 57 | 57 | sn_db_transaction_commit(); |
| 58 | 58 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $current_time = time(); |
| 63 | 63 | classSupernova::$config->db_saveItem('var_db_update', $current_time); |
| 64 | 64 | classSupernova::$config->db_saveItem('var_db_update_end', $current_time); |
| 65 | - } elseif(filemtime($update_file) > classSupernova::$config->var_db_update) { |
|
| 65 | + } elseif (filemtime($update_file) > classSupernova::$config->var_db_update) { |
|
| 66 | 66 | sn_db_transaction_rollback(); |
| 67 | 67 | $timeout = classSupernova::$config->var_db_update_end - SN_TIME_NOW; |
| 68 | 68 | die( |