DataSift\Storyplayer\Cli\ListProcesses_Switch::process PHP Method

process() public method

public process ( Phix_Project\CliEngine $engine, $invokes = 1, array $params = [], $isDefaultParam = false, mixed $additionalContext = null ) : Phix_Project\CliEngine\CliResult
$engine Phix_Project\CliEngine
$params array
$additionalContext mixed
return Phix_Project\CliEngine\CliResult
    public function process(CliEngine $engine, $invokes = 1, $params = array(), $isDefaultParam = false, $additionalContext = null)
    {
        // shorthand
        $runtimeConfig = $additionalContext->getRuntimeConfig();
        // are there any processes in the table?
        if (!isset($runtimeConfig->processes)) {
            // we're done
            return new CliResult(0);
        }
        // let's walk through the table
        foreach ($runtimeConfig->processes as $details) {
            if (isset($details->screenName)) {
                echo "{$details->pid}:{$details->processName}:{$details->screenName}\n";
            } else {
                echo "{$details->pid}:{$details->processName}\n";
            }
        }
        // all done
        return new CliResult(CliResult::PROCESS_COMPLETE);
    }
ListProcesses_Switch