mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Updated controllers naming
This commit is contained in:
+14
-14
@@ -3,96 +3,96 @@
|
||||
return [
|
||||
'/' => [
|
||||
'name' => 'Homepage',
|
||||
'controller' => 'controllers/web/home.php',
|
||||
'controller' => 'web/home.php',
|
||||
'sdk' => false,
|
||||
'tests' => false,
|
||||
],
|
||||
'console/' => [
|
||||
'name' => 'Console',
|
||||
'controller' => 'controllers/web/console.php',
|
||||
'controller' => 'web/console.php',
|
||||
'sdk' => false,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/account' => [
|
||||
'name' => 'Account',
|
||||
'description' => '/docs/services/account.md',
|
||||
'controller' => 'controllers/api/account.php',
|
||||
'controller' => 'api/account.php',
|
||||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/avatars' => [
|
||||
'name' => 'Avatars',
|
||||
'description' => '/docs/services/avatars.md',
|
||||
'controller' => 'controllers/api/avatars.php',
|
||||
'controller' => 'api/avatars.php',
|
||||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/database' => [
|
||||
'name' => 'Database',
|
||||
'description' => '/docs/services/database.md',
|
||||
'controller' => 'controllers/api/database.php',
|
||||
'controller' => 'api/database.php',
|
||||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/locale' => [
|
||||
'name' => 'Locale',
|
||||
'description' => '/docs/services/locale.md',
|
||||
'controller' => 'controllers/api/locale.php',
|
||||
'controller' => 'api/locale.php',
|
||||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/health' => [
|
||||
'name' => 'Health',
|
||||
'description' => '/docs/services/health.md',
|
||||
'controller' => 'controllers/api/health.php',
|
||||
'controller' => 'api/health.php',
|
||||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/projects' => [
|
||||
'name' => 'Projects',
|
||||
'controller' => 'controllers/api/projects.php',
|
||||
'controller' => 'api/projects.php',
|
||||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/storage' => [
|
||||
'name' => 'Storage',
|
||||
'description' => '/docs/services/storage.md',
|
||||
'controller' => 'controllers/api/storage.php',
|
||||
'controller' => 'api/storage.php',
|
||||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/teams' => [
|
||||
'name' => 'Teams',
|
||||
'description' => '/docs/services/teams.md',
|
||||
'controller' => 'controllers/api/teams.php',
|
||||
'controller' => 'api/teams.php',
|
||||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/users' => [
|
||||
'name' => 'Users',
|
||||
'description' => '/docs/services/users.md',
|
||||
'controller' => 'controllers/api/users.php',
|
||||
'controller' => 'api/users.php',
|
||||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/functions' => [
|
||||
'name' => 'Users',
|
||||
'description' => '/docs/services/functions.md',
|
||||
'controller' => 'controllers/api/functions.php',
|
||||
'controller' => 'api/functions.php',
|
||||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/mock' => [
|
||||
'name' => 'Mock',
|
||||
'description' => '',
|
||||
'controller' => 'controllers/mock.php',
|
||||
'controller' => 'mock.php',
|
||||
'sdk' => false,
|
||||
'tests' => true,
|
||||
],
|
||||
'v1/graphql' => [
|
||||
'name' => 'GraphQL',
|
||||
'description' => 'GraphQL Endpoint',
|
||||
'controller' => 'controllers/api/graphql.php',
|
||||
'controller' => 'api/graphql.php',
|
||||
'sdk' => false,
|
||||
'tests' => false,
|
||||
],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/init.php';
|
||||
require_once __DIR__.'/../init.php';
|
||||
|
||||
use Utopia\App;
|
||||
use Appwrite\Swoole\Request;
|
||||
@@ -460,8 +460,8 @@ App::get('/.well-known/acme-challenge')
|
||||
$response->text($content);
|
||||
}, ['request', 'response']);
|
||||
|
||||
include_once __DIR__ . '/controllers/shared/api.php';
|
||||
include_once __DIR__ . '/controllers/shared/web.php';
|
||||
include_once __DIR__ . '/shared/api.php';
|
||||
include_once __DIR__ . '/shared/web.php';
|
||||
|
||||
foreach(Config::getParam('services', []) as $service) {
|
||||
include_once $service['controller'];
|
||||
+1
-1
@@ -63,7 +63,7 @@ $http->on('start', function (Server $http) use ($payloadSize) {
|
||||
|
||||
Files::load(__DIR__ . '/../public');
|
||||
|
||||
include __DIR__ . '/app.php';
|
||||
include __DIR__ . '/controllers/general.php';
|
||||
|
||||
$domain = App::getEnv('_APP_DOMAIN', '');
|
||||
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ if (file_exists(__DIR__.'/../vendor/autoload.php')) {
|
||||
|
||||
use Appwrite\Preloader\Preloader;
|
||||
|
||||
include 'init.php';
|
||||
include 'app.php';
|
||||
include './init.php';
|
||||
include './controllers/general.php';
|
||||
|
||||
(new Preloader())
|
||||
->paths(realpath(__DIR__ . '/../app/config'))
|
||||
|
||||
+17
-16
@@ -17,7 +17,7 @@ $cli
|
||||
* 2.2. Get ENV vars
|
||||
* 2.2.1 Fetch from older docker-compose.yml file
|
||||
* 2.2.2 Fetch from older .env file (manually parse)
|
||||
* 2.3 Use old ENV vars as default values
|
||||
* 2.3 Use old ENV vars as default values
|
||||
* 2.4 Ask for all required vars not given as CLI args and if in interactive mode
|
||||
* Otherwise, just use default vars. - DONE
|
||||
* 3. Ask user to backup important volumes, env vars, and SQL tables
|
||||
@@ -26,21 +26,16 @@ $cli
|
||||
* 5. Run docker-compose up -d - DONE
|
||||
* 6. Run data migration
|
||||
*/
|
||||
|
||||
$vars = Config::getParam('variables');
|
||||
|
||||
Console::success('Starting Appwrite installation...');
|
||||
|
||||
if(!empty($httpPort)) {
|
||||
$httpPort = Console::confirm('Choose your server HTTP port: (default: 80)');
|
||||
$httpPort = ($httpPort) ? $httpPort : 80;
|
||||
}
|
||||
|
||||
if(!empty($httpsPort)) {
|
||||
$httpsPort = Console::confirm('Choose your server HTTPS port: (default: 443)');
|
||||
$httpsPort = ($httpsPort) ? $httpsPort : 443;
|
||||
}
|
||||
|
||||
$httpPort = Console::confirm('Choose your server HTTP port: (default: 80)');
|
||||
$httpPort = ($httpPort) ? $httpPort : 80;
|
||||
|
||||
$httpsPort = Console::confirm('Choose your server HTTPS port: (default: 443)');
|
||||
$httpsPort = ($httpsPort) ? $httpsPort : 443;
|
||||
|
||||
$input = [];
|
||||
|
||||
foreach($vars as $key => $var) {
|
||||
@@ -56,8 +51,8 @@ $cli
|
||||
}
|
||||
}
|
||||
|
||||
$templateForCompose = new View('../views/install/compose.phtml');
|
||||
$templateForEnv = new View('../views/install/env.phtml');
|
||||
$templateForCompose = new View(__DIR__.'/../views/install/compose.phtml');
|
||||
$templateForEnv = new View(__DIR__.'/../views/install/env.phtml');
|
||||
|
||||
$templateForCompose
|
||||
->setParam('httpPort', $httpPort)
|
||||
@@ -71,12 +66,12 @@ $cli
|
||||
|
||||
$path = '/usr/src/code';
|
||||
|
||||
if(!file_put_contents($path.'/docker-compose.yml', $templateForCompose->render())) {
|
||||
if(!file_put_contents($path.'/docker-compose.yml', $templateForCompose->render(false))) {
|
||||
Console::error('Failed to save Docker Compose file');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(!file_put_contents($path.'/.env', $templateForEnv->render())) {
|
||||
if(!file_put_contents($path.'/.env', $templateForEnv->render(false))) {
|
||||
Console::error('Failed to save environment variables file');
|
||||
exit(1);
|
||||
}
|
||||
@@ -91,4 +86,10 @@ $cli
|
||||
} else {
|
||||
Console::success("Appwrite installed successfully");
|
||||
}
|
||||
|
||||
$files1 = scandir($path);
|
||||
|
||||
var_dump($files1);
|
||||
var_dump(file_get_contents($path.'/.env'));
|
||||
var_dump(file_get_contents($path.'/docker-compose.yml'));
|
||||
});
|
||||
+1
-1
@@ -20,7 +20,7 @@ ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
//trigger_error('hide errors in prod', E_USER_NOTICE);
|
||||
|
||||
include __DIR__ . '/../app/app.php';
|
||||
include __DIR__ . '/../app/controllers/general.php';
|
||||
|
||||
$app = new App('Asia/Tel_Aviv');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user