Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yaf 3.0.4 偶尔会出现去auto load到错误路径 #320

Closed
ghost opened this issue Nov 8, 2016 · 3 comments
Closed

Yaf 3.0.4 偶尔会出现去auto load到错误路径 #320

ghost opened this issue Nov 8, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Nov 8, 2016

Yaf 3.0.4
PHP 7.0.12

请求5万次的情况下,有一定几率会出现 auto load 会到错误路径,回滚到 3.0.3 问题消失。

比如
$util = new Util_LocalIP();

正常情况是去加载

/data/release/framework/library/Util/LocalIP.php

但是 3.0.4 在日志中能看见一定几率出现去加载了

/data/release/framework/library/Util_LocalIP.php

日志内容:

critical | 24527 | 1478586810.319 | 2016:11:08 14:33:30 | Error - type:2 - file:/data/release/framework/library/Util/Request.php - line:268 - msg:Yaf_Loader::autoload
(): Failed opening script /data/release/framework/library/Util_LocalIP.php: No such file or directory
critical | 24527 | 1478586810.319 | 2016:11:08 14:33:30 | Error - type:1 - file:/data/release/framework/library/Util/Request.php - line:268 - msg:Uncaught Error: Clas
s 'Util_LocalIP' not found in /data/release/framework/library/Util/Request.php:268

前台直接是 500 错误

初始化 loader 时的代码如下

public function _initLoader(Yaf_Dispatcher $dispatcher) {
    Yaf_Loader::getInstance()->setLibraryPath(ROOT_PATH . '/framework/library', true);
    $dispatcher->setRequest(new Controller_Request());
    Yaf_Loader::getInstance()->setLibraryPath(APP_PATH . '/src/controllers');
    Yaf_Loader::getInstance()->registerLocalNamespace("Backend");
}
@tangyouyou
Copy link

这个又找到解决方案吗?

@laruence
Copy link
Owner

你可以试试最新版的yaf, 应该已经解决了

@xilylg
Copy link

xilylg commented Nov 28, 2017

3.0.5-dev还是有这个问题啊,有时候找到文件提示找不到类,全都是library下自动加载问题,错误率还挺高的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants