The broader PR seeks to make path computation more intuitive, which requires computing the
path to `templates_c` using a function. This PR replaces the reference to `CIVICRM_TEMPLATE_COMPILEDIR`
with a function-call to `Civi::paths()->getVariable()`.
Is it safe change to make this change in `CRM_Core_IDS`? Will the
`Civi::paths()` be callable? Yes, here's why I believe so:
* (Big picture) Civi completes the bootstrap process
(`CRM_Core_Config::singleton()`) and brings critical services online
*before* the invoker does any routing or page-processing. The invoker
(`CRM_Core_Invoke::runItem()`) is the only thing which uses
`CRM_Core_IDS`.
* (Little picture) In the changed function
`CRM_Core_IDS::createBaseConfig()`, observe that it calls
`CRM_Core_Config::singleton()` before running this modified code. That's
a tell-tale sign of code that already relies on having a booted system.
*/
public static function createBaseConfig() {
$config = \CRM_Core_Config::singleton();
- $tmpDir = empty($config->uploadDir) ? CIVICRM_TEMPLATE_COMPILEDIR : $config->uploadDir;
+ $tmpDir = empty($config->uploadDir) ? Civi::paths()->getVariable('civicrm.compile', 'path') : $config->uploadDir;
global $civicrm_root;
return [