出现的问题, 找了几圈某度, 说的都不知道什么鬼. 所以还得自己试着搞(因为不太想跟这源码写的代码)
可处理方法:
- 直接把调试模式关掉, 不鸟他
- 对于强迫症的人来说(譬如我) 不能容忍在开启调试模式时,还有一堆的warning提示, 解决方法如下:
Warning: Use of undefined constant MODULE_ROOT - assumed 'MODULE_ROOT' (this will throw an Error in a future version of PHP) in xxxxx
Warning: Use of undefined constant FRAME - assumed 'FRAME' (this will throw an Error in a future version of PHP) in xxxxx
当前环境配置为: we7 1.7.0 + x版 + php7.2+mysql(这个不用管)
- MODULE_ROOT 的问题, 一般是由cloudapi.class.php 文件里没定义MODULE_ROOT常量引起的. 所以, 定位到问题出处:
\framework\class\cloudapi.class.php 53行 修改为:
private function cer_filepath($file) {
if (defined('MODULE_ROOT')) {
return MODULE_ROOT.'/'.$file;
}
return $file;
}
- FRAME 的问题, 是由于头部没定义常量FRAME就直接用,所以在 \web\themes\default\common\header-base.html 的头部加个defined的判断就可以了.
web/themes/default/common/header.html 去掉:
{php $frames = buildframes(FRAME);_calc_current_frames($frames);}
web/themes/default/common/header-base.html 4行 添加
{if !defined('FRAME')}{php define('FRAME', '')}{/if}
{php $frames = buildframes(FRAME);_calc_current_frames($frames);}
本文详细介绍了如何解决PHP中因未定义常量MODULE_ROOT和FRAME导致的警告问题,通过修改cloudapi.class.php和header-base.html文件,确保在开启调试模式下也能避免警告提示。
6404

被折叠的 条评论
为什么被折叠?



