Commit 1122da95 by Alexander Makarov

Adjustments according to comments on #3575

parent 07f30cb0
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
namespace yii\base; namespace yii\base;
use Yii; use Yii;
use yii\log\Logger;
/** /**
* Application is the base class for all application classes. * Application is the base class for all application classes.
...@@ -153,8 +152,8 @@ abstract class Application extends Module ...@@ -153,8 +152,8 @@ abstract class Application extends Module
* [[bootstrap()|bootstrapping process]]. If the class implements [[BootstrapInterface]], * [[bootstrap()|bootstrapping process]]. If the class implements [[BootstrapInterface]],
* its [[BootstrapInterface::bootstrap()|bootstrap()]] method will be also be called. * its [[BootstrapInterface::bootstrap()|bootstrap()]] method will be also be called.
* *
* If the property isn't specified in the application bootstrap file i.e. index.php, content is loaded automatically * If not set explicitily in the application config, this property will be populated with the contents of
* from @vendor/yiisoft/extensions.php. * `@vendor/yiisoft/extensions.php`.
*/ */
public $extensions; public $extensions;
/** /**
...@@ -267,11 +266,8 @@ abstract class Application extends Module ...@@ -267,11 +266,8 @@ abstract class Application extends Module
protected function bootstrap() protected function bootstrap()
{ {
if ($this->extensions === null) { if ($this->extensions === null) {
try { $file = Yii::getAlias('@vendor/yiisoft/extensions.php');
$this->extensions = include Yii::getAlias('@vendor/yiisoft/extensions.php'); $this->extensions = is_file($file) ? include($file) : [];
} catch (ErrorException $e) {
$this->extensions = [];
}
} }
foreach ($this->extensions as $extension) { foreach ($this->extensions as $extension) {
if (!empty($extension['alias'])) { if (!empty($extension['alias'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment