Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 18 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * |
4 | * This file is part of the phpBB Forum Software package. |
5 | * |
6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
8 | * |
9 | * For full copyright and license information, please see |
10 | * the docs/CREDITS.txt file. |
11 | * |
12 | */ |
13 | |
14 | /** |
15 | */ |
16 | if (!defined('IN_PHPBB')) |
17 | { |
18 | exit; |
19 | } |
20 | |
21 | // Report all errors, except notices and deprecation messages |
22 | $level = E_ALL & ~E_NOTICE & ~E_DEPRECATED; |
23 | error_reporting($level); |
24 | |
25 | /** |
26 | * Minimum Requirement: PHP 8.1.0 |
27 | */ |
28 | if (version_compare(PHP_VERSION, '8.1.0', '<')) |
29 | { |
30 | die('You are running an unsupported PHP version (' . PHP_VERSION . '). Please upgrade to PHP 8.1.0 or higher before trying to install or update to phpBB 4.0'); |
31 | } |
32 | |
33 | // In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems |
34 | // because we show E_WARNING errors and do not set a default timezone. |
35 | // This is because we have our own timezone handling and work in UTC only anyway. |
36 | |
37 | // So what we basically want to do is set our timezone to UTC, |
38 | // but we don't know what other scripts (such as bridges) are involved, |
39 | // so we check whether a timezone is already set by calling date_default_timezone_get(). |
40 | |
41 | // Unfortunately, date_default_timezone_get() itself might throw E_WARNING |
42 | // if no timezone has been set, so we have to keep it quiet with @. |
43 | |
44 | // date_default_timezone_get() tries to guess the correct timezone first |
45 | // and then falls back to UTC when everything fails. |
46 | // We just set the timezone to whatever date_default_timezone_get() returns. |
47 | date_default_timezone_set(@date_default_timezone_get()); |
48 | |
49 | // Autoloading of dependencies. |
50 | // Three options are supported: |
51 | // 1. If dependencies are installed with Composer, Composer will create a |
52 | // vendor/autoload.php. If this file exists it will be |
53 | // automatically used by phpBB. This is the default mode that phpBB |
54 | // will use when shipped. |
55 | // 2. To disable composer autoloading, PHPBB_NO_COMPOSER_AUTOLOAD can be specified. |
56 | // Additionally specify PHPBB_AUTOLOAD=/path/to/autoload.php in the |
57 | // environment. This is useful for running CLI scripts and tests. |
58 | // /path/to/autoload.php should define and register class loaders |
59 | // for all of phpBB's dependencies. |
60 | // 3. You can also set PHPBB_NO_COMPOSER_AUTOLOAD without setting PHPBB_AUTOLOAD. |
61 | // In this case autoloading needs to be defined before running any phpBB |
62 | // script. This might be useful in cases when phpBB is integrated into a |
63 | // larger program. |
64 | if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD')) |
65 | { |
66 | if (getenv('PHPBB_AUTOLOAD')) |
67 | { |
68 | require(getenv('PHPBB_AUTOLOAD')); |
69 | } |
70 | } |
71 | else |
72 | { |
73 | if (!file_exists($phpbb_root_path . 'vendor/autoload.php')) |
74 | { |
75 | trigger_error( |
76 | 'Composer dependencies have not been set up yet, run ' . |
77 | "'php ../composer.phar install' from the phpBB directory to do so.", |
78 | E_USER_ERROR |
79 | ); |
80 | } |
81 | require($phpbb_root_path . 'vendor/autoload.php'); |
82 | } |
83 | |
84 | $starttime = microtime(true); |