@@ -21,7 +21,7 @@ public function run($args)
2121 define ('DEBUG ' , 0 );
2222 }
2323
24- if (! defined ('PID ' )) {
24+ if ( ! defined ('PID ' )) {
2525 define ("PID " , "/var/run/magnus/SipTracepid.php " );
2626 }
2727
@@ -45,7 +45,7 @@ public function run($args)
4545 continue ;
4646 }
4747
48- exec ('pkill -f ngrep ' );
48+ LinuxAccess:: exec ('pkill -f ngrep ' );
4949 echo $ command = "ngrep -p -W byline " . $ modelTrace ->filter . " -t port " . $ modelTrace ->port . $ device . " >> " . $ this ->file_name ;
5050
5151 $ output = $ this ->PsExecute ($ command , $ modelTrace ->timeout , $ modelTrace ->filter );
@@ -72,7 +72,7 @@ public function PsExecute($command, $timeout = 58, $filter, $sleep = 2)
7272
7373 if ($ cur % 5 == 0 ) {
7474 $ modelTrace = SipTrace::model ()->find ();
75- if (! isset ($ modelTrace )) {
75+ if ( ! isset ($ modelTrace )) {
7676 SipTrace::model ()->deleteAll ();
7777 $ this ->PsKill ($ pid );
7878 break ;
@@ -91,7 +91,7 @@ public function PsExec($commandJob)
9191
9292 $ command = $ commandJob . ' 2>&1 & echo $! ' ;
9393
94- exec ($ command, $ op );
94+ $ op = LinuxAccess:: exec ($ command );
9595
9696 $ pid = (int ) $ op [0 ];
9797
@@ -105,7 +105,7 @@ public function PsExec($commandJob)
105105 public function PsExists ($ pid )
106106 {
107107
108- exec ("ps ax | grep $ pid|wc -l 2>&1 " , $ output );
108+ $ output = LinuxAccess:: exec ("ps ax | grep $ pid|wc -l 2>&1 " );
109109
110110 if ($ output [0 ] > 0 ) {
111111 return true ;
@@ -117,7 +117,7 @@ public function PsExists($pid)
117117 public function PsKill ($ pid )
118118 {
119119 echo "End process $ pid " ;
120- exec ('pkill ngrep ' );
120+ LinuxAccess:: exec ('pkill ngrep ' );
121121 try {
122122 posix_kill ($ pid , 2 );
123123 } catch (Exception $ e ) {
0 commit comments