@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | $appConfig = $di->getShared('config')->adminApplication; |
32 | 32 | $di->setShared( |
33 | 33 | self::SERVICE_NAME, |
34 | - function () use ($view, $di, $appConfig) { |
|
35 | - $voltCacheDir = $appConfig->voltCacheDir . '/'; |
|
34 | + function() use ($view, $di, $appConfig) { |
|
35 | + $voltCacheDir = $appConfig->voltCacheDir.'/'; |
|
36 | 36 | $volt = new VoltEngine($view, $di); |
37 | 37 | $volt->setOptions( |
38 | 38 | [ |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | $compiler->addFunction('in_array', 'in_array'); |
45 | 45 | |
46 | 46 | if ($appConfig->debugMode === true) { |
47 | - $cacheFiles = glob($appConfig->voltCacheDir . '/*.php'); |
|
48 | - if ($cacheFiles!==false){ |
|
47 | + $cacheFiles = glob($appConfig->voltCacheDir.'/*.php'); |
|
48 | + if ($cacheFiles !== false) { |
|
49 | 49 | array_map( |
50 | 50 | 'unlink', |
51 | 51 | $cacheFiles |
@@ -31,7 +31,8 @@ |
||
31 | 31 | $appConfig = $di->getShared('config')->adminApplication; |
32 | 32 | $di->setShared( |
33 | 33 | self::SERVICE_NAME, |
34 | - function () use ($view, $di, $appConfig) { |
|
34 | + function () use ($view, $di, $appConfig) |
|
35 | + { |
|
35 | 36 | $voltCacheDir = $appConfig->voltCacheDir . '/'; |
36 | 37 | $volt = new VoltEngine($view, $di); |
37 | 38 | $volt->setOptions( |
@@ -31,12 +31,12 @@ |
||
31 | 31 | { |
32 | 32 | $di->setShared( |
33 | 33 | self::SERVICE_NAME, |
34 | - function () use ($di){ |
|
34 | + function() use ($di){ |
|
35 | 35 | $roSession = $di->getShared('sessionRO'); |
36 | 36 | if ($roSession !== null && array_key_exists( |
37 | 37 | 'WebAdminLanguage', |
38 | 38 | $roSession |
39 | - ) && ! empty($roSession['WebAdminLanguage'])) { |
|
39 | + ) && !empty($roSession['WebAdminLanguage'])) { |
|
40 | 40 | $language = $roSession['WebAdminLanguage']; |
41 | 41 | } elseif (array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) { |
42 | 42 | $ls = new LanguageSelector(); |
@@ -31,7 +31,8 @@ |
||
31 | 31 | { |
32 | 32 | $di->setShared( |
33 | 33 | self::SERVICE_NAME, |
34 | - function () use ($di){ |
|
34 | + function () use ($di) |
|
35 | + { |
|
35 | 36 | $roSession = $di->getShared('sessionRO'); |
36 | 37 | if ($roSession !== null && array_key_exists( |
37 | 38 | 'WebAdminLanguage', |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $q_conf .= "\n"; |
87 | 87 | } |
88 | 88 | |
89 | - Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/queues.conf', $q_conf); |
|
89 | + Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/queues.conf', $q_conf); |
|
90 | 90 | |
91 | 91 | } |
92 | 92 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | // Генерация внутреннего номерного плана. |
141 | 141 | $conf = "[queue_agent_answer]\n"; |
142 | 142 | $conf .= "exten => s,1,NoOp(--- Answer Queue ---)\n\t"; |
143 | - $conf .= 'same => n,Gosub(queue_answer,${EXTEN},1)' . "\n\t"; |
|
143 | + $conf .= 'same => n,Gosub(queue_answer,${EXTEN},1)'."\n\t"; |
|
144 | 144 | $conf .= "same => n,Return()\n\n"; |
145 | 145 | |
146 | 146 | return $conf; |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | $conf = ''; |
171 | 171 | $db_data = $this->getQueueData(); |
172 | 172 | foreach ($db_data as $queue) { |
173 | - $conf .= 'exten => _' . $queue['extension'] . ',1,Set(__ISTRANSFER=transfer_)' . " \n\t"; |
|
174 | - $conf .= 'same => n,Goto(internal,${EXTEN},1)' . " \n"; |
|
173 | + $conf .= 'exten => _'.$queue['extension'].',1,Set(__ISTRANSFER=transfer_)'." \n\t"; |
|
174 | + $conf .= 'same => n,Goto(internal,${EXTEN},1)'." \n"; |
|
175 | 175 | } |
176 | 176 | $conf .= "\n"; |
177 | 177 | |
@@ -190,36 +190,36 @@ discard block |
||
190 | 190 | $queue_ext_conf = ''; |
191 | 191 | $db_data = $this->getQueueData(); |
192 | 192 | foreach ($db_data as $queue) { |
193 | - $calleridPrefix = preg_replace('/[^a-zA-Zа-яА-Я0-9 ]/ui', '', $queue['callerid_prefix']??''); |
|
193 | + $calleridPrefix = preg_replace('/[^a-zA-Zа-яА-Я0-9 ]/ui', '', $queue['callerid_prefix'] ?? ''); |
|
194 | 194 | |
195 | 195 | $queue_ext_conf .= "exten => {$queue['extension']},1,NoOp(--- Start Queue ---) \n\t"; |
196 | 196 | $queue_ext_conf .= "same => n,Answer() \n\t"; |
197 | - $queue_ext_conf .= 'same => n,Set(__QUEUE_SRC_CHAN=${CHANNEL})' . "\n\t"; |
|
198 | - $queue_ext_conf .= 'same => n,ExecIf($["${CHANNEL(channeltype)}" == "Local"]?Gosub(set_orign_chan,s,1))' . "\n\t"; |
|
199 | - $queue_ext_conf .= 'same => n,Set(CHANNEL(hangup_handler_wipe)=hangup_handler,s,1)' . "\n\t"; |
|
200 | - $queue_ext_conf .= 'same => n,Gosub(queue_start,${EXTEN},1)' . "\n\t"; |
|
197 | + $queue_ext_conf .= 'same => n,Set(__QUEUE_SRC_CHAN=${CHANNEL})'."\n\t"; |
|
198 | + $queue_ext_conf .= 'same => n,ExecIf($["${CHANNEL(channeltype)}" == "Local"]?Gosub(set_orign_chan,s,1))'."\n\t"; |
|
199 | + $queue_ext_conf .= 'same => n,Set(CHANNEL(hangup_handler_wipe)=hangup_handler,s,1)'."\n\t"; |
|
200 | + $queue_ext_conf .= 'same => n,Gosub(queue_start,${EXTEN},1)'."\n\t"; |
|
201 | 201 | |
202 | 202 | $options = ''; |
203 | 203 | if (isset($queue['caller_hear']) && $queue['caller_hear'] === 'ringing') { |
204 | 204 | $options .= 'r'; // Установить КПВ (гудки) вместо Музыки на Удержании для ожидающих в очереди |
205 | 205 | } |
206 | - $ringlength = (trim($queue['timeout_to_redirect_to_extension']) == '') ? 300 : $queue['timeout_to_redirect_to_extension']; |
|
207 | - if(!empty($calleridPrefix)){ |
|
206 | + $ringlength = (trim($queue['timeout_to_redirect_to_extension']) == '') ? 300 : $queue['timeout_to_redirect_to_extension']; |
|
207 | + if (!empty($calleridPrefix)) { |
|
208 | 208 | $queue_ext_conf .= "same => n,Set(CALLERID(name)={$calleridPrefix}:".'${CALLERID(name)}'.") \n\t"; |
209 | 209 | } |
210 | 210 | |
211 | 211 | $queue_ext_conf .= "same => n,Queue({$queue['uniqid']},CkT{$options},,,{$ringlength},,,queue_agent_answer) \n\t"; |
212 | 212 | // Оповестим о завершении работы очереди. |
213 | - $queue_ext_conf .= 'same => n,Gosub(queue_end,${EXTEN},1)' . "\n\t"; |
|
213 | + $queue_ext_conf .= 'same => n,Gosub(queue_end,${EXTEN},1)'."\n\t"; |
|
214 | 214 | |
215 | 215 | if (trim($queue['timeout_extension']) !== '') { |
216 | 216 | // Если по таймауту не ответили, то выполним переадресацию. |
217 | - $queue_ext_conf .= 'same => n,ExecIf($["${QUEUESTATUS}" == "TIMEOUT"]?Goto(internal,' . $queue['timeout_extension'] . ',1))' . " \n\t"; |
|
217 | + $queue_ext_conf .= 'same => n,ExecIf($["${QUEUESTATUS}" == "TIMEOUT"]?Goto(internal,'.$queue['timeout_extension'].',1))'." \n\t"; |
|
218 | 218 | } |
219 | 219 | if (trim($queue['redirect_to_extension_if_empty']) !== '') { |
220 | 220 | // Если пустая очередь, то выполним переадресацию. |
221 | - $exp = '$["${QUEUESTATUS}" == "JOINEMPTY" || "${QUEUESTATUS}" == "LEAVEEMPTY" ]'; |
|
222 | - $queue_ext_conf .= 'same => n,ExecIf(' . $exp . '?Goto(internal,' . $queue['redirect_to_extension_if_empty'] . ',1))' . " \n\t"; |
|
221 | + $exp = '$["${QUEUESTATUS}" == "JOINEMPTY" || "${QUEUESTATUS}" == "LEAVEEMPTY" ]'; |
|
222 | + $queue_ext_conf .= 'same => n,ExecIf('.$exp.'?Goto(internal,'.$queue['redirect_to_extension_if_empty'].',1))'." \n\t"; |
|
223 | 223 | } |
224 | 224 | $queue_ext_conf .= "\n"; |
225 | 225 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | public static function queueReload(): void |
234 | 234 | { |
235 | - $queue = new self(); |
|
235 | + $queue = new self(); |
|
236 | 236 | $queue->generateConfig(); |
237 | 237 | $out = []; |
238 | 238 | $asteriskPath = Util::which('asterisk'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | // e.g. 10.0.2.56/21 = 10.0.0.0 |
41 | 41 | public function cidr2network($ip, $cidr) |
42 | 42 | { |
43 | - return long2ip((ip2long($ip)) & ((-1 << (32 - (int)$cidr)))); |
|
43 | + return long2ip((ip2long($ip)) & ((-1 << (32 - (int) $cidr)))); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | // convert netmask to cidr |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $netmask = explode(".", $netmask); |
52 | 52 | |
53 | 53 | foreach ($netmask as $octect) { |
54 | - $bits += strlen(str_replace("0", "", decbin((int)$octect))); |
|
54 | + $bits += strlen(str_replace("0", "", decbin((int) $octect))); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | return $bits; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | class WorkerLongPoolAPI extends WorkerBase |
32 | 32 | { |
33 | - protected int $maxProc=1; |
|
33 | + protected int $maxProc = 1; |
|
34 | 34 | |
35 | 35 | public function start($argv): void |
36 | 36 | { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $this->setChannelsData(); |
47 | 47 | if (is_array($data) && isset($data['infos'])) { |
48 | 48 | foreach ($data['infos'] as $channel_data) { |
49 | - $url = 'http://localhost/pbxcore/api/long/pub?id=' . $channel_data['channel']; |
|
49 | + $url = 'http://localhost/pbxcore/api/long/pub?id='.$channel_data['channel']; |
|
50 | 50 | |
51 | 51 | $data_for_send = $this->execFunction($channel_data['channel']); |
52 | 52 | if ($data_for_send) { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $this->postData($url, "$data_for_send\n"); |
55 | 55 | } |
56 | 56 | |
57 | - if ( ! isset($COMMON_CNANNELS[$channel_data['channel']])) { |
|
57 | + if (!isset($COMMON_CNANNELS[$channel_data['channel']])) { |
|
58 | 58 | continue; |
59 | 59 | } |
60 | 60 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | private function execFunction($channel, $common_chan = null) |
132 | 132 | { |
133 | 133 | clearstatcache(); |
134 | - if ( ! $this->checkAction($channel, $common_chan)) { |
|
134 | + if (!$this->checkAction($channel, $common_chan)) { |
|
135 | 135 | return ''; |
136 | 136 | } |
137 | 137 | $data_for_send = null; |
@@ -162,18 +162,18 @@ discard block |
||
162 | 162 | */ |
163 | 163 | private function checkAction($channel, $common_chan = null) |
164 | 164 | { |
165 | - if ( ! $common_chan) { |
|
165 | + if (!$common_chan) { |
|
166 | 166 | $actions = $GLOBALS['ACTIONS']; |
167 | 167 | } else { |
168 | 168 | $actions = $GLOBALS['COMMON_CNANNELS'][$common_chan]; |
169 | 169 | } |
170 | 170 | |
171 | 171 | $enable = false; |
172 | - if ( ! $actions) { |
|
172 | + if (!$actions) { |
|
173 | 173 | return $enable; |
174 | 174 | } |
175 | 175 | // $data = null; |
176 | - $now = time(); |
|
176 | + $now = time(); |
|
177 | 177 | |
178 | 178 | $action_data = $actions[$channel] ?? null; |
179 | 179 | if ($action_data !== null) { |
@@ -63,17 +63,17 @@ discard block |
||
63 | 63 | echo $killPath.' -QUIT '.$pid."\n"; |
64 | 64 | } |
65 | 65 | $timeStart = time(); |
66 | - while (true){ |
|
67 | - if(time() - $timeStart > 20){ |
|
66 | + while (true) { |
|
67 | + if (time() - $timeStart > 20) { |
|
68 | 68 | break; |
69 | 69 | } |
70 | 70 | usleep(50000); |
71 | 71 | $pid = Util::getPidOfProcess('nginx: master process'); |
72 | - if($pid !== ''){ |
|
72 | + if ($pid !== '') { |
|
73 | 73 | continue; |
74 | 74 | } |
75 | 75 | $result = Util::mwExec($NginxPath); |
76 | - if($result === 0){ |
|
76 | + if ($result === 0) { |
|
77 | 77 | break; |
78 | 78 | } |
79 | 79 | echo "RESULT -- $result\n"; |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | |
112 | 112 | $RedirectToHttps = $this->mikoPBXConfig->getGeneralSettings('RedirectToHttps'); |
113 | 113 | if ($RedirectToHttps === '1' && $not_ssl === false) { |
114 | - $conf_data = 'if ( $remote_addr != "127.0.0.1" ) {' . PHP_EOL |
|
115 | - . ' ' . 'return 301 https://$host:' . $WEBHTTPSPort . '$request_uri;' . PHP_EOL |
|
116 | - . ' }' . PHP_EOL; |
|
114 | + $conf_data = 'if ( $remote_addr != "127.0.0.1" ) {'.PHP_EOL |
|
115 | + . ' '.'return 301 https://$host:'.$WEBHTTPSPort.'$request_uri;'.PHP_EOL |
|
116 | + . ' }'.PHP_EOL; |
|
117 | 117 | $config = str_replace('include mikopbx/locations/*.conf;', $conf_data, $config); |
118 | 118 | } |
119 | 119 | file_put_contents($httpConfigFile, $config); |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | $WEBHTTPSPrivateKey = $this->mikoPBXConfig->getGeneralSettings('WEBHTTPSPrivateKey'); |
124 | 124 | if ( |
125 | 125 | $not_ssl === false |
126 | - && ! empty($WEBHTTPSPublicKey) |
|
127 | - && ! empty($WEBHTTPSPrivateKey) |
|
126 | + && !empty($WEBHTTPSPublicKey) |
|
127 | + && !empty($WEBHTTPSPrivateKey) |
|
128 | 128 | ) { |
129 | 129 | $public_filename = '/etc/ssl/certs/nginx.crt'; |
130 | 130 | $private_filename = '/etc/ssl/private/nginx.key'; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | // Test work |
141 | 141 | $currentConfigIsGood = $this->testCurrentNginxConfig(); |
142 | - if ($level < 1 && ! $currentConfigIsGood) { |
|
142 | + if ($level < 1 && !$currentConfigIsGood) { |
|
143 | 143 | ++$level; |
144 | 144 | Util::sysLogMsg('nginx', 'Failed test config file. SSL will be disable...'); |
145 | 145 | $this->generateConf(true, $level); |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function generateModulesConf(): void |
170 | 170 | { |
171 | - $locationsPath = self::MODULES_LOCATIONS_PATH; |
|
172 | - if (!is_dir($locationsPath)){ |
|
173 | - Util::mwMkdir($locationsPath,true); |
|
171 | + $locationsPath = self::MODULES_LOCATIONS_PATH; |
|
172 | + if (!is_dir($locationsPath)) { |
|
173 | + Util::mwMkdir($locationsPath, true); |
|
174 | 174 | } |
175 | 175 | $additionalModules = $this->di->getShared('pbxConfModules'); |
176 | 176 | $rmPath = Util::which('rm'); |
@@ -178,12 +178,12 @@ discard block |
||
178 | 178 | foreach ($additionalModules as $appClass) { |
179 | 179 | if (method_exists($appClass, 'createNginxLocations')) { |
180 | 180 | $locationContent = $appClass->createNginxLocations(); |
181 | - if ( ! empty($locationContent)) { |
|
181 | + if (!empty($locationContent)) { |
|
182 | 182 | $confFileName = "{$locationsPath}/{$appClass->moduleUniqueId}.conf"; |
183 | 183 | file_put_contents($confFileName, $locationContent); |
184 | - if ( ! $this->testCurrentNginxConfig()) { |
|
184 | + if (!$this->testCurrentNginxConfig()) { |
|
185 | 185 | Util::mwExec("{$rmPath} {$confFileName}"); |
186 | - Util::sysLogMsg('nginx', 'Failed test config file for module' . $appClass->moduleUniqueId); |
|
186 | + Util::sysLogMsg('nginx', 'Failed test config file for module'.$appClass->moduleUniqueId); |
|
187 | 187 | } |
188 | 188 | } |
189 | 189 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | protected function generateConfigProtected(): void |
20 | 20 | { |
21 | 21 | $conf = ""; |
22 | - file_put_contents($this->config->path('asterisk.astetcdir') . '/confbridge.conf', $conf); |
|
22 | + file_put_contents($this->config->path('asterisk.astetcdir').'/confbridge.conf', $conf); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $conf = ''; |
33 | 33 | $data = ConferenceRooms::find(['order' => 'extension']); |
34 | 34 | foreach ($data as $conference) { |
35 | - $conf .= "exten => {$conference->extension},1,Goto(conference-rooms,{$conference->extension},1)" . "\n"; |
|
35 | + $conf .= "exten => {$conference->extension},1,Goto(conference-rooms,{$conference->extension},1)"."\n"; |
|
36 | 36 | } |
37 | 37 | $conf .= "\n"; |
38 | 38 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $conf = ''; |
48 | 48 | $data = ConferenceRooms::find(['order' => 'extension']); |
49 | 49 | foreach ($data as $conference) { |
50 | - $conf .= "exten => {$conference->extension},1,Goto(conference-rooms,{$conference->extension},1)" . "\n"; |
|
50 | + $conf .= "exten => {$conference->extension},1,Goto(conference-rooms,{$conference->extension},1)"."\n"; |
|
51 | 51 | } |
52 | 52 | $conf .= "\n"; |
53 | 53 | |
@@ -72,13 +72,13 @@ discard block |
||
72 | 72 | $conf .= "[conference-rooms] \n"; |
73 | 73 | $data = ConferenceRooms::find(['order' => 'extension']); |
74 | 74 | foreach ($data as $conference) { |
75 | - $conf .= 'exten => ' . $conference->extension . ',1,NoOp(---)' . "\n\t"; |
|
76 | - $conf .= 'same => n,ExecIf($["${CHANNEL(channeltype)}" == "Local"]?Hangup())' . "\n\t"; |
|
77 | - $conf .= 'same => n,AGI(cdr_connector.php,meetme_dial)' . "\n\t"; |
|
78 | - $conf .= 'same => n,Answer()' . "\n\t"; |
|
79 | - $conf .= 'same => n,Set(CHANNEL(hangup_handler_wipe)=hangup_handler_meetme,s,1)' . "\n\t"; |
|
80 | - $conf .= 'same => n,Meetme(${EXTEN},qdMT' . $rec_options . ')' . "\n\t"; |
|
81 | - $conf .= 'same => n,Hangup()' . "\n\n"; |
|
75 | + $conf .= 'exten => '.$conference->extension.',1,NoOp(---)'."\n\t"; |
|
76 | + $conf .= 'same => n,ExecIf($["${CHANNEL(channeltype)}" == "Local"]?Hangup())'."\n\t"; |
|
77 | + $conf .= 'same => n,AGI(cdr_connector.php,meetme_dial)'."\n\t"; |
|
78 | + $conf .= 'same => n,Answer()'."\n\t"; |
|
79 | + $conf .= 'same => n,Set(CHANNEL(hangup_handler_wipe)=hangup_handler_meetme,s,1)'."\n\t"; |
|
80 | + $conf .= 'same => n,Meetme(${EXTEN},qdMT'.$rec_options.')'."\n\t"; |
|
81 | + $conf .= 'same => n,Hangup()'."\n\n"; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | return $conf; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | { |
26 | 26 | $src_log_file = '/var/log/php_error.log'; |
27 | 27 | $dst_log_file = self::getLogFile(); |
28 | - if ( ! file_exists($src_log_file)) { |
|
28 | + if (!file_exists($src_log_file)) { |
|
29 | 29 | file_put_contents($src_log_file, ''); |
30 | 30 | } |
31 | 31 | $options = file_exists($dst_log_file) ? '>' : ''; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public static function getLogFile(): string |
43 | 43 | { |
44 | - $logdir = System::getLogDir() . '/php'; |
|
44 | + $logdir = System::getLogDir().'/php'; |
|
45 | 45 | Util::mwMkdir($logdir); |
46 | 46 | return "$logdir/error.log"; |
47 | 47 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $max_size = 2; |
57 | 57 | $f_name = self::getLogFile(); |
58 | - $text_config = $f_name . " { |
|
58 | + $text_config = $f_name." { |
|
59 | 59 | nocreate |
60 | 60 | nocopytruncate |
61 | 61 | delaycompress |
@@ -69,13 +69,13 @@ discard block |
||
69 | 69 | endscript |
70 | 70 | }"; |
71 | 71 | // TODO::Доделать рестарт PHP-FPM после обновление лога |
72 | - $di = Di::getDefault(); |
|
73 | - if ($di !== null){ |
|
72 | + $di = Di::getDefault(); |
|
73 | + if ($di !== null) { |
|
74 | 74 | $varEtcDir = $di->getConfig()->path('core.varEtcDir'); |
75 | 75 | } else { |
76 | 76 | $varEtcDir = '/var/etc'; |
77 | 77 | } |
78 | - $path_conf = $varEtcDir . '/php_logrotate_' . basename($f_name) . '.conf'; |
|
78 | + $path_conf = $varEtcDir.'/php_logrotate_'.basename($f_name).'.conf'; |
|
79 | 79 | file_put_contents($path_conf, $text_config); |
80 | 80 | $mb10 = $max_size * 1024 * 1024; |
81 | 81 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public static function phpTimeZoneConfigure(): void |
93 | 93 | { |
94 | - $timezone = PbxSettings::getValueByKey('PBXTimezone'); |
|
94 | + $timezone = PbxSettings::getValueByKey('PBXTimezone'); |
|
95 | 95 | date_default_timezone_set($timezone); |
96 | 96 | if (file_exists('/etc/TZ')) { |
97 | 97 | $catPath = Util::which('cat'); |
@@ -22,12 +22,12 @@ |
||
22 | 22 | $ntp_servers = PbxSettings::getValueByKey('NTPServer'); |
23 | 23 | $ntp_servers = preg_split('/\r\n|\r|\n| /', $ntp_servers); |
24 | 24 | $ntp_conf = ''; |
25 | - foreach ($ntp_servers as $ntp_server){ |
|
26 | - if ( ! empty($ntp_server)) { |
|
25 | + foreach ($ntp_servers as $ntp_server) { |
|
26 | + if (!empty($ntp_server)) { |
|
27 | 27 | $ntp_conf .= "server {$ntp_server}".PHP_EOL; |
28 | 28 | } |
29 | 29 | } |
30 | - if ($ntp_conf==='') { |
|
30 | + if ($ntp_conf === '') { |
|
31 | 31 | $ntp_conf = 'server 0.pool.ntp.org |
32 | 32 | server 1.pool.ntp.org |
33 | 33 | server 2.pool.ntp.org'; |