加载类 EWSType_FindItemType (php-ews) 时发生致命错误
我从来没有真正玩过课程,但我希望在页面上使用 php-ews我在自动取款机上工作。
我的主文件通过 include 调用 5 个“根”php 文件
include ("php-ews/ExchangeWebServices.php");
include ("php-ews/EWS_Exception.php");
include ("php-ews/EWSType.php");
include ("php-ews/NTLMSoapClient.php");
include ("php-ews/NTLMStream.php");
,但是在本例中,这些文件抱怨子文件夹中的文件不包括在内。
Fatal error: Class 'EWSType_FindItemType' not found in C:\wamp\www\intranet\dashboard\mailtest.php on line 19
我尝试将上述文件包含在 EWSType.php 文件中,然后它抱怨未包含下一个文件。我尝试过在文件夹中包含任何 .php 的方法,但这不起作用。
我想我只是要错误地加载一个类,并且想知道是否有人可以给我指路!
I've never really had to play with classes but am looking to use php-ews on a page i'm working on atm.
my main file is calling the 5 "root" php files via include
include ("php-ews/ExchangeWebServices.php");
include ("php-ews/EWS_Exception.php");
include ("php-ews/EWSType.php");
include ("php-ews/NTLMSoapClient.php");
include ("php-ews/NTLMStream.php");
however these are complaining that files in there subfolders aren't included, in this case.
Fatal error: Class 'EWSType_FindItemType' not found in C:\wamp\www\intranet\dashboard\mailtest.php on line 19
I have tried including the above file in the EWSType.php file and it then complains the next file isn't included. I have tried methods to include any .php in the folder and that isn't working.
I'm presuming I'm just going about loading a class wrong and was wondering if anyone could show me the way!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不要手动加载类,而是尝试使用 __autoload 来加载它们。这样您就不必担心保留包含列表。自动装载机将为您做到这一点。
如果类文件的调用方式与类本身相同,那么应该很容易。
请参阅 http://php.net/manual/en/function.spl- autoload-register.php
和 http://de3.php.net/manual/en/language。 oop5.autoload.php 了解详情
Instead of loading classes manually, try
__autoload
ing them. That way you don't need to worry about keeping the list of includes. Autoloader will do it for you.Should be easy enough, if class files are called the same as as classes themselves.
See http://php.net/manual/en/function.spl-autoload-register.php
and http://de3.php.net/manual/en/language.oop5.autoload.php for details
设法组合一些代码来包含主文件夹文件。
managed to put together a little bit of code to get the main folder files included.