Re: [SMARTY] tpl, installation (forgot)

From: Date: Mon, 01 Jul 2002 22:30:11 +0000
Subject: Re: [SMARTY] tpl, installation (forgot)
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5152@lists.php.net to get a copy of this message
the ./ your putting in front of the SMARTY_DIR means that when smarty wants to load the rest of its files, it will look in the current working directory + SMARTY_DIR, which translates to public_html/dir2/hro/smarty/. in most cases you shouldn¹t need to touch the SMARTY_DIR constant, because its designed to find out where its living on its own :) the variables you will want should be the templates directories, so if your directory structure is dir2/hro/public_html/ and dir2/hro/smarty/ then you should probably set the template and compile dirs to ../smarty/templates/, etc -bok On 2/7/02 8:17 AM, Patti Ewanski banged a keyboard and produced the following weird but readable email: > Monte, Robert, > Thanks so much for being patient with me. > > I think I set up the files correctly and the directory paths. (I > think, I hope). > > This is what my Smarty.class.php file looks like now (only part > of it) > > > define('SMARTY_DIR', './dir2/hro/smarty/'); > define('DIR_SEP', DIRECTORY_SEPARATOR); > > if (!defined('SMARTY_DIR')) { > define('SMARTY_DIR', dirname(__FILE__) . DIR_SEP); > } > > define('SMARTY_PHP_PASSTHRU', 0); > define('SMARTY_PHP_QUOTE', 1); > define('SMARTY_PHP_REMOVE', 2); > define('SMARTY_PHP_ALLOW', 3); > > class Smarty > { > > /**************************************************************** > **********/ > /* BEGIN SMARTY CONFIGURATION SECTION > */ > /* Set the following config variables to your liking. > */ > /**************************************************************** > **********/ > > // public vars > var $template_dir = './dir2/hro/smarty/templates'; > // name of directory for templates > var $compile_dir = './dir2/hro/smarty/templates_c'; > // name of directory for compiled templates > var $config_dir = './dir2/hro/smarty/configs'; > // directory where config files are located > var $plugins_dir = './dir2/hro/smarty/plugins'; > // directory where plugins are kept > > > Now, my test page shoots me these errors: > > Warning: Unable to access > ./users2/hro/smarty/Smarty_Compiler.class.php in > /users2/hro/smarty/Smarty.class.php on line 1026 > > Fatal error: Failed opening required > './users2/hro/smarty/Smarty_Compiler.class.php' > (include_path='.:/usr/local/include/php') in > /users2/hro/smarty/Smarty.class.php on line 1026 > > > I looked at line 1026 and it's a function definition: > /*=============================================================== > =======*\ > Function: _compile_template() > Purpose: called to compile the templates > \*=============================================================== > =======*/ > function _compile_template($tpl_file, $template_source, > &$template_compiled) > { > require_once SMARTY_DIR.$this->compiler_class . > '.class.php'; > > $smarty_compiler = new $this->compiler_class; > > $smarty_compiler->template_dir = > $this->template_dir; > $smarty_compiler->compile_dir = $this->compile_dir; > $smarty_compiler->plugins_dir = $this->plugins_dir; > $smarty_compiler->config_dir = $this->config_dir; > $smarty_compiler->force_compile = > $this->force_compile; > $smarty_compiler->caching = $this->caching; > $smarty_compiler->php_handling = > $this->php_handling; > $smarty_compiler->left_delimiter = > $this->left_delimiter; > $smarty_compiler->right_delimiter = > $this->right_delimiter; > $smarty_compiler->_version = $this->_version; > $smarty_compiler->security = $this->security; > $smarty_compiler->secure_dir = $this->secure_dir; > $smarty_compiler->security_settings = > $this->security_settings; > $smarty_compiler->trusted_dir = $this->trusted_dir; > $smarty_compiler->_plugins = &$this->_plugins; > $smarty_compiler->_tpl_vars = &$this->_tpl_vars; > > if ($smarty_compiler->_compile_file($tpl_file, > $template_source, $template_compiled)) > return true; > else { > $this->trigger_error($smarty_compiler->_error_msg); > return false; > } > } > > > And I don't think I should be changing anything this far down in > the program.... > Maybe has to do with my definition of SMARTY_DIR in > Smarty.class.php? > > You don't have to answer all these questions right now if you are > squeezed for time..... > I truly appreciate your help. I should send you both something. I > make candles and paper mache things in my spare time.... > > :) > Patti > > > > -----Original Message----- > From: Monte Ohrt [mailto:monte@ispi.net] > Sent: Monday, July 01, 2002 3:03 PM > To: Patti Ewanski > Cc: Robert Amos; smarty-general@lists.php.net > Subject: Re: [SMARTY] tpl, installation (forgot) > > If you're wanting to use relative paths, then you will need > "../smarty/templates" and "../smarty/tempaltes_c" according to > your > setup (paths must be relative to executing script), or fully > qualified > pathnames as Robert suggested. >

« previous php.smarty.general (#5152) next »