@@ -279,7 +279,7 @@ |
||
279 | 279 | $classpath = implode(':', $jars); |
280 | 280 | $threads = $this->config->getThreads(); |
281 | 281 | |
282 | - $directives = ' -D' . implode(' -D', [ |
|
282 | + $directives = ' -D'.implode(' -D', [ |
|
283 | 283 | 'php.java.bridge.daemon="false"', |
284 | 284 | "php.java.bridge.threads=$threads" |
285 | 285 | ]); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | { |
224 | 224 | // Four levels back. |
225 | 225 | $ds = DIRECTORY_SEPARATOR; |
226 | - $dir = __DIR__ . "$ds..$ds..$ds..$ds..$ds"; |
|
226 | + $dir = __DIR__."$ds..$ds..$ds..$ds..$ds"; |
|
227 | 227 | $base_dir = realpath($dir); |
228 | 228 | if (!$base_dir) { |
229 | 229 | $message = 'Cannot resolve project base directory.'; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | |
253 | 253 | // Step 2: server_jar file must exists |
254 | 254 | if (!is_file($config['server_jar']) || !is_readable($config['server_jar'])) { |
255 | - throw new Exception\InvalidArgumentException("Server jar file not exists or unreadable. server-jar: '" . $config['server_jar'] . "'"); |
|
255 | + throw new Exception\InvalidArgumentException("Server jar file not exists or unreadable. server-jar: '".$config['server_jar']."'"); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | // Step 3: log and pid file should be creatable |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $this->server = new StandaloneServer($config, $logger); |
59 | 59 | $this->server->restart(); |
60 | 60 | |
61 | - $logger->debug("Server output: \n" . $this->server->getOutput()); |
|
61 | + $logger->debug("Server output: \n".$this->server->getOutput()); |
|
62 | 62 | |
63 | 63 | $output->writeln("Server successfully restarted on port $port"); |
64 | 64 |
@@ -25,19 +25,19 @@ |
||
25 | 25 | protected function configure(): void |
26 | 26 | { |
27 | 27 | $this->setName('pjbserver:restart') |
28 | - ->setDescription( |
|
29 | - 'Restart the standalone pjb server (java)' |
|
30 | - ) |
|
31 | - ->addArgument( |
|
32 | - 'config-file', |
|
33 | - InputArgument::REQUIRED, |
|
34 | - 'Configuration file, see ./dist/pjbserver.config.php.dist' |
|
35 | - ) |
|
36 | - ->setHelp( |
|
37 | - <<<'EOT' |
|
28 | + ->setDescription( |
|
29 | + 'Restart the standalone pjb server (java)' |
|
30 | + ) |
|
31 | + ->addArgument( |
|
32 | + 'config-file', |
|
33 | + InputArgument::REQUIRED, |
|
34 | + 'Configuration file, see ./dist/pjbserver.config.php.dist' |
|
35 | + ) |
|
36 | + ->setHelp( |
|
37 | + <<<'EOT' |
|
38 | 38 | Start the php java bridge server in the background. |
39 | 39 | EOT |
40 | - ); |
|
40 | + ); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | protected function execute(InputInterface $input, OutputInterface $output) |
@@ -52,7 +52,7 @@ |
||
52 | 52 | $process = new Linux\LinuxProcess($logger); |
53 | 53 | break; |
54 | 54 | default: |
55 | - $msg = "System style '" . $style . "' is not supported"; |
|
55 | + $msg = "System style '".$style."' is not supported"; |
|
56 | 56 | throw new UnsupportedSystemException($msg); |
57 | 57 | } |
58 | 58 |
@@ -21,11 +21,11 @@ |
||
21 | 21 | */ |
22 | 22 | public function logServerConfig(ConsoleLogger $logger, Config $config): void |
23 | 23 | { |
24 | - $logger->info('* config port :' . $config->getPort()); |
|
25 | - $logger->info('* config log_file :' . $config->getLogFile()); |
|
26 | - $logger->info('* config pid_file :' . $config->getPidFile()); |
|
27 | - $logger->info('* config classpaths :' . implode(',', $config->getClasspaths())); |
|
28 | - $logger->info('* config java_bin :' . $config->getJavaBin()); |
|
29 | - $logger->info('* config server_jar :' . $config->getServerJar()); |
|
24 | + $logger->info('* config port :'.$config->getPort()); |
|
25 | + $logger->info('* config log_file :'.$config->getLogFile()); |
|
26 | + $logger->info('* config pid_file :'.$config->getPidFile()); |
|
27 | + $logger->info('* config classpaths :'.implode(',', $config->getClasspaths())); |
|
28 | + $logger->info('* config java_bin :'.$config->getJavaBin()); |
|
29 | + $logger->info('* config server_jar :'.$config->getServerJar()); |
|
30 | 30 | } |
31 | 31 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | public function isRunning(int $pid): bool |
40 | 40 | { |
41 | 41 | $cmd = sprintf('kill -0 %d 2>&1', $pid); |
42 | - $this->logger->debug(__METHOD__ . ": Exec command: $cmd"); |
|
42 | + $this->logger->debug(__METHOD__.": Exec command: $cmd"); |
|
43 | 43 | exec($cmd, $output, $return_var); |
44 | 44 | |
45 | 45 | return $return_var === 0; |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | if ($wait) { |
58 | 58 | $sleep_time = '0.2'; |
59 | 59 | $cmd = sprintf('kill %d; while ps -p %d; do sleep %s;done;', $pid, $pid, $sleep_time); |
60 | - $this->logger->debug(__METHOD__ . " Exec command: $cmd"); |
|
60 | + $this->logger->debug(__METHOD__." Exec command: $cmd"); |
|
61 | 61 | exec($cmd, $output, $return_var); |
62 | 62 | $killed = ($return_var === 0); |
63 | 63 | if ($killed) { |
64 | - $this->logger->debug(__METHOD__ . " Successfully killed process {$pid}"); |
|
64 | + $this->logger->debug(__METHOD__." Successfully killed process {$pid}"); |
|
65 | 65 | } else { |
66 | - $this->logger->notice(__METHOD__ . " Cannot kill process {$pid}, $output"); |
|
66 | + $this->logger->notice(__METHOD__." Cannot kill process {$pid}, $output"); |
|
67 | 67 | } |
68 | 68 | } else { |
69 | 69 | //@todo |
@@ -72,7 +72,7 @@ |
||
72 | 72 | } |
73 | 73 | $this->options['backend'] = strtolower($this->options['backend']); |
74 | 74 | if (!in_array($this->options['backend'], $this->supportedBackends, true)) { |
75 | - throw new \InvalidArgumentException("Unsupported backend '" . $this->options['backend'] . "'"); |
|
75 | + throw new \InvalidArgumentException("Unsupported backend '".$this->options['backend']."'"); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 |
@@ -26,20 +26,20 @@ |
||
26 | 26 | protected function configure(): void |
27 | 27 | { |
28 | 28 | $this->setName('pjbserver:status') |
29 | - ->setDescription( |
|
30 | - 'Get the status of the standalone pjb server (java)' |
|
31 | - ) |
|
29 | + ->setDescription( |
|
30 | + 'Get the status of the standalone pjb server (java)' |
|
31 | + ) |
|
32 | 32 | ->addArgument( |
33 | 33 | 'config-file', |
34 | 34 | InputArgument::REQUIRED, |
35 | 35 | 'Configuration file, see ./dist/pjbserver.config.php.dist' |
36 | 36 | ) |
37 | 37 | |
38 | - ->setHelp( |
|
39 | - <<<'EOT' |
|
38 | + ->setHelp( |
|
39 | + <<<'EOT' |
|
40 | 40 | Get the status of the php java bridge server in the background. |
41 | 41 | EOT |
42 | - ); |
|
42 | + ); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | protected function execute(InputInterface $input, OutputInterface $output) |
@@ -25,20 +25,20 @@ |
||
25 | 25 | protected function configure(): void |
26 | 26 | { |
27 | 27 | $this->setName('pjbserver:reveal') |
28 | - ->setDescription( |
|
29 | - 'Print the underlying java cli command' |
|
30 | - ) |
|
28 | + ->setDescription( |
|
29 | + 'Print the underlying java cli command' |
|
30 | + ) |
|
31 | 31 | ->addArgument( |
32 | 32 | 'config-file', |
33 | 33 | InputArgument::REQUIRED, |
34 | 34 | 'Configuration file, see ./dist/pjbserver.config.php.dist' |
35 | 35 | ) |
36 | 36 | |
37 | - ->setHelp( |
|
38 | - <<<'EOT' |
|
37 | + ->setHelp( |
|
38 | + <<<'EOT' |
|
39 | 39 | Echo the underlying cli command (call to java) that will be called. |
40 | 40 | EOT |
41 | - ); |
|
41 | + ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | protected function execute(InputInterface $input, OutputInterface $output) |