diff --git a/app/controllers/general.php b/app/controllers/general.php index e75b2f216..2b52a03db 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -5,7 +5,7 @@ require_once __DIR__.'/../init.php'; use Utopia\App; use Utopia\Swoole\Request; use Appwrite\Utopia\Response; -use Utopia\View; +use Appwrite\Utopia\View; use Utopia\Exception; use Utopia\Config\Config; use Utopia\Domains\Domain; @@ -298,7 +298,7 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) { /** @var Utopia\App $utopia */ /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ /** @var Utopia\Database\Document $project */ if ($error instanceof PDOException) { diff --git a/app/controllers/shared/web.php b/app/controllers/shared/web.php index 3ebc41080..37bfb0130 100644 --- a/app/controllers/shared/web.php +++ b/app/controllers/shared/web.php @@ -7,7 +7,7 @@ App::init(function ($utopia, $request, $response, $layout) { /** @var Utopia\App $utopia */ /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ /* AJAX check */ if (!empty($request->getQuery('version', ''))) { diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index d17836fde..2a74f7052 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -1,14 +1,14 @@ setParam('description', 'Appwrite Console allows you to easily manage, monitor, and control your entire backend API and tools.') @@ -18,7 +18,7 @@ App::init(function ($layout) { App::shutdown(function ($response, $layout) { /** @var Appwrite\Utopia\Response $response */ - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $header = new View(__DIR__.'/../../views/console/comps/header.phtml'); $footer = new View(__DIR__.'/../../views/console/comps/footer.phtml'); @@ -43,7 +43,7 @@ App::get('/error/:code') ->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false) ->inject('layout') ->action(function ($code, $layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/error.phtml'); @@ -62,7 +62,7 @@ App::get('/console') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/index.phtml'); @@ -81,7 +81,7 @@ App::get('/console/account') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/account/index.phtml'); @@ -102,7 +102,7 @@ App::get('/console/notifications') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/v1/console/notifications/index.phtml'); @@ -117,7 +117,7 @@ App::get('/console/home') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/home/index.phtml'); $page @@ -133,7 +133,7 @@ App::get('/console/settings') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $target = new Domain(App::getEnv('_APP_DOMAIN_TARGET', '')); @@ -157,7 +157,7 @@ App::get('/console/webhooks') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/webhooks/index.phtml'); @@ -176,7 +176,7 @@ App::get('/console/keys') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $scopes = array_keys(Config::getParam('scopes')); $page = new View(__DIR__.'/../../views/console/keys/index.phtml'); @@ -194,7 +194,7 @@ App::get('/console/database') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/database/index.phtml'); @@ -212,7 +212,7 @@ App::get('/console/database/collection') ->inject('layout') ->action(function ($id, $response, $layout) { /** @var Appwrite\Utopia\Response $response */ - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $logs = new View(__DIR__.'/../../views/console/comps/logs.phtml'); @@ -247,7 +247,7 @@ App::get('/console/database/document') ->param('collection', '', new UID(), 'Collection unique ID.') ->inject('layout') ->action(function ($collection, $layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $logs = new View(__DIR__.'/../../views/console/comps/logs.phtml'); @@ -280,7 +280,7 @@ App::get('/console/database/document/new') ->param('collection', '', new UID(), 'Collection unique ID.') ->inject('layout') ->action(function ($collection, $layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/database/document.phtml'); @@ -301,7 +301,7 @@ App::get('/console/storage') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/storage/index.phtml'); $page @@ -321,7 +321,7 @@ App::get('/console/users') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/users/index.phtml'); @@ -342,7 +342,7 @@ App::get('/console/users/user') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/users/user.phtml'); @@ -357,7 +357,7 @@ App::get('/console/users/teams/team') ->label('scope', 'console') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/users/team.phtml'); diff --git a/app/controllers/web/home.php b/app/controllers/web/home.php index 59d03a033..97389b894 100644 --- a/app/controllers/web/home.php +++ b/app/controllers/web/home.php @@ -3,15 +3,15 @@ use Appwrite\Specification\Format\OpenAPI3; use Appwrite\Specification\Format\Swagger2; use Appwrite\Specification\Specification; +use Appwrite\Utopia\View; use Utopia\App; -use Utopia\View; use Utopia\Config\Config; use Utopia\Exception; use Utopia\Validator\Range; use Utopia\Validator\WhiteList; App::init(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $header = new View(__DIR__.'/../../views/home/comps/header.phtml'); $footer = new View(__DIR__.'/../../views/home/comps/footer.phtml'); @@ -32,7 +32,7 @@ App::init(function ($layout) { App::shutdown(function ($response, $layout) { /** @var Appwrite\Utopia\Response $response */ - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $response->html($layout->render()); }, ['response', 'layout'], 'home'); @@ -76,7 +76,7 @@ App::get('/auth/signin') ->label('scope', 'home') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/signin.phtml'); @@ -95,7 +95,7 @@ App::get('/auth/signup') ->label('scope', 'home') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/signup.phtml'); $page @@ -113,7 +113,7 @@ App::get('/auth/recovery') ->label('scope', 'home') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/recovery.phtml'); @@ -132,7 +132,7 @@ App::get('/auth/confirm') ->label('scope', 'home') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/confirm.phtml'); @@ -147,7 +147,7 @@ App::get('/auth/join') ->label('scope', 'home') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/join.phtml'); @@ -162,7 +162,7 @@ App::get('/auth/recovery/reset') ->label('scope', 'home') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/recovery/reset.phtml'); @@ -177,7 +177,7 @@ App::get('/auth/oauth2/success') ->label('scope', 'home') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/oauth2.phtml'); @@ -195,7 +195,7 @@ App::get('/auth/magic-url') ->label('scope', 'home') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/magicURL.phtml'); @@ -213,7 +213,7 @@ App::get('/auth/oauth2/failure') ->label('scope', 'home') ->inject('layout') ->action(function ($layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/oauth2.phtml'); @@ -232,7 +232,7 @@ App::get('/error/:code') ->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false) ->inject('layout') ->action(function ($code, $layout) { - /** @var Utopia\View $layout */ + /** @var Appwrite\Utopia\View $layout */ $page = new View(__DIR__.'/../../views/error.phtml'); diff --git a/app/init.php b/app/init.php index 62d79be3b..39cd2c264 100644 --- a/app/init.php +++ b/app/init.php @@ -27,8 +27,8 @@ use Appwrite\Network\Validator\IP; use Appwrite\Network\Validator\URL; use Appwrite\OpenSSL\OpenSSL; use Appwrite\Stats\Stats; +use Appwrite\Utopia\View; use Utopia\App; -use Utopia\View; use Utopia\Config\Config; use Utopia\Locale\Locale; use Utopia\Registry\Registry; diff --git a/app/tasks/install.php b/app/tasks/install.php index 0898ae67c..979e9b469 100644 --- a/app/tasks/install.php +++ b/app/tasks/install.php @@ -5,10 +5,10 @@ global $cli; use Appwrite\Auth\Auth; use Appwrite\Docker\Compose; use Appwrite\Docker\Env; +use Appwrite\Utopia\View; use Utopia\Analytics\GoogleAnalytics; use Utopia\CLI\Console; use Utopia\Config\Config; -use Utopia\View; use Utopia\Validator\Text; $cli diff --git a/app/views/console/database/form.phtml b/app/views/console/database/form.phtml index 971e4fa70..401267902 100644 --- a/app/views/console/database/form.phtml +++ b/app/views/console/database/form.phtml @@ -1,6 +1,6 @@ getParam('collection', null); $collections = $this->getParam('collections', []); diff --git a/src/Appwrite/Template/Template.php b/src/Appwrite/Template/Template.php index f2343d441..6f586a625 100644 --- a/src/Appwrite/Template/Template.php +++ b/src/Appwrite/Template/Template.php @@ -2,8 +2,8 @@ namespace Appwrite\Template; +use Appwrite\Utopia\View; use Exception; -use Utopia\View; class Template extends View { diff --git a/src/Appwrite/Utopia/View.php b/src/Appwrite/Utopia/View.php new file mode 100644 index 000000000..4dee18087 --- /dev/null +++ b/src/Appwrite/Utopia/View.php @@ -0,0 +1,22 @@ +