Yii2Debug::updateIndexFile PHP Method

updateIndexFile() private method

Updates index file with summary log data
private updateIndexFile ( string $indexFile, array $summary )
$indexFile string path to index file
$summary array summary log data
    private function updateIndexFile($indexFile, $summary)
    {
        touch($indexFile);
        if (($fp = @fopen($indexFile, 'r+')) === false) {
            throw new Exception("Unable to open debug data index file: {$indexFile}");
        }
        @flock($fp, LOCK_EX);
        $manifest = '';
        while (($buffer = fgets($fp)) !== false) {
            $manifest .= $buffer;
        }
        if (!feof($fp) || empty($manifest)) {
            // error while reading index data, ignore and create new
            $manifest = array();
        } else {
            $manifest = unserialize($manifest);
        }
        $manifest[$this->tag] = $summary;
        $this->resizeHistory($manifest);
        ftruncate($fp, 0);
        rewind($fp);
        fwrite($fp, serialize($manifest));
        @flock($fp, LOCK_UN);
        @fclose($fp);
    }