updating rest dispatching method on bootstrap

This commit is contained in:
Erik Amaru Ortiz
2013-09-11 10:12:44 -04:00
parent b0e98a9af7
commit 29fe5cf83a

View File

@@ -1036,7 +1036,7 @@ class Bootstrap
}
return $res;
}
//use Luracast\Restler\Format\XmlFormat as XmlFormat;
/**
* This method dispatch rest/api service
*
@@ -1059,11 +1059,19 @@ class Bootstrap
require_once PATH_CORE . "classes" . PATH_SEP . "class.api.php";
\ProcessMaker\Api::setWorkspace(SYS_SYS);
//var_dump($apiDir . 'oauth2/views'); die;
Luracast\Restler\Format\HtmlFormat::$viewPath = $servicesDir . 'oauth2/views';
require_once $servicesDir . 'oauth2/Server.php';
$rest = new Luracast\Restler\Restler();
$rest->setAPIVersion('1.0');
$rest->setSupportedFormats('JsonFormat', 'XmlFormat');//, 'HtmlFormat');
$rest->addAuthenticationClass('Api\\OAuth2\\Server', '');
$rest->setSupportedFormats('JsonFormat', 'XmlFormat'); //, 'HtmlFormat');
//$rest->setOverridingFormats('UploadFormat', 'JsonFormat', 'XmlFormat', 'HtmlFormat');
$rest->setOverridingFormats('HtmlFormat');
$_SERVER['REQUEST_URI'] = $uri;
@@ -1082,10 +1090,6 @@ class Bootstrap
$rest->handleError(500);
}
//Luracast\Restler\Format\HtmlFormat::$viewPath = $apiDir . 'oauth2/views';
//require_once $apiDir . 'oauth2/Server.php';
//$rest->addAuthenticationClass('Api\\OAuth2\\Server', '');
$rest->handle();