@@ -73,7 +73,7 @@ |
||
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | if (!in_array($this->options['backend'], $this->supportedBackends)) { |
| 76 | - throw new \InvalidArgumentException("Unsupported backend '" . $this->options['backend'] . "'"); |
|
| 76 | + throw new \InvalidArgumentException("Unsupported backend '".$this->options['backend']."'"); |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
@@ -24,15 +24,15 @@ |
||
| 24 | 24 | protected function configure() |
| 25 | 25 | { |
| 26 | 26 | $this->setName('pjbserver:restart') |
| 27 | - ->setDescription( |
|
| 28 | - 'Restart the standalone pjb server (java)' |
|
| 29 | - ) |
|
| 30 | - ->addArgument( |
|
| 27 | + ->setDescription( |
|
| 28 | + 'Restart the standalone pjb server (java)' |
|
| 29 | + ) |
|
| 30 | + ->addArgument( |
|
| 31 | 31 | 'config-file', |
| 32 | 32 | InputArgument::REQUIRED, |
| 33 | 33 | 'Configuration file, see ./dist/pjbserver.config.php.dist' |
| 34 | - ) |
|
| 35 | - ->setHelp(<<<EOT |
|
| 34 | + ) |
|
| 35 | + ->setHelp(<<<EOT |
|
| 36 | 36 | Start the php java bridge server in the background. |
| 37 | 37 | EOT |
| 38 | 38 | ); |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $this->server = new StandaloneServer($config, $logger); |
| 60 | 60 | $this->server->restart(); |
| 61 | 61 | |
| 62 | - $logger->debug("Server output: \n" . $this->server->getOutput()); |
|
| 62 | + $logger->debug("Server output: \n".$this->server->getOutput()); |
|
| 63 | 63 | |
| 64 | 64 | $output->writeln("Server successfully restarted on port $port"); |
| 65 | 65 | return 0; |
@@ -24,15 +24,15 @@ |
||
| 24 | 24 | protected function configure() |
| 25 | 25 | { |
| 26 | 26 | $this->setName('pjbserver:stop') |
| 27 | - ->setDescription( |
|
| 28 | - 'Stop the standalone pjb server (java)' |
|
| 29 | - ) |
|
| 27 | + ->setDescription( |
|
| 28 | + 'Stop the standalone pjb server (java)' |
|
| 29 | + ) |
|
| 30 | 30 | ->addArgument( |
| 31 | 31 | 'config-file', |
| 32 | 32 | InputArgument::REQUIRED, |
| 33 | 33 | 'Configuration file, see ./dist/pjbserver.config.php.dist' |
| 34 | 34 | ) |
| 35 | - ->setHelp(<<<EOT |
|
| 35 | + ->setHelp(<<<EOT |
|
| 36 | 36 | Stop the standalone php java bridge server (running in the background). |
| 37 | 37 | EOT |
| 38 | 38 | ); |
@@ -24,16 +24,16 @@ |
||
| 24 | 24 | protected function configure() |
| 25 | 25 | { |
| 26 | 26 | $this->setName('pjbserver:start') |
| 27 | - ->setDescription( |
|
| 28 | - 'Start the standalone pjb server (java)' |
|
| 29 | - ) |
|
| 27 | + ->setDescription( |
|
| 28 | + 'Start the standalone pjb server (java)' |
|
| 29 | + ) |
|
| 30 | 30 | ->addArgument( |
| 31 | 31 | 'config-file', |
| 32 | 32 | InputArgument::REQUIRED, |
| 33 | 33 | 'Configuration file, see ./dist/pjbserver.config.php.dist' |
| 34 | 34 | ) |
| 35 | 35 | |
| 36 | - ->setHelp(<<<EOT |
|
| 36 | + ->setHelp(<<<EOT |
|
| 37 | 37 | Start the php java bridge server in the background. |
| 38 | 38 | EOT |
| 39 | 39 | ); |
@@ -27,16 +27,16 @@ |
||
| 27 | 27 | protected function configure() |
| 28 | 28 | { |
| 29 | 29 | $this->setName('pjbserver:status') |
| 30 | - ->setDescription( |
|
| 31 | - 'Get the status of the standalone pjb server (java)' |
|
| 32 | - ) |
|
| 30 | + ->setDescription( |
|
| 31 | + 'Get the status of the standalone pjb server (java)' |
|
| 32 | + ) |
|
| 33 | 33 | ->addArgument( |
| 34 | 34 | 'config-file', |
| 35 | 35 | InputArgument::REQUIRED, |
| 36 | 36 | 'Configuration file, see ./dist/pjbserver.config.php.dist' |
| 37 | 37 | ) |
| 38 | 38 | |
| 39 | - ->setHelp(<<<EOT |
|
| 39 | + ->setHelp(<<<EOT |
|
| 40 | 40 | Get the status of the php java bridge server in the background. |
| 41 | 41 | EOT |
| 42 | 42 | ); |
@@ -24,11 +24,11 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function logServerConfig(ConsoleLogger $logger, Config $config) |
| 26 | 26 | { |
| 27 | - $logger->info("* config port :" . $config->getPort()); |
|
| 28 | - $logger->info("* config log_file :" . $config->getLogFile()); |
|
| 29 | - $logger->info("* config pid_file :" . $config->getPidFile()); |
|
| 30 | - $logger->info("* config classpaths :" . implode(',', $config->getClasspaths())); |
|
| 31 | - $logger->info("* config java_bin :" . $config->getJavaBin()); |
|
| 32 | - $logger->info("* config server_jar :" . $config->getServerJar()); |
|
| 27 | + $logger->info("* config port :".$config->getPort()); |
|
| 28 | + $logger->info("* config log_file :".$config->getLogFile()); |
|
| 29 | + $logger->info("* config pid_file :".$config->getPidFile()); |
|
| 30 | + $logger->info("* config classpaths :".implode(',', $config->getClasspaths())); |
|
| 31 | + $logger->info("* config java_bin :".$config->getJavaBin()); |
|
| 32 | + $logger->info("* config server_jar :".$config->getServerJar()); |
|
| 33 | 33 | } |
| 34 | 34 | } |
@@ -26,16 +26,16 @@ |
||
| 26 | 26 | protected function configure() |
| 27 | 27 | { |
| 28 | 28 | $this->setName('pjbserver:reveal') |
| 29 | - ->setDescription( |
|
| 30 | - 'Print the underlying java cli command' |
|
| 31 | - ) |
|
| 29 | + ->setDescription( |
|
| 30 | + 'Print the underlying java cli command' |
|
| 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(<<<EOT |
|
| 38 | + ->setHelp(<<<EOT |
|
| 39 | 39 | Echo the underlying cli command (call to java) that will be called. |
| 40 | 40 | EOT |
| 41 | 41 | ); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | { |
| 186 | 186 | // Four levels back. |
| 187 | 187 | $ds = DIRECTORY_SEPARATOR; |
| 188 | - $dir = __DIR__ . "$ds..$ds..$ds..$ds..$ds"; |
|
| 188 | + $dir = __DIR__."$ds..$ds..$ds..$ds..$ds"; |
|
| 189 | 189 | $base_dir = realpath($dir); |
| 190 | 190 | if (!$base_dir) { |
| 191 | 191 | $message = "Cannot resolve project base directory."; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | // Step 2: server_jar file must exists |
| 213 | 213 | if (!is_file($config['server_jar']) || !is_readable($config['server_jar'])) { |
| 214 | - throw new Exception\InvalidArgumentException("Server jar file not exists or unreadable. server-jar: '" . $config['server_jar'] ."'"); |
|
| 214 | + throw new Exception\InvalidArgumentException("Server jar file not exists or unreadable. server-jar: '".$config['server_jar']."'"); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | // Step 3: log and pid file should be creatable |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | public function isRunning($pid) |
| 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 | $running = ($return_var === 0); |
| 45 | 45 | return $running; |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | if ($wait) { |
| 61 | 61 | $sleep_time = '0.2'; |
| 62 | 62 | $cmd = sprintf("kill %d; while ps -p %d; do sleep %s;done;", $pid, $pid, $sleep_time); |
| 63 | - $this->logger->debug(__METHOD__ . " Exec command: $cmd"); |
|
| 63 | + $this->logger->debug(__METHOD__." Exec command: $cmd"); |
|
| 64 | 64 | exec($cmd, $output, $return_var); |
| 65 | 65 | $killed = ($return_var === 0); |
| 66 | 66 | if ($killed) { |
| 67 | - $this->logger->debug(__METHOD__ . " Successfully killed process {$pid}"); |
|
| 67 | + $this->logger->debug(__METHOD__." Successfully killed process {$pid}"); |
|
| 68 | 68 | } else { |
| 69 | - $this->logger->notice(__METHOD__ . " Cannot kill process {$pid}, $output"); |
|
| 69 | + $this->logger->notice(__METHOD__." Cannot kill process {$pid}, $output"); |
|
| 70 | 70 | } |
| 71 | 71 | } else { |
| 72 | 72 | //@todo |