Changeset View
Changeset View
Standalone View
Standalone View
support/init/init-script.php
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | if (!ini_get('date.timezone')) { | ||||
// the system timezone setting in any capacity, so prevent PHP from flipping | // the system timezone setting in any capacity, so prevent PHP from flipping | ||||
// out by setting it to a safe default (UTC) if it isn't set to some other | // out by setting it to a safe default (UTC) if it isn't set to some other | ||||
// value. | // value. | ||||
date_default_timezone_set('UTC'); | date_default_timezone_set('UTC'); | ||||
} | } | ||||
// Adjust `include_path`. | // Adjust `include_path`. | ||||
ini_set('include_path', implode(PATH_SEPARATOR, array( | ini_set('include_path', implode(PATH_SEPARATOR, array( | ||||
dirname(dirname(__FILE__)).'/externals/includes', | dirname(__DIR__).'/externals/includes', | ||||
ini_get('include_path'), | ini_get('include_path'), | ||||
))); | ))); | ||||
// Disable the insanely dangerous XML entity loader by default. | // Disable the insanely dangerous XML entity loader by default. | ||||
// PHP 8 deprecates this function and disables this by default; remove once | // PHP 8 deprecates this function and disables this by default; remove once | ||||
// PHP 7 is no longer supported or a future version has removed the function | // PHP 7 is no longer supported or a future version has removed the function | ||||
// entirely. | // entirely. | ||||
if (function_exists('libxml_disable_entity_loader')) { | if (function_exists('libxml_disable_entity_loader')) { | ||||
@libxml_disable_entity_loader(true); | @libxml_disable_entity_loader(true); | ||||
} | } | ||||
$root = dirname(dirname(dirname(__FILE__))); | $root = dirname(dirname(__DIR__)); | ||||
require_once $root.'/src/init/init-library.php'; | require_once $root.'/src/init/init-library.php'; | ||||
PhutilErrorHandler::initialize(); | PhutilErrorHandler::initialize(); | ||||
// If "variables_order" excludes "E", silently repair it so that $_ENV has | // If "variables_order" excludes "E", silently repair it so that $_ENV has | ||||
// the values we expect. | // the values we expect. | ||||
PhutilExecutionEnvironment::repairMissingVariablesOrder(); | PhutilExecutionEnvironment::repairMissingVariablesOrder(); | ||||
Show All 10 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0