yii\apidoc\components\BaseController::loadContext PHP Method

loadContext() protected method

Loads context from cache
protected loadContext ( string $location ) : Context
$location string
return yii\apidoc\models\Context
    protected function loadContext($location)
    {
        $context = new Context();
        $cacheFile = $location . '/cache/apidoc.data';
        $this->stdout('Loading apidoc data from cache... ');
        if (file_exists($cacheFile)) {
            $context = unserialize(file_get_contents($cacheFile));
            $this->stdout('done.' . PHP_EOL, Console::FG_GREEN);
        } else {
            $this->stdout('no data available.' . PHP_EOL, Console::FG_YELLOW);
        }
        return $context;
    }