Remove smarty_prefix config setting
Remove smarty_prefix config setting

--- a/config/gitphp.conf.defaults.php
+++ b/config/gitphp.conf.defaults.php
@@ -389,29 +389,6 @@
  */
 
 /*
- * smarty_prefix
- * This is the prefix where smarty is installed.
- * If an absolute (starts with /) path is given,
- * Smarty.class.php will be searched for in that directory.
- * If a relative (doesn't start with /) path is given,
- * that subdirectory inside the php include dirs will be
- * searched.  So, for example, if you specify the path as
- * "/usr/share/Smarty/" then the script will look for
- * /usr/share/Smarty/Smarty.class.php.
- * If you specify the path as "smarty/" then it will search
- * the include directories in php.ini's include_path directive,
- * so it would search in places like /usr/share/php and /usr/lib/php:
- * /usr/share/php/smarty/Smarty.class.php,
- * /usr/lib/php/smarty/Smarty.class.php, etc.
- * Leave blank to just search in the root of the php include directories
- * like /usr/share/php/Smarty.class.php, /usr/lib/php/Smarty.class.php, etc.
- *
- * This is only necessary if you want to use a smarty install other than
- * the one that comes with GitPHP.
- */
-$gitphp_conf['smarty_prefix'] = 'lib/smarty/libs/';
-
-/*
  * geshiroot
  * Directory where geshi is installed, only applies if geshi is enabled
  * NOTE: this is the path to the base geshi.php file to include,

--- a/include/cache/Cache.class.php
+++ b/include/cache/Cache.class.php
@@ -280,7 +280,7 @@
 		if ($this->tpl)
 			return;
 
-		require_once(GitPHP_Util::AddSlash(GitPHP_Config::GetInstance()->GetValue('smarty_prefix', 'lib/smarty/libs/')) . 'Smarty.class.php');
+		require_once(GITPHP_SMARTYDIR . 'Smarty.class.php');
 		$this->tpl = new Smarty;
 		$this->tpl->addPluginsDir(GITPHP_INCLUDEDIR . 'smartyplugins');
 

--- a/include/controller/ControllerBase.class.php
+++ b/include/controller/ControllerBase.class.php
@@ -107,7 +107,7 @@
 		$this->config = GitPHP_Config::GetInstance();
 		$this->projectList = GitPHP_ProjectList::GetInstance();
 
-		require_once(GitPHP_Util::AddSlash($this->config->GetValue('smarty_prefix', 'lib/smarty/libs/')) . 'Smarty.class.php');
+		require_once(GITPHP_SMARTYDIR . 'Smarty.class.php');
 		$this->tpl = new Smarty;
 		$this->tpl->error_reporting = E_ALL & ~E_NOTICE;
 		$this->tpl->merge_compiled_includes = true;

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -29,8 +29,9 @@
 define('GITPHP_CONFIGDIR', GITPHP_BASEDIR . 'config/');
 define('GITPHP_INCLUDEDIR', GITPHP_BASEDIR . 'include/');
 define('GITPHP_LOCALEDIR', GITPHP_BASEDIR . 'locale/');
-
 define('GITPHP_CACHEDIR', GITPHP_BASEDIR . 'cache/');
+define('GITPHP_LIBDIR', GITPHP_BASEDIR . 'lib/');
+define('GITPHP_SMARTYDIR', GITPHP_LIBDIR . 'smarty/libs/');
 
 include(GITPHP_INCLUDEDIR . 'version.php');
 

comments