protected function getPidsByPath(string $path) : array
    {
        $pids = [];
        $cliOutput = [];
        exec('ps x | grep ' . $path, $cliOutput);
        foreach ($cliOutput as $line) {
            $line = trim($line);
            if (empty($line)) {
                continue;
            }
            if (strpos($line, 'grep') !== false) {
                continue;
            }
            $procInfo = preg_split('#\s+#', $line);
            array_push($pids, (int)$procInfo[0]);
        }
        return $pids;
    }
protected function getPidsByPath(string $path) : array
    {
        $pids = [];
        $cliOutput = [];
        exec('ps x | grep ' . $path, $cliOutput);
        foreach ($cliOutput as $line) {
            $line = trim($line);
            if (empty($line)) {
                continue;
            }
            if (strpos($line, 'grep') !== false) {
                continue;
            }
            $procInfo = preg_split('#\s+#', $line);
            array_push($pids, (int)$procInfo[0]);
        }
        return $pids;
    }
protected function getPidsByPath ( string $ path ) : array { $ pids = [ ] ; $ cliOutput = [ ] ; exec ( 'ps x | grep ' . $ path , $ cliOutput ) ; foreach ( $ cliOutput as $ line ) { $ line = trim ( $ line ) ; if ( empty ( $ line ) ) { continue ; } if ( strpos ( $ line , 'grep' ) !== false ) { continue ; } $ procInfo = preg_split ( '#\s+#' , $ line ) ; array_push ( $ pids , ( int ) $ procInfo [ 0 ] ) ; } return $ pids ; }
Tries to estimate all PIDs by given path.

@param string $path
@return array
Tries to estimate all PIDs by given path .