2.16版本
根据Fecmall-2.x WAMP环境安装 - 手把手系列安装。
Invalid Configuration – yii\base\InvalidConfigException
Child Service [admin] does not exist in fecshop\services\Application, you must config it!
1. in D:\wamp64\www\fecshop\vendor\fancyecommerce\fecshop\services\Application.php at line 120
111112113114115116117118119120121122123124125126127128129 $childService = $this->childService;
if (isset($childService[$childServiceName])) {
$service = $childService[$childServiceName];
if (!isset($service['enableService']) || $service['enableService']) {
$this->_childService[$childServiceName] = Yii::createObject($service);
} else {
throw new InvalidConfigException('Child Service ['.$childServiceName.'] is disabled in '.get_called_class().', you must enable it! ');
}
} else {
throw new InvalidConfigException('Child Service ['.$childServiceName.'] does not exist in '.get_called_class().', you must config it! ');
}
}
return isset($this->_childService[$childServiceName]) ? $this->_childService[$childServiceName] : null;
}
/**
* 魔术方法,当调用一个属性,对象不存在的时候就会执行该方法,然后
* 根据构造方法注入的配置,实例化service对象。
2. in D:\wamp64\www\fecshop\vendor\fancyecommerce\fecshop\services\Application.php at line 136 – fecshop\services\Application::getChildService('admin')
130131132133134135136137138 * @var string $serviceName service name
* @return \fecshop\services\Service
* @throws \yii\base\InvalidConfigException if the service does not exist or the service is disabled
*/
public function __get($serviceName)
{
return $this->getChildService($serviceName);
}
}
3. in D:\wamp64\www\fecshop\vendor\fancyecommerce\fecshop\components\Store.php at line 41 – fecshop\services\Application::__get('admin')
35363738394041424344454647
// 初始化的bootstrap
public function bootstrap($app)
{
if ($this->appName == 'appadmin') {
Yii::$service->admin->bootstrap($app);
} else {
Yii::$service->store->bootstrap($app);
}
}
// 得到配置值
/**
4. in D:\wamp64\www\fecshop\vendor\yiisoft\yii2\base\Application.php at line 327 – fecshop\components\Store::bootstrap(yii\web\Application)
5. in D:\wamp64\www\fecshop\vendor\yiisoft\yii2\web\Application.php at line 69 – yii\base\Application::bootstrap()
6. in D:\wamp64\www\fecshop\vendor\yiisoft\yii2\base\Application.php at line 273 – yii\web\Application::bootstrap()
7. in D:\wamp64\www\fecshop\vendor\yiisoft\yii2\base\BaseObject.php at line 109 – yii\base\Application::init()
8. in D:\wamp64\www\fecshop\vendor\yiisoft\yii2\base\Application.php at line 206 – yii\base\BaseObject::__construct(['aliases' => ['@bower' => '@vendor/bower-asset', '@npm' => '@vendor/npm-asset'], 'components' => ['urlManager' => ['class' => 'yii\web\UrlManager', 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => ['' => 'fecadmin/index/index']], 'db' => ['class' => 'yii\db\Connection', 'dsn' => 'mysql:host=127.0.0.1;dbname=fecm...', 'username' => 'root', 'password' => '123456', ...], 'mongodb' => ['class' => 'yii\mongodb\Connection', 'dsn' => 'mongodb://127.0.0.1:27017/fecsho...'], 'cache' => ['class' => 'yii\caching\FileCache', 'keyPrefix' => 'appadmin_cache'], ...], 'id' => 'app-admin', 'controllerNamespace' => 'appadmin\controllers', ...])
9. in D:\wamp64\www\fecshop\appadmin\web\index.php at line 76 – yii\base\Application::__construct(['aliases' => ['@bower' => '@vendor/bower-asset', '@npm' => '@vendor/npm-asset'], 'components' => ['urlManager' => ['class' => 'yii\web\UrlManager', 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => ['' => 'fecadmin/index/index']], 'db' => ['class' => 'yii\db\Connection', 'dsn' => 'mysql:host=127.0.0.1;dbname=fecm...', 'username' => 'root', 'password' => '123456', ...], 'mongodb' => ['class' => 'yii\mongodb\Connection', 'dsn' => 'mongodb://127.0.0.1:27017/fecsho...'], 'cache' => ['class' => 'yii\caching\FileCache', 'keyPrefix' => 'appadmin_cache'], ...], 'id' => 'app-admin', 'controllerNamespace' => 'appadmin\controllers', ...])
70717273747576777879808182 * 使用方法:Yii::$service->cms->article;
* 上面的例子就是获取cms服务的子服务article。
*/
new fecshop\services\Application($config['services']);
unset($config['services']);
$application = new yii\web\Application($config);
$application->run();
$_COOKIE = [
'SL_GWPT_Show_Hide_tmp' => '1',
'SL_wptGlobTipTmp' => '1',
];