Skip to content

Commit

Permalink
Issue #3 by [email protected]: Added version as a property of t…
Browse files Browse the repository at this point in the history
…he ExchangeWebServices class and passing it in as an option to the SOAP client.
  • Loading branch information
jamesiarmes committed Sep 30, 2011
1 parent 9951d53 commit d7e17ed
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions ExchangeWebServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ class ExchangeWebServices {
* @var string
*/
const VERSION_2010_SP1 = 'Exchange2010_SP1';

/**
* Password to use when connecting to the Exchange server.
*
* @var string
*/
protected $password;

/**
* Location of the Exchange server.
Expand All @@ -50,27 +57,34 @@ class ExchangeWebServices {
* @var string
*/
protected $username;

/**
* Password to use when connecting to the Exchange server.
*
* Miscrosoft Exchange version that we are going to connect to
*
* @var string
*
* @see ExchangeWebServices::VERSION_2007
* @see ExchangeWebServices::VERSION_2007_SP1
* @see ExchangeWebServices::VERSION_2010
* @see ExchangeWebServices::VERSION_2010_SP1
*/
protected $password;
protected $version;

/**
* Constructor for the ExchangeWebServices class
*
* @param string $server
* @param string $username
* @param string $password
* @param string $version one of the ExchangeWebServices::VERSION_* constants
*/
public function __construct($server = null, $username = null,
$password = null) {
$password = null, $version = self::VERSION_2007) {
// set the object properties
$this->setServer($server);
$this->setUsername($username);
$this->setPassword($password);
$this->setVersion($version);
} // end function __construct()

/**
Expand Down Expand Up @@ -115,6 +129,17 @@ public function setUsername($username) {

return true;
} // end function setUsername()

/**
* Sets the version property
*
* @param string $version
*/
public function setVersion($version) {
$this->version = $version;

return true;
} // end function setVersion()

/**
* Function Description
Expand Down Expand Up @@ -467,6 +492,7 @@ protected function initializeSoapClient() {
array(
'user' => $this->username,
'password' => $this->password,
'version' => $this->version,
'location' => 'https://'.$this->server.'/EWS/Exchange.asmx',
)); // end return
} // end function initializeSoapClient()
Expand Down

0 comments on commit d7e17ed

Please sign in to comment.