Commit 4dc9d216 authored by totten's avatar totten

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

parent 23a66ec9
......@@ -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();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment