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


PHP Error::__construct方法代码示例

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


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

示例1:

 /**
  * @param string $name
  * @param string|null $message
  */
 function __construct($name, $message = null)
 {
     if (empty($message)) {
         $message = "Param '{$name}' is required";
     }
     parent::__construct($message);
 }
开发者ID:activecollab,项目名称:shade,代码行数:11,代码来源:ParamRequiredError.php

示例2:

 /**
 * Construct the InvalidControllerActionError
 *
 * @access public
 * @param string $controller Controller name
 * @param string $action Controller action
 * @param string $message Error message, if NULL default will be used
 * @return InvalidControllerActionError
 */
 function __construct($controller, $action, $message = null) {
   if(is_null($message)) $message = "Invalid controller action $controller::$action()";
   parent::__construct($message);
   
   $this->setController($controller);
   $this->setAction($action);
 } // __construct
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:16,代码来源:InvalidControllerActionError.class.php

示例3:

 /**
 * Construct the FailedToMoveFileError
 *
 * @access public
 * @param string $from_path
 * @param string $to_path
 * @param string $message If NULL default message will be used
 * @return FailedToMoveFileError
 */
 function __construct($from_path, $to_path, $message = null) {
   if(is_null($message)) $message = "Failed to move file '$from_path' to '$to_path'";
   parent::__construct($message);
   
   $this->setFromPath($from_path);
   $this->setToPath($to_path);
 } // __construct
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:16,代码来源:FailedToMoveFileError.class.php

示例4:

 /**
  * @param string $name
  * @param string $expected_location
  * @param string|null $message
  */
 function __construct($name, $expected_location, $message = null)
 {
     if (empty($message)) {
         $message = "Theme '{$name}' was not found at '{$expected_location}'";
     }
     parent::__construct($message);
 }
开发者ID:activecollab,项目名称:shade,代码行数:12,代码来源:ThemeNotFoundError.php

示例5:

 /**
  * Construct the OwnerCompanyDnxError
  *
  * @param string $message
  * @return OwnerCompanyDnxError
  */
 function __construct($message = null)
 {
     if (is_null($message)) {
         $message = 'Owner company is not defined';
     }
     parent::__construct($message);
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:13,代码来源:OwnerCompanyDnxError.class.php

示例6: switch

 /**
  * Constructor
  *
  * @param void
  * @return UploadError
  */
 function __construct($code)
 {
     switch ($code) {
         case UPLOAD_ERR_INI_SIZE:
             $message = 'The uploaded file exceeds the upload_max_filesize directive in php.ini';
             break;
         case UPLOAD_ERR_FORM_SIZE:
             $message = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';
             break;
         case UPLOAD_ERR_PARTIAL:
             $message = 'The uploaded file was only partially uploaded';
             break;
         case UPLOAD_ERR_NO_FILE:
             $message = 'No file was uploaded';
             break;
         case UPLOAD_ERR_NO_TMP_DIR:
             $message = 'Missing a temporary folder';
             break;
         case UPLOAD_ERR_CANT_WRITE:
             $message = 'Failed to write file to disk';
             break;
         case UPLOAD_ERR_EXTENSION:
             $message = 'File upload stopped by extension';
             break;
         default:
             $message = 'Unknown file upload error';
     }
     // switch
     parent::__construct($message);
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:36,代码来源:UploadError.class.php

示例7:

 /**
  * @param string $expected_location
  * @param string|null $message
  */
 function __construct($expected_location, $message = null)
 {
     if (empty($message)) {
         $message = "Temp folder not found at '{$expected_location}'";
     }
     parent::__construct($message);
 }
开发者ID:activecollab,项目名称:shade,代码行数:11,代码来源:TempNotFoundError.php

示例8:

 /**
  * @param string $expected_location
  * @param string|null $message
  */
 function __construct($expected_location, $message = null)
 {
     if (empty($message)) {
         $message = "File '{$expected_location}' was not found";
     }
     parent::__construct($message);
 }
开发者ID:activecollab,项目名称:shade,代码行数:11,代码来源:ElementFileNotFoundError.php

示例9: __construct

 /**
  * @param \Exception $exception
  */
 public function __construct(\Exception $exception)
 {
     parent::__construct($exception);
     $this->fileName = $exception->getFile();
     $this->line = $exception->getLine();
     $this->trace = $exception->getTraceAsString();
 }
开发者ID:phprest,项目名称:phprest,代码行数:10,代码来源:DebugError.php

示例10:

 /**
 * Constructor
 *
 * @param array $errors Array of errors
 * @param string $message If NULL default message will be used
 * @return FormSubmissionErrors
 */
 function __construct($errors, $message = null) {
   if(is_null($message)) {
     $message = 'Form submission failed';
   } // if
   parent::__construct($message);
   $this->setErrors($errors);
 } // __construct
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:14,代码来源:FormSubmissionErrors.class.php

示例11: switch

 /**
  * Construct exception instance
  *
  * @param string $json
  * @param int $json_error
  * @param string|null $message
  */
 function __construct($json, $json_error, $message = null)
 {
     $this->json = $json;
     $this->json_error = $json_error;
     if (empty($message)) {
         switch ($json_error) {
             case JSON_ERROR_DEPTH:
                 $message = 'The maximum stack depth has been exceeded';
                 break;
             case JSON_ERROR_STATE_MISMATCH:
                 $message = 'Invalid or malformed JSON';
                 break;
             case JSON_ERROR_CTRL_CHAR:
                 $message = 'Control character error, possibly incorrectly encoded';
                 break;
             case JSON_ERROR_SYNTAX:
                 $message = 'Syntax error';
                 break;
             case JSON_ERROR_UTF8:
                 $message = 'Malformed UTF-8 characters, possibly incorrectly encoded';
                 break;
             default:
                 if (defined('JSON_ERROR_RECURSION') && $json_error === JSON_ERROR_RECURSION) {
                     $message = 'One or more recursive references in the value to be encoded';
                 } elseif (defined('JSON_ERROR_INF_OR_NAN') && $json_error === JSON_ERROR_INF_OR_NAN) {
                     $message = 'One or more NAN or INF values in the value to be encoded';
                 } elseif (defined('JSON_ERROR_UNSUPPORTED_TYPE') && $json_error === JSON_ERROR_UNSUPPORTED_TYPE) {
                     $message = 'A value of a type that cannot be encoded was given';
                 } else {
                     $message = 'Failed to parse JSON';
                 }
         }
     }
     parent::__construct($message);
 }
开发者ID:activecollab,项目名称:shade,代码行数:42,代码来源:ParseJsonError.php

示例12: __construct

 /**
  * Construct the FileDnxError.
  *
  * @param string $file_path
  * @param string $message
  */
 public function __construct($file_path, $message = null)
 {
     if (is_null($message)) {
         $message = "File '{$file_path}' doesn't exists";
     }
     parent::__construct($message, ['path' => $file_path]);
 }
开发者ID:activecollab,项目名称:logger,代码行数:13,代码来源:FileDnxError.php

示例13:

 /**
  * Construct the AdministratorDnxError
  *
  * @param string $message
  * @return AdministratorDnxError
  */
 function __construct($message = null)
 {
     if (is_null($message)) {
         $message = 'Administrator account is not defined';
     }
     parent::__construct($message);
 }
开发者ID:469306621,项目名称:Languages,代码行数:13,代码来源:AdministratorDnxError.class.php

示例14:

 /**
  * Construct the DirDnxError
  *
  * @access public
  * @param string $dir_path
  * @param string $message
  * @return DirDnxError
  */
 function __construct($dir_path, $message = null)
 {
     if (is_null($message)) {
         $message = "Directory '{$dir_path}' doesn't exists";
     }
     parent::__construct($message);
     $this->setDirPath($dir_path);
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:16,代码来源:DirDnxError.class.php

示例15:

 /**
  * Construct the ImageTypeNotSupportedError
  *
  * @access public
  * @param void
  * @return ImageTypeNotSupportedError
  */
 function __construct($file_path, $type_value, $message = null)
 {
     if (is_null($message)) {
         $message = "This type of image is not supported. SimpleGD supports only PNG, JPG and GIF image types. Type: {$type_value}";
     }
     parent::__construct($message);
     $this->setFilePath($file_path);
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:15,代码来源:ImageTypeNotSupportedError.class.php


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