本文整理汇总了PHP中Backend::getSuccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Backend::getSuccess方法的具体用法?PHP Backend::getSuccess怎么用?PHP Backend::getSuccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Backend
的用法示例。
在下文中一共展示了Backend::getSuccess方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hook_output
public static function hook_output($to_print)
{
//Construct the object to output
$object = new StdClass();
$object->result = $to_print;
$object->error = Backend::getError();
$object->notice = Backend::getNotice();
$object->success = Backend::getSuccess();
$object->content = Backend::getContent();
$last = '';
while (ob_get_level() > self::$ob_level) {
//Ending the ob_start from __construct
$last .= ob_get_clean();
}
$object->output = $last;
//Clean up
Backend::setError();
Backend::setNotice();
Backend::setSuccess();
//Return the XML
$options = array(XML_SERIALIZER_OPTION_INDENT => "\t", XML_SERIALIZER_OPTION_RETURN_RESULT => true, XML_SERIALIZER_OPTION_DEFAULT_TAG => 'item', XML_SERIALIZER_OPTION_XML_DECL_ENABLED => true, XML_SERIALIZER_OPTION_XML_ENCODING => Controller::$view->charset, XML_SERIALIZER_OPTION_ROOT_NAME => 'XmlResult', XML_SERIALIZER_OPTION_TYPEHINTS => true);
$serializer = new XML_Serializer($options);
if ($result = @$serializer->serialize($object)) {
return $result;
} else {
return null;
}
}
示例2: hook_output
public static function hook_output($to_print)
{
Backend::add('BackendErrors', Backend::getError());
Backend::add('BackendSuccess', Backend::getSuccess());
Backend::add('BackendNotices', Backend::getNotice());
Backend::add('BackendInfo', Backend::getInfo());
Backend::setError();
Backend::setSuccess();
Backend::setNotice();
Backend::setInfo();
$content = Backend::getContent();
if (empty($content)) {
ob_start();
var_dump($to_print);
$content = ob_get_clean();
if (substr($content, 0, 4) != '<pre') {
$content = '<pre>' . $content . '</pre>';
}
Backend::addContent($content);
}
$layout = Backend::get('HTMLLayout', 'index');
if (!Render::checkTemplateFile($layout . '.tpl.php')) {
if (SITE_STATE != 'production') {
Backend::addError('Missing Layout ' . $layout);
}
$layout = 'index';
}
$to_print = Render::file($layout . '.tpl.php');
$to_print = self::addLastContent($to_print);
$to_print = self::replace($to_print);
$to_print = self::rewriteLinks($to_print);
$to_print = self::addLinks($to_print);
$to_print = self::formsAcceptCharset($to_print);
//TODO fix this
if (Component::isActive('BackendFilter')) {
$BEFilter = new BEFilterObj();
$BEFilter->read();
$filters = $BEFilter->list ? $BEFilter->list : array();
foreach ($filters as $row) {
if (class_exists($row['class'], true) && is_callable(array($row['class'], $row['function']))) {
$to_print = call_user_func(array($row['class'], $row['function']), $to_print);
}
}
}
//TODO Make this configurable
if (ConfigValue::get('html_view.TidyHTML') && function_exists('tidy_repair_string')) {
$to_print = tidy_repair_string($to_print);
}
return $to_print;
}
示例3: hook_output
public static function hook_output($to_print)
{
Backend::add('BackendErrors', Backend::getError());
Backend::add('BackendSuccess', Backend::getSuccess());
Backend::add('BackendNotices', Backend::getNotice());
Backend::add('BackendInfo', Backend::getInfo());
Backend::setError();
Backend::setSuccess();
Backend::setNotice();
Backend::setInfo();
$content = Backend::getContent();
if (empty($content)) {
ob_start();
var_dump($to_print);
$content = ob_get_clean();
if (substr($content, 0, 4) != '<pre') {
$content = '<pre>' . $content . '</pre>';
}
Backend::addContent($content);
}
$to_print = Render::renderFile('styles.area.tpl.php');
$to_print .= Render::renderFile('maincontent.tpl.php');
$to_print .= Render::renderFile('scripts.tpl.php');
$to_print = HtmlView::addLastContent($to_print);
$to_print = HtmlView::replace($to_print);
$to_print = HtmlView::rewriteLinks($to_print);
$to_print = HtmlView::addLinks($to_print);
$to_print = HtmlView::formsAcceptCharset($to_print);
if (Component::isActive('BackendFilter')) {
$BEFilter = new BEFilterObj();
$BEFilter->read();
$filters = $BEFilter->list ? $BEFilter->list : array();
foreach ($filters as $row) {
if (class_exists($row['class'], true) && is_callable(array($row['class'], $row['function']))) {
$to_print = call_user_func(array($row['class'], $row['function']), $to_print);
}
}
}
return $to_print;
}
示例4: hook_output
public static function hook_output($to_print)
{
//Construct the object to output
$object = new stdClass();
$object->result = $to_print;
$object->error = Backend::getError();
$object->notice = Backend::getNotice();
$object->success = Backend::getSuccess();
$object->info = Backend::getInfo();
$object->content = Backend::getContent();
$last = '';
while (ob_get_level() > self::$ob_level) {
//Ending the ob_start from __construct
$last .= ob_get_clean();
}
$object->output = $last;
//Clean up
Backend::setError();
Backend::setNotice();
Backend::setSuccess();
Backend::setInfo();
//$result_only = Controller::getVar('result_only');
return json_encode($object);
}
示例5: finish
/**
* This function get's called via register_shutdown_function when the script finishes or exit is called
*/
public static function finish()
{
if (self::$init) {
Hook::run('finish', 'pre');
$_SESSION['error'] = Backend::getError();
$_SESSION['notice'] = Backend::getNotice();
$_SESSION['success'] = Backend::getSuccess();
if (!empty(self::$view)) {
if (empty($_SESSION['previous_url']) || !is_array($_SESSION['previous_url'])) {
$_SESSION['previous_url'] = array();
}
if (array_key_exists('REQUEST_URI', $_SERVER)) {
$_SESSION['previous_url'][self::$view->mode] = $_SERVER['REQUEST_URI'];
}
if (empty($_SESSION['previous_area']) || !is_array($_SESSION['previous_area'])) {
$_SESSION['previous_area'] = array();
}
$_SESSION['previous_area'][self::$view->mode] = self::$area;
if (empty($_SESSION['previous_action']) || !is_array($_SESSION['previous_action'])) {
$_SESSION['previous_action'] = array();
}
$_SESSION['previous_action'][self::$view->mode] = self::$action;
if (empty($_SESSION['previous_parameters']) || !is_array($_SESSION['previous_parameters'])) {
$_SESSION['previous_parameters'] = array();
}
$_SESSION['previous_parameters'][self::$view->mode] = self::$parameters;
}
//Check if we encountered a fatal error
if ($last_error = error_get_last()) {
if ($last_error['type'] === E_ERROR && SITE_STATE == 'production') {
$id = send_email(ConfigValue::get('author.Email', ConfigValue::get('Email', 'info@' . SITE_DOMAIN)), 'Fatal PHP Error in ' . ConfigValue::get('Title', 'Application'), 'Error: ' . var_export($last_error, true) . PHP_EOL . 'Query: ' . self::$query_string . PHP_EOL . 'Payload: ' . var_export(self::$payload, true));
}
}
//Clean up
self::$query_string = false;
self::$query_vars = array();
self::$method = null;
self::$payload = false;
self::$area = 'home';
self::$action = 'index';
self::$parameters = array();
self::$salt = false;
self::$view = false;
self::$started = false;
self::$init = false;
self::$firephp = false;
self::$whoopsed = false;
Backend::shutdown();
Hook::run('finish', 'post');
while (ob_get_level() > self::$ob_level) {
ob_end_flush();
}
}
self::$init = false;
}