protected function views_xml_backend_plugin_query_xml::errorStop in Views XML Backend 6
Same name and namespace in other branches
- 7 views_xml_backend_plugin_query_xml.inc \views_xml_backend_plugin_query_xml::errorStop()
Stop custom error handling.
Parameters
bool $use: The previous value of use_errors.
bool $print: (Optional) Whether to print errors to the screen. Defaults to TRUE.
1 call to views_xml_backend_plugin_query_xml::errorStop()
- views_xml_backend_plugin_query_xml::execute in ./
views_xml_backend_plugin_query_xml.inc - Executes the query and fills the associated view object with according values.
File
- ./
views_xml_backend_plugin_query_xml.inc, line 367 - Query plugin for views_xml_backend.
Class
- views_xml_backend_plugin_query_xml
- @file Query plugin for views_xml_backend.
Code
protected function errorStop($use, $print = TRUE) {
if ($print) {
foreach (libxml_get_errors() as $error) {
switch ($error->level) {
case LIBXML_ERR_WARNING:
case LIBXML_ERR_ERROR:
$type = 'warning';
break;
case LIBXML_ERR_FATAL:
$type = 'error';
break;
}
$message = t('Views XML Backend: %error on line %num. Error code: %code', array(
'%error' => trim($error->message),
'%num' => $error->line,
'%code' => $error->code,
));
drupal_set_message($message, $type, FALSE);
}
}
libxml_clear_errors();
libxml_use_internal_errors($use);
}