pedro_morgan
2007-08-21 1d751b044e3e2a8c0ebd607425ef3605c00b1096
* Got rid of $conf['cachedir']
* tidy tpl.php , removed $conf global

3 files modified
58 ■■■■■ changed files
interface/lib/classes/tpl.inc.php 20 ●●●●● patch | view | raw | blame | history
interface/lib/classes/tpl_ini.inc.php 4 ●●● patch | view | raw | blame | history
interface/lib/config.inc.php 34 ●●●● patch | view | raw | blame | history
interface/lib/classes/tpl.inc.php
@@ -157,7 +157,9 @@
         */
        public function newTemplate($tmplfile)
        {
            if (!$tfile = $this->_fileSearch($tmplfile)) vlibTemplateError::raiseError('VT_ERROR_NOFILE',KILL,$tmplfile);
            if (!$tfile = $this->_fileSearch($tmplfile)){
                vlibTemplateError::raiseError('VT_ERROR_NOFILE', KILL, $tmplfile);
            }
            //* make sure that any parsing vars are cleared for the new template
            $this->_tmplfile = null;
@@ -169,8 +171,9 @@
            $this->_totalparsetime = null;
            //* reset debug module
            if ($this->_debug) $this->_debugReset();
            if ($this->_debug){
                $this->_debugReset();
            }
            $this->_tmplfilename = $tfile;
            return true;
        }
@@ -253,8 +256,7 @@
         */
        public function getVars()
        {
            if (empty($this->_vars)) return false;
            return $this->_vars;
            return empty($this->_vars) ? false : $this->_vars;
        }
        /**
@@ -265,8 +267,7 @@
        public function getVar($var)
        {
            if ($this->OPTIONS['CASELESS']) $var = strtolower($var);
            if (empty($var) || !isset($this->_vars[$var])) return false;
            return $this->_vars[$var];
            return (empty($var) || !isset($this->_vars[$var])) ? false : $this->_vars[$var];
        }
        /**
@@ -328,6 +329,7 @@
            }
            $loop_arr = array();
            // TODO: Are all these necessary as were onyl using mysql and possible postgres ? - pedro
            switch ($db_type) {
                case 'MYSQL':
@@ -795,7 +797,9 @@
            if ($this->_includedepth > $this->OPTIONS['MAX_INCLUDES'] || $tmplfile == false) {
                return;
            } else {
                if ($this->_debug) array_push ($this->_debugIncludedfiles, $tmplfile);
                if ($this->_debug){
                    array_push ($this->_debugIncludedfiles, $tmplfile);
                }
                if ($do_eval) {
                    array_push($this->_currentincludedir, dirname($tmplfile));
                    $this->_includedepth++;
interface/lib/classes/tpl_ini.inc.php
@@ -49,8 +49,6 @@
        public static function vlibTemplate()
        {
            
            global $conf;
            $tpl_dir = ISPC_THEMES_PATH.'/'.$_SESSION['s']['theme'].'/templates';
            return array(
@@ -89,7 +87,7 @@
                        /* the following are only used by the vlibTemplateCache class. */
                        // pedro notes:: triggers a notice as its not set - was $conf['template']['cache_dir'],
                        'CACHE_DIRECTORY' => $conf['cache_dir'],
                        'CACHE_DIRECTORY' => ISPC_CACHE_PATH,
                                                                   // Directory where the cached filesystem
                                                                   // will be set up (full path, and must be writable)
                                                                   // '/' or '\' off the end of the directory.
interface/lib/config.inc.php
@@ -41,6 +41,16 @@
$conf['app_version'] = '3.0.0';
$conf['modules_available']     = 'admin,mail,sites,monitor,client,dns';
//** The main ROOT is the parent directory to this file, ie Interface/. NO trailing slashes.
define('ISPC_ROOT_PATH',   realpath(dirname(__FILE__).'/../'));
define('ISPC_LIB_PATH',    ISPC_ROOT_PATH.'/lib');
define('ISPC_CLASS_PATH',  ISPC_ROOT_PATH.'/lib/classes');
define('ISPC_WEB_PATH',    ISPC_ROOT_PATH.'/web');
define('ISPC_THEMES_PATH', ISPC_ROOT_PATH.'/web/themes');
define('ISPC_TEMP_PATH',   ISPC_ROOT_PATH.'/temp');
define('ISPC_CACHE_PATH',  ISPC_ROOT_PATH.'/cache');
//********************************************************************************
//** Future Code idea  - pedro - rfc
@@ -86,18 +96,6 @@
    $conf['db_database']        = 'ispconfig3';
}
//** The main ROOT is the parent directory to this file, ie Interface/. NO trailing slashes.
define('ISPC_ROOT_PATH',   realpath(dirname(__FILE__).'/../'));
define('ISPC_LIB_PATH',    ISPC_ROOT_PATH.'/lib');
define('ISPC_CLASS_PATH',  ISPC_ROOT_PATH.'/lib/classes');
define('ISPC_WEB_PATH',    ISPC_ROOT_PATH.'/web');
define('ISPC_THEMES_PATH', ISPC_ROOT_PATH.'/web/themes');
define('ISPC_TEMP_PATH',   ISPC_ROOT_PATH.'/temp');
define('ISPC_CACHE_PATH',  ISPC_ROOT_PATH.'/cache');
//** Database Settings
/* See above
$conf['db_type']            = 'mysql';
@@ -107,18 +105,6 @@
$conf['db_database']        = 'ispconfig3';
*/
$conf['cache_dir']          = ISPC_ROOT_PATH.'/cache';
/* pedro notes ? this stuff is REALLY not necessay, can leak everywhere
   Don think this lot is being used so commented out
define('DB_TYPE', $conf['db_type']);
define('DB_HOST', $conf['db_host']);
define('DB_DATABASE',$conf['db_database']);
define('DB_USER', $conf['db_user']);
define('DB_PASSWORD', $conf['db_password']);
*/
//**  External programs
//$conf["programs"]["convert"]    = "/usr/bin/convert";