From 0029971517158657a17c30b8a5501a67c6ea990b Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 1 Jul 2020 07:41:08 +0300 Subject: [PATCH] Updated preloading --- app/app.php | 18 +++--------------- app/preload.php | 4 ++++ public/index.php | 8 ++++++++ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/app.php b/app/app.php index d31cc9192f..2125a98cec 100644 --- a/app/app.php +++ b/app/app.php @@ -15,20 +15,12 @@ use Appwrite\Database\Document; use Appwrite\Database\Validator\Authorization; use Appwrite\Network\Validator\Origin; -Config::setParam('domain', $_SERVER['HTTP_HOST']); +Config::setParam('domain', 'localhost'); Config::setParam('domainVerification', false); // Config::setParam('domain', $request->getServer('HTTP_HOST', '')); // Config::setParam('domainVerification', false); -\define('COOKIE_DOMAIN', - ( - $_SERVER['HTTP_HOST'] === 'localhost' || - $_SERVER['HTTP_HOST'] === 'localhost:'.$request->getPort() || - (\filter_var($request->getHostname(), FILTER_VALIDATE_IP) !== false) - ) - ? null - : '.'.$request->getHostname() - ); +\define('COOKIE_DOMAIN', 'localhost'); \define('COOKIE_SAMESITE', Response::COOKIE_SAMESITE_NONE); // \define('COOKIE_DOMAIN', @@ -452,8 +444,4 @@ include_once __DIR__ . '/controllers/shared/web.php'; foreach(Config::getParam('services', []) as $service) { include_once $service['controller']; -} - -$app = new App('Asia/Tel_Aviv'); - -$app->run(new Request(), new Response()); \ No newline at end of file +} \ No newline at end of file diff --git a/app/preload.php b/app/preload.php index 1eb22282b1..9c876d0194 100644 --- a/app/preload.php +++ b/app/preload.php @@ -18,8 +18,12 @@ if (file_exists(__DIR__.'/../vendor/autoload.php')) { use Appwrite\Preloader\Preloader; +include 'init.php'; +include 'app.php'; + (new Preloader()) ->paths(realpath(__DIR__ . '/../app/config')) + ->paths(realpath(__DIR__ . '/../app/controllers')) ->paths(realpath(__DIR__ . '/../src')) ->ignore(realpath(__DIR__ . '/../vendor/twig/twig')) ->ignore(realpath(__DIR__ . '/../vendor/guzzlehttp/guzzle')) diff --git a/public/index.php b/public/index.php index 794382ff58..a143994d99 100644 --- a/public/index.php +++ b/public/index.php @@ -8,6 +8,10 @@ * ― Rick Cook, The Wizardry Compiled */ +use Utopia\App; +use Utopia\Request; +use Utopia\Response; + error_reporting(0); ini_set('display_errors', 0); @@ -17,3 +21,7 @@ error_reporting(E_ALL); //trigger_error('hide errors in prod', E_USER_NOTICE); include __DIR__ . '/../app/app.php'; + +$app = new App('Asia/Tel_Aviv'); + +$app->run(new Request(), new Response()); \ No newline at end of file