Skip to content

Commit

Permalink
Add timezone setting
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrime-ru committed Jun 12, 2020
1 parent 4d67bda commit 46f9ab4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.docker.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SERVER_ADDRESS=0.0.0.0
SERVER_PORT=9503

MEMORY_LIMIT=256M
TIMEZONE=UTC

# List of allowed clients. Separate with comma.
# Leave blanc, to allow requests from all IP (dangerous!)
Expand Down
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SERVER_ADDRESS=127.0.0.1
SERVER_PORT=9503

MEMORY_LIMIT=256M
TIMEZONE=UTC

# List of allowed clients. Separate with comma.
# Leave blanc, to allow requests from all IP (dangerous!)
Expand Down
7 changes: 5 additions & 2 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@
}
}

$memoryLimit = getenv('MEMORY_LIMIT');
if ($memoryLimit !== false) {
if ($memoryLimit = getenv('MEMORY_LIMIT')) {
ini_set('memory_limit', $memoryLimit);
}

if ($timezone = getenv('TIMEZONE')) {
date_default_timezone_set($timezone);
}

if (!function_exists('debug')) {
function debug(string $message, array $context) {
Logger::getInstance()->debug($message, $context);
Expand Down

0 comments on commit 46f9ab4

Please sign in to comment.