Connection reset after php include
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.
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).
精彩评论