A loop for the parent.

@return void
320095
public function run()
    {
        $this->setupSignalHandlers();

        $procs = [];
        while (true) {
            $jobs = $this->runner->getJobs();
            foreach ($jobs as $job) {
                if (! array_key_exists($job->identifier(), $procs)) {
                    $procs[$job->identifier()] = [];
                }
                while (count($procs[$job->identifier()]) > $job->numWorkers()) {
                    // Stopping an excessive child.
                    echo 'Stopping an excessive child.' . PHP_EOL;
                    $proc = array_pop($procs[$job->identifier()]);
                    $status = proc_get_status($proc);
                    // Keep sending SIGTERM until the child exits.
                    while ($status['running'] === true) {
                        @proc_terminate($proc);
                        usleep(50000);
                        $status = proc_get_status($proc);
                    }
                    @proc_close($proc);
                }
                for ($i = 0; $i < $job->numWorkers(); $i++) {
                    $needStart = false;
                    if (array_key_exists($i, $procs[$job->identifier()])) {
                        $status = proc_get_status($procs[$job->identifier()][$i]);
                        if ($status['running'] !== true) {
                            $needStart = true;
                        }
                    } else {
                        $needStart = true;
                    }
                    if ($needStart) {
                        echo 'Starting a child.' . PHP_EOL;
                        $procs[$job->identifier()][$i] = proc_open(
                            sprintf('%s %d', $this->command, $job->id()),
                            $this->descriptorSpec,
                            $pipes
                        );
                    }
                }
            }
            usleep(1000000); // Reload the config after 1 second
            pcntl_signal_dispatch();
            if ($this->shutdown) {
                echo 'Shutting down, waiting for the children' . PHP_EOL;
                foreach ($procs as $k => $v) {
                    foreach ($v as $proc) {
                        $status = proc_get_status($proc);
                        // Keep sending SIGTERM until the child exits.
                        while ($status['running'] === true) {
                            @proc_terminate($proc);
                            usleep(50000);
                            $status = proc_get_status($proc);
                        }
                        @proc_close($proc);
                    }
                }
                echo 'BatchDaemon exiting' . PHP_EOL;
                exit;
            }
            // Reload the config
            $this->runner->loadConfig();
        }
    }
1323969
protected function _inherit() {

		$inherited = array_fill_keys($this->_inherited(), []);

		foreach (static::_parents() as $parent) {
			$parentConfig = get_class_vars($parent);

			foreach ($inherited as $key => $value) {
				if (isset($parentConfig["{$key}"])) {
					$val = $parentConfig["{$key}"];
					if (is_array($val)) {
						$inherited[$key] += $val;
					}
				}
			}

			if ($parent === __CLASS__) {
				break;
			}
		}

		foreach ($inherited as $key => $value) {
			if (is_array($this->{$key})) {
				$this->{$key} += $value;
			}
		}
	}
1339141
public function process()
	{
		try
		{
			parent::process();
		}
		catch( \Exception $e )
		{
			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
		}
	}
285771
protected function clear(): void
    {
        $this->innerHtml = null;
        $this->outerHtml = null;
        $this->text      = null;
        $this->textWithChildren = null;

        if (is_null($this->parent) === false) {
            $this->parent->clear();
        }
    }
1289770
public function onBeforeWrite()
    {
        parent::onBeforeWrite();
        $parent = $this->Parent();
        if ($parent->exists() && !$parent instanceof Blog) {
            $first_blog = Blog::get()->first();
            if ($first_blog) {
                $this->ParentID = $first_blog->ID;
            }
        }
        $this->extend('onBeforeWrite');
    }
1172040
private function ParentItem()
    {
        $this->parent = $this->GetTreeItem('parent');
        return $this->parent->Exists() ? $this->parent : null;
    }
612680
public function getParentList()
    {
        if (null === $this->parentList) {
            $this->parentList = [];

            $parent = $this->getDescriptor()->getParent();

            for ($index = 1; null !== $parent; $index++) {
                $this->parentList[$parent->getName() . '-'] = $parent;

                $parent = $parent->getDescriptor()->getParent();
            }
        }

        return $this->parentList;
    }
378349
protected function setParents()
		{
			// variables
			$segments   = explode('/', trim($this->route, '/'));
			$path       = '';

			// build parent routes
			foreach($segments as $segment)
			{
				$path .= $segment . '/';
				$this->parents[$segment] = $path;
			}

			// remove last parent
			array_pop($this->parents);
		}
52769
public function fields($parent, array $fields)
    {
        foreach ($fields as $id => $field) {
            if (!isset($field['id'])) {
                $field['id'] = $id;
            }
            if (!isset($field['name'])) {
                $field['name'] = $id;
            }
            $this->field($parent, $field);
        }
    }
328688
public function execute()
    {
        if (!$this->isEmpty()) {
            $this->table->update($this->context + $this->values, $this->where)->run();
        }

        parent::execute();
    }
1009030
public function run()
    {
        echo Html::beginTag('div', ['class' => 'page-footer']);
        echo Html::beginTag('div', ['class' => 'page-footer-inner']);
        echo $this->html;
        echo Html::tag('div', Html::tag('i', '', ['class' => 'icon-arrow-up']), ['class' => 'scroll-to-top']);

        echo Html::endTag('div');   // page-footer-inner
        echo Html::endTag('div');   // page-footer
    }
185725
protected function insertNode()
    {
        $descendant = $this->getKey();
        $ancestor = (isset($this->parent_id) ? $this->parent_id : $descendant);

        $this->closure->insertNode($ancestor, $descendant);
    }
935331
public function init()
    {
        parent::init();

        foreach ($this->children as $child) {
            $child->init();
            foreach ($child->getPages() as $page) {
                $this->addPage($page);
            }
        }

        foreach ($this->pages as $page) {
            $page->init();
        }
    }
853790
public function activate()
    {
        if ($this->menu->config->activeElement == 'item') {
            $this->setToActive();
        } else {
            if ($this->link) {
                $this->link->activate();
            }
        }

        // If parent activation is enabled:
        if ($this->menu->config->activateParents) {
            // Moving up through the parent nodes, activating them as well.
            if ($this->parent) {
                $this->parent->activate();
            }
        }
    }
860429
public function build()
    {
        if ($this->updateRequired) {
            $this->updateRequired = false;
            foreach ($this->nodes as $node) {
                if ($node->parent()) {
                    $node->unlock()->detach();
                }
            }
            $this->root->addChildren($this->builder->build($this->hierarchy, $this->nodes->toArray()));
            foreach ($this->nodes as $node) {
                if ($node->parent() === $this->root || $this->nodes->contains($node->parent())) {
                    $node->lock();
                }
            }
        }
    }
652151
public function add($x)
	{
		if (!isset($this->parents[$x])) {
			$this->parents[$x] = $x;
		}
	}
1231042
public function init() {
		
		if (!isset($this->htmlOptions['id'])) {
			$this->htmlOptions['id'] = $this->getId();
		}

		if (isset($this->parent) && !isset($this->options['parent'])) {
			$this->options['parent'] = $this->parent;
		}

		if (isset($this->toggle) && !isset($this->options['toggle'])) {
			$this->options['toggle'] = $this->toggle;
		}

		// NOTE: we depend on the htmlOptions being initialized to empty array already.
		if (empty($this->htmlOptions['class'])) {
			$this->htmlOptions['class'] = 'collapse';
		} else {
			$this->htmlOptions['class'] .= ' collapse';
		}
		echo CHtml::openTag($this->tagName, $this->htmlOptions);
	}