public function isRunning()
    {
        $processId = $this->getProcessId();

        if (OperatingSystem::isWindows()) {
            $pids = shell_exec("wmic process get processid | find \"{$processId}\"");
            $resource = array_filter(explode(' ', $pids));

            $isRunning = count($resource) > 0 && $processId == reset($resource);
        } else {
            $isRunning = (bool) posix_getsid($processId);
        }

        return $isRunning;
    }
public function isRunning()
    {
        $processId = $this->getProcessId();

        if (OperatingSystem::isWindows()) {
            $pids = shell_exec("wmic process get processid | find \"{$processId}\"");
            $resource = array_filter(explode(' ', $pids));

            $isRunning = count($resource) > 0 && $processId == reset($resource);
        } else {
            $isRunning = (bool) posix_getsid($processId);
        }

        return $isRunning;
    }
public function isRunning ( ) { $ processId = $ this -> getProcessId ( ) ; if ( OperatingSystem :: isWindows ( ) ) { $ pids = shell_exec ( "wmic process get processid | find \"{$processId}\"" ) ; $ resource = array_filter ( explode ( ' ' , $ pids ) ) ; $ isRunning = count ( $ resource ) > 0 && $ processId == reset ( $ resource ) ; } else { $ isRunning = ( bool ) posix_getsid ( $ processId ) ; } return $ isRunning ; }
Returns true if the process ID is still active.

@return bool
Returns true if the process ID is still active .