本文整理汇总了PHP中BaseException::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseException::__construct方法的具体用法?PHP BaseException::__construct怎么用?PHP BaseException::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseException
的用法示例。
在下文中一共展示了BaseException::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(array $parameters = array())
{
parent::__construct($parameters);
$message = "ERROR: your backend is empty because you haven't configured any Doctrine entity to manage.\n\n";
$message .= "Solution: open your 'app/config/config.yml' file and configure the backend under the 'easy_admin' key.\n\n";
$this->setMessage($message);
}
示例2: __construct
public function __construct($message = "", $code = 404, Exception $previous = null)
{
if (empty($message)) {
$message = \JText::_('LIB_FOF_MODEL_ERR_COULDNOTLOAD');
}
parent::__construct($message, $code, $previous);
}
示例3: __construct
public function __construct($base, $path, $lang1, $country1, $lang2, $country2, $lang3, $country3, $code = 0, $prev = null)
{
$langs = array();
if (!empty($lang1)) {
if (empty($country1)) {
$langs[] = $lang1;
} else {
$langs[] = "{$lang1_}{$country1}";
}
}
if (!empty($lang2)) {
if (empty($country2)) {
$langs[] = $lang2;
} else {
$langs[] = "{$lang2_}{$country2}";
}
}
if (!empty($lang3)) {
if (empty($country3)) {
$langs[] = $lang3;
} else {
$langs[] = "{$lang3_}{$country3}";
}
}
parent::__construct("Language not found", "Languages " . implode(', ', $langs) . " and en_US not found for {$base} in {$path}", $code, $prev);
}
示例4: __construct
public function __construct(array $parameters = array())
{
parent::__construct($parameters);
$message = sprintf("ERROR: the requested '%s' action is not allowed for the '%s' entity.\n\n", $parameters['action'], $parameters['entity']);
$message .= sprintf("Solution: remove the '%s' action from the 'disabled_actions' option, which can be configured globally for the entire backend or locally for the '%s' entity.\n\n", $parameters['action'], $parameters['entity']);
$this->setMessage($message);
}
示例5: __construct
public function __construct($message = '', $code = 500, Exception $previous = null)
{
if (empty($message)) {
$message = \JText::_('LIB_FOF_MODEL_ERR_CANNOTLOCKNOTLOADEDRECORD');
}
parent::__construct($message, $code, $previous);
}
示例6: __construct
public function __construct(array $parameters = array())
{
parent::__construct($parameters);
$message = sprintf("ERROR: the '%s' entity is not defined in the configuration of your backend.\n\n", $parameters['entity_name']);
$message .= sprintf("Solution: open your 'app/config/config.yml' file and add the '%s' entity to the list of entities managed by EasyAdmin.\n\n", $parameters['entity_name']);
$this->setMessage($message);
}
示例7: __construct
/**
* NotFoundException constructor.
*
* @param string $detail
* @param string $title
* @param string $instance
* @param string $type
*/
public function __construct($detail, $title = '', $instance = '', $type = '')
{
$this->detail = $detail ?: $this->title;
$this->title = $title ?: $this->title;
$this->instance = $instance;
$this->type = $type;
parent::__construct($this->detail);
}
示例8: __construct
public function __construct($message, $code = 0, $messageToLogFile = NULL)
{
parent::__construct($message, $code, $messageToLogFile);
if (__ENABLE_DEBUG__ == 0) {
App::redirect('admin/mainside');
}
$this->errorDesignPath = 'error/index/index.tpl';
echo "<pre>";
echo $this->errorText;
die;
}
示例9:
function __construct($str, $info = null, $shift = 0)
{
$this->str = $str;
if (is_object($info)) {
$this->info['last_query'] = $info->last_query;
$this->info['mysql_error'] = mysql_error();
} else {
$this->info = $info;
}
parent::__construct("DBlite error: " . $this->str, null, $shift);
}
示例10: __construct
public function __construct($message, $code = 0, $messageToLogFile = NULL)
{
parent::__construct($message, $code, $messageToLogFile);
if (__ENABLE_DEBUG__ == 0) {
App::redirect('admin/mainside');
}
$this->errorDesignPath = 'error/index/index.tpl';
App::getModel('template')->assign('SHOP_NAME', App::getRegistry()->session->getActiveShopName());
App::getModel('template')->assign('error', preg_replace('/(\\n|\\r)+/', '\\n', nl2br(addslashes($this->errorText))));
App::getModel('template')->display($this->errorDesignPath);
die;
}
示例11: __construct
public function __construct($message, $code = 0, $messageToLogFile = NULL)
{
parent::__construct($message, $code, $messageToLogFile);
if (__ENABLE_DEBUG__ == 0) {
App::redirectSeo(App::getURLAdress());
}
App::getModel('template')->assign('SHOP_NAME', App::getRegistry()->session->getActiveShopName());
App::getModel('template')->assign('error', $this->errorText);
App::getModel('template')->assign('BASE_URL', App::getURLAdress());
App::getModel('template')->display('error/index/layout.tpl');
die;
}
示例12: htmlentities
function __construct($last_query = '', $message = null, $func = null, $shift = 1)
{
$last_query = htmlentities($last_query);
$mysql_error = mysql_error();
$cause = preg_replace('/.*near \'(.*)\' at line .*/', '\\1', $mysql_error);
if ($cause != $mysql_error) {
$last_query = str_replace($cause, "<font color=blue><b>" . $cause . "</b></font>", $last_query);
}
list($message) = explode('select', $message);
$msg = '<p>' . $message . '</p>';
if ($mysql_error) {
$msg .= ($last_query == '' ? "" : "<b>Last query:</b> <div style='border: 1px solid black'>" . $last_query . "</div>") . "<b>MySQL error:</b> <div style='border: 1px solid black'><font color=red>" . $mysql_error . "</font></div>";
}
parent::__construct($msg, $func, $shift);
}
示例13: __construct
/**
* @param string $error Short name of the error
* @param string $error_description Description of the error (optional)
* @param string $error_uri Uri of the error (optional)
* @param array $data Additional data sent to the exception (optional)
*/
public function __construct($error, $error_description = null, $error_uri = null, array $data = [])
{
parent::__construct(401, $error, $error_description, $error_uri);
if (!isset($data['schemes'])) {
throw new \InvalidArgumentException('schemes_not_defined');
}
$schemes = [];
foreach ($data['schemes'] as $scheme => $values) {
if (empty($values)) {
$schemes[] = $scheme;
} else {
$result = [];
foreach ($values as $key => $value) {
$result[] = sprintf('%s=%s', $key, $this->quote($value));
}
$schemes[] = $scheme . ' ' . implode(',', $result);
}
}
$this->header = ['WWW-Authenticate' => $schemes];
}
示例14: __construct
public function __construct($controller, $action, $message = "", \Exception $previous = null)
{
parent::__construct($message, Globals::EXCEPTION_ERROR_WEB, $previous);
$this->controller = $controller;
$this->action = $action;
}
示例15: __construct
public function __construct($message, $code = 0)
{
parent::__construct($message, $code);
}