|
|
@ -8,6 +8,7 @@ |
|
|
|
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. |
|
|
@ -151,8 +152,11 @@ abstract class Application extends Module |
|
|
|
* The "bootstrap" class listed above will be instantiated during the application |
|
|
|
* The "bootstrap" class listed above will be instantiated during the application |
|
|
|
* [[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 |
|
|
|
|
|
|
|
* from @vendor/yiisoft/extensions.php. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public $extensions = []; |
|
|
|
public $extensions; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* @var array list of components that should be run during the application [[bootstrap()|bootstrapping process]]. |
|
|
|
* @var array list of components that should be run during the application [[bootstrap()|bootstrapping process]]. |
|
|
|
* |
|
|
|
* |
|
|
@ -262,6 +266,13 @@ abstract class Application extends Module |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected function bootstrap() |
|
|
|
protected function bootstrap() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if ($this->extensions === null) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
$this->extensions = include Yii::getAlias('@vendor/yiisoft/extensions.php'); |
|
|
|
|
|
|
|
} catch (ErrorException $e) { |
|
|
|
|
|
|
|
$this->extensions = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
foreach ($this->extensions as $extension) { |
|
|
|
foreach ($this->extensions as $extension) { |
|
|
|
if (!empty($extension['alias'])) { |
|
|
|
if (!empty($extension['alias'])) { |
|
|
|
foreach ($extension['alias'] as $name => $path) { |
|
|
|
foreach ($extension['alias'] as $name => $path) { |
|
|
|