1
0
Fork 0
mirror of synced 2024-05-21 05:02:37 +12:00

Updated env to mode

This commit is contained in:
Eldad Fux 2020-06-19 02:07:41 +03:00
parent 8c53875992
commit 0266e1a667
8 changed files with 25 additions and 25 deletions

View file

@ -292,7 +292,7 @@ $utopia->error(function ($error /* @var $error Exception */) use ($request, $res
$_SERVER = []; // Reset before reporting to error log to avoid keys being compromised
$output = ((App::ENV_TYPE_DEVELOPMENT == $env)) ? [
$output = ((App::MODE_TYPE_DEVELOPMENT == $env)) ? [
'message' => $error->getMessage(),
'code' => $error->getCode(),
'file' => $error->getFile(),

View file

@ -26,7 +26,7 @@ use GeoIp2\Database\Reader;
include_once __DIR__ . '/../shared/api.php';
$isDev = (App::ENV_TYPE_PRODUCTION !== $utopia->getEnv());
$isDev = (App::MODE_TYPE_PRODUCTION !== $utopia->getMode());
$utopia->post('/v1/database/collections')
->desc('Create Collection')

View file

@ -26,7 +26,7 @@ $utopia->get('/v1/locale')
$countries = Locale::getText('countries');
$continents = Locale::getText('continents');
if (App::ENV_TYPE_PRODUCTION !== $utopia->getEnv()) {
if (App::MODE_TYPE_PRODUCTION !== $utopia->getMode()) {
$ip = '79.177.241.94';
}

View file

@ -28,12 +28,12 @@ $layout
->setParam('class', 'unknown')
->setParam('icon', '/images/favicon.png')
->setParam('roles', $roles)
->setParam('env', $utopia->getEnv())
->setParam('env', $utopia->getMode())
;
$utopia->init(function () use ($utopia, $response, $request, $layout) {
$time = (60 * 60 * 24 * 45); // 45 days cache
$isDev = (\Utopia\App::ENV_TYPE_DEVELOPMENT == Config::getParam('env'));
$isDev = (\Utopia\App::MODE_TYPE_DEVELOPMENT == Config::getParam('env'));
$response
->addHeader('Cache-Control', 'public, max-age='.$time)

View file

@ -60,7 +60,7 @@ Config::load('platforms', __DIR__.'/../app/config/platforms.php');
Config::load('locales', __DIR__.'/../app/config/locales.php');
Config::load('collections', __DIR__.'/../app/config/collections.php');
Config::setParam('env', $request->getServer('_APP_ENV', App::ENV_TYPE_PRODUCTION));
Config::setParam('env', $request->getServer('_APP_ENV', App::MODE_TYPE_PRODUCTION));
Config::setParam('domain', $request->getServer('HTTP_HOST', ''));
Config::setParam('domainVerification', false);
Config::setParam('version', $request->getServer('_APP_VERSION', 'UNKNOWN'));

View file

@ -105,7 +105,7 @@ class CertificatesV1
throw new Exception('Renew isn\'t required');
}
$staging = (Config::getParam('env') === App::ENV_TYPE_PRODUCTION) ? '' : ' --dry-run';
$staging = (Config::getParam('env') === App::MODE_TYPE_PRODUCTION) ? '' : ' --dry-run';
$response = shell_exec("certbot certonly --webroot --noninteractive --agree-tos{$staging} --email security@appwrite.io \
-w ".APP_STORAGE_CERTIFICATES." \

View file

@ -32,11 +32,11 @@
"appwrite/php-clamav": "1.0.*",
"utopia-php/framework": "0.2.*",
"utopia-php/framework": "0.3.1",
"utopia-php/abuse": "0.2.*",
"utopia-php/audit": "0.3.*",
"utopia-php/cache": "0.2.*",
"utopia-php/cli": "0.5.*",
"utopia-php/cli": "0.6.1",
"utopia-php/config": "0.2.*",
"utopia-php/locale": "0.2.*",
"utopia-php/registry": "0.2.*",

32
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e93c84ab77f0085004222c942dcba6f4",
"content-hash": "79b5c353af354f8df106d2f933750102",
"packages": [
{
"name": "appwrite/php-clamav",
@ -1452,21 +1452,21 @@
},
{
"name": "utopia-php/cli",
"version": "0.5.0",
"version": "0.6.1",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/cli.git",
"reference": "c66255fed87f00c5a8f7cc0c482cdb082260cd32"
"reference": "0e88da425122f81020e90d575cbe80232f364b68"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/cli/zipball/c66255fed87f00c5a8f7cc0c482cdb082260cd32",
"reference": "c66255fed87f00c5a8f7cc0c482cdb082260cd32",
"url": "https://api.github.com/repos/utopia-php/cli/zipball/0e88da425122f81020e90d575cbe80232f364b68",
"reference": "0e88da425122f81020e90d575cbe80232f364b68",
"shasum": ""
},
"require": {
"php": ">=7.1",
"utopia-php/framework": "0.2.*"
"utopia-php/framework": "0.*.*"
},
"require-dev": {
"phpunit/phpunit": "^7.0"
@ -1496,7 +1496,7 @@
"upf",
"utopia"
],
"time": "2020-05-05T09:02:10+00:00"
"time": "2020-06-18T23:00:19+00:00"
},
{
"name": "utopia-php/config",
@ -1596,16 +1596,16 @@
},
{
"name": "utopia-php/framework",
"version": "0.2.0",
"version": "0.3.1",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/framework.git",
"reference": "e3d88b794badbd5ededcf62d708b31009111f860"
"reference": "b480f9dd01ad7990a12e90e5e4d11ded558dd8fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/framework/zipball/e3d88b794badbd5ededcf62d708b31009111f860",
"reference": "e3d88b794badbd5ededcf62d708b31009111f860",
"url": "https://api.github.com/repos/utopia-php/framework/zipball/b480f9dd01ad7990a12e90e5e4d11ded558dd8fc",
"reference": "b480f9dd01ad7990a12e90e5e4d11ded558dd8fc",
"shasum": ""
},
"require": {
@ -1636,7 +1636,7 @@
"php",
"upf"
],
"time": "2020-03-08T15:42:21+00:00"
"time": "2020-06-18T22:58:05+00:00"
},
{
"name": "utopia-php/locale",
@ -2141,12 +2141,12 @@
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e"
"reference": "5892a510fe31de9c4200e6f9ae30e91dc5cd5a41"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
"reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/5892a510fe31de9c4200e6f9ae30e91dc5cd5a41",
"reference": "5892a510fe31de9c4200e6f9ae30e91dc5cd5a41",
"shasum": ""
},
"require": {
@ -2186,7 +2186,7 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2020-02-22T12:28:44+00:00"
"time": "2020-06-18T20:57:11+00:00"
},
{
"name": "phpdocumentor/type-resolver",