@@ -7,8 +7,8 @@ |
||
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -define('INSIDE' , true); |
|
| 11 | -define('INSTALL' , false); |
|
| 10 | +define('INSIDE', true); |
|
| 11 | +define('INSTALL', false); |
|
| 12 | 12 | |
| 13 | 13 | require('common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 14 | 14 | |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 4 | 4 | |
| 5 | -if(sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG')) |
|
| 5 | +if (sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG')) |
|
| 6 | 6 | { |
| 7 | 7 | define('BE_DEBUG', true); |
| 8 | 8 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | $sym_defender = $_POST['defender'] ? $_POST['defender'] : array(); |
| 16 | 16 | $sym_attacker = $_POST['attacker'] ? $_POST['attacker'] : array(); |
| 17 | 17 | |
| 18 | -if($replay) |
|
| 18 | +if ($replay) |
|
| 19 | 19 | { |
| 20 | 20 | $unpacked = sn_ube_simulator_decode_replay($replay); |
| 21 | 21 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $sym_attacker = array(1 => $sym_attacker); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | -if($_POST['submit'] || $execute) |
|
| 31 | +if ($_POST['submit'] || $execute) |
|
| 32 | 32 | { |
| 33 | 33 | $replay = sn_ube_simulator_encode_replay($sym_defender, 'D'); |
| 34 | 34 | $replay .= sn_ube_simulator_encode_replay($sym_attacker, 'A'); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | // sn_ube_report_save($combat_data); |
| 43 | 43 | // } |
| 44 | 44 | |
| 45 | - if(sys_get_param_str('reload')) |
|
| 45 | + if (sys_get_param_str('reload')) |
|
| 46 | 46 | { |
| 47 | 47 | $combat_data = sn_ube_report_load($combat_data[UBE_REPORT_CYPHER]); |
| 48 | 48 | } |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | $template = gettemplate('simulator', true); |
| 63 | 63 | $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL); |
| 64 | 64 | |
| 65 | - foreach($techs_and_officers as $tech_id) |
|
| 65 | + foreach ($techs_and_officers as $tech_id) |
|
| 66 | 66 | { |
| 67 | - if(!$sym_attacker[1][$tech_id]) |
|
| 67 | + if (!$sym_attacker[1][$tech_id]) |
|
| 68 | 68 | { |
| 69 | 69 | $sym_attacker[1][$tech_id] = mrc_get_level($user, false, $tech_id); |
| 70 | 70 | } |
@@ -78,14 +78,14 @@ discard block |
||
| 78 | 78 | UNIT_GOVERNORS => array(MRC_FORTIFIER), |
| 79 | 79 | UNIT_DEFENCE => sn_get_groups('defense_active'), |
| 80 | 80 | ); |
| 81 | - foreach($show_groups as $unit_group_id => $unit_group) |
|
| 81 | + foreach ($show_groups as $unit_group_id => $unit_group) |
|
| 82 | 82 | { |
| 83 | 83 | $template->assign_block_vars('simulator', array( |
| 84 | 84 | 'GROUP' => $unit_group_id, |
| 85 | 85 | 'NAME' => $lang['tech'][$unit_group_id], |
| 86 | 86 | )); |
| 87 | 87 | |
| 88 | - foreach($unit_group as $unit_id) |
|
| 88 | + foreach ($unit_group as $unit_id) |
|
| 89 | 89 | { |
| 90 | 90 | $tab++; |
| 91 | 91 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | include('includes/init.' . substr(strrchr(__FILE__, '.'), 1)); |
| 17 | 17 | // die(); |
| 18 | -if($template_result[F_USER_IS_AUTHORIZED]) { |
|
| 18 | +if ($template_result[F_USER_IS_AUTHORIZED]) { |
|
| 19 | 19 | sys_redirect('index' . DOT_PHP_EX); |
| 20 | 20 | } |
| 21 | 21 | lng_include('login'); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $newstock = $stock; |
| 27 | 27 | $intError = MARKET_DEAL; |
| 28 | 28 | |
| 29 | -switch($mode) |
|
| 29 | +switch ($mode) |
|
| 30 | 30 | { |
| 31 | 31 | case MARKET_RESOURCES: // Resource trader |
| 32 | 32 | require('includes/includes/market_trader.inc'); |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $message_id = sys_get_param_int('message'); |
| 85 | -if($message_id != MARKET_NOTHING) |
|
| 85 | +if ($message_id != MARKET_NOTHING) |
|
| 86 | 86 | { |
| 87 | 87 | $template->assign_block_vars('result', array('MESSAGE' => $lang['eco_mrk_errors'][$message_id])); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | -if($message) |
|
| 90 | +if ($message) |
|
| 91 | 91 | { |
| 92 | 92 | $template->assign_block_vars('result', array('MESSAGE' => $message)); |
| 93 | 93 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | // OK 4.9 |
| 37 | 37 | public function __construct($filename = __FILE__) { |
| 38 | - if($this->provider_id == ACCOUNT_PROVIDER_NONE) { |
|
| 38 | + if ($this->provider_id == ACCOUNT_PROVIDER_NONE) { |
|
| 39 | 39 | die('У всех провайдеров должен быть $provider_id!'); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | // OK 4.6 |
| 134 | 134 | public function player_name_suggest() { |
| 135 | 135 | $name = ''; |
| 136 | - if(is_object($this->account) && !empty($this->account->account_email)) { |
|
| 136 | + if (is_object($this->account) && !empty($this->account->account_email)) { |
|
| 137 | 137 | list($name) = explode('@', $this->account->account_email); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | // $query = static::$db->doquery("SELECT `id` FROM {{confirmations}} WHERE `code` = '{$confirm_code_safe}' AND `type` = {$confirmation_type_safe} FOR UPDATE", true); |
| 42 | 42 | // Тип не нужен для проверки - код подтверждения должен быть уникален от слова "совсем" |
| 43 | 43 | $query = $this->db->doquery("SELECT `id` FROM {{confirmations}} WHERE `code` = '{$confirm_code_safe}' FOR UPDATE", true); |
| 44 | - } while($query); |
|
| 44 | + } while ($query); |
|
| 45 | 45 | |
| 46 | 46 | $this->db->doquery( |
| 47 | 47 | "REPLACE INTO {{confirmations}} |
@@ -239,7 +239,7 @@ |
||
| 239 | 239 | |
| 240 | 240 | $factory = $this->values[$id]; |
| 241 | 241 | |
| 242 | - $extended = function ($c) use ($callable, $factory) { |
|
| 242 | + $extended = function($c) use ($callable, $factory) { |
|
| 243 | 243 | return $callable($factory($c), $c); |
| 244 | 244 | }; |
| 245 | 245 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | protected static $is_init = false; |
| 20 | 20 | |
| 21 | 21 | protected static function init() { |
| 22 | - if(!empty(static::$db)) { |
|
| 22 | + if (!empty(static::$db)) { |
|
| 23 | 23 | return; |
| 24 | 24 | } |
| 25 | 25 | static::$db = classSupernova::$db; |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | $provider_id_safe = intval($provider_id_unsafe); |
| 67 | 67 | !is_array($account_list) ? $account_list = array($account_list) : false; |
| 68 | 68 | |
| 69 | - foreach($account_list as $provider_account_id_unsafe) { |
|
| 69 | + foreach ($account_list as $provider_account_id_unsafe) { |
|
| 70 | 70 | $provider_account_id_safe = intval($provider_account_id_unsafe); |
| 71 | 71 | |
| 72 | 72 | // TODO - Здесь могут отсутствовать аккаунты - проверять провайдером |
| 73 | 73 | $query = static::$db->doquery("SELECT `user_id` FROM {{account_translate}} WHERE `provider_id` = {$provider_id_safe} AND `provider_account_id` = {$provider_account_id_safe} FOR UPDATE"); |
| 74 | - while($row = static::$db->db_fetch($query)) { |
|
| 74 | + while ($row = static::$db->db_fetch($query)) { |
|
| 75 | 75 | $account_translation[$row['user_id']][$provider_id_unsafe][$provider_account_id_unsafe] = true; |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | "SELECT * FROM {{account_translate}} WHERE `user_id` = {$user_id_safe} " . |
| 92 | 92 | ($provider_id_unsafe ? "AND `provider_id` = {$provider_id_safe} " : '') . |
| 93 | 93 | "ORDER BY `timestamp` FOR UPDATE"); |
| 94 | - while($row = static::$db->db_fetch($query)) { |
|
| 94 | + while ($row = static::$db->db_fetch($query)) { |
|
| 95 | 95 | $account_translation[$row['user_id']][$row['provider_id']][$row['provider_account_id']] = $row; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | !is_array($offset) ? $offset = array($offset) : false; |
| 39 | 39 | |
| 40 | 40 | $current_leaf = $this->__get(reset($offset)); |
| 41 | - while(($leaf_index = next($offset)) !== false) { |
|
| 42 | - if(!isset($current_leaf) || !is_array($current_leaf) || !isset($current_leaf[$leaf_index])) { |
|
| 41 | + while (($leaf_index = next($offset)) !== false) { |
|
| 42 | + if (!isset($current_leaf) || !is_array($current_leaf) || !isset($current_leaf[$leaf_index])) { |
|
| 43 | 43 | unset($current_leaf); |
| 44 | 44 | break; |
| 45 | 45 | } |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | !is_array($offset) ? $offset = array($offset) : false; |
| 66 | 66 | |
| 67 | - if($this->offsetExists($offset)) { |
|
| 67 | + if ($this->offsetExists($offset)) { |
|
| 68 | 68 | $result = $this->__get(reset($offset)); |
| 69 | - while(($leaf_index = next($offset)) !== false) { |
|
| 69 | + while (($leaf_index = next($offset)) !== false) { |
|
| 70 | 70 | $result = $result[$leaf_index]; |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -91,12 +91,12 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function offsetSet($offset, $value = null) { |
| 93 | 93 | // Если нет никакого индекса - значит нечего записывать |
| 94 | - if(!isset($offset) || (is_array($offset) && empty($offset))) { |
|
| 94 | + if (!isset($offset) || (is_array($offset) && empty($offset))) { |
|
| 95 | 95 | return; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // Если в массиве индекса только один элемент - значит это просто индекс |
| 99 | - if(is_array($offset) && count($offset) == 1) { |
|
| 99 | + if (is_array($offset) && count($offset) == 1) { |
|
| 100 | 100 | // Разворачиваем его в индекс |
| 101 | 101 | $offset = array(reset($offset) => $value); |
| 102 | 102 | unset($value); |
@@ -104,16 +104,16 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | // Адресация многомерного массива через массив индексов в $option |
| 107 | - if(is_array($offset) && isset($value)) { |
|
| 107 | + if (is_array($offset) && isset($value)) { |
|
| 108 | 108 | // TODO - а не переделать ли это всё на __isset() ?? |
| 109 | 109 | // Вытаскиваем корневой элемент |
| 110 | 110 | $root = $this->__get(reset($offset)); |
| 111 | 111 | $current_leaf = &$root; |
| 112 | - while(($leaf_index = next($offset)) !== false) { |
|
| 112 | + while (($leaf_index = next($offset)) !== false) { |
|
| 113 | 113 | !is_array($current_leaf[$leaf_index]) ? $current_leaf[$leaf_index] = array() : false; |
| 114 | 114 | $current_leaf = &$current_leaf[$leaf_index]; |
| 115 | 115 | } |
| 116 | - if($current_leaf != $value) { |
|
| 116 | + if ($current_leaf != $value) { |
|
| 117 | 117 | $current_leaf = $value; |
| 118 | 118 | // Сохраняем данные с корня |
| 119 | 119 | $this->__set(reset($offset), $root); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | // Пакетная запись из массива ключ -> значение |
| 123 | 123 | !is_array($offset) ? $offset = array($offset => $value) : false; |
| 124 | 124 | |
| 125 | - foreach($offset as $key => $value) { |
|
| 125 | + foreach ($offset as $key => $value) { |
|
| 126 | 126 | $this->__get($key) !== $value ? $this->__set($key, $value) : false; |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -143,18 +143,18 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function offsetUnset($offset) { |
| 145 | 145 | // Если нет никакого индекса - значит нечего записывать |
| 146 | - if(!isset($offset) || (is_array($offset) && empty($offset))) { |
|
| 146 | + if (!isset($offset) || (is_array($offset) && empty($offset))) { |
|
| 147 | 147 | return; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | !is_array($offset) ? $offset = array($offset) : false; |
| 151 | 151 | |
| 152 | - if($this->offsetExists($offset)) { |
|
| 152 | + if ($this->offsetExists($offset)) { |
|
| 153 | 153 | // Перематываем массив в конец |
| 154 | 154 | $key_to_delete = end($offset); |
| 155 | 155 | $parent_offset = $offset; |
| 156 | 156 | array_pop($parent_offset); |
| 157 | - if(!count($parent_offset)) { |
|
| 157 | + if (!count($parent_offset)) { |
|
| 158 | 158 | // В массиве был один элемент - мы удаляем в корне. Просто удаляем элемент |
| 159 | 159 | $this->__unset($key_to_delete); |
| 160 | 160 | } else { |