@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param ApplicationContracts $app |
26 | 26 | * @param WorkerManagerContracts $worker |
27 | 27 | */ |
28 | - public function __construct(ApplicationContracts $app,WorkerManagerContracts $worker) |
|
28 | + public function __construct(ApplicationContracts $app, WorkerManagerContracts $worker) |
|
29 | 29 | { |
30 | 30 | parent::__construct($app); |
31 | 31 | |
@@ -41,15 +41,15 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function jobProcessor() |
43 | 43 | { |
44 | - if($this->app->get('WORKER_START')===true){ |
|
44 | + if ($this->app->get('WORKER_START')===true) { |
|
45 | 45 | return 'start'; |
46 | 46 | } |
47 | 47 | |
48 | - if($this->app->get('WORKER_STOP')===true){ |
|
48 | + if ($this->app->get('WORKER_STOP')===true) { |
|
49 | 49 | return 'stop'; |
50 | 50 | } |
51 | 51 | |
52 | - if($this->app->get('WORKER_STATUS')===true){ |
|
52 | + if ($this->app->get('WORKER_STATUS')===true) { |
|
53 | 53 | return 'status'; |
54 | 54 | } |
55 | 55 | } |
@@ -115,8 +115,8 @@ |
||
115 | 115 | { |
116 | 116 | $path = config('supervisor.path').'/'.$this->app->get('WORKER').'.conf'; |
117 | 117 | |
118 | - if(files()->exists($path)===false){ |
|
119 | - files()->put($path,' |
|
118 | + if (files()->exists($path)===false) { |
|
119 | + files()->put($path, ' |
|
120 | 120 | [program:'.$this->app()->get('WORKER').'] |
121 | 121 | process_name=%(program_name)s_%(process_num)02d |
122 | 122 | command=php '.root.'/api worker start '.$this->app->get('PROJECT_NAME').' worker:'.$this->worker->getWorker().' apply:default |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | public function start() |
32 | 32 | { |
33 | 33 | $workerName = $this->projectName().'-'.$this->argument['worker']; |
34 | - app()->register('WORKER',$workerName); |
|
35 | - app()->register('PROJECT_NAME',strtolower($this->projectName())); |
|
36 | - app()->register('WORKER_START',true); |
|
37 | - app()->register('WORKER_STOP',false); |
|
38 | - app()->register('WORKER_STATUS',false); |
|
34 | + app()->register('WORKER', $workerName); |
|
35 | + app()->register('PROJECT_NAME', strtolower($this->projectName())); |
|
36 | + app()->register('WORKER_START', true); |
|
37 | + app()->register('WORKER_STOP', false); |
|
38 | + app()->register('WORKER_STATUS', false); |
|
39 | 39 | |
40 | - app()->resolve(WorkerManager::class,['args'=>$this->argument])->execute(); |
|
40 | + app()->resolve(WorkerManager::class, ['args'=>$this->argument])->execute(); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | public function stop() |
47 | 47 | { |
48 | 48 | $workerName = $this->projectName().'-'.$this->argument['worker']; |
49 | - app()->register('WORKER',$workerName); |
|
50 | - app()->register('PROJECT_NAME',strtolower($this->projectName())); |
|
51 | - app()->register('WORKER_START',false); |
|
52 | - app()->register('WORKER_STOP',true); |
|
53 | - app()->register('WORKER_STATUS',false); |
|
49 | + app()->register('WORKER', $workerName); |
|
50 | + app()->register('PROJECT_NAME', strtolower($this->projectName())); |
|
51 | + app()->register('WORKER_START', false); |
|
52 | + app()->register('WORKER_STOP', true); |
|
53 | + app()->register('WORKER_STATUS', false); |
|
54 | 54 | |
55 | - app()->resolve(WorkerManager::class,['args'=>$this->argument])->execute(); |
|
55 | + app()->resolve(WorkerManager::class, ['args'=>$this->argument])->execute(); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | public function status() |
62 | 62 | { |
63 | 63 | $workerName = $this->projectName().'-'.$this->argument['worker']; |
64 | - app()->register('WORKER',$workerName); |
|
65 | - app()->register('PROJECT_NAME',strtolower($this->projectName())); |
|
66 | - app()->register('WORKER_START',false); |
|
67 | - app()->register('WORKER_STOP',false); |
|
68 | - app()->register('WORKER_STATUS',true); |
|
64 | + app()->register('WORKER', $workerName); |
|
65 | + app()->register('PROJECT_NAME', strtolower($this->projectName())); |
|
66 | + app()->register('WORKER_START', false); |
|
67 | + app()->register('WORKER_STOP', false); |
|
68 | + app()->register('WORKER_STATUS', true); |
|
69 | 69 | |
70 | - app()->resolve(WorkerManager::class,['args'=>$this->argument])->execute(); |
|
70 | + app()->resolve(WorkerManager::class, ['args'=>$this->argument])->execute(); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function create() |
77 | 77 | { |
78 | - if(!file_exists(app()->path()->workers())){ |
|
78 | + if (!file_exists(app()->path()->workers())) { |
|
79 | 79 | $this->directory['worker'] = app()->path()->workers(); |
80 | 80 | $this->file->makeDirectory($this); |
81 | 81 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $this->argument['workerClass'] = ucfirst($this->argument['worker']).''; |
85 | 85 | $this->argument['projectName'] = strtolower($this->projectName()); |
86 | 86 | |
87 | - $this->touch['worker/worker']= app()->path()->workers().'/'.$this->argument['worker'].'.php'; |
|
87 | + $this->touch['worker/worker'] = app()->path()->workers().'/'.$this->argument['worker'].'.php'; |
|
88 | 88 | |
89 | 89 | |
90 | 90 | $this->file->touch($this); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * @var $type |
16 | 16 | */ |
17 | - public $type='project'; |
|
17 | + public $type = 'project'; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @var array |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | /** |
32 | 32 | * @var $commandRule |
33 | 33 | */ |
34 | - public $commandRule=[]; |
|
34 | + public $commandRule = []; |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @method create |
@@ -46,15 +46,15 @@ discard block |
||
46 | 46 | $this->argument['exceptionNamespace'] = app()->namespace()->exception(); |
47 | 47 | $this->argument['resourcePath'] = app()->path()->appResourche(); |
48 | 48 | |
49 | - $recursiveDefaultDirectory = explode("\\",$this->argument['project']); |
|
49 | + $recursiveDefaultDirectory = explode("\\", $this->argument['project']); |
|
50 | 50 | $this->argument['applicationName'] = pos($recursiveDefaultDirectory); |
51 | 51 | $recursiveDefaultDirectory[] = 'V1'; |
52 | 52 | $recursiveDefaultDirectoryList = []; |
53 | 53 | |
54 | - foreach (array_slice($recursiveDefaultDirectory,1) as $defaultDirectory){ |
|
54 | + foreach (array_slice($recursiveDefaultDirectory, 1) as $defaultDirectory) { |
|
55 | 55 | |
56 | - $recursiveDefaultDirectoryList[]=$defaultDirectory; |
|
57 | - $this->directory[$defaultDirectory.'Path'] = $this->projectPath().''.implode("/",$recursiveDefaultDirectoryList); |
|
56 | + $recursiveDefaultDirectoryList[] = $defaultDirectory; |
|
57 | + $this->directory[$defaultDirectory.'Path'] = $this->projectPath().''.implode("/", $recursiveDefaultDirectoryList); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | //$this->directory['optionalDir'] = $this->optional(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | //$this->directory['sourceDir'] = $this->sourceDir(); |
81 | 81 | //$this->directory['sourceSupportDir'] = $this->sourceSupportDir(); |
82 | 82 | //$this->directory['sourceSupportTraitDir'] = $this->sourceSupportDir().'/Traits'; |
83 | - $this->directory['exceptionDir'] = app()->path()->exception(); |
|
83 | + $this->directory['exceptionDir'] = app()->path()->exception(); |
|
84 | 84 | |
85 | 85 | //set project directory |
86 | 86 | $this->file->makeDirectory($this); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $this->touch['app/gitignore'] = $this->projectPath().'/.gitignore'; |
134 | 134 | $this->touch['app/composer'] = $this->projectPath().'/composer.json'; |
135 | 135 | $this->touch['test/index'] = $this->storage().'/index.html'; |
136 | - $this->touch['exception/authenticate'] = $this->directory['exceptionDir'] .'/AuthenticateException.php'; |
|
136 | + $this->touch['exception/authenticate'] = $this->directory['exceptionDir'].'/AuthenticateException.php'; |
|
137 | 137 | |
138 | 138 | //set project touch |
139 | 139 | $this->file->touch($this); |