Bug #17933: Log warning instead of erroring when URLManager is unable to initialize cache

This commit is contained in:
Alexander Makarov
2020-03-26 23:21:35 +03:00
committed by GitHub
parent f8d417c42a
commit fbd7eded2d
3 changed files with 7 additions and 2 deletions

View File

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.34 under development
------------------------
- Bug #17933: Log warning instead of erroring when URLManager is unable to initialize cache (samdark)
- Bug #17935: Reset DB quoted table/column name caches when the connection is closed (brandonkelly)
- Bug #17932: Fix regression in detection of AJAX requests (samdark)
- Bug #17934: Fix regression in Oracle when binding several string parameters (fen1xpv, samdark)

View File

@ -631,7 +631,7 @@ abstract class Application extends Module
'mailer' => ['class' => 'yii\swiftmailer\Mailer'],
'urlManager' => ['class' => 'yii\web\UrlManager'],
'assetManager' => ['class' => 'yii\web\AssetManager'],
'security' => ['class' => 'yii\base\Security'],
'security' => ['class' => 'yii\base\Security']
];
}

View File

@ -186,7 +186,11 @@ class UrlManager extends Component
return;
}
if ($this->cache !== false && $this->cache !== null) {
$this->cache = Instance::ensure($this->cache, 'yii\caching\CacheInterface');
try {
$this->cache = Instance::ensure($this->cache, 'yii\caching\CacheInterface');
} catch (InvalidConfigException $e) {
Yii::warning('Unable to use cache for URL manager: ' . $e->getMessage());
}
}
if (empty($this->rules)) {
return;