Re: SPAM-LOW: Re: [SMARTY] Basic question

From: Date: Thu, 26 Jan 2006 21:22:36 +0000
Subject: Re: SPAM-LOW: Re: [SMARTY] Basic question
References: 1 2 3 4 5 6 7 8 9  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13273@lists.php.net to get a copy of this message
Are you sure you're using the latest version? In Smarty_Compiler.class.php (2.6.12) at line 180, I am showing : $this->_func_regexp = '[a-zA-Z_]\w*'; Howler wrote:
Its a comment line, so my guess is that the real culprit is line 178. 169 /**
170     * This is the number of seconds cached content will persist.
171     * <ul>
172     *  <li>0 = always regenerate cache</li>
173     *  <li>-1 = never expires</li>
174     * </ul>
175     *
176     * @var integer
177     */
178    var $cache_lifetime  =  3600;
179
180    /**
181     * Only used when $caching is enabled. If true, then
If-Modified-Since headers
182     * are respected with cached content, and appropriate HTTP
headers are sent.
183     * This way repeated hits to a cached page do not send the entire
page to the
184     * client every time.
185     *
186     * @var boolean
187     */
188    var $cache_modified_check = false;
Monte Ohrt wrote:
what does line 180 look like? Howler wrote:
Monte, Thanks, that turned off the |magic_quotes_runtime but I am still getting the error. :-/| *Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in */home/vomramha/smarty/Smarty_Compiler.class.php* on line *180* *Parse error*: parse error, unexpected ')', expecting ',' or ';' in */home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180* Monte Ohrt wrote:
     
http://www.phpinsider.com/smarty-forum/viewtopic.php?t=4936 Howler wrote:
       
The line: ini_set('magic_quotes_gpc',0); Doesn't seem to turn off magic_quotes, perhaps this is something that needs to be set in the php.ini. I don't have access to the global php.ini, but my understanding is that the script will look in the current directory for a php.ini, then wwwroot, and then the global position. Is this correct? My hosting service provider put a copy of php.ini in my directory for me, and I turned off magic_quotes in it, but still no joy. Thanks, John Monte Ohrt wrote:
         
I think so, see the PHP docs. Howler wrote:
     
           
Monte, Thanks, is this something that I can turn off via ini_set()? Monte Ohrt wrote:
       
             
A hunch, turn off PHP magic quotes? Howler wrote:
         
               
Hello Everyone, I apologize in advance as I am sure that this question has been answered before. I have searched through mail lists and news groups and have not found a satifactory answer. I am still pretty new to PHP/Smarty so please be patient. I have installed Smarty to my Linux hosting server. I installed it outside of the www directory per the recommendations. /www |_______>myappstuff |_______>lib . . . /Smarty
      |_____> internals
      |_____>plugins
      |_____>myappstuff
      |                     |________>cache
      |                     |________>configs
      |                     |________>templates
      |                     |________>templates_c
      |
      |
      |________________>Config_file.class.php
      |________________>debug.tpl
      |________________>Smarty.class.php
      |________________>Smarty_Compiler.class.php
I set the path using the ini_set and I can find the Smarty.class.php without issue, what seems to be the problem is that when my PHP code performs the $smSmarty->display('index.tpl'); I get the following error: ================= *Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in */home/vomramha/smarty/Smarty_Compiler.class.php* on line *180* *Parse error*: parse error, unexpected ')', expecting ',' or ';' in */home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180* ================== I believe that I have the permissions set correctly but I am not sure, it could be something that I missed in my code. ================== index.php <?php ini_set ('include_path',".:/usr/lib/php:/usr/local/lib/php:/home/myhomedir/smarty"); require_once ('Smarty.class.php'); require_once ('lib/my_dbconnect.php'); $smSmarty = new Smarty; $smSmarty->compile_check = true; $smSmarty->debugging = true; $smSmarty->template_dir = '/home/myhomedir/www/myappstuff/templates/'; $smSmarty->compile_dir = '/home/myhomedir/www/myappstuff/templates_c/';
$smSmarty->cache_dir    = '/home/myhomedir/www/myappstuff/cache/';
$smSmarty->config_dir = '/home/myhomedir/www/myappstuff/configs/'; $smSmarty->force_compile = true; $smSmarty->assign('Name', 'Joe'); if ($smSmarty->template_exists('index.tpl')) { if(!$smSmarty->is_cached('index.tpl')) { $smSmarty->display('index.tpl'); } } else { $smSmarty->display('debug.tpl'); phpinfo(); } ?> index.tpl <html> <head> <title>My Smarty test App</title> </head> <body> This is a test: {$Name} </body> </html> ================== index.php does find the template and executes the correct code, however when the line: $smSmarty->display('index.tpl'); is executed I get the error. Any assistance would be greatly appreciated. Thanks in advance! John
                                      
         
!DSPAM:43d939fe175471669485837!
     


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