Permalink
Browse files

Move all routes JSON definitions inside core.ajaxplorer/routes/ folder

  • Loading branch information...
1 parent 9a8fd54 commit bfa63f172fc92d105188463a901c826877569d9c @cdujeu cdujeu committed Oct 13, 2016
@@ -66,7 +66,7 @@ public function __construct($base, $cacheOptions = []){
*/
public function configureRoutes(\FastRoute\RouteCollector &$r){
- $configObject = json_decode(file_get_contents(AJXP_INSTALL_PATH . "/" . AJXP_DOCS_FOLDER . "/api2.json"), true);
+ $configObject = json_decode(file_get_contents(AJXP_INSTALL_PATH . "/" . AJXP_PLUGINS_FOLDER . "/core.ajaxplorer/routes/api2.json"), true);
foreach ($configObject["paths"] as $path => $methods){
foreach($methods as $method => $apiData){
if(preg_match('/\{path\}/', $path)){
@@ -69,7 +69,7 @@ public function __construct($cacheOptions = []){
public function configureRoutes($base, RouteCollector &$r){
$allMethods = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'TRACE', 'OPTIONS', 'CONNECT', 'PATCH', 'PROPFIND', 'PROPPATCH', 'MKCOL', 'COPY', 'MOVE', 'LOCK', 'UNLOCK'];
- $file = AJXP_INSTALL_PATH."/".AJXP_PLUGINS_FOLDER."/core.ajaxplorer/routes.json";
+ $file = AJXP_INSTALL_PATH."/".AJXP_PLUGINS_FOLDER."/core.ajaxplorer/routes/main.json";
$textContent = file_get_contents($file);
$textContent = str_replace("%PUBLIC_BASEURI%", ConfService::getGlobalConf("PUBLIC_BASEURI"), $textContent);
$textContent = str_replace("%WEBDAV_BASEURI%", ConfService::getGlobalConf("WEBDAV_BASEURI"), $textContent);
@@ -64,7 +64,7 @@ public function __construct($base, $cacheOptions = []){
*/
public function configureRoutes(RouteCollector &$r){
- $configObject = json_decode(file_get_contents(AJXP_INSTALL_PATH . "/" . AJXP_DOCS_FOLDER . "/wopi.json"), true);
+ $configObject = json_decode(file_get_contents(AJXP_INSTALL_PATH . "/" . AJXP_PLUGINS_FOLDER . "/core.ajaxplorer/routes/wopi.json"), true);
foreach ($configObject["paths"] as $path => $methods){
foreach($methods as $method => $apiData){

0 comments on commit bfa63f1

Please sign in to comment.