mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Use all controllers
This commit is contained in:
+3
-9
@@ -3,7 +3,7 @@
|
||||
// Init
|
||||
require_once __DIR__.'/init.php';
|
||||
|
||||
global $utopia, $request, $response, $register, $consoleDB, $project, $service;
|
||||
global $utopia, $request, $response, $register, $consoleDB, $project;
|
||||
|
||||
use Utopia\App;
|
||||
use Utopia\Request;
|
||||
@@ -426,14 +426,8 @@ $utopia->get('/.well-known/acme-challenge')
|
||||
}
|
||||
);
|
||||
|
||||
$name = APP_NAME;
|
||||
|
||||
if (\array_key_exists($service, $services)) { /** @noinspection PhpIncludeInspection */
|
||||
include_once $services[$service]['controller'];
|
||||
$name = APP_NAME.' '.\ucfirst($services[$service]['name']);
|
||||
} else {
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
include_once $services['/']['controller'];
|
||||
foreach($services as $key => $service) {
|
||||
include_once $services[$key]['controller'];
|
||||
}
|
||||
|
||||
$utopia->run($request, $response);
|
||||
+1
-11
@@ -20,14 +20,4 @@ $path = (isset($_GET['q'])) ? explode('/', $_GET['q']) : [];
|
||||
array_shift($path);
|
||||
$version = array_shift($path);
|
||||
|
||||
switch ($version) { // Switch between API version
|
||||
case 'v1':
|
||||
$service = $version . '/' . array_shift($path);
|
||||
include __DIR__ . '/../app/app.php';
|
||||
break;
|
||||
case 'console':
|
||||
default:
|
||||
$service = $version . '/';
|
||||
include __DIR__ . '/../app/app.php';
|
||||
break;
|
||||
}
|
||||
include __DIR__ . '/../app/app.php';
|
||||
|
||||
Reference in New Issue
Block a user