Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/env/PhabricatorEnv.php
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | if (strlen($instance)) { | ||||
$_ENV['PHABRICATOR_INSTANCE'] = $instance; | $_ENV['PHABRICATOR_INSTANCE'] = $instance; | ||||
} | } | ||||
PhabricatorEventEngine::initialize(); | PhabricatorEventEngine::initialize(); | ||||
// TODO: Add a "locale.default" config option once we have some reasonable | // TODO: Add a "locale.default" config option once we have some reasonable | ||||
// defaults which aren't silly nonsense. | // defaults which aren't silly nonsense. | ||||
self::setLocaleCode('en_US'); | self::setLocaleCode('en_US'); | ||||
// Load the preamble utility library if we haven't already. On web | |||||
// requests this loaded earlier, but we want to load it for non-web | |||||
// requests so that unit tests can call these functions. | |||||
require_once $phabricator_path.'/support/startup/preamble-utils.php'; | |||||
} | } | ||||
public static function beginScopedLocale($locale_code) { | public static function beginScopedLocale($locale_code) { | ||||
return new PhabricatorLocaleScopeGuard($locale_code); | return new PhabricatorLocaleScopeGuard($locale_code); | ||||
} | } | ||||
public static function getLocaleCode() { | public static function getLocaleCode() { | ||||
return self::$localeCode; | return self::$localeCode; | ||||
▲ Show 20 Lines • Show All 840 Lines • Show Last 20 Lines |