private function pruneProcessList()
{
// should the processes persist?
if ($this->st->getPersistProcesses()) {
return;
}
// get the processes table, if we have one
$table = $this->getTable();
if (!$table) {
return;
}
foreach ($table as $key => $details) {
list($hostId, $pid) = explode(":", $key);
if ($hostId != "localhost") {
continue;
}
if (!posix_kill($pid, 0)) {
// process no longer running
unset($table->{$key});
}
}
$this->removeTablesIfEmpty();
$this->st->saveRuntimeConfig();
return;
/*
// shorthand
$output = $this->output;
// do we have anything to shutdown?
$screenSessions = fromShell()->getAllScreenSessions();
if (count($screenSessions) == 0) {
// nothing to do
return;
}
// if we get here, there are background jobs running
echo "\n";
if (count($screenSessions) == 1) {
$output->logCliInfo("There is 1 background process still running");
}
else {
$output->logCliInfo("There are " . count($screenSessions) . " background processes still running");
}
$output->logCliInfo("Use 'storyplayer list-processes' to see the list of background processes");
$output->logCliInfo("Use 'storyplayer kill-processes' to stop any background processes");
*/
}