把入口文件的所有错误都打开,即把下面这句注释掉:
error_reporting(E_ALL || ~E_NOTICE)
Undefined index: helper
in D:\phpStudy\www\merchant\vendor\fancyecommerce\fecshop\services\Application.php at line 43
34353637383940414243444546474849505152
$this->childService = $config;
}
/**
* 得到services 里面配置的子服务childService的实例.
* 单例模式,懒加载,使用的时候才会被实例化。类似于Yii2的component原理。
*/
public function getChildService($childServiceName)
{
if (!$this->_childService[$childServiceName]) {
$childService = $this->childService;
if (isset($childService[$childServiceName])) {
$service = $childService[$childServiceName];
$this->_childService[$childServiceName] = Yii::createObject($service);
} else {
throw new InvalidConfigException('Child Service ['.$childServiceName.'] is not find in '.get_called_class().', you must config it! ');
}
}
2. in D:\phpStudy\www\merchant\vendor\fancyecommerce\fecshop\services\Application.php at line 43 – yii\base\ErrorHandler::handleError(8, 'Undefined index: helper', 'D:\phpStudy\www\merchant\vendor\...', 43, ...)
37383940414243444546474849
/**
* 得到services 里面配置的子服务childService的实例.
* 单例模式,懒加载,使用的时候才会被实例化。类似于Yii2的component原理。
*/
public function getChildService($childServiceName)
{
if (!$this->_childService[$childServiceName]) {
$childService = $this->childService;
if (isset($childService[$childServiceName])) {
$service = $childService[$childServiceName];
$this->_childService[$childServiceName] = Yii::createObject($service);
} else {
throw new InvalidConfigException('Child Service ['.$childServiceName.'] is not find in '.get_called_class().', you must config it! ');
3. in D:\phpStudy\www\merchant\vendor\fancyecommerce\fecshop\services\Application.php at line 62 – fecshop\services\Application::getChildService('helper')
565758596061626364
* @property $attr | String , service的name。
* 魔术方法,当调用一个属性,对象不存在的时候就会执行该方法,然后
* 根据构造方法注入的配置,实例化service对象。
*/
public function __get($attr)
{
return $this->getChildService($attr);
}
}
4. in D:\phpStudy\www\merchant\vendor\fancyecommerce\fecshop\services\Service.php at line 87 – fecshop\services\Application::__get('helper')
81828384858687888990919293
/**
* 如果开启service log,则记录开始的时间。
*/
protected function beginCall($originMethod, $arguments)
{
if (Yii::$service->helper->log->isServiceLogEnable()) {
$this->_beginCallTime = microtime(true);
}
}
/**
* @param $originMethod and $arguments,魔术方法传递的参数
5. in D:\phpStudy\www\merchant\vendor\fancyecommerce\fecshop\services\Service.php at line 47 – fecshop\services\Service::beginCall('getUnderBranchId', [])
41424344454647484950515253
$method = $this->_callFuncLog[$originMethod];
} else {
$method = 'action'.ucfirst($originMethod);
$this->_callFuncLog[$originMethod] = $method;
}
if (method_exists($this, $method)) {
$this->beginCall($originMethod, $arguments);
$return = call_user_func_array([$this, $method], $arguments);
$this->endCall($originMethod, $arguments);
return $return;
} else {
throw new InvalidCallException('fecshop service method is not exit. '.get_class($this)."::$method");
6. in D:\phpStudy\www\merchant\appcrm\modules\Crmbranch\block\index\Index.php at line 35 – fecshop\services\Service::__call('getUnderBranchId', [])
29303132333435363738394041
public function getAll($params){
$all = Yii::$service->Crmbranch->CBranch->getAll($params);
return $all;
}
//分账号展示分支
public function getUnderBranchId(){
$data = Yii::$service->PublicMethod->getUnderBranchId();
return $data;
}
//获取登录用户的branch_id
public function getBranchUser(){
$data = Yii::$service->BranchUser->getBranchUser();
return $data;
7. in D:\phpStudy\www\merchant\appcrm\modules\Crmbranch\controllers\IndexController.php at line 28 – appcrm\modules\Crmbranch\block\index\Index::getUnderBranchId()
22232425262728293031323334
public function actionIndex()
{
/**
* 分账号展示分支,若无总分支,则需先添加总分支
* 若有,返回分支id,中间以,隔开
*/
$branchIdAll = $this->getBlock()->getUnderBranchId();
if($branchIdAll == 'error'){
Yii::$app->getSession()->setFlash('b_error', '无分支,请先添加总分支');
return $this->redirect(['create']);
}
$arrIdAll = explode(',',$branchIdAll);
8. appcrm\modules\Crmbranch\controllers\IndexController::actionIndex()
9. in D:\phpStudy\www\merchant\vendor\yiisoft\yii2\base\InlineAction.php at line 57 – call_user_func_array([appcrm\modules\Crmbranch\controllers\IndexController, 'actionIndex'], [])
10. in D:\phpStudy\www\merchant\vendor\yiisoft\yii2\base\Controller.php at line 156 – yii\base\InlineAction::runWithParams([])
11. in D:\phpStudy\www\merchant\vendor\yiisoft\yii2\base\Module.php at line 523 – yii\base\Controller::runAction('index', [])
12. in D:\phpStudy\www\merchant\vendor\yiisoft\yii2\web\Application.php at line 102 – yii\base\Module::runAction('crmbranch/index/index', [])
13. in D:\phpStudy\www\merchant\vendor\yiisoft\yii2\base\Application.php at line 380 – yii\web\Application::handleRequest(yii\web\Request)
14. in D:\phpStudy\www\merchant\appcrm\web\index.php at line 58 – yii\base\Application::run()
除了屏蔽错误,还有别的解决办法吗?php版本是7.0