@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$autoload = __DIR__ . "/../vendor/autoload.php"; |
|
3 | +$autoload = __DIR__."/../vendor/autoload.php"; |
|
4 | 4 | if (!file_exists($autoload)) { |
5 | - $autoload = __DIR__ . "/../../../../autoload.php"; |
|
5 | + $autoload = __DIR__."/../../../../autoload.php"; |
|
6 | 6 | if (!file_exists($autoload)) { |
7 | 7 | throw new \Exception('Autoload not found. Did you run `composer dump-autload`?'); |
8 | 8 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | public function process() |
13 | 13 | { |
14 | - file_put_contents(sys_get_temp_dir() . '/tryme.txt', date('c') . "\n", FILE_APPEND); |
|
15 | - file_put_contents(sys_get_temp_dir() . '/tryme.txt', print_r($_REQUEST, true), FILE_APPEND); |
|
14 | + file_put_contents(sys_get_temp_dir().'/tryme.txt', date('c')."\n", FILE_APPEND); |
|
15 | + file_put_contents(sys_get_temp_dir().'/tryme.txt', print_r($_REQUEST, true), FILE_APPEND); |
|
16 | 16 | } |
17 | 17 | } |
@@ -10,21 +10,21 @@ discard block |
||
10 | 10 | throw new \Exception("Template '$template' not found"); |
11 | 11 | } |
12 | 12 | |
13 | - $bootstrap = $curdir . '/' . $bootstrap; |
|
13 | + $bootstrap = $curdir.'/'.$bootstrap; |
|
14 | 14 | if (!file_exists($bootstrap)) { |
15 | 15 | throw new \Exception("Bootstrap '$bootstrap' not found"); |
16 | 16 | } |
17 | 17 | |
18 | - $autoload = realpath(__DIR__ . "/../vendor/autoload.php"); |
|
18 | + $autoload = realpath(__DIR__."/../vendor/autoload.php"); |
|
19 | 19 | if (!file_exists($autoload)) { |
20 | - $autoload = realpath(__DIR__ . "/../../../autoload.php"); |
|
20 | + $autoload = realpath(__DIR__."/../../../autoload.php"); |
|
21 | 21 | if (!file_exists($autoload)) { |
22 | 22 | throw new \Exception('Daemonize autoload not found. Did you run `composer dump-autload`?'); |
23 | 23 | } |
24 | 24 | } |
25 | 25 | |
26 | 26 | if (!empty($consoleArgs)) { |
27 | - $consoleArgsPrepared = '[ "' . implode('", "', $consoleArgs) . '" ]'; |
|
27 | + $consoleArgsPrepared = '[ "'.implode('", "', $consoleArgs).'" ]'; |
|
28 | 28 | } else { |
29 | 29 | $consoleArgsPrepared = "[ ]"; |
30 | 30 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | ) |
46 | 46 | ); |
47 | 47 | |
48 | - set_error_handler(function ($number, $error) { |
|
48 | + set_error_handler(function($number, $error) { |
|
49 | 49 | throw new \Exception($error); |
50 | 50 | }); |
51 | 51 | file_put_contents("/etc/init.d/$svcName", $templateStr); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | protected static function isDaemonizeService($filename) |
76 | 76 | { |
77 | - set_error_handler(function ($number, $error) { |
|
77 | + set_error_handler(function($number, $error) { |
|
78 | 78 | throw new \Exception($error); |
79 | 79 | }); |
80 | 80 |
@@ -46,15 +46,15 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | if (empty($logname)) { |
49 | - $logname = str_replace("\\", "_", strtolower($this->className)) . "." . strtolower($this->methodName); |
|
49 | + $logname = str_replace("\\", "_", strtolower($this->className)).".".strtolower($this->methodName); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | fclose(STDIN); |
53 | 53 | fclose(STDOUT); |
54 | 54 | fclose(STDERR); |
55 | 55 | $this->stdIn = fopen('/dev/null', 'r'); |
56 | - $this->stdOut = fopen(self::BASE_LOG_PATH . '/' . $logname . '.log', 'ab'); |
|
57 | - $this->stdErr = fopen(self::BASE_LOG_PATH . '/' . $logname . '.error.log', 'ab'); |
|
56 | + $this->stdOut = fopen(self::BASE_LOG_PATH.'/'.$logname.'.log', 'ab'); |
|
57 | + $this->stdErr = fopen(self::BASE_LOG_PATH.'/'.$logname.'.error.log', 'ab'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | protected function extractQueryParameters($consoleArgs) |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $instance = $this->instance; |
76 | 76 | $method = $this->methodName; |
77 | 77 | |
78 | - $this->writeToStdout("Service " . $this->className . "::" . $this->methodName . " started at " . date('c') . "\n"); |
|
78 | + $this->writeToStdout("Service ".$this->className."::".$this->methodName." started at ".date('c')."\n"); |
|
79 | 79 | |
80 | 80 | $continue = true; |
81 | 81 | |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | $this->writeToStdout($output); |
88 | 88 | } |
89 | 89 | } catch (Exception $ex) { |
90 | - $this->writeToStderr(date('c') . ' [' . get_class($ex) . '] in ' . $ex->getFile() . ' at line ' . $ex->getLine() . ' -- ' . "\n"); |
|
91 | - $this->writeToStderr('Message: ' . $ex->getMessage() . "\n"); |
|
92 | - $this->writeToStderr("Stack Trace:\n" . $ex->getTraceAsString()); |
|
90 | + $this->writeToStderr(date('c').' ['.get_class($ex).'] in '.$ex->getFile().' at line '.$ex->getLine().' -- '."\n"); |
|
91 | + $this->writeToStderr('Message: '.$ex->getMessage()."\n"); |
|
92 | + $this->writeToStderr("Stack Trace:\n".$ex->getTraceAsString()); |
|
93 | 93 | $this->writeToStderr("\n\n"); |
94 | 94 | } |
95 | 95 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $input->getArgument('classname'), |
58 | 58 | $input->getArgument('bootstrap'), |
59 | 59 | $input->getArgument('rootdir'), |
60 | - __DIR__ . "/../../template/linux-initd-service.conf", |
|
60 | + __DIR__."/../../template/linux-initd-service.conf", |
|
61 | 61 | $input->getArgument('description'), |
62 | 62 | $input->getArgument('args') |
63 | 63 | ); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | } else { |
27 | 27 | $output->writeln("List of daemonize services: "); |
28 | 28 | foreach ($list as $filename) { |
29 | - $output->writeln(" - " . basename($filename)); |
|
29 | + $output->writeln(" - ".basename($filename)); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | $output->writeln(""); |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $bootstrap = $input->getArgument('bootstrap'); |
46 | 46 | $rootPath = $input->getArgument('rootdir'); |
47 | 47 | |
48 | - $realPathBootstrap = realpath($rootPath . $bootstrap); |
|
48 | + $realPathBootstrap = realpath($rootPath.$bootstrap); |
|
49 | 49 | $realPathRootPath = realpath($rootPath); |
50 | 50 | |
51 | 51 | if (!file_exists($realPathRootPath)) { |