PS::execute PHP Method

execute() public method

doing all tasks to get the required informations that the plugin needs result is stored in an internal array
the array is build like a tree, so that it is possible to get only a specific process with the childs
public execute ( ) : void
return void
    public function execute()
    {
        if (empty($this->_filecontent)) {
            return;
        }
        $items = array();
        foreach ($this->_filecontent as $roworig) {
            $row = preg_split("/[\\s]+/", trim($roworig), 4);
            if (count($row) != 4) {
                break;
            }
            foreach ($row as $key => $val) {
                $items[$row[0]][$key] = $val;
            }
            if ($row[1] !== $row[0]) {
                $items[$row[1]]['childs'][$row[0]] =& $items[$row[0]];
            }
        }
        foreach ($items as $item) {
            //find zombie
            if (!isset($item[0])) {
                foreach ($item["childs"] as $subitem) {
                    $zombie = $subitem[1];
                    if ($zombie != 0) {
                        $items[$zombie]["0"] = $zombie;
                        $items[$zombie]["1"] = "0";
                        $items[$zombie]["2"] = "0";
                        $items[$zombie]["3"] = "unknown";
                        $items[0]['childs'][$zombie] =& $items[$zombie];
                    }
                    break;
                    //first is sufficient
                }
            }
        }
        if (isset($items[0])) {
            $this->_result = $items[0];
        } else {
            $_result = array();
        }
    }