From 1b81ed503682ef2d88f65673b0dce9f112078000 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Wed, 24 Feb 2016 17:25:21 +0530 Subject: [PATCH] CRM-18079 fix --- CRM/Core/Config/Runtime.php | 21 +++++++++++++++------ Civi/Core/Container.php | 2 ++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CRM/Core/Config/Runtime.php b/CRM/Core/Config/Runtime.php index 28583382d3..b6e4ee13c6 100644 --- a/CRM/Core/Config/Runtime.php +++ b/CRM/Core/Config/Runtime.php @@ -32,7 +32,7 @@ * the DSN, CMS type, CMS URL, etc. Generally, runtime properties must be * determined externally (before loading CiviCRM). */ -class CRM_Core_Config_Runtime { +class CRM_Core_Config_Runtime extends CRM_Core_Config_MagicMerge { public $dsn; @@ -135,11 +135,6 @@ class CRM_Core_Config_Runtime { $this->templateDir = array(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR); - // FIXME - if (isset($this->customPHPPathDir) && $this->customPHPPathDir) { - set_include_path($this->customPHPPathDir . PATH_SEPARATOR . get_include_path()); - } - $this->initialized = 1; } @@ -148,6 +143,20 @@ class CRM_Core_Config_Runtime { exit(); } + /** + * Include custom PHP and template paths + */ + public function includeCustomPath() { + $customProprtyName = array('customPHPPathDir', 'customTemplateDir'); + foreach ($customProprtyName as $property) { + $value = $this->getSettings()->get($property); + if (!empty($value)) { + $customPath = Civi::paths()->getPath($value); + set_include_path($customPath . PATH_SEPARATOR . get_include_path()); + } + } + } + /** * Create a unique identification code for this runtime. * diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index e8d71486bb..ce9d947956 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -358,6 +358,8 @@ class Container { \CRM_Extension_System::singleton(TRUE); \CRM_Extension_System::singleton(TRUE)->getClassLoader()->register(); + $runtime->includeCustomPath(); + $c = new self(); $container = $c->loadContainer(); foreach ($bootServices as $name => $obj) { -- 2.25.1