Fix minor issues with D2630

Summary:
  - The config is called "resource-path" and the script references "resource-path", but the actual value checked for is "resource-map".
  - Use nonempty(), since defaulting with getEnvConfig() will give you null if the setting exists but is set to null. This default is nearly useless so maybe we should change it to use coalesce().
  - Remove Celerity map initialization from warmup. We don't currently initialize the environment in warmup, and Celerity initialization now depends on the environment.

Test Plan: Ran patch locally and on FPM-Warmup.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: hsb, aran

Differential Revision: https://secure.phabricator.com/D2662
This commit is contained in:
epriestley
2012-06-06 08:15:42 -07:00
parent 3e87112d69
commit 259638e900
4 changed files with 20 additions and 10 deletions

View File

@@ -35,12 +35,13 @@ final class CelerityResourceMap {
if (empty(self::$instance)) {
self::$instance = new CelerityResourceMap();
$root = phutil_get_library_root('phabricator');
$path = PhabricatorEnv::getEnvConfig(
'celerity.resource-map',
'__celerity_resource_map__.php');
$path = PhabricatorEnv::getEnvConfig('celerity.resource-path');
$ok = include_once Filesystem::resolvePath($path, $root);
if (!$ok) {
throw new Exception("Failed to load Celerity resource map!");
throw new Exception(
"Failed to load Celerity resource map! Check the ".
"'celerity.resource-path' setting in your configuration.");
}
}
return self::$instance;