E_NOTICE
当核心 CakePHP 文件尝试引用从未设置或未设置的会话 ( ) 时,我在该文件中遇到错误cake/libs/cake_session.php line 372
:
function read($name = null) {
if (is_null($name)) {
return $this->__returnSessionVars();
}
if (empty($name)) {
return false;
}
$result = Set::classicExtract($_SESSION, $name);
}
我已经通过我的代码(在 app/ 目录中)进行了搜索,但我找不到对$_SESSION
or的引用session_destroy
。我错过了什么吗?
当我尝试运行任何单元测试时会出现此错误。这……正常吗?我已清除cake/
目录并将其替换为另一个(相同版本),以确保我没有无意中修改核心文件中的任何内容,但我仍然遇到相同的错误。我不确定这是否只是框架中的缺陷还是其他原因。
编辑
以下是在命令行上运行的测试结果:
Welcome to CakePHP v1.3.11 Console
---------------------------------------------------------------
App : app
Path: /var/www/program/app
---------------------------------------------------------------
CakePHP Test Shell
---------------------------------------------------------------
Running app case models/owners_equity
E_NOTICE: Undefined variable: _SESSION in /var/www/program/cake/libs/cake_session.php on line 372
E_NOTICE: Undefined variable: _SESSION in /var/www/program/cake/libs/cake_session.php on line 372
ERROR->Unexpected PHP error [Undefined variable: _SESSION] severity [E_NOTICE] in [/var/www/program/cake/libs/cake_session.php line 372]
in testGenerateOwnerWithdrawals
in BalanceTestCase
in /var/www/program/app/tests/cases/models/owners_equity.test.php
ERROR->Unexpected PHP error [Undefined variable: _SESSION] severity [E_NOTICE] in [/var/www/program/cake/libs/cake_session.php line 372]
in testGenerateOwnerWithdrawals
in BalanceTestCase
in /var/www/program/app/tests/cases/models/owners_equity.test.php