-
- Downloads
(cloud-native#3) Container, Extension Classloader - Change...
(cloud-native#3) Container, Extension Classloader - 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()->getPath()`. Why change these two files in the same commit? Because they're basically doing the same thing (writing an executable PHP file to the template cache), and the demonstration of their safety is basically the same. Is it safe to change this reference to `CIVICRM_TEMPLATE_COMPILEDIR` in `Civi\Core\Container::loadContainer()` and `CRM_Extension_ClassLoader::register()/::getCacheFile()`? Yes, I believe so: * Look at `Civi\Core\Container::boot()`. * Observe that it initializes services in two general stages: * First, the `$bootServices` (`runtime`, `paths`, `userSystem`, etc) * Second, the DB/extension-dependent services (`CRM_Utils_Hook`, `CRM_Extension_System`, `loadContainer()`). * The first stage services (e.g. `paths`) provide enough information to process `Civi::paths()->getPath('[civicrm.compile]/foo')`. * All the modified lines run as part of the *second* stage (i.e. after the `$bootServices` have been initialized).
Please register or sign in to comment