本文整理汇总了PHP中ezcBaseException::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ezcBaseException::__construct方法的具体用法?PHP ezcBaseException::__construct怎么用?PHP ezcBaseException::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ezcBaseException
的用法示例。
在下文中一共展示了ezcBaseException::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* Constructs a new eZDFSFileHandlerTableNotFoundException
*
* @param string $sql The SQL query
* @param string $error The SQL error message
* @return void
*/
function __construct( $sql, $error )
{
$message = "Table not found when executing SQL '$sql' ".
"(error message: $error).\n" .
"Please review the cluster tables installation or configuration";
parent::__construct( $message );
}
示例2: array
/**
* Constructs a new ezcBaseAutoloadException for the $className that was
* searched for in the autoload files $fileNames from the directories
* specified in $dirs.
*
* @param string $className
* @param array(string) $files
* @param array(ezcBaseRepositoryDirectory) $dirs
*/
function __construct($className, $files, $dirs)
{
$paths = array();
foreach ($dirs as $dir) {
$paths[] = realpath($dir->autoloadPath);
}
parent::__construct("Could not find a class to file mapping for '{$className}'. Searched for " . implode(', ', $files) . " in: " . implode(', ', $paths));
}
示例3:
/**
* Constructs a new ezcBaseExtensionNotFoundException.
*
* @param string $name The name of the extension
* @param string $version The version of the extension
* @param string $message Additional text
*/
function __construct($name, $version = null, $message = null)
{
if ($version === null) {
parent::__construct("The extension '{$name}' could not be found. {$message}");
} else {
parent::__construct("The extension '{$name}' with version '{$version}' could not be found. {$message}");
}
}
示例4: gettype
/**
* Constructs a new ezcBaseValueException on the $name variable.
*
* @param string $settingName The name of the setting where something was
* wrong with.
* @param mixed $value The value that the option was tried to be set too.
* @param string $expectedValue A string explaining the allowed type and value range.
* @param string $variableType What type of variable was tried to be set (setting, argument).
*/
function __construct($settingName, $value, $expectedValue = null, $variableType = 'setting')
{
$type = gettype($value);
if (in_array($type, array('array', 'object', 'resource'))) {
$value = serialize($value);
}
$msg = "The value '{$value}' that you were trying to assign to {$variableType} '{$settingName}' is invalid.";
if ($expectedValue) {
$msg .= " Allowed values are: " . $expectedValue . '.';
}
parent::__construct($msg);
}
示例5: __construct
/**
* Constructs a new ezcLogWriterException with the original exception $e.
*
* @param Exception $e
*/
public function __construct(Exception $e)
{
$this->exception = $e;
parent::__construct($e->getMessage());
}
示例6:
/**
* Constructs a new ezcBaseWhateverException.
*
* @param string $what What happened?
* @param string $where Where did it happen?
* @param string $who Who is responsible?
* @param string $why Why did is happen?
* @access protected
* @return void
*/
function __construct($what, $where, $who, $why)
{
parent::__construct("Thanks for using eZ components. Hope you like it! Greetings from Amos, Derick, El Frederico, Ray and Toby.");
}
示例7:
/**
* Constructs a new eZDFSFileHandlerNFSMountPointNotFoundException
*
* @param string $path the mount point path
* @return void
*/
function __construct($path)
{
parent::__construct("Local DFS mount point '{$path}' is not writeable");
}
示例8: __construct
public function __construct($itemType, $itemValue)
{
$this->itemType = $itemType;
$this->itemValue = $itemValue;
parent::__construct("The requested {$itemType} item with ID {$itemValue} was not found");
}
示例9: __construct
public function __construct($url, $body)
{
$this->url = $url;
$this->body = $body;
parent::__construct("An error occured while parsing the fetched HTML");
}
示例10: __construct
/**
* Constructs a new ezcLogWrongSeverityException for severity $severity
*
* @param string $severity
*/
public function __construct($severity)
{
parent::__construct("There is no severity named '{$severity}'.");
}
示例11:
/**
* Constructs a new ezcReflectionCallToUndefinedMethodException.
*
* @param string $class
* @param string $method
* @return void
*/
function __construct($class, $method)
{
// TODO One could obtain a stacktrace and report file and line of the invocation
parent::__construct("Call to undefined method '{$class}::{$method}'.");
}
示例12: __construct
public function __construct( $url, $http_response_headers )
{
$this->url = $url;
$this->http_response_headers = $http_response_headers;
parent::__construct( "An HTTP error code was returned while fetching URL '$url'. Response headers: " . print_r( $http_response_headers, true ) );
}
示例13:
/**
* Constructs a new ezcBaseSettingNotFoundException for $settingName.
*
* @param string $settingName The name of the setting that does not exist.
*/
function __construct($settingName)
{
parent::__construct("The setting '{$settingName}' is not a valid configuration setting.");
}
示例14:
/**
* Constructs a new ezcBaseDoubleClassRepositoryPrefixException for the
* $prefix that points to $basePath with autoload directory
* $autoloadDirPath.
*
* @param string $prefix
* @param string $basePath
* @param string $autoloadDirPath
*/
function __construct($prefix, $basePath, $autoloadDirPath)
{
parent::__construct("The class repository in '{$basePath}' (with autoload dir '{$autoloadDirPath}') can not be added because another class repository already uses the prefix '{$prefix}'.");
}
示例15:
/**
* Constructs a new eZDFSFileHandlerNFSMountPointNotFoundException
*
* @param string $host The hostname
* @param string $user The username
* @param string $pass The password (will be displayed as *)
* @return void
*/
function __construct($path)
{
parent::__construct("Local DFS mount point '{$path}' does not exist");
}