mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 00:18:25 +00:00
Use all controllers
This commit is contained in:
parent
1e3472b724
commit
7a277c3b6a
2 changed files with 4 additions and 20 deletions
12
app/app.php
12
app/app.php
|
|
@ -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);
|
||||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Reference in a new issue