Skip to content

Commit d01c342

Browse files
authored
Set ClosureProcess default enable start. (#67)
1 parent f8ad497 commit d01c342

25 files changed

+34
-3
lines changed

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
'single_quote' => true,
8686
'standardize_not_equals' => true,
8787
'multiline_comment_opening_closing' => true,
88+
'single_line_empty_body' => false,
8889
])
8990
->setFinder(
9091
PhpCsFixer\Finder::create()

README-CN.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,14 @@ $app = AppFactory::create();
223223
$app->addProcess(function(){
224224
while (true) {
225225
sleep(1);
226-
$this->get(StdoutLoggerInterface::class)->info('Processing...');
226+
$this->container->get(StdoutLoggerInterface::class)->info('Processing...');
227227
}
228228
})->setName('nano-process')->setNums(1);
229229

230+
$app->addProcess(function(){
231+
$this->container->get(StdoutLoggerInterface::class)->info('根据env判定是否需要启动进程...');
232+
})->setName('nano-process')->setNums(1)->setEnable(\Hyperf\Support\env('PROCESS_ENABLE', true))));
233+
230234
$app->run();
231235
```
232236

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,14 @@ $app = AppFactory::create();
214214
$app->addProcess(function(){
215215
while (true) {
216216
sleep(1);
217-
$this->get(StdoutLoggerInterface::class)->info('Processing...');
217+
$this->container->get(StdoutLoggerInterface::class)->info('Processing...');
218218
}
219219
})->setName('nano-process')->setNums(1);
220220

221+
$app->addProcess(function(){
222+
$this->container->get(StdoutLoggerInterface::class)->info('Determine whether the process needs to be started based on env...');
223+
})->setName('nano-process')->setNums(1)->setEnable(\Hyperf\Support\env('PROCESS_ENABLE', true))));
224+
221225
$app->run();
222226
```
223227

example/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/nano/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Nano;
1314

1415
use Exception;

src/App.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/nano/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Nano;
1314

1415
use Closure;

src/BoundInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/nano/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Nano;
1314

1415
interface BoundInterface

src/ConfigProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/nano/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Nano;
1314

1415
class ConfigProvider

src/Constant.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/nano/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Nano;
1314

1415
class Constant

src/ContainerProxy.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/nano/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Nano;
1314

1415
use Hyperf\Contract\ContainerInterface;

src/Factory/AppFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/nano/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Nano\Factory;
1314

1415
use Dotenv\Dotenv;

0 commit comments

Comments
 (0)