php include 后连接重置

发布于 2024-11-29 06:15:15 字数 1941 浏览 0 评论 0原文

我一直在使用 php-ews 来完成我正在进行的一个项目。

通过 scandir 循环和一些手动条目包含存储库后,

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");
include ("php-ews/NTLMStream/Exchange.php");

$dir    = '/wamp/www/intranet/dashboard/php-ews/EWSType/';
$files1 = scandir($dir);
foreach ($files1 as $value) {
if(preg_match('/\.php$/i', $value)){
$inc = "php-ews/EWSType/";
$inc .= $value;
include ($inc);
}}

我继续添加下一个包含项之一

include ("php-ews/NTLMSoapClient/Exchange.php");

,并且该页面不再可在任何浏览器中加载,从而在 Firefox 中给出连接重置错误,但是这是即时的,而不是超时问题。在评论该行后,它又回到要求将其包含在内的问题。

代码存储库下方文件的内容

class NTLMSoapClient_Exchange extends NTLMSoapClient {
    /**
     * Username for authentication on the exchnage server
     * 
     * @var string
     */
    protected $user;

    /**
     * password for authentication on the exchnage server
     * 
     * @var string
     */
    protected $password;

    /**
     * Constructor
     * 
     * @param string $wsdl
     * @param array $options
     */
    public function __construct($wsdl, $options) {
        // verify that a user name and password were entered
        if (empty($options['user']) || empty($options['password'])) {
            throw new EWS_Exception('A username and password is required.');
        } // end if no user name and password were entered

        // set the username and password properties
        $this->user = $options['user'];
        $this->password = $options['password'];

        parent::__construct($wsdl, $options);
    } // end function __construct()
} // end class NTLMSoapClient_Exchange

位于 http://code.google。 com/p/php-ews/source/browse/ 如果您需要更多参考。

任何帮助将不胜感激。

I've been working with php-ews for a project i'm working on.

upon including the repository via a scandir loop and a few manual entries

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");
include ("php-ews/NTLMStream/Exchange.php");

$dir    = '/wamp/www/intranet/dashboard/php-ews/EWSType/';
$files1 = scandir($dir);
foreach ($files1 as $value) {
if(preg_match('/\.php$/i', $value)){
$inc = "php-ews/EWSType/";
$inc .= $value;
include ($inc);
}}

i then proceed to add one of the next includes

include ("php-ews/NTLMSoapClient/Exchange.php");

and the page is no longer loadable in any browser giving connection reset errors in firefox, however this is instant and not a timeout issue. upon commenting that line out it goes back to asking for it to be included.

contents of the file below

class NTLMSoapClient_Exchange extends NTLMSoapClient {
    /**
     * Username for authentication on the exchnage server
     * 
     * @var string
     */
    protected $user;

    /**
     * password for authentication on the exchnage server
     * 
     * @var string
     */
    protected $password;

    /**
     * Constructor
     * 
     * @param string $wsdl
     * @param array $options
     */
    public function __construct($wsdl, $options) {
        // verify that a user name and password were entered
        if (empty($options['user']) || empty($options['password'])) {
            throw new EWS_Exception('A username and password is required.');
        } // end if no user name and password were entered

        // set the username and password properties
        $this->user = $options['user'];
        $this->password = $options['password'];

        parent::__construct($wsdl, $options);
    } // end function __construct()
} // end class NTLMSoapClient_Exchange

the code repository is at http://code.google.com/p/php-ews/source/browse/ if you need anymore reference.

any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

少跟Wǒ拽 2024-12-06 06:15:15

如果您已经包含该类并且我们尝试再次包含该文件,则会发生这种情况。
为了防止这种情况,请使用 include_once &还要检查使用代码是否再次包含该类(之前或之后)。

It Happens in-case when you have included the class already and we try to include that file again.
To prevent this use include_once & also check use code whether that class is included again (before or after).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文