From 2f4b426cfca8a6c7f0b78a38839c9fe124a5bacb Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 26 Jun 2017 23:54:26 -0700 Subject: [PATCH] CRM-20243 - Civi\Core\Paths - Define 'civicrm.packages' variable (etal) In the long run, the file location of the `packages`, `vendor`, and `bower_components` should be adjustable (depending on how the codebase is built). This patch begins loosening the coupling between the `$civicrm_root` and those folders. --- Civi/Core/Paths.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Civi/Core/Paths.php b/Civi/Core/Paths.php index 718b4bc294..13efe656f7 100644 --- a/Civi/Core/Paths.php +++ b/Civi/Core/Paths.php @@ -34,6 +34,24 @@ class Paths { ->register('civicrm.root', function () { return \CRM_Core_Config::singleton()->userSystem->getCiviSourceStorage(); }) + ->register('civicrm.packages', function () { + return array( + 'path' => \Civi::paths()->getPath('[civicrm.root]/packages/'), + 'url' => \Civi::paths()->getUrl('[civicrm.root]/packages/'), + ); + }) + ->register('civicrm.vendor', function () { + return array( + 'path' => \Civi::paths()->getPath('[civicrm.root]/vendor/'), + 'url' => \Civi::paths()->getUrl('[civicrm.root]/vendor/'), + ); + }) + ->register('civicrm.bower', function () { + return array( + 'path' => \Civi::paths()->getPath('[civicrm.root]/bower_components/'), + 'url' => \Civi::paths()->getUrl('[civicrm.root]/bower_components/'), + ); + }) ->register('civicrm.files', function () { return \CRM_Core_Config::singleton()->userSystem->getDefaultFileStorage(); }) -- 2.25.1