@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | if (TProcessHelper::isSystemWindows()) { |
| 163 | 163 | if (is_string($command)) { |
| 164 | - $command = '"' . $command . '"'; //Windows, better command support |
|
| 164 | + $command = '"' . $command . '"'; //Windows, better command support |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | return $command; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $output = shell_exec("wmic process where ProcessId={$pid} get priority"); |
| 232 | 232 | preg_match('/^\s*Priority\s*\r?\n\s*(\d+)/m', $output, $matches); |
| 233 | 233 | if (isset($matches[1])) { |
| 234 | - $priorityValues = [ // Map Windows Priority Numbers to Linux style Numbers |
|
| 234 | + $priorityValues = [// Map Windows Priority Numbers to Linux style Numbers |
|
| 235 | 235 | TProcessWindowsPriority::Idle => static::WINDOWS_IDLE_PRIORITY, |
| 236 | 236 | TProcessWindowsPriority::BelowNormal => static::WINDOWS_BELOW_NORMAL_PRIORITY, |
| 237 | 237 | TProcessWindowsPriority::Normal => static::WINDOWS_NORMAL_PRIORITY, |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | $pid = getmypid(); |
| 264 | 264 | } |
| 265 | 265 | if (static::isSystemWindows()) { |
| 266 | - $priorityValues = [ // The priority cap to windows text priority. |
|
| 266 | + $priorityValues = [// The priority cap to windows text priority. |
|
| 267 | 267 | -15 => TProcessWindowsPriorityName::Realtime, |
| 268 | 268 | -10 => TProcessWindowsPriorityName::HighPriority, |
| 269 | 269 | -5 => TProcessWindowsPriorityName::AboveNormal, |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | 9 => TProcessWindowsPriorityName::BelowNormal, |
| 272 | 272 | PHP_INT_MAX => TProcessWindowsPriorityName::Idle, |
| 273 | 273 | ]; |
| 274 | - foreach($priorityValues as $keyPriority => $priorityName) { |
|
| 274 | + foreach ($priorityValues as $keyPriority => $priorityName) { |
|
| 275 | 275 | if ($priority <= $keyPriority) { |
| 276 | 276 | break; |
| 277 | 277 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $logger->deleteLogs(); |
| 146 | 146 | $logs = $logger->deleteProfileLogs(); |
| 147 | 147 | $pid = getmypid(); |
| 148 | - foreach(array_keys($logs) as $key) { // Reset PROFILE_BEGIN to pid. |
|
| 148 | + foreach (array_keys($logs) as $key) { // Reset PROFILE_BEGIN to pid. |
|
| 149 | 149 | $logs[$key][TLogger::LOG_LEVEL] &= ~TLogger::LOGGED; |
| 150 | 150 | $logs[$key][TLogger::LOG_PID] = $pid; |
| 151 | 151 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | if (!$this->_parentConnections) { |
| 177 | 177 | return; |
| 178 | 178 | } |
| 179 | - if($pid && !isset($this->_parentConnections[$pid])) { |
|
| 179 | + if ($pid && !isset($this->_parentConnections[$pid])) { |
|
| 180 | 180 | return; |
| 181 | 181 | } |
| 182 | 182 | |
@@ -187,11 +187,11 @@ discard block |
||
| 187 | 187 | do { |
| 188 | 188 | $read = $connections; |
| 189 | 189 | if (stream_select($read, $write, $except, ($wait || count($childLogs)) ? 1 : 0, 0)) { |
| 190 | - foreach($read as $pid => $socket) { |
|
| 190 | + foreach ($read as $pid => $socket) { |
|
| 191 | 191 | $data = fread($socket, 8192); |
| 192 | 192 | do { |
| 193 | 193 | $iterate = false; |
| 194 | - if($data !== false) { |
|
| 194 | + if ($data !== false) { |
|
| 195 | 195 | if (array_key_exists($pid, $childLogs)) { |
| 196 | 196 | $childLogs[$pid][0] .= $data; |
| 197 | 197 | } else { |
@@ -234,12 +234,12 @@ discard block |
||
| 234 | 234 | } while ($iterate); |
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | - } while(count($childLogs) || $wait && ($pid && isset($connections[$pid]) || $pid === null && $connections)); |
|
| 237 | + } while (count($childLogs) || $wait && ($pid && isset($connections[$pid]) || $pid === null && $connections)); |
|
| 238 | 238 | |
| 239 | 239 | if (!$completeLogs) { |
| 240 | 240 | return; |
| 241 | 241 | } |
| 242 | - foreach(array_merge(...$completeLogs) as $pid => $logs) { |
|
| 242 | + foreach (array_merge(...$completeLogs) as $pid => $logs) { |
|
| 243 | 243 | Prado::getLogger()->mergeLogs(unserialize($logs)); |
| 244 | 244 | } |
| 245 | 245 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | return; |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | - if(!($logger instanceof TLogger)) { |
|
| 260 | + if (!($logger instanceof TLogger)) { |
|
| 261 | 261 | $logger = Prado::getLogger(); |
| 262 | 262 | } |
| 263 | 263 | |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | $data = substr($data, $count); |
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | - } while($count !== false && strlen($data) > 0); |
|
| 297 | + } while ($count !== false && strlen($data) > 0); |
|
| 298 | 298 | |
| 299 | 299 | if ($final) { |
| 300 | 300 | stream_socket_shutdown($this->_childConnection, STREAM_SHUT_RDWR); |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | */ |
| 114 | 114 | public function getAddress(): string |
| 115 | 115 | { |
| 116 | - if(!$this->_address) { |
|
| 116 | + if (!$this->_address) { |
|
| 117 | 117 | if ($this->getIpv6()) { |
| 118 | 118 | if ($this->getAll()) { |
| 119 | 119 | return '[::0]'; |