本文整理汇总了PHP中PMA_Error::isDisplayed方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Error::isDisplayed方法的具体用法?PHP PMA_Error::isDisplayed怎么用?PHP PMA_Error::isDisplayed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Error
的用法示例。
在下文中一共展示了PMA_Error::isDisplayed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __destruct
/**
* Destructor
*
* stores errors in session
*
*/
public function __destruct()
{
if (isset($_SESSION)) {
if (!isset($_SESSION['errors'])) {
$_SESSION['errors'] = array();
}
if ($GLOBALS['cfg']['Error_Handler']['gather']) {
// remember all errors
$_SESSION['errors'] = array_merge($_SESSION['errors'], $this->errors);
} else {
// remember only not displayed errors
foreach ($this->errors as $key => $error) {
/**
* We don't want to store all errors here as it would
* explode user session. In case you want them all set
* $GLOBALS['cfg']['Error_Handler']['gather'] to true
*/
if (count($_SESSION['errors']) >= 20) {
$error = new PMA_Error(0, __('Too many error messages, some are not displayed.'), __FILE__, __LINE__);
$_SESSION['errors'][$error->getHash()] = $error;
break;
} else {
if ($error instanceof PMA_Error && !$error->isDisplayed()) {
$_SESSION['errors'][$key] = $error;
}
}
}
}
}
}
示例2: __destruct
/**
* Destructor
*
* stores errors in session
*
*/
public function __destruct()
{
if (isset($_SESSION)) {
if (!isset($_SESSION['errors'])) {
$_SESSION['errors'] = array();
}
// remember only not displayed errors
foreach ($this->errors as $key => $error) {
/**
* We don't want to store all errors here as it would
* explode user session.
*/
if (count($_SESSION['errors']) >= 10) {
$error = new PMA_Error(0, __('Too many error messages, some are not displayed.'), __FILE__, __LINE__);
$_SESSION['errors'][$error->getHash()] = $error;
break;
} else {
if ($error instanceof PMA_Error && !$error->isDisplayed()) {
$_SESSION['errors'][$key] = $error;
}
}
}
}
}