未验证 提交 8ef2ffca 编写于 作者: T Terry 提交者: GitHub

Merge pull request #66 from opensource-labs/fix-var-name

fix var name typo
......@@ -76,7 +76,11 @@ class Store extends Service
}
}
// 得到当前入口的名字
/**
* 得到当前入口的名字
* @return mixed
*/
public function getCurrentAppName()
{
return Yii::$app->params['appName'];
......@@ -87,16 +91,17 @@ class Store extends Service
* if you not config this ,default class property will be set.
* if current store_code is not config , InvalidValueException will be throw.
* class property $currentStore will be set value $store_code.
* @param $app
*/
protected function actionBootstrap($app)
{
$host = explode('//', $app->getHomeUrl());
$stores = $this->stores;
$init_compelte = 0;
$init_complete = 0;
if (is_array($stores) && !empty($stores)) {
foreach ($stores as $store_code => $store) {
if ($host[1] == $store_code) {
$this->html5DevideCheckAndRedirect($store_code, $store);
$this->html5DeviceCheckAndRedirect($store_code, $store);
Yii::$service->store->currentStore = $store_code;
$this->store = $store;
if (isset($store['language']) && !empty($store['language'])) {
......@@ -126,9 +131,9 @@ class Store extends Service
}
Yii::$service->page->currency->initCurrency($currency);
/**
* current domian is config is store config.
* current domain is config is store config.
*/
$init_compelte = 1;
$init_complete = 1;
$this->thirdLogin = $store['thirdLogin'];
/**
* appserver 部分
......@@ -160,7 +165,7 @@ class Store extends Service
}
}
}
if (!$init_compelte) {
if (!$init_complete) {
throw new InvalidValueException('this domain is not config in store component');
}
}
......@@ -168,10 +173,10 @@ class Store extends Service
/**
* @param $store_code | String
* @param $store | Array
* mobile devide url redirect.
* mobile device url redirect.
* pc端自动跳转到html5端的检测
*/
protected function html5DevideCheckAndRedirect($store_code, $store)
protected function html5DeviceCheckAndRedirect($store_code, $store)
{
if (!isset($store['mobile'])) {
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册