aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/startup.php
diff options
context:
space:
mode:
authorGaëtan Muller <m.gaetan89@gmail.com>2014-12-30 02:22:13 +0100
committerGaëtan Muller <m.gaetan89@gmail.com>2015-01-11 13:22:59 +0100
commit63da128ee5891971cc9e4f283572e0198174d692 (patch)
treee35a7b1020bf944beb198cc9ab1df612ef77760c /phpBB/includes/startup.php
parentef1be6e247cf01a99e68ec85600a80fd62ca9a75 (diff)
downloadforums-63da128ee5891971cc9e4f283572e0198174d692.tar
forums-63da128ee5891971cc9e4f283572e0198174d692.tar.gz
forums-63da128ee5891971cc9e4f283572e0198174d692.tar.bz2
forums-63da128ee5891971cc9e4f283572e0198174d692.tar.xz
forums-63da128ee5891971cc9e4f283572e0198174d692.zip
[ticket/12487] Update PHP code
PHPBB3-12487
Diffstat (limited to 'phpBB/includes/startup.php')
-rw-r--r--phpBB/includes/startup.php43
1 files changed, 13 insertions, 30 deletions
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index 2885c80541..c90fd79366 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -19,10 +19,6 @@ if (!defined('IN_PHPBB'))
}
// Report all errors, except notices and deprecation messages
-if (!defined('E_DEPRECATED'))
-{
- define('E_DEPRECATED', 8192);
-}
$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
error_reporting($level);
@@ -105,33 +101,21 @@ else
define('STRIP', (get_magic_quotes_gpc()) ? true : false);
}
-// Prevent date/time functions from throwing E_WARNING on PHP 5.3 by setting a default timezone
-if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get'))
-{
- // For PHP 5.1.0 the date/time functions have been rewritten
- // and setting a timezone is required prior to calling any date/time function.
-
- // Since PHP 5.2.0 calls to date/time functions without having a timezone set
- // result in E_STRICT errors being thrown.
- // Note: We already exclude E_STRICT errors
- // (to be exact: they are not included in E_ALL in PHP 5.2)
-
- // In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems
- // because we show E_WARNING errors and do not set a default timezone.
- // This is because we have our own timezone handling and work in UTC only anyway.
+// In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems
+// because we show E_WARNING errors and do not set a default timezone.
+// This is because we have our own timezone handling and work in UTC only anyway.
- // So what we basically want to do is set our timezone to UTC,
- // but we don't know what other scripts (such as bridges) are involved,
- // so we check whether a timezone is already set by calling date_default_timezone_get().
+// So what we basically want to do is set our timezone to UTC,
+// but we don't know what other scripts (such as bridges) are involved,
+// so we check whether a timezone is already set by calling date_default_timezone_get().
- // Unfortunately, date_default_timezone_get() itself might throw E_WARNING
- // if no timezone has been set, so we have to keep it quiet with @.
+// Unfortunately, date_default_timezone_get() itself might throw E_WARNING
+// if no timezone has been set, so we have to keep it quiet with @.
- // date_default_timezone_get() tries to guess the correct timezone first
- // and then falls back to UTC when everything fails.
- // We just set the timezone to whatever date_default_timezone_get() returns.
- date_default_timezone_set(@date_default_timezone_get());
-}
+// date_default_timezone_get() tries to guess the correct timezone first
+// and then falls back to UTC when everything fails.
+// We just set the timezone to whatever date_default_timezone_get() returns.
+date_default_timezone_set(@date_default_timezone_get());
// Autoloading of dependencies.
// Three options are supported:
@@ -168,5 +152,4 @@ else
require($phpbb_root_path . 'vendor/autoload.php');
}
-$starttime = explode(' ', microtime());
-$starttime = $starttime[1] + $starttime[0];
+$starttime = microtime(true);