aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/startup.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/startup.php')
-rw-r--r--phpBB/includes/startup.php48
1 files changed, 32 insertions, 16 deletions
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index cf216a65db..441eaec6b1 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -3,7 +3,7 @@
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
@@ -20,21 +20,6 @@ if (!defined('E_DEPRECATED'))
define('E_DEPRECATED', 8192);
}
$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
-if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
-{
- // PHP 5.4 adds E_STRICT to E_ALL.
- // Our utf8 normalizer triggers E_STRICT output on PHP 5.4.
- // Unfortunately it cannot be made E_STRICT-clean while
- // continuing to work on PHP 4.
- // Therefore, in phpBB 3.0.x we disable E_STRICT on PHP 5.4+,
- // while phpBB 3.1 will fix utf8 normalizer.
- // E_STRICT is defined starting with PHP 5
- if (!defined('E_STRICT'))
- {
- define('E_STRICT', 2048);
- }
- $level &= ~E_STRICT;
-}
error_reporting($level);
/*
@@ -162,5 +147,36 @@ if (function_exists('date_default_timezone_set') && function_exists('date_defaul
date_default_timezone_set(@date_default_timezone_get());
}
+// Autoloading of dependencies.
+// Three options are supported:
+// 1. If dependencies are installed with Composer, Composer will create a
+// vendor/autoload.php. If this file exists it will be
+// automatically used by phpBB. This is the default mode that phpBB
+// will use when shipped.
+// 2. To disable composer autoloading, PHPBB_NO_COMPOSER_AUTOLOAD can be specified.
+// Additionally specify PHPBB_AUTOLOAD=/path/to/autoload.php in the
+// environment. This is useful for running CLI scripts and tests.
+// /path/to/autoload.php should define and register class loaders
+// for all of phpBB's dependencies.
+// 3. You can also set PHPBB_NO_COMPOSER_AUTOLOAD without setting PHPBB_AUTOLOAD.
+// In this case autoloading needs to be defined before running any phpBB
+// script. This might be useful in cases when phpBB is integrated into a
+// larger program.
+if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD'))
+{
+ if (getenv('PHPBB_AUTOLOAD'))
+ {
+ require(getenv('PHPBB_AUTOLOAD'));
+ }
+}
+else
+{
+ if (!file_exists($phpbb_root_path . 'vendor/autoload.php'))
+ {
+ trigger_error('You have not set up composer dependencies. See http://getcomposer.org/.', E_USER_ERROR);
+ }
+ require($phpbb_root_path . 'vendor/autoload.php');
+}
+
$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];