DummyCache does not cache anything. It is provided so that one can always configure a 'cache' application component and save the check of existence of \Yii::$app->cache. By replacing DummyCache with some other cache component, one can quickly switch from non-caching mode to caching mode. For more details and usage information on Cache, see the guide article on caching.
Since: 2.0
Author: Qiang Xue (qiang.xue@gmail.com)
Inheritance: extends Cache
Beispiel #1
0
if (!isset($base['components']['db'])) {
    $base['components']['db'] = (include 'database.php');
}
if (!isset($base['components']['collectors'])) {
    $collectorsConfigPath = CANIS_APP_CONFIG_PATH . DIRECTORY_SEPARATOR . 'modules.php';
    if (file_exists($collectorsConfigPath)) {
        $base['components']['collectors'] = (include $collectorsConfigPath);
    } else {
        $base['components']['collectors'] = (include 'collectors.php');
    }
}
if (!isset($base['components']['cache'])) {
    if (isset($base['components']['redis'])) {
        $base['components']['cache'] = ['class' => RedisCache::className()];
    } else {
        $base['components']['cache'] = ['class' => DummyCache::className()];
    }
}
if (!isset($base['components']['fileCache'])) {
    $base['components']['fileCache'] = ['class' => FileCache::className()];
}
if (!isset($base['components']['gk'])) {
    $base['components']['gk'] = ['class' => Gatekeeper::className(), 'authority' => ['type' => 'Individual']];
}
if (class_exists('cascade\\models\\User')) {
    $base['components']['user'] = ['class' => 'canis\\web\\User', 'enableAutoLogin' => false, 'identityClass' => 'cascade\\server\\models\\User', 'loginUrl' => ['/user/login']];
}
if (!isset($base['components']['fileStorage'])) {
    $base['components']['fileStorage'] = ['class' => FileStorage::className()];
}
if (!isset($base['components']['view'])) {