Yii2Debug::resizeHistory PHP Method

resizeHistory() protected method

Debug files rotation according to {@link ::$historySize}.
protected resizeHistory ( &$manifest )
$manifest
    protected function resizeHistory(&$manifest)
    {
        $tags = array_keys($manifest);
        $count = 0;
        foreach ($tags as $tag) {
            if (!$this->getLock($tag)) {
                $count++;
            }
        }
        if ($count > $this->historySize + 10) {
            $path = $this->logPath;
            $n = $count - $this->historySize;
            foreach ($tags as $tag) {
                if (!$this->getLock($tag)) {
                    @unlink("{$path}/{$tag}.data");
                    unset($manifest[$tag]);
                    if (--$n <= 0) {
                        break;
                    }
                }
            }
        }
    }