當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PEAR_Error::__construct方法代碼示例

本文整理匯總了PHP中PEAR_Error::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP PEAR_Error::__construct方法的具體用法?PHP PEAR_Error::__construct怎麽用?PHP PEAR_Error::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PEAR_Error的用法示例。


在下文中一共展示了PEAR_Error::__construct方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

 /**
  * Overloaded FileMaker_Error constructor.
  *
  * @param FileMaker_Delegate &$fm FileMaker_Delegate object this error
  *        came from.
  * @param string $message Error message.
  * @param integer $code Error code.
  */
 function FileMaker_Error(&$fm, $message = null, $code = null)
 {
     $this->_fm =& $fm;
     parent::__construct($message, $code);
     // Log the error.
     $fm->log($this->getMessage(), FILEMAKER_LOG_ERR);
 }
開發者ID:lakinmohapatra,項目名稱:laravelTest,代碼行數:15,代碼來源:Error.php

示例2:

 /**
  * Mail_Queue_Error constructor.
  *
  * @param mixed   $code      Mail_Queue error code, or string with error message.
  * @param integer $mode      what 'error mode' to operate in
  * @param integer $level     what error level to use for
  *                           $mode & PEAR_ERROR_TRIGGER
  * @param string  $debuginfo additional debug info
  */
 function Mail_Queue_Error($code = MAILQUEUE_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $file = __FILE__, $line = __LINE__, $debuginfo = '')
 {
     $debuginfo .= (empty($debuginfo) ? '' : ' - ') . 'FILE: ' . $file . ', LINE: ' . $line;
     if (is_int($code)) {
         parent::__construct('Mail Queue Error: ' . Mail_Queue::errorMessage($code), $code, $mode, $level, $debuginfo);
     } else {
         parent::__construct('Mail Queue Error: ' . $code, MAILQUEUE_ERROR, $mode, $level, $debuginfo);
     }
 }
開發者ID:roojs,項目名稱:pear,代碼行數:18,代碼來源:Error.php

示例3:

 /**
  * DB_Error constructor
  *
  * @param mixed $code       DB error code, or string with error message
  * @param int   $mode       what "error mode" to operate in
  * @param int   $level      what error level to use for $mode &
  *                           PEAR_ERROR_TRIGGER
  * @param mixed $debuginfo  additional debug info, such as the last query
  *
  * @see PEAR_Error
  */
 function __construct($code = DB_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
 {
     if (is_int($code)) {
         parent::__construct('DB Error: ' . DB::errorMessage($code), $code, $mode, $level, $debuginfo);
     } else {
         parent::__construct("DB Error: {$code}", DB_ERROR, $mode, $level, $debuginfo);
     }
 }
開發者ID:julianbarrerar,項目名稱:Moe-Framework,代碼行數:19,代碼來源:DB.php

示例4:

 /**
  * DB_DataObject_Error constructor.
  *
  * @param mixed   $code   DB error code, or string with error message.
  * @param integer $mode   what "error mode" to operate in
  * @param integer $level  what error level to use for $mode & PEAR_ERROR_TRIGGER
  * @param mixed   $debuginfo  additional debug info, such as the last query
  *
  * @access public
  *
  * @see PEAR_Error
  */
 function __construct($message = '', $code = DB_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE)
 {
     parent::__construct('DB_DataObject Error: ' . $message, $code, $mode, $level);
 }
開發者ID:Jaree,項目名稱:revive-adserver,代碼行數:16,代碼來源:Error.php

示例5:

 /**
  * MDB2_Schema_Error constructor.
  *
  * @param mixed     error code, or string with error message.
  * @param int       what 'error mode' to operate in
  * @param int       what error level to use for $mode & PEAR_ERROR_TRIGGER
  * @param mixed     additional debug info, such as the last query
  * @access  public
  */
 function __construct($code = MDB2_SCHEMA_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
 {
     parent::__construct('MDB2_Schema Error: ' . MDB2_Schema::errorMessage($code), $code, $mode, $level, $debuginfo);
 }
開發者ID:hostinger,項目名稱:revive-adserver,代碼行數:13,代碼來源:Schema.php

示例6: sprintf

 /**
  * construct a new error instance
  *
  * You may either pass a message or an xml_parser resource as first
  * parameter. If a resource has been passed, the last error that
  * happened will be retrieved and returned.
  *
  * @param string|resource $msgorparser message or parser resource
  * @param integer         $code        error code
  * @param integer         $mode        error handling
  * @param integer         $level       error level
  *
  * @access   public
  * @todo PEAR CS - can't meet 85char line limit without arg refactoring
  */
 function __construct($msgorparser = 'unknown error', $code = 0, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE)
 {
     if (is_resource($msgorparser)) {
         $code = xml_get_error_code($msgorparser);
         $msgorparser = sprintf('%s at XML input line %d:%d', xml_error_string($code), xml_get_current_line_number($msgorparser), xml_get_current_column_number($msgorparser));
     }
     parent::__construct($msgorparser, $code, $mode, $level);
 }
開發者ID:pear,項目名稱:xml_parser,代碼行數:23,代碼來源:Parser.php

示例7:

 /**
  * Creates an cache error object.
  * 
  * @param  string  error message
  * @param  string  file where the error occured
  * @param  string  linenumber where the error occured
  */
 function Cache_Error($msg, $file = __FILE__, $line = __LINE__)
 {
     parent::__construct(sprintf("%s [%s on line %d].", $msg, $file, $line));
 }
開發者ID:roojs,項目名稱:pear,代碼行數:11,代碼來源:Error.php

示例8: __construct

 /**
  * Creates a quickform error object, extending the PEAR_Error class
  *
  * @param int   $code the error code
  * @param int   $mode the reaction to the error, either return, die or trigger/callback
  * @param int   $level intensity of the error (PHP error code)
  * @param mixed $debuginfo any information that can inform user as to nature of the error
  */
 public function __construct($code = QUICKFORM_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
 {
     if (is_int($code)) {
         parent::__construct(HTML_QuickForm::errorMessage($code), $code, $mode, $level, $debuginfo);
     } else {
         parent::__construct("Invalid error code: {$code}", QUICKFORM_ERROR, $mode, $level, $debuginfo);
     }
 }
開發者ID:elie89,項目名稱:moodle,代碼行數:16,代碼來源:QuickForm.php

示例9: __construct

 /**
  * MDB2_Error constructor.
  *
  * @param   mixed   MDB2 error code, or string with error message.
  * @param   int     what 'error mode' to operate in
  * @param   int     what error level to use for $mode & PEAR_ERROR_TRIGGER
  * @param   mixed   additional debug info, such as the last query
  */
 public function __construct($code = MDB2_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null, $dummy = null)
 {
     if (null === $code) {
         $code = MDB2_ERROR;
     }
     parent::__construct('MDB2 Error: ' . MDB2::errorMessage($code), $code, $mode, $level, $debuginfo);
 }
開發者ID:gauthierm,項目名稱:MDB2,代碼行數:15,代碼來源:MDB2.php

示例10: __construct

 /**
  * Net_LDAP2_Error constructor.
  *
  * @param string  $message   String with error message.
  * @param integer $code      Net_LDAP2 error code
  * @param integer $mode      what "error mode" to operate in
  * @param mixed   $level     what error level to use for $mode & PEAR_ERROR_TRIGGER
  * @param mixed   $debuginfo additional debug info, such as the last query
  *
  * @access public
  * @see PEAR_Error
  */
 public function __construct($message = 'Net_LDAP2_Error', $code = NET_LDAP2_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
 {
     if (is_int($code)) {
         parent::__construct($message . ': ' . Net_LDAP2::errorMessage($code), $code, $mode, $level, $debuginfo);
     } else {
         parent::__construct("{$message}: {$code}", NET_LDAP2_ERROR, $mode, $level, $debuginfo);
     }
 }
開發者ID:pear,項目名稱:net_ldap2,代碼行數:20,代碼來源:LDAP2.php


注:本文中的PEAR_Error::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。