Skip to content

Commit 86ff854

Browse files
committed
add swoole-ide-helper
1 parent 7d4c1c1 commit 86ff854

File tree

6 files changed

+29
-3
lines changed

6 files changed

+29
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ vendor
55
.DS_Store
66
.sonar
77
.php_cs.cache
8+
.idea

bin/plumber

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (!$autoloader()) {
88
use Codeages\Plumber\Plumber;
99

1010
$workDir = getcwd();
11-
$version = '0.6.0';
11+
$version = '0.7.2';
1212
$commands = ['run', 'start', 'restart', 'stop'];
1313

1414
$usage = sprintf('%s (%s) [--bootstrap=<file>]', $argv[0], implode('|', $commands));

composer.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@
2626
"codeages/beanstalk-client" : "^0.1.4",
2727
"monolog/monolog": "^1.22.0"
2828
},
29-
"bin": ["bin/plumber"]
29+
"bin": ["bin/plumber"],
30+
"require-dev": {
31+
"eaglewu/swoole-ide-helper": "dev-master"
32+
}
3033
}

sonar-project.properties

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sonar.projectKey=plumber
2+
sonar.projectName=Plumber
3+
sonar.projectVersion=0.7.2
4+
5+
sonar.sourceEncoding=UTF-8
6+
sonar.sources=src
7+
sonar.tests=tests
8+
sonar.language=php
9+
10+
# sonar.php.coverage.reportPath=reports/phpunit.coverage.xml
11+
# sonar.php.tests.reportPath=reports/phpunit.xml

src/Plumber.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Monolog\Logger;
77
use Monolog\Handler\StreamHandler;
88
use Monolog\ErrorHandler;
9+
use Psr\Log\LoggerInterface;
910
use swoole_process;
1011

1112
class Plumber
@@ -22,6 +23,11 @@ class Plumber
2223

2324
protected $workers;
2425

26+
/**
27+
* @var LoggerInterface
28+
*/
29+
protected $logger;
30+
2531
const ALREADY_RUNNING_ERROR = 1;
2632

2733
const LOCK_PROCESS_ERROR = 2;
@@ -92,7 +98,7 @@ protected function start($daemon = true)
9298
/**
9399
* @todo
94100
* 此方法有逻辑缺陷:
95-
* 如plumber进程异常退出后,pid文件b并不会被清除
101+
* 如plumber进程异常退出后,pid文件并不会被清除
96102
* 当系统重启后,此时pid文件中所指示的pid可能为其他程序的进程,如果这时执行stop操作,存在可能把其他程序进程kill掉的风险。
97103
*/
98104
protected function stop()

src/WorkerProcess.php

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ class WorkerProcess
1616

1717
protected $times;
1818

19+
/**
20+
* @var BeanstalkClientProxy
21+
*/
22+
protected $queue;
23+
1924
const RESERVE_TIMEOUT = 5;
2025

2126
public function __construct($tubeName, $process, $container)

0 commit comments

Comments
 (0)