@@ -1,7 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function sys_maintenance() |
|
4 | -{ |
|
3 | +function sys_maintenance() { |
|
5 | 4 | global $config; |
6 | 5 | |
7 | 6 | $bashing_time_limit = SN_TIME_NOW - $config->fleet_bashing_scope; |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | * TODO: 2. [<m|w|d|h|m|s>@]<time> |
43 | 42 | */ |
44 | 43 | |
45 | -function sys_schedule_get_prev_run($scheduleList, $recorded_run = SN_TIME_NOW, $return_next_run = false) |
|
46 | -{ |
|
44 | +function sys_schedule_get_prev_run($scheduleList, $recorded_run = SN_TIME_NOW, $return_next_run = false) { |
|
47 | 45 | static $date_part_names_reverse = array('seconds', 'minutes', 'hours', 'days', 'months', 'years',); |
48 | 46 | |
49 | 47 | $possible_schedules = array(); |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | array('query' => "DELETE FROM `{{planets}}` WHERE `id_owner` = 0 AND `destruyed` < UNIX_TIMESTAMP();", 'result' => false, 'error' => '', 'affected_rows' => 0), |
18 | 18 | ); |
19 | 19 | |
20 | - foreach($queries as &$query) |
|
20 | + foreach ($queries as &$query) |
|
21 | 21 | { |
22 | 22 | $query['result'] = doquery($query['query']); |
23 | 23 | $query['error'] = SN::$db->db_error(); |
24 | - $query['affected_rows'] = SN::$db->db_affected_rows(); |
|
24 | + $query['affected_rows'] = SN::$db->db_affected_rows(); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | return $queries; |
@@ -53,30 +53,30 @@ discard block |
||
53 | 53 | $recorded_run = strtotime($recorded_run); |
54 | 54 | |
55 | 55 | $prev_run_array = getdate($recorded_run); |
56 | - $prev_run_array = array($prev_run_array['seconds'],$prev_run_array['minutes'],$prev_run_array['hours'],$prev_run_array['mday'],$prev_run_array['mon'],$prev_run_array['year']); |
|
56 | + $prev_run_array = array($prev_run_array['seconds'], $prev_run_array['minutes'], $prev_run_array['hours'], $prev_run_array['mday'], $prev_run_array['mon'], $prev_run_array['year']); |
|
57 | 57 | $today_array = getdate(SN_TIME_NOW); |
58 | - $today_array = array($today_array['seconds'],$today_array['minutes'],$today_array['hours'],$today_array['mday'],$today_array['mon'],$today_array['year']); |
|
58 | + $today_array = array($today_array['seconds'], $today_array['minutes'], $today_array['hours'], $today_array['mday'], $today_array['mon'], $today_array['year']); |
|
59 | 59 | $scheduleList = explode(',', $scheduleList); |
60 | 60 | array_walk($scheduleList, function(&$schedule) use ($prev_run_array, $today_array, $date_part_names_reverse, &$possible_schedules) { |
61 | 61 | $schedule = array('schedule_array' => array_reverse(explode(':', trim($schedule)))); |
62 | 62 | |
63 | 63 | $interval = $date_part_names_reverse[count($schedule['schedule_array'])]; |
64 | 64 | |
65 | - foreach($prev_run_array as $index => $date_part) { |
|
65 | + foreach ($prev_run_array as $index => $date_part) { |
|
66 | 66 | $schedule['array']['recorded'][$index] = isset($schedule['schedule_array'][$index]) ? intval($schedule['schedule_array'][$index]) : $date_part; |
67 | 67 | $schedule['array']['now'][$index] = isset($schedule['schedule_array'][$index]) ? intval($schedule['schedule_array'][$index]) : $today_array[$index]; |
68 | 68 | } |
69 | - if($schedule['array']['recorded'] == $schedule['array']['now']) { |
|
69 | + if ($schedule['array']['recorded'] == $schedule['array']['now']) { |
|
70 | 70 | unset($schedule['array']['now']); |
71 | 71 | } |
72 | 72 | |
73 | - foreach($schedule['array'] as $name => $array) { |
|
73 | + foreach ($schedule['array'] as $name => $array) { |
|
74 | 74 | $schedule['string'][$name] = "{$array[5]}-{$array[4]}-{$array[3]} {$array[2]}:{$array[1]}:{$array[0]}"; |
75 | 75 | $schedule['string'][$name . '_next'] = $schedule['string'][$name] . ' +1 ' . $interval; |
76 | 76 | $schedule['string'][$name . '_prev'] = $schedule['string'][$name] . ' -1 ' . $interval; |
77 | 77 | } |
78 | 78 | |
79 | - foreach($schedule['string'] as $string) { |
|
79 | + foreach ($schedule['string'] as $string) { |
|
80 | 80 | $timestamp = strtotime($string); |
81 | 81 | $schedule['timestamp'][$timestamp] = $possible_schedules[$timestamp] = date(FMT_DATE_TIME_SQL, strtotime($string)); |
82 | 82 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | $prev_run = 0; |
88 | 88 | $next_run = 0; |
89 | - foreach($possible_schedules as $timestamp => $string_date) { |
|
89 | + foreach ($possible_schedules as $timestamp => $string_date) { |
|
90 | 90 | $prev_run = SN_TIME_NOW >= $timestamp ? $timestamp : $prev_run; |
91 | 91 | $next_run = SN_TIME_NOW < $timestamp && !$next_run ? $timestamp : $next_run; |
92 | 92 | } |
@@ -1,14 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // ---------------------------------------------------------------------------------------------------------------- |
4 | -function lng_try_filepath($path, $file_path_relative) |
|
5 | -{ |
|
4 | +function lng_try_filepath($path, $file_path_relative) { |
|
6 | 5 | $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative; |
7 | 6 | return file_exists($file_path) ? $file_path : false; |
8 | 7 | } |
9 | 8 | |
10 | -function lng_die_not_an_object() |
|
11 | -{ |
|
9 | +function lng_die_not_an_object() { |
|
12 | 10 | print('Ошибка - $lang не объект! Сообщите Администратору сервера и приложите содержимое страницы'); |
13 | 11 | $trace = debug_backtrace(); |
14 | 12 | unset($trace[0]); |
@@ -17,32 +15,27 @@ discard block |
||
17 | 15 | } |
18 | 16 | |
19 | 17 | // ---------------------------------------------------------------------------------------------------------------- |
20 | -function lng_include($filename, $path = '', $ext = '.mo.php') |
|
21 | -{ |
|
18 | +function lng_include($filename, $path = '', $ext = '.mo.php') { |
|
22 | 19 | global $lang; |
23 | 20 | return is_object($lang) ? $lang->lng_include($filename, $path, $ext) : lng_die_not_an_object(); |
24 | 21 | } |
25 | 22 | |
26 | -function lng_get_list() |
|
27 | -{ |
|
23 | +function lng_get_list() { |
|
28 | 24 | global $lang; |
29 | 25 | return is_object($lang) ? $lang->lng_get_list() : lng_die_not_an_object(); |
30 | 26 | } |
31 | 27 | |
32 | -function lng_get_info($entry) |
|
33 | -{ |
|
28 | +function lng_get_info($entry) { |
|
34 | 29 | global $lang; |
35 | 30 | return is_object($lang) ? $lang->lng_get_info($entry) : lng_die_not_an_object(); |
36 | 31 | } |
37 | 32 | |
38 | -function lng_switch($language_new) |
|
39 | -{ |
|
33 | +function lng_switch($language_new) { |
|
40 | 34 | global $lang; |
41 | 35 | return is_object($lang) ? $lang->lng_switch($language_new) : lng_die_not_an_object(); |
42 | 36 | } |
43 | 37 | |
44 | -function lng_load_i18n($i18n) |
|
45 | -{ |
|
38 | +function lng_load_i18n($i18n) { |
|
46 | 39 | global $lang; |
47 | 40 | return is_object($lang) ? $lang->lng_load_i18n($i18n) : lng_die_not_an_object(); |
48 | 41 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | QUEST_STATUS_COMPLETE => '', |
32 | 32 | ); |
33 | 33 | |
34 | - if(!isset($statuses[$this->filterQuestStatus])) { |
|
34 | + if (!isset($statuses[$this->filterQuestStatus])) { |
|
35 | 35 | $this->filterQuestStatus = QUEST_STATUS_ALL; |
36 | 36 | } |
37 | 37 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | - if(!isset($next)) { |
|
104 | + if (!isset($next)) { |
|
105 | 105 | $next = new TextEntity(); |
106 | 106 | } |
107 | 107 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $prev = $this->getById($currentText->prev); |
120 | 120 | } |
121 | 121 | |
122 | - if(!isset($prev)) { |
|
122 | + if (!isset($prev)) { |
|
123 | 123 | $prev = new TextEntity(); |
124 | 124 | } |
125 | 125 |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * @return string |
339 | 339 | */ |
340 | 340 | protected function stringValue($value) { |
341 | - return "'" . $this->escape((string)$value) . "'"; |
|
341 | + return "'" . $this->escape((string) $value) . "'"; |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | /** |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | * @return string |
350 | 350 | */ |
351 | 351 | public function quote($fieldName) { |
352 | - return "`" . $this->escape((string)$fieldName) . "`"; |
|
352 | + return "`" . $this->escape((string) $fieldName) . "`"; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | /** |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | * @return string |
397 | 397 | */ |
398 | 398 | protected function quoteTable($tableName) { |
399 | - return "`{{" . $this->escape((string)$tableName) . "}}`"; |
|
399 | + return "`{{" . $this->escape((string) $tableName) . "}}`"; |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | /** |
@@ -43,7 +43,7 @@ |
||
43 | 43 | */ |
44 | 44 | public function toArray() { |
45 | 45 | $tutorial = array(); |
46 | - foreach($this->keys() as $key) { |
|
46 | + foreach ($this->keys() as $key) { |
|
47 | 47 | $tutorial[$key] = $this->$key; |
48 | 48 | } |
49 | 49 |
@@ -7,9 +7,9 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
12 | -define('IN_ADMIN' , true); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | +define('IN_ADMIN', true); |
|
13 | 13 | |
14 | 14 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
15 | 15 |
@@ -4,6 +4,6 @@ |
||
4 | 4 | |
5 | 5 | // header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); |
6 | 6 | // @header("{$serverProtocol} 200 OK"); |
7 | -echo "File {$redirectFrom} not found on server. Contact administration if you think that this is error"; |
|
7 | +echo "file {$redirectFrom} not found on server. Contact administration if you think that this is error"; |
|
8 | 8 | die(); |
9 | 9 | ?> */ |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | protected $_repository; |
31 | 31 | |
32 | - /** |
|
32 | + /** |
|
33 | 33 | * @var ContainerPlus $_oldRepo |
34 | 34 | */ |
35 | 35 | protected $_oldRepo; |
@@ -86,7 +86,7 @@ |
||
86 | 86 | |
87 | 87 | public function get($entityClass, $id) { |
88 | 88 | $entityIndex = get_class($entityClass) . '\\' . $id; |
89 | - if(!isset($this->_repository[$entityIndex])) { |
|
89 | + if (!isset($this->_repository[$entityIndex])) { |
|
90 | 90 | |
91 | 91 | } |
92 | 92 |