@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+20 -10
+2 -3
conf/default.conf.php
··· 974 974 'phd.start-taskmasters' => 4, 975 975 976 976 // Path to custom celerity resource map. Absolute or relative to 977 - // 'phabricator/src'. Defaults to '__celerity_resource_map__.php'. 978 - // See also `scripts/celerity_mapper.php`. 979 - 'celerity.resource-path' => null, 977 + // 'phabricator/src'. See also `scripts/celerity_mapper.php`. 978 + 'celerity.resource-path' => '__celerity_resource_map__.php', 980 979 981 980 // This value is an input to the hash function when building resource hashes. 982 981 // It has no security value, but if you accidentally poison user caches (by
-3
scripts/fpm/warmup.php
··· 48 48 $loader = new PhutilSymbolLoader(); 49 49 $loader->selectAndLoadSymbols(); 50 50 51 - // Force load of the Celerity map. 52 - CelerityResourceMap::getInstance(); 53 - 54 51 define('__WARMUP__', true); 55 52 } 56 53
+5 -4
src/infrastructure/celerity/CelerityResourceMap.php
··· 35 35 if (empty(self::$instance)) { 36 36 self::$instance = new CelerityResourceMap(); 37 37 $root = phutil_get_library_root('phabricator'); 38 - $path = PhabricatorEnv::getEnvConfig( 39 - 'celerity.resource-map', 40 - '__celerity_resource_map__.php'); 38 + 39 + $path = PhabricatorEnv::getEnvConfig('celerity.resource-path'); 41 40 $ok = include_once Filesystem::resolvePath($path, $root); 42 41 if (!$ok) { 43 - throw new Exception("Failed to load Celerity resource map!"); 42 + throw new Exception( 43 + "Failed to load Celerity resource map! Check the ". 44 + "'celerity.resource-path' setting in your configuration."); 44 45 } 45 46 } 46 47 return self::$instance;
+13
webroot/index.php
··· 152 152 )); 153 153 } 154 154 155 + // If execution throws an exception and then trying to render that exception 156 + // throws another exception, we want to show the original exception, as it is 157 + // likely the root cause of the rendering exception. 158 + $original_exception = null; 155 159 try { 156 160 $response = $controller->willBeginExecution(); 157 161 ··· 172 176 $response = id(new AphrontRedirectResponse()) 173 177 ->setURI($ex->getURI()); 174 178 } catch (Exception $ex) { 179 + $original_exception = $ex; 175 180 $response = $application->handleException($ex); 176 181 } 177 182 ··· 183 188 $write_guard->dispose(); 184 189 if ($access_log) { 185 190 $access_log->write(); 191 + } 192 + if ($original_exception) { 193 + $ex = new PhutilAggregateException( 194 + "Multiple exceptions during processing and rendering.", 195 + array( 196 + $original_exception, 197 + $ex, 198 + )); 186 199 } 187 200 phabricator_fatal('[Rendering Exception] '.$ex->getMessage()); 188 201 }