diff options
author | VirtualTam <virtualtam@flibidi.net> | 2015-08-04 18:31:16 +0200 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2015-08-04 23:54:03 +0200 |
commit | afd7b77b4c79a0450a6ef0489ca383c156111173 (patch) | |
tree | 1892b2fdcdaa65448b653b7ee57fd96dae376fd9 /index.php | |
parent | 27cf2e671d1f35bd8c9383d008cd3733fc1c6e0d (diff) | |
download | Shaarli-afd7b77b4c79a0450a6ef0489ca383c156111173.tar.gz Shaarli-afd7b77b4c79a0450a6ef0489ca383c156111173.tar.zst Shaarli-afd7b77b4c79a0450a6ef0489ca383c156111173.zip |
Installation: default to the server's timezone
Modifications
- attempt to use the server's timezone
- if none is set, use UTC
- TimeZone: apply coding conventions
- variable naming
- no closing PHP tag
Relates to #274
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -5,10 +5,12 @@ | |||
5 | // Licence: http://www.opensource.org/licenses/zlib-license.php | 5 | // Licence: http://www.opensource.org/licenses/zlib-license.php |
6 | // Requires: PHP 5.3.x | 6 | // Requires: PHP 5.3.x |
7 | // ----------------------------------------------------------------------------------------------- | 7 | // ----------------------------------------------------------------------------------------------- |
8 | // NEVER TRUST IN PHP.INI | 8 | |
9 | // Some hosts do not define a default timezone in php.ini, | 9 | // Set 'UTC' as the default timezone if it is not defined in php.ini |
10 | // so we have to do this for avoid the strict standard error. | 10 | // See http://php.net/manual/en/datetime.configuration.php#ini.date.timezone |
11 | date_default_timezone_set('UTC'); | 11 | if (date_default_timezone_get() == '') { |
12 | date_default_timezone_set('UTC'); | ||
13 | } | ||
12 | 14 | ||
13 | // ----------------------------------------------------------------------------------------------- | 15 | // ----------------------------------------------------------------------------------------------- |
14 | // Hardcoded parameter (These parameters can be overwritten by editing the file /data/config.php) | 16 | // Hardcoded parameter (These parameters can be overwritten by editing the file /data/config.php) |