Edit report at https://bugs.php.net/bug.php?id=63026&edit=1

 ID:                 63026
 Updated by:         larue...@php.net
 Reported by:        ian dot xspace at yahoo dot cn
 Summary:            require_once error
-Status:             Feedback
+Status:             Not a bug
 Type:               Bug
 Package:            *Compile Issues
 Operating System:   windows 7
 PHP Version:        5.3.16
 Block user comment: N
 Private report:     N

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

到现在, 我确认这个和require once没什么关系了, 

也许你的宏本身就没定义好, 
或者其他的什么原因造成的看起来怪异的结论, 

关闭这个报告,  建议你多打调试信息, 
多关注错误输出去排查.

thanks


Previous Comments:
------------------------------------------------------------------------
[2012-09-13 05:46:51] ian dot xspace at yahoo dot cn

return array(
                                'M'=>'MODELS', 'V'=>'VIEWS',
                                'C'=>'CTRLS', 'L'=>'LIBS',
                                'P'=>'PLNS', 'H'=>'HLP'
                );
关键是这种情况下我调用很多类都成功了,不是应该失败的吗,下面才是正确写法
                return array(
                                'M'=>MODELS, 'V'=>VIEWS,
                                'C'=>CTRLS, 'L'=>LIBS,
                                'P'=>PLNS, 'H'=>HLP
                );

------------------------------------------------------------------------
[2012-09-12 10:30:46] re...@php.net

“$obj = $this->loadCS('M.share_model');//调用其它类
           
//你可以多调用几个类,在上面错误写法情况下,有的类可以调用成功,有的失败
           //sysModule 
里的对应关系,应该这么写'C'=>CTRLS,后者无需引号
”
require_once的路径是直接拼的,而且不是autoload,
他这里没有其他的例子,如果部分类名大小写错了,就会出现部分类找不到的情况。

在require前增加个检查就能确认或者排除这个问题了

------------------------------------------------------------------------
[2012-09-12 10:25:08] larue...@php.net

你从哪里看出来和大小写有关系的?

------------------------------------------------------------------------
[2012-09-12 10:15:04] re...@php.net

看你这情况,有可能是你的大小写问题, 
你是直接require_once的,如果大小写错了是有问题的。
为了好调试,你可以在require_once 前加一个if(!file_exists($file) 
{die($file not found)}
检查一下。 你确认一下文件的确存在吧。

同时,是在不行,把你的代码完整打包传到某个地方吧。。

------------------------------------------------------------------------
[2012-09-12 02:03:08] larue...@php.net

那些类名可以正确加载 ,那些类名不可以?  你举个例子?

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=63026


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63026&edit=1

Reply via email to