Lib/Task/TaskProcess.php
protected function _getPidRecursive($ppid) {
		if (!$ppid) {
			return array();
		}
		$allPids = $pids = array_filter(preg_split('/\s+/', `ps -o pid --no-heading --ppid $ppid`));

		foreach ($pids as $pid) {
			$allPids = array_merge($allPids, $this->_getPidRecursive($pid));
		}
		return $allPids;
	}
protected function _getPidRecursive($ppid) {
		if (!$ppid) {
			return array();
		}
		$allPids = $pids = array_filter(preg_split('/\s+/', `ps -o pid --no-heading --ppid $ppid`));

		foreach ($pids as $pid) {
			$allPids = array_merge($allPids, $this->_getPidRecursive($pid));
		}
		return $allPids;
	}
protected function _getPidRecursive ( $ ppid ) { if ( ! $ ppid ) { return array ( ) ; } $ allPids = $ pids = array_filter ( preg_split ( '/\s+/' , `ps -o pid --no-heading --ppid $ppid` ) ) ; foreach ( $ pids as $ pid ) { $ allPids = array_merge ( $ allPids , $ this -> _getPidRecursive ( $ pid ) ) ; } return $ allPids ; }
Collect all childrens pids recursively

@param int $ppid
@return array
Collect all childrens pids recursively