Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../var/softacul.../yii
File: Application.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* @link https://www.yiiframework.com/
[2] Fix | Delete
* @copyright Copyright (c) 2008 Yii Software LLC
[3] Fix | Delete
* @license https://www.yiiframework.com/license/
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
namespace yii\base;
[7] Fix | Delete
[8] Fix | Delete
use Yii;
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* Application is the base class for all application classes.
[12] Fix | Delete
*
[13] Fix | Delete
* For more details and usage information on Application, see the [guide article on applications](guide:structure-applications).
[14] Fix | Delete
*
[15] Fix | Delete
* @property-read \yii\web\AssetManager $assetManager The asset manager application component.
[16] Fix | Delete
* @property-read \yii\rbac\ManagerInterface|null $authManager The auth manager application component or null
[17] Fix | Delete
* if it's not configured.
[18] Fix | Delete
* @property string $basePath The root directory of the application.
[19] Fix | Delete
* @property-read \yii\caching\CacheInterface|null $cache The cache application component. Null if the
[20] Fix | Delete
* component is not enabled.
[21] Fix | Delete
* @property-write array $container Values given in terms of name-value pairs.
[22] Fix | Delete
* @property-read \yii\db\Connection $db The database connection.
[23] Fix | Delete
* @property-read \yii\web\ErrorHandler|\yii\console\ErrorHandler $errorHandler The error handler application
[24] Fix | Delete
* component.
[25] Fix | Delete
* @property-read \yii\i18n\Formatter $formatter The formatter application component.
[26] Fix | Delete
* @property-read \yii\i18n\I18N $i18n The internationalization application component.
[27] Fix | Delete
* @property-read \yii\log\Dispatcher $log The log dispatcher application component.
[28] Fix | Delete
* @property-read \yii\mail\MailerInterface $mailer The mailer application component.
[29] Fix | Delete
* @property-read \yii\web\Request|\yii\console\Request $request The request component.
[30] Fix | Delete
* @property-read \yii\web\Response|\yii\console\Response $response The response component.
[31] Fix | Delete
* @property string $runtimePath The directory that stores runtime files. Defaults to the "runtime"
[32] Fix | Delete
* subdirectory under [[basePath]].
[33] Fix | Delete
* @property-read \yii\base\Security $security The security application component.
[34] Fix | Delete
* @property string $timeZone The time zone used by this application.
[35] Fix | Delete
* @property-read string $uniqueId The unique ID of the module.
[36] Fix | Delete
* @property-read \yii\web\UrlManager $urlManager The URL manager for this application.
[37] Fix | Delete
* @property string $vendorPath The directory that stores vendor files. Defaults to "vendor" directory under
[38] Fix | Delete
* [[basePath]].
[39] Fix | Delete
* @property-read View|\yii\web\View $view The view application component that is used to render various view
[40] Fix | Delete
* files.
[41] Fix | Delete
*
[42] Fix | Delete
* @author Qiang Xue <qiang.xue@gmail.com>
[43] Fix | Delete
* @since 2.0
[44] Fix | Delete
*/
[45] Fix | Delete
abstract class Application extends Module
[46] Fix | Delete
{
[47] Fix | Delete
/**
[48] Fix | Delete
* @event Event an event raised before the application starts to handle a request.
[49] Fix | Delete
*/
[50] Fix | Delete
const EVENT_BEFORE_REQUEST = 'beforeRequest';
[51] Fix | Delete
/**
[52] Fix | Delete
* @event Event an event raised after the application successfully handles a request (before the response is sent out).
[53] Fix | Delete
*/
[54] Fix | Delete
const EVENT_AFTER_REQUEST = 'afterRequest';
[55] Fix | Delete
/**
[56] Fix | Delete
* Application state used by [[state]]: application just started.
[57] Fix | Delete
*/
[58] Fix | Delete
const STATE_BEGIN = 0;
[59] Fix | Delete
/**
[60] Fix | Delete
* Application state used by [[state]]: application is initializing.
[61] Fix | Delete
*/
[62] Fix | Delete
const STATE_INIT = 1;
[63] Fix | Delete
/**
[64] Fix | Delete
* Application state used by [[state]]: application is triggering [[EVENT_BEFORE_REQUEST]].
[65] Fix | Delete
*/
[66] Fix | Delete
const STATE_BEFORE_REQUEST = 2;
[67] Fix | Delete
/**
[68] Fix | Delete
* Application state used by [[state]]: application is handling the request.
[69] Fix | Delete
*/
[70] Fix | Delete
const STATE_HANDLING_REQUEST = 3;
[71] Fix | Delete
/**
[72] Fix | Delete
* Application state used by [[state]]: application is triggering [[EVENT_AFTER_REQUEST]]..
[73] Fix | Delete
*/
[74] Fix | Delete
const STATE_AFTER_REQUEST = 4;
[75] Fix | Delete
/**
[76] Fix | Delete
* Application state used by [[state]]: application is about to send response.
[77] Fix | Delete
*/
[78] Fix | Delete
const STATE_SENDING_RESPONSE = 5;
[79] Fix | Delete
/**
[80] Fix | Delete
* Application state used by [[state]]: application has ended.
[81] Fix | Delete
*/
[82] Fix | Delete
const STATE_END = 6;
[83] Fix | Delete
[84] Fix | Delete
/**
[85] Fix | Delete
* @var string the namespace that controller classes are located in.
[86] Fix | Delete
* This namespace will be used to load controller classes by prepending it to the controller class name.
[87] Fix | Delete
* The default namespace is `app\controllers`.
[88] Fix | Delete
*
[89] Fix | Delete
* Please refer to the [guide about class autoloading](guide:concept-autoloading.md) for more details.
[90] Fix | Delete
*/
[91] Fix | Delete
public $controllerNamespace = 'app\\controllers';
[92] Fix | Delete
/**
[93] Fix | Delete
* @var string the application name.
[94] Fix | Delete
*/
[95] Fix | Delete
public $name = 'My Application';
[96] Fix | Delete
/**
[97] Fix | Delete
* @var string the charset currently used for the application.
[98] Fix | Delete
*/
[99] Fix | Delete
public $charset = 'UTF-8';
[100] Fix | Delete
/**
[101] Fix | Delete
* @var string the language that is meant to be used for end users. It is recommended that you
[102] Fix | Delete
* use [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag). For example, `en` stands
[103] Fix | Delete
* for English, while `en-US` stands for English (United States).
[104] Fix | Delete
* @see sourceLanguage
[105] Fix | Delete
*/
[106] Fix | Delete
public $language = '[[language]]';
[107] Fix | Delete
/**
[108] Fix | Delete
* @var string the language that the application is written in. This mainly refers to
[109] Fix | Delete
* the language that the messages and view files are written in.
[110] Fix | Delete
* @see language
[111] Fix | Delete
*/
[112] Fix | Delete
public $sourceLanguage = 'en-US';
[113] Fix | Delete
/**
[114] Fix | Delete
* @var Controller the currently active controller instance
[115] Fix | Delete
*/
[116] Fix | Delete
public $controller;
[117] Fix | Delete
/**
[118] Fix | Delete
* @var string|bool the layout that should be applied for views in this application. Defaults to 'main'.
[119] Fix | Delete
* If this is false, layout will be disabled.
[120] Fix | Delete
*/
[121] Fix | Delete
public $layout = 'main';
[122] Fix | Delete
/**
[123] Fix | Delete
* @var string the requested route
[124] Fix | Delete
*/
[125] Fix | Delete
public $requestedRoute;
[126] Fix | Delete
/**
[127] Fix | Delete
* @var Action|null the requested Action. If null, it means the request cannot be resolved into an action.
[128] Fix | Delete
*/
[129] Fix | Delete
public $requestedAction;
[130] Fix | Delete
/**
[131] Fix | Delete
* @var array the parameters supplied to the requested action.
[132] Fix | Delete
*/
[133] Fix | Delete
public $requestedParams;
[134] Fix | Delete
/**
[135] Fix | Delete
* @var array|null list of installed Yii extensions. Each array element represents a single extension
[136] Fix | Delete
* with the following structure:
[137] Fix | Delete
*
[138] Fix | Delete
* ```php
[139] Fix | Delete
* [
[140] Fix | Delete
* 'name' => 'extension name',
[141] Fix | Delete
* 'version' => 'version number',
[142] Fix | Delete
* 'bootstrap' => 'BootstrapClassName', // optional, may also be a configuration array
[143] Fix | Delete
* 'alias' => [
[144] Fix | Delete
* '@alias1' => 'to/path1',
[145] Fix | Delete
* '@alias2' => 'to/path2',
[146] Fix | Delete
* ],
[147] Fix | Delete
* ]
[148] Fix | Delete
* ```
[149] Fix | Delete
*
[150] Fix | Delete
* The "bootstrap" class listed above will be instantiated during the application
[151] Fix | Delete
* [[bootstrap()|bootstrapping process]]. If the class implements [[BootstrapInterface]],
[152] Fix | Delete
* its [[BootstrapInterface::bootstrap()|bootstrap()]] method will be also be called.
[153] Fix | Delete
*
[154] Fix | Delete
* If not set explicitly in the application config, this property will be populated with the contents of
[155] Fix | Delete
* `@vendor/yiisoft/extensions.php`.
[156] Fix | Delete
*/
[157] Fix | Delete
public $extensions;
[158] Fix | Delete
/**
[159] Fix | Delete
* @var array list of components that should be run during the application [[bootstrap()|bootstrapping process]].
[160] Fix | Delete
*
[161] Fix | Delete
* Each component may be specified in one of the following formats:
[162] Fix | Delete
*
[163] Fix | Delete
* - an application component ID as specified via [[components]].
[164] Fix | Delete
* - a module ID as specified via [[modules]].
[165] Fix | Delete
* - a class name.
[166] Fix | Delete
* - a configuration array.
[167] Fix | Delete
* - a Closure
[168] Fix | Delete
*
[169] Fix | Delete
* During the bootstrapping process, each component will be instantiated. If the component class
[170] Fix | Delete
* implements [[BootstrapInterface]], its [[BootstrapInterface::bootstrap()|bootstrap()]] method
[171] Fix | Delete
* will be also be called.
[172] Fix | Delete
*/
[173] Fix | Delete
public $bootstrap = [];
[174] Fix | Delete
/**
[175] Fix | Delete
* @var int the current application state during a request handling life cycle.
[176] Fix | Delete
* This property is managed by the application. Do not modify this property.
[177] Fix | Delete
*/
[178] Fix | Delete
public $state;
[179] Fix | Delete
/**
[180] Fix | Delete
* @var array list of loaded modules indexed by their class names.
[181] Fix | Delete
*/
[182] Fix | Delete
public $loadedModules = [];
[183] Fix | Delete
[184] Fix | Delete
[185] Fix | Delete
/**
[186] Fix | Delete
* Constructor.
[187] Fix | Delete
* @param array $config name-value pairs that will be used to initialize the object properties.
[188] Fix | Delete
* Note that the configuration must contain both [[id]] and [[basePath]].
[189] Fix | Delete
* @throws InvalidConfigException if either [[id]] or [[basePath]] configuration is missing.
[190] Fix | Delete
*/
[191] Fix | Delete
public function __construct($config = [])
[192] Fix | Delete
{
[193] Fix | Delete
Yii::$app = $this;
[194] Fix | Delete
static::setInstance($this);
[195] Fix | Delete
[196] Fix | Delete
$this->state = self::STATE_BEGIN;
[197] Fix | Delete
[198] Fix | Delete
$this->preInit($config);
[199] Fix | Delete
[200] Fix | Delete
$this->registerErrorHandler($config);
[201] Fix | Delete
[202] Fix | Delete
Component::__construct($config);
[203] Fix | Delete
}
[204] Fix | Delete
[205] Fix | Delete
/**
[206] Fix | Delete
* Pre-initializes the application.
[207] Fix | Delete
* This method is called at the beginning of the application constructor.
[208] Fix | Delete
* It initializes several important application properties.
[209] Fix | Delete
* If you override this method, please make sure you call the parent implementation.
[210] Fix | Delete
* @param array $config the application configuration
[211] Fix | Delete
* @throws InvalidConfigException if either [[id]] or [[basePath]] configuration is missing.
[212] Fix | Delete
*/
[213] Fix | Delete
public function preInit(&$config)
[214] Fix | Delete
{
[215] Fix | Delete
if (!isset($config['id'])) {
[216] Fix | Delete
throw new InvalidConfigException('The "id" configuration for the Application is required.');
[217] Fix | Delete
}
[218] Fix | Delete
if (isset($config['basePath'])) {
[219] Fix | Delete
$this->setBasePath($config['basePath']);
[220] Fix | Delete
unset($config['basePath']);
[221] Fix | Delete
} else {
[222] Fix | Delete
throw new InvalidConfigException('The "basePath" configuration for the Application is required.');
[223] Fix | Delete
}
[224] Fix | Delete
[225] Fix | Delete
if (isset($config['vendorPath'])) {
[226] Fix | Delete
$this->setVendorPath($config['vendorPath']);
[227] Fix | Delete
unset($config['vendorPath']);
[228] Fix | Delete
} else {
[229] Fix | Delete
// set "@vendor"
[230] Fix | Delete
$this->getVendorPath();
[231] Fix | Delete
}
[232] Fix | Delete
if (isset($config['runtimePath'])) {
[233] Fix | Delete
$this->setRuntimePath($config['runtimePath']);
[234] Fix | Delete
unset($config['runtimePath']);
[235] Fix | Delete
} else {
[236] Fix | Delete
// set "@runtime"
[237] Fix | Delete
$this->getRuntimePath();
[238] Fix | Delete
}
[239] Fix | Delete
[240] Fix | Delete
if (isset($config['timeZone'])) {
[241] Fix | Delete
$this->setTimeZone($config['timeZone']);
[242] Fix | Delete
unset($config['timeZone']);
[243] Fix | Delete
} elseif (!ini_get('date.timezone')) {
[244] Fix | Delete
$this->setTimeZone('UTC');
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
if (isset($config['container'])) {
[248] Fix | Delete
$this->setContainer($config['container']);
[249] Fix | Delete
[250] Fix | Delete
unset($config['container']);
[251] Fix | Delete
}
[252] Fix | Delete
[253] Fix | Delete
// merge core components with custom components
[254] Fix | Delete
foreach ($this->coreComponents() as $id => $component) {
[255] Fix | Delete
if (!isset($config['components'][$id])) {
[256] Fix | Delete
$config['components'][$id] = $component;
[257] Fix | Delete
} elseif (is_array($config['components'][$id]) && !isset($config['components'][$id]['class'])) {
[258] Fix | Delete
$config['components'][$id]['class'] = $component['class'];
[259] Fix | Delete
}
[260] Fix | Delete
}
[261] Fix | Delete
}
[262] Fix | Delete
[263] Fix | Delete
/**
[264] Fix | Delete
* {@inheritdoc}
[265] Fix | Delete
*/
[266] Fix | Delete
public function init()
[267] Fix | Delete
{
[268] Fix | Delete
$this->state = self::STATE_INIT;
[269] Fix | Delete
$this->bootstrap();
[270] Fix | Delete
}
[271] Fix | Delete
[272] Fix | Delete
/**
[273] Fix | Delete
* Initializes extensions and executes bootstrap components.
[274] Fix | Delete
* This method is called by [[init()]] after the application has been fully configured.
[275] Fix | Delete
* If you override this method, make sure you also call the parent implementation.
[276] Fix | Delete
*/
[277] Fix | Delete
protected function bootstrap()
[278] Fix | Delete
{
[279] Fix | Delete
if ($this->extensions === null) {
[280] Fix | Delete
$file = Yii::getAlias('@vendor/yiisoft/extensions.php');
[281] Fix | Delete
$this->extensions = is_file($file) ? include $file : [];
[282] Fix | Delete
}
[283] Fix | Delete
foreach ($this->extensions as $extension) {
[284] Fix | Delete
if (!empty($extension['alias'])) {
[285] Fix | Delete
foreach ($extension['alias'] as $name => $path) {
[286] Fix | Delete
Yii::setAlias($name, $path);
[287] Fix | Delete
}
[288] Fix | Delete
}
[289] Fix | Delete
if (isset($extension['bootstrap'])) {
[290] Fix | Delete
$component = Yii::createObject($extension['bootstrap']);
[291] Fix | Delete
if ($component instanceof BootstrapInterface) {
[292] Fix | Delete
Yii::debug('Bootstrap with ' . get_class($component) . '::bootstrap()', __METHOD__);
[293] Fix | Delete
$component->bootstrap($this);
[294] Fix | Delete
} else {
[295] Fix | Delete
Yii::debug('Bootstrap with ' . get_class($component), __METHOD__);
[296] Fix | Delete
}
[297] Fix | Delete
}
[298] Fix | Delete
}
[299] Fix | Delete
[300] Fix | Delete
foreach ($this->bootstrap as $mixed) {
[301] Fix | Delete
$component = null;
[302] Fix | Delete
if ($mixed instanceof \Closure) {
[303] Fix | Delete
Yii::debug('Bootstrap with Closure', __METHOD__);
[304] Fix | Delete
if (!$component = call_user_func($mixed, $this)) {
[305] Fix | Delete
continue;
[306] Fix | Delete
}
[307] Fix | Delete
} elseif (is_string($mixed)) {
[308] Fix | Delete
if ($this->has($mixed)) {
[309] Fix | Delete
$component = $this->get($mixed);
[310] Fix | Delete
} elseif ($this->hasModule($mixed)) {
[311] Fix | Delete
$component = $this->getModule($mixed);
[312] Fix | Delete
} elseif (strpos($mixed, '\\') === false) {
[313] Fix | Delete
throw new InvalidConfigException("Unknown bootstrapping component ID: $mixed");
[314] Fix | Delete
}
[315] Fix | Delete
}
[316] Fix | Delete
[317] Fix | Delete
if (!isset($component)) {
[318] Fix | Delete
$component = Yii::createObject($mixed);
[319] Fix | Delete
}
[320] Fix | Delete
[321] Fix | Delete
if ($component instanceof BootstrapInterface) {
[322] Fix | Delete
Yii::debug('Bootstrap with ' . get_class($component) . '::bootstrap()', __METHOD__);
[323] Fix | Delete
$component->bootstrap($this);
[324] Fix | Delete
} else {
[325] Fix | Delete
Yii::debug('Bootstrap with ' . get_class($component), __METHOD__);
[326] Fix | Delete
}
[327] Fix | Delete
}
[328] Fix | Delete
}
[329] Fix | Delete
[330] Fix | Delete
/**
[331] Fix | Delete
* Registers the errorHandler component as a PHP error handler.
[332] Fix | Delete
* @param array $config application config
[333] Fix | Delete
*/
[334] Fix | Delete
protected function registerErrorHandler(&$config)
[335] Fix | Delete
{
[336] Fix | Delete
if (YII_ENABLE_ERROR_HANDLER) {
[337] Fix | Delete
if (!isset($config['components']['errorHandler']['class'])) {
[338] Fix | Delete
echo "Error: no errorHandler component is configured.\n";
[339] Fix | Delete
exit(1);
[340] Fix | Delete
}
[341] Fix | Delete
$this->set('errorHandler', $config['components']['errorHandler']);
[342] Fix | Delete
unset($config['components']['errorHandler']);
[343] Fix | Delete
$this->getErrorHandler()->register();
[344] Fix | Delete
}
[345] Fix | Delete
}
[346] Fix | Delete
[347] Fix | Delete
/**
[348] Fix | Delete
* Returns an ID that uniquely identifies this module among all modules within the current application.
[349] Fix | Delete
* Since this is an application instance, it will always return an empty string.
[350] Fix | Delete
* @return string the unique ID of the module.
[351] Fix | Delete
*/
[352] Fix | Delete
public function getUniqueId()
[353] Fix | Delete
{
[354] Fix | Delete
return '';
[355] Fix | Delete
}
[356] Fix | Delete
[357] Fix | Delete
/**
[358] Fix | Delete
* Sets the root directory of the application and the @app alias.
[359] Fix | Delete
* This method can only be invoked at the beginning of the constructor.
[360] Fix | Delete
* @param string $path the root directory of the application.
[361] Fix | Delete
* @property string the root directory of the application.
[362] Fix | Delete
* @throws InvalidArgumentException if the directory does not exist.
[363] Fix | Delete
*/
[364] Fix | Delete
public function setBasePath($path)
[365] Fix | Delete
{
[366] Fix | Delete
parent::setBasePath($path);
[367] Fix | Delete
Yii::setAlias('@app', $this->getBasePath());
[368] Fix | Delete
}
[369] Fix | Delete
[370] Fix | Delete
/**
[371] Fix | Delete
* Runs the application.
[372] Fix | Delete
* This is the main entrance of an application.
[373] Fix | Delete
* @return int the exit status (0 means normal, non-zero values mean abnormal)
[374] Fix | Delete
*/
[375] Fix | Delete
public function run()
[376] Fix | Delete
{
[377] Fix | Delete
try {
[378] Fix | Delete
$this->state = self::STATE_BEFORE_REQUEST;
[379] Fix | Delete
$this->trigger(self::EVENT_BEFORE_REQUEST);
[380] Fix | Delete
[381] Fix | Delete
$this->state = self::STATE_HANDLING_REQUEST;
[382] Fix | Delete
$response = $this->handleRequest($this->getRequest());
[383] Fix | Delete
[384] Fix | Delete
$this->state = self::STATE_AFTER_REQUEST;
[385] Fix | Delete
$this->trigger(self::EVENT_AFTER_REQUEST);
[386] Fix | Delete
[387] Fix | Delete
$this->state = self::STATE_SENDING_RESPONSE;
[388] Fix | Delete
$response->send();
[389] Fix | Delete
[390] Fix | Delete
$this->state = self::STATE_END;
[391] Fix | Delete
[392] Fix | Delete
return $response->exitStatus;
[393] Fix | Delete
} catch (ExitException $e) {
[394] Fix | Delete
$this->end($e->statusCode, isset($response) ? $response : null);
[395] Fix | Delete
return $e->statusCode;
[396] Fix | Delete
}
[397] Fix | Delete
}
[398] Fix | Delete
[399] Fix | Delete
/**
[400] Fix | Delete
* Handles the specified request.
[401] Fix | Delete
*
[402] Fix | Delete
* This method should return an instance of [[Response]] or its child class
[403] Fix | Delete
* which represents the handling result of the request.
[404] Fix | Delete
*
[405] Fix | Delete
* @param Request $request the request to be handled
[406] Fix | Delete
* @return Response the resulting response
[407] Fix | Delete
*/
[408] Fix | Delete
abstract public function handleRequest($request);
[409] Fix | Delete
[410] Fix | Delete
private $_runtimePath;
[411] Fix | Delete
[412] Fix | Delete
/**
[413] Fix | Delete
* Returns the directory that stores runtime files.
[414] Fix | Delete
* @return string the directory that stores runtime files.
[415] Fix | Delete
* Defaults to the "runtime" subdirectory under [[basePath]].
[416] Fix | Delete
*/
[417] Fix | Delete
public function getRuntimePath()
[418] Fix | Delete
{
[419] Fix | Delete
if ($this->_runtimePath === null) {
[420] Fix | Delete
$this->setRuntimePath($this->getBasePath() . DIRECTORY_SEPARATOR . 'runtime');
[421] Fix | Delete
}
[422] Fix | Delete
[423] Fix | Delete
return $this->_runtimePath;
[424] Fix | Delete
}
[425] Fix | Delete
[426] Fix | Delete
/**
[427] Fix | Delete
* Sets the directory that stores runtime files.
[428] Fix | Delete
* @param string $path the directory that stores runtime files.
[429] Fix | Delete
*/
[430] Fix | Delete
public function setRuntimePath($path)
[431] Fix | Delete
{
[432] Fix | Delete
$this->_runtimePath = Yii::getAlias($path);
[433] Fix | Delete
Yii::setAlias('@runtime', $this->_runtimePath);
[434] Fix | Delete
}
[435] Fix | Delete
[436] Fix | Delete
private $_vendorPath;
[437] Fix | Delete
[438] Fix | Delete
/**
[439] Fix | Delete
* Returns the directory that stores vendor files.
[440] Fix | Delete
* @return string the directory that stores vendor files.
[441] Fix | Delete
* Defaults to "vendor" directory under [[basePath]].
[442] Fix | Delete
*/
[443] Fix | Delete
public function getVendorPath()
[444] Fix | Delete
{
[445] Fix | Delete
if ($this->_vendorPath === null) {
[446] Fix | Delete
$this->setVendorPath($this->getBasePath() . DIRECTORY_SEPARATOR . 'vendor');
[447] Fix | Delete
}
[448] Fix | Delete
[449] Fix | Delete
return $this->_vendorPath;
[450] Fix | Delete
}
[451] Fix | Delete
[452] Fix | Delete
/**
[453] Fix | Delete
* Sets the directory that stores vendor files.
[454] Fix | Delete
* @param string $path the directory that stores vendor files.
[455] Fix | Delete
*/
[456] Fix | Delete
public function setVendorPath($path)
[457] Fix | Delete
{
[458] Fix | Delete
$this->_vendorPath = Yii::getAlias($path);
[459] Fix | Delete
Yii::setAlias('@vendor', $this->_vendorPath);
[460] Fix | Delete
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower');
[461] Fix | Delete
Yii::setAlias('@npm', $this->_vendorPath . DIRECTORY_SEPARATOR . 'npm');
[462] Fix | Delete
}
[463] Fix | Delete
[464] Fix | Delete
/**
[465] Fix | Delete
* Returns the time zone used by this application.
[466] Fix | Delete
* This is a simple wrapper of PHP function date_default_timezone_get().
[467] Fix | Delete
* If time zone is not configured in php.ini or application config,
[468] Fix | Delete
* it will be set to UTC by default.
[469] Fix | Delete
* @return string the time zone used by this application.
[470] Fix | Delete
* @see https://www.php.net/manual/en/function.date-default-timezone-get.php
[471] Fix | Delete
*/
[472] Fix | Delete
public function getTimeZone()
[473] Fix | Delete
{
[474] Fix | Delete
return date_default_timezone_get();
[475] Fix | Delete
}
[476] Fix | Delete
[477] Fix | Delete
/**
[478] Fix | Delete
* Sets the time zone used by this application.
[479] Fix | Delete
* This is a simple wrapper of PHP function date_default_timezone_set().
[480] Fix | Delete
* Refer to the [php manual](https://www.php.net/manual/en/timezones.php) for available timezones.
[481] Fix | Delete
* @param string $value the time zone used by this application.
[482] Fix | Delete
* @see https://www.php.net/manual/en/function.date-default-timezone-set.php
[483] Fix | Delete
*/
[484] Fix | Delete
public function setTimeZone($value)
[485] Fix | Delete
{
[486] Fix | Delete
date_default_timezone_set($value);
[487] Fix | Delete
}
[488] Fix | Delete
[489] Fix | Delete
/**
[490] Fix | Delete
* Returns the database connection component.
[491] Fix | Delete
* @return \yii\db\Connection the database connection.
[492] Fix | Delete
*/
[493] Fix | Delete
public function getDb()
[494] Fix | Delete
{
[495] Fix | Delete
return $this->get('db');
[496] Fix | Delete
}
[497] Fix | Delete
[498] Fix | Delete
/**
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function