Skip to content
Snippets Groups Projects
Commit 4dc9d216 authored by totten's avatar totten
Browse files

extern/rest.php - Refactor (in anticipation of producing better errors during bootstrap)

parent 23a66ec9
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,11 @@ class CRM_Utils_REST {
return self::output($result);
}
function bootAndRun() {
$this->loadCMSBootstrap();
return $this->run();
}
static function output(&$result) {
$hier = FALSE;
if (is_scalar($result)) {
......
......@@ -32,12 +32,10 @@ $config = CRM_Core_Config::singleton();
require_once 'CRM/Utils/REST.php';
$rest = new CRM_Utils_REST();
$rest->loadCMSBootstrap();
if (isset($_GET['json']) && $_GET['json']) {
header('Content-Type: text/javascript');
}
else {
header('Content-Type: text/xml');
}
echo $rest->run();
echo $rest->bootAndRun();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment