当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Exception::__construct方法代码示例

本文整理汇总了PHP中Zend_Exception::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Exception::__construct方法的具体用法?PHP Zend_Exception::__construct怎么用?PHP Zend_Exception::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Exception的用法示例。


在下文中一共展示了Zend_Exception::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  *
  * @param String $msg The message
  * @param int $code the HttpResponseCode for this exception
  * @param \Exception $previous
  * @param string $info Optional extra information on the exception
  */
 public function __construct($msg = '', $code = 200, \Exception $previous = null, $info = null)
 {
     parent::__construct($msg, $code, $previous);
     if ($info) {
         $this->setInfo($info);
     }
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:14,代码来源:Exception.php

示例2: __construct

 public function __construct($message, $op1 = null, $op2 = null, $result = null)
 {
     $this->op1 = $op1;
     $this->op2 = $op2;
     $this->result = $result;
     parent::__construct($message);
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:7,代码来源:Exception.php

示例3: __construct

 public function __construct($message = 'Server Error', $code = 400, $extra = null)
 {
     switch ($code) {
         case 401:
             if (null == $message) {
                 $message = 'Not Authorised';
             }
             break;
         case 403:
             if (null == $message) {
                 $message = 'Forbidden';
             }
             break;
         case 404:
             if (null == $message) {
                 $message = 'Not Found';
             }
             break;
         case 405:
             if (null == $message) {
                 $message = 'Method Not Allowed';
             }
             Zend_Controller_Front::getInstance()->getResponse()->setHeader('Allow', $extra['allowed_methods']);
             break;
     }
     parent::__construct($message, $code);
 }
开发者ID:rdallasgray,项目名称:bbx,代码行数:27,代码来源:Exception.php

示例4: __construct

 public function __construct($message = '', $code = 0, Exception $previous = null)
 {
     if (Core_Registry::getMessage()->isTranslated($message)) {
         $message = Core_Registry::getMessage()->translate($message);
     }
     parent::__construct($message, (int) $code, $previous);
 }
开发者ID:sgdoc,项目名称:sgdoce-codigo,代码行数:7,代码来源:Exception.php

示例5: __construct

 /**
  * Create a new ServiceException.
  *
  * @return array An array containing a collection of
  *          Zend_Gdata_Gapps_Error objects.
  */
 public function __construct($errors = null)
 {
     parent::__construct("Server errors encountered");
     if ($errors !== null) {
         $this->setErrors($errors);
     }
 }
开发者ID:ramonornela,项目名称:Zebra,代码行数:13,代码来源:ServiceException.php

示例6: __construct

 public function __construct($message = null)
 {
     if (empty($message)) {
         parent::__construct('This page does not exist. (404)', 404);
     } else {
         parent::__construct($message . ' (404)', 404);
     }
 }
开发者ID:vrtulka23,项目名称:daiquiri,代码行数:8,代码来源:NotFound.php

示例7: __construct

 public function __construct($message = null)
 {
     if (empty($message)) {
         parent::__construct('There has been an error with your request. (400)', 400);
     } else {
         parent::__construct($message . ' (400)', 400);
     }
 }
开发者ID:vrtulka23,项目名称:daiquiri,代码行数:8,代码来源:BadRequest.php

示例8: __construct

 /**
  *
  * @param string $msg
  * @param int $code
  * @param Exception $previous 
  */
 public function __construct($msg = '', $code = 0, Exception $previous = null)
 {
     if (is_array($msg)) {
         $code = $msg['type'];
         $msg = $msg['message'];
     }
     parent::__construct($msg, $code, $previous);
 }
开发者ID:rtsantos,项目名称:mais,代码行数:14,代码来源:Exception.php

示例9: __construct

 public function __construct($message = null)
 {
     if (empty($message)) {
         parent::__construct('You are not authorized to view this page. (401)', 401);
     } else {
         parent::__construct($message . ' (401)', 401);
     }
 }
开发者ID:vrtulka23,项目名称:daiquiri,代码行数:8,代码来源:Unauthorized.php

示例10: __construct

 /**
  * @param string
  */
 public function __construct($message)
 {
     if (func_num_args() > 1) {
         $params = func_get_args();
         $params[0] = $message;
         $message = call_user_func_array("sprintf", $params);
     }
     parent::__construct($message);
 }
开发者ID:phpscr,项目名称:usvn,代码行数:12,代码来源:Exception.php

示例11:

 /**
  * Constructor
  * @param string $message
  * @param string $code
  * @param int $type
  */
 function __construct($message = 'Exception', $code = 0, $type = CS_Exception::MINOR_ERROR)
 {
     if (empty($code)) {
         $code = crc32(get_class($this));
     }
     $this->_errType = $type;
     parent::__construct($message, $code);
     //self::makeExceptionLog($this);
 }
开发者ID:andybui2014,项目名称:PocketRecuiter,代码行数:15,代码来源:Exception.php

示例12: __construct

 /**
 *
 * @var type
 * /
     private $_stacktrace;
 
     /**
 * Construct the exception
 *
 * @param  string $msg
 * @param  int $code
 * @param  \Exception $previous
 * @param  array $stacktrace
 * @return void
 */
 public function __construct($msg = '', $code = 0, \Exception $previous = null)
 {
     parent::__construct($msg, $code, $previous);
     /*
             $this->_stacktrace = debug_backtrace(false);
     
             // Remove this line
             array_shift($this->_stacktrace);
             // */
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:25,代码来源:LazyException.php

示例13: __construct

 public function __construct($msg = '', $code = 0, Exception $previous = null)
 {
     if (is_array($msg)) {
         $txt = '';
         foreach ($msg as $key => $value) {
             $txt .= $key . ': ' . $value . '   \\n  ';
         }
         $msg = $txt;
     }
     parent::__construct($msg, $code, $previous);
 }
开发者ID:brunopbaffonso,项目名称:ongonline,代码行数:11,代码来源:Exception.php

示例14: __construct

 /**
  * Erstellt die Ausnahme mit der Möglichkeit zusätzliche Daten anzugeben
  * @param string $message
  * @param array $data
  * @param int $code
  * @param Exception $previous
  */
 public function __construct($message = '', array $data = array(), $code = 0, Exception $previous = null)
 {
     if (isset($previous)) {
         if ($message == '') {
             $message = $previous->getMessage();
         }
         if (count($data) == 0 && $previous instanceof Dragon_Application_Exception_Abstract) {
             $data = $previous->getData();
         }
         if ($code == 0) {
             $code = $previous->getCode();
         }
     }
     $this->_data = $data;
     parent::__construct($message, $code, $previous);
 }
开发者ID:dragonprojects,项目名称:dragonjsonserver,代码行数:23,代码来源:Abstract.php

示例15: __construct

 public function __construct($msg = '', $code = 0, Exception $previous = null)
 {
     // just pass ahead if it was throw from the CLI
     if (php_sapi_name() == "cli") {
         return parent::__construct($msg, (int) $code, $previous);
     } else {
         parent::__construct($msg, (int) $code, $previous);
         $response = new Zend_Controller_Response_Http();
         $response->setHttpResponseCode(500);
         ob_get_clean();
         ob_start();
         require APPLICATION_PATH . "/layout/scripts/exception.phtml";
         $outputBuffer = ob_get_clean();
         $response->setBody($outputBuffer);
         $response->sendResponse();
         trigger_error($msg, E_USER_ERROR);
         exit;
     }
 }
开发者ID:henvic,项目名称:MediaLab,代码行数:19,代码来源:Exception.php


注:本文中的Zend_Exception::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。