skeeks\cms\console\controllers\CacheController::actionFlushRuntimes PHP Method

actionFlushRuntimes() public method

Clear rintimes directories
public actionFlushRuntimes ( )
    public function actionFlushRuntimes()
    {
        $paths = ArrayHelper::getValue(\Yii::$app->cms->tmpFolderScheme, 'runtime');
        $this->stdout("Clear runtimes directories\n", Console::FG_YELLOW);
        if ($paths) {
            foreach ($paths as $path) {
                $realPath = \Yii::getAlias($path);
                $this->stdout("\tClear runtime directory: {$realPath}\n");
                FileHelper::removeDirectory(\Yii::getAlias($path));
                FileHelper::createDirectory(\Yii::getAlias($path));
            }
        }
        //It is important to the proper configuration is cached differently
        \Yii::$app->cms->generateTmpConsoleConfig();
        \Yii::$app->cms->generateTmpConfig();
    }