Advertisement
Guest User

Untitled

a guest
Jul 19th, 2010
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * require php 5.2+
  5.  * @package ExceptionHandler
  6.  */
  7. class exceptionHandlerOutputSoap extends exceptionHandlerOutput{
  8.  
  9.     /**
  10.      * @var SoapServer
  11.      */
  12.     protected $soapServer;
  13.  
  14.     /**
  15.      * @param SoapServer $soapServer
  16.      */
  17.     public function  __construct($soapServer) {
  18.         $this->$soapServer = $soapServer;
  19.     }
  20.  
  21.     /**
  22.      * @param Exception $exception
  23.      * @param bool $debug
  24.      */
  25.     public function output($exception, $debug){
  26.         header('HTTP/1.0 500 Internal Server Error', true, 500);
  27.         header('Status: 500 Internal Server Error', true, 500);
  28.         if($debug){
  29.             $this->soapServer->fault($exception->getCode(),
  30.                 $exception->getMessage(), null, $exception->getTraceAsString());
  31.         } else {
  32.             $this->soapServer->fault(0, self::$productionMessage);
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement