当前位置: 首页>>代码示例>>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;未经允许,请勿转载。