diff options
Diffstat (limited to 'library/SSRS/Soap')
-rwxr-xr-x | library/SSRS/Soap/Exception.php | 14 | ||||
-rwxr-xr-x | library/SSRS/Soap/NTLM.php | 8 | ||||
-rw-r--r-- | library/SSRS/Soap/ServerException.php | 10 |
3 files changed, 19 insertions, 13 deletions
diff --git a/library/SSRS/Soap/Exception.php b/library/SSRS/Soap/Exception.php index 5e6170d..2257404 100755 --- a/library/SSRS/Soap/Exception.php +++ b/library/SSRS/Soap/Exception.php @@ -1,15 +1,17 @@ <?php -class SSRS_Soap_Exception extends Exception{ - +namespace SSRS\Soap; + +class Exception extends \Exception { + public $httpCode; public $response; - + public function __construct($message, $code, $response = null) { $this->httpCode = $code; $this->response = $response; - + parent::__construct($message, $code); } - -}
\ No newline at end of file + +} diff --git a/library/SSRS/Soap/NTLM.php b/library/SSRS/Soap/NTLM.php index 929a642..084e92c 100755 --- a/library/SSRS/Soap/NTLM.php +++ b/library/SSRS/Soap/NTLM.php @@ -1,6 +1,8 @@ <?php -class SSRS_Soap_NTLM extends SoapClient { +namespace SSRS\Soap; + +class NTLM extends \SoapClient { protected $_uri; protected $_username; @@ -154,9 +156,9 @@ class SSRS_Soap_NTLM extends SoapClient { $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); if ($httpCode >= 300 && $httpCode <= 600) { - throw SSRS_Soap_ServerException::fromResponse($response); + throw ServerException::fromResponse($response); } else if ($httpCode !== 200) { - throw new SSRS_Soap_Exception('HTTP error: ' . $httpCode . ' ' . $response, $httpCode, $response); + throw new Exception('HTTP error: ' . $httpCode . ' ' . $response, $httpCode, $response); } curl_close($handle); diff --git a/library/SSRS/Soap/ServerException.php b/library/SSRS/Soap/ServerException.php index 3ffce47..7d71d10 100644 --- a/library/SSRS/Soap/ServerException.php +++ b/library/SSRS/Soap/ServerException.php @@ -1,6 +1,8 @@ <?php -class SSRS_Soap_ServerException extends Exception { +namespace SSRS\Soap; + +class ServerException extends \Exception { public $faultcode; public $faultstring; @@ -15,15 +17,15 @@ class SSRS_Soap_ServerException extends Exception { if (isset($body->Fault)) { $fault = $body->Fault->children(); - $exception = new SSRS_Soap_ServerException((string) $fault->faultstring); + $exception = new ServerException((string) $fault->faultstring); $exception->faultcode = (string) $fault->faultcode; $exception->faultstring = (string) $fault->faultstring; $exception->faultactor = (string) $fault->faultactor; } else { - throw new SSRS_Soap_Exception('Invalid server response'); + throw new Exception('Invalid server response'); } return $exception; } -}
\ No newline at end of file +} |