File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 10
10
11
11
class Local {
12
12
13
- private $ handle = NULL ;
14
- private $ pipes = array ();
15
- private $ loghandle = NULL ;
16
13
public $ pid = NULL ;
17
14
18
15
public function __construct () {
@@ -25,7 +22,8 @@ public function __destruct() {
25
22
}
26
23
27
24
public function isRunning () {
28
-
25
+ if ($ this ->pid == NULL )
26
+ return False ;
29
27
if (strtoupper (substr (PHP_OS , 0 , 3 )) === 'WIN ' )
30
28
{
31
29
$ processes = explode ( "\n" , shell_exec ( "tasklist.exe " ));
@@ -40,7 +38,11 @@ public function isRunning() {
40
38
41
39
}
42
40
else {
43
- return file_exists ( "/proc/ $ this ->pid " );
41
+ $ return_message = shell_exec ("ps - " . "$ this ->pid " . "| wc -l " );
42
+ if (intval ($ return_message ) > 1 )
43
+ {
44
+ return True ;
45
+ }
44
46
}
45
47
}
46
48
@@ -109,7 +111,6 @@ public function start($arguments) {
109
111
}
110
112
111
113
public function stop () {
112
- fclose ($ this ->loghandle );
113
114
$ call = $ this ->stop_command ();
114
115
shell_exec ("$ call " );
115
116
}
You can’t perform that action at this time.
0 commit comments