本文整理汇总了PHP中Framework::control方法的典型用法代码示例。如果您正苦于以下问题:PHP Framework::control方法的具体用法?PHP Framework::control怎么用?PHP Framework::control使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework
的用法示例。
在下文中一共展示了Framework::control方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
public static function handle($e, $override = array())
{
if (isset($override['message'])) {
$message = $override['message'];
} else {
$message = $e->getMessage();
}
if (isset($override['code'])) {
$code = $override['code'];
} else {
$code = $e->getCode();
}
if (isset($override['line'])) {
$line = $override['line'];
} else {
$line = $e->getLine();
}
if (isset($override['file'])) {
$file = $override['file'];
} else {
$file = $e->getFile();
}
// check if inline errors are enabled and the error is not fatal
// if (self::$inlineErrors === true && in_array($code, array(2, 4, 8, 32, 128, 256, 1024, 2048, 4096, 8192, 16384))) {
// echo nl2br($message);
// echo '<br />' . $file . ' on line ' . $line;
// return;
// }
// clean output buffer
if (ob_get_level() > 0) {
ob_clean();
}
if (self::$debugMode === true) {
// get random snippet
$snippet = self::$funSnippets[rand(0, count(self::$funSnippets) - 1)];
// call error controller and pass information
$message = array('exception' => get_class($e), 'error' => nl2br($message), 'backtrace' => $e->getTraceAsString(), 'snippet' => $snippet, 'line' => $line, 'code' => $code, 'file' => $file);
if (!isset($_SERVER['SHELL'])) {
require 'madeam/src/madeam/exception/template.html.php';
} else {
require 'madeam/src/madeam/exception/template.shell.php';
}
exit;
} else {
// return 404 error page
$params = array('_controller' => 'error', '_action' => 'http404', '_method' => 'get', '_layout' => 1, '_format' => 'html');
echo Framework::control($params);
}
}