(dev/cloud-native#3) CRM_Core_IDS - Change CIVICRM_TEMPLATE_COMPILEDIR to 'civicrm...
authorTim Otten <totten@civicrm.org>
Wed, 10 Jul 2019 04:53:04 +0000 (21:53 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 16 Jul 2019 01:58:12 +0000 (18:58 -0700)
commit9a13b5fda600936bad646d7c145ef6e6e679c3b5
tree419c4132678eba222ff8ea32fc05664bb4f4f709
parent896050a0ed8732c37e7355fd43a8e4186b3234ad
(dev/cloud-native#3) CRM_Core_IDS - Change CIVICRM_TEMPLATE_COMPILEDIR to 'civicrm.compile'

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.
CRM/Core/IDS.php