From 94dbed1f20c72e86d9da2f87a619f0a53c7b9dc3 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sat, 22 Aug 2015 03:21:14 -0700 Subject: [PATCH] CRM-16373 - Config - Remove `smartyDir`, `pluginsDir`, and `sqlDir` --- CRM/Core/Config/Defaults.php | 7 ------- CRM/Core/Config/Variables.php | 7 ------- CRM/Core/Smarty.php | 7 +++++-- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/CRM/Core/Config/Defaults.php b/CRM/Core/Config/Defaults.php index b21a1f7bf0..f0f954430c 100644 --- a/CRM/Core/Config/Defaults.php +++ b/CRM/Core/Config/Defaults.php @@ -45,17 +45,10 @@ class CRM_Core_Config_Defaults { public function setCoreVariables() { global $civicrm_root; - // set of base directories relying on $civicrm_root - $this->smartyDir = $civicrm_root . DIRECTORY_SEPARATOR . 'packages' . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR; - - $this->pluginsDir = $civicrm_root . DIRECTORY_SEPARATOR . 'CRM' . DIRECTORY_SEPARATOR . 'Core' . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR; - $this->templateDir = array( $civicrm_root . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR, ); - - $this->sqlDir = $civicrm_root . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR; } /** diff --git a/CRM/Core/Config/Variables.php b/CRM/Core/Config/Variables.php index 7f69eb5001..69b3737161 100644 --- a/CRM/Core/Config/Variables.php +++ b/CRM/Core/Config/Variables.php @@ -44,13 +44,6 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults { public $debug = 0; public $backtrace = 0; - /** - * The directory where Smarty and plugins are installed. - * @var string - */ - public $smartyDir = NULL; - public $pluginsDir = NULL; - /** * The root directory of our template tree. * @var string diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index 9022db85a5..fb84a6c1a9 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -128,11 +128,14 @@ class CRM_Core_Smarty extends Smarty { } } + $smartyDir = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'packages' . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR; + $pluginsDir = __DIR__ . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR; + if ($customPluginsDir) { - $this->plugins_dir = array($customPluginsDir, $config->smartyDir . 'plugins', $config->pluginsDir); + $this->plugins_dir = array($customPluginsDir, $smartyDir . 'plugins', $pluginsDir); } else { - $this->plugins_dir = array($config->smartyDir . 'plugins', $config->pluginsDir); + $this->plugins_dir = array($smartyDir . 'plugins', $pluginsDir); } // add the session and the config here -- 2.25.1