Backend\Core\Engine\Navigation::buildCache PHP Method

buildCache() public method

Build navigation cache file.
public buildCache ( )
    public function buildCache()
    {
        $navigationTree = '';
        // build tree starting with the root
        $this->buildNavigation(0, $navigationTree);
        // start generating PHP
        $value = '<?php' . "\n";
        $value .= '/*' . "\n";
        $value .= ' *' . "\n";
        $value .= ' * This file is generated by the Backend, it contains' . "\n";
        $value .= ' * more information about the navigation in the backend. Do NOT edit.' . "\n";
        $value .= ' * ' . "\n";
        $value .= ' * @generated ' . date('Y-m-d H:i:s') . "\n";
        $value .= ' */' . "\n";
        $value .= "\n";
        $value .= "\$navigation = array(\n";
        // add navigation tree
        $value .= $navigationTree;
        // close php
        $value .= ");\n";
        $value .= "\n";
        $value .= '?>';
        // store
        $filesystem = new Filesystem();
        $filesystem->dumpFile(self::getCacheDirectory() . 'navigation.php', $value);
    }