1
0
Fork 0
mirror of synced 2024-06-01 18:39:57 +12:00

Updated preloading

This commit is contained in:
Eldad Fux 2020-07-01 07:41:08 +03:00
parent 18f2074584
commit 0029971517
3 changed files with 15 additions and 15 deletions

View file

@ -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());
}

View file

@ -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'))

View file

@ -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());