[pLog-svn] r2881 - in plog/trunk/class/template/smarty:

Mark Wu markplace at gmail.com
Wed Feb 1 19:54:30 GMT 2006


Why move the "." before $templateDir?

Becaste templatestorage already merge the ./templates and template name
standard (for example) for us, it will assign ./templates/standards to
$blogtemplate,

So, if we put the "." before $templateDir, it can use the most few
iterations..

Mark

> -----Original Message-----
> From: Mark Wu [mailto:markplace at gmail.com] 
> Sent: Thursday, February 02, 2006 3:50 AM
> To: 'plog-svn at devel.lifetype.net'
> Subject: RE: [pLog-svn] r2881 - in plog/trunk/class/template/smarty:
> 
> After several tests, I will suggest the way that Christoph 
> suggested but with a little change (because , it won't change 
> any smarty code)
> 
> ** Move the '.' before $templateDir, it can use the most few 
> iterations. **
> 
> $this->template_dir = array( '.', $config->getValue( 
> 'template_folder' ) );
> 
> And
> 
>  function setTemplateDir( $templateDir ) {
>     $this->template_dir = array ('.', $templateDir);
>     return true;
> } 
> 
> If everybody happy, I will commit the change later.
> 
> (I will try a fresh install, and test it before commit it, so 
> ... May take some time)
> 
> Mark
> 
> > -----Original Message-----
> > From: plog-svn-bounces at devel.lifetype.net
> > [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Christoph 
> > Feddersen
> > Sent: Thursday, February 02, 2006 3:17 AM
> > To: plog-svn at devel.lifetype.net
> > Subject: Re: [pLog-svn] r2881 - in plog/trunk/class/template/smarty:
> > 
> > That should work. I tested this on my windows environment.
> > Another way to get around is are two small changes to 
> > template.class.php
> > 
> > In the contructor add '.' as a template dir:
> > 
> > $this->template_dir = array( $config->getValue( 
> 'template_folder' ), 
> > '.');
> > 
> > And also change the setTemplateDir() function to add '.'
> > 
> > function setTemplateDir( $templateDir ) {
> >    $this->template_dir = array ($templateDir,'.');
> >    return true;
> > }
> > 
> > Mark Wu wrote:
> > > Another kind of fix is more generic for us...
> > > 
> > > I try to add the relative path support in 
> smarty.class.php, then we 
> > > don't need to change any thing
> > > 
> > > Take a look at the code from 1540-1549 ...
> > > 
> > > So, it may make smarty more slower/unsafe/worst (I guess)
> > .... Need to
> > > clarify ...
> > > 
> > > (Personally, I like this one)
> > > 
> > > Mark
> > > 
> > >> -----Original Message-----
> > >> From: plog-svn-bounces at devel.lifetype.net
> > >> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf 
> Of Jon Daley
> > >> Sent: Thursday, February 02, 2006 2:22 AM
> > >> To: plog-svn at devel.lifetype.net
> > >> Subject: RE: [pLog-svn] r2881 - in
> > plog/trunk/class/template/smarty:
> > >>
> > >>  	It sounds like we had better switch to absolute paths.  
> > >> They keep talking about safest/best/etc, sounds like there
> > might be
> > >> other issues that we don't know about (yet).
> > >>  	It seems like Mark's solution of prepending the
> > CLASS_PATH would be
> > >> fine, we just need to make sure to do it every time we use the
> > >> config('template_folder') call.
> > >>
> > >> On Thu, 2 Feb 2006, Mark Wu wrote:
> > >>> You can take a look at these two post, why the relative
> > path is not
> > >>> allowed in .template  (.tpl) file
> > >>>
> > >>> http://www.phpinsider.com/smarty-forum/viewtopic.php?t=4725
> > >>> http://www.phpinsider.com/smarty-forum/viewtopic.php?t=5985
> > >>>
> > >>> BTW, I am not sure the modification is work for every
> > >> situation, need
> > >>> more test ...
> > >> _______________________________________________
> > >> pLog-svn mailing list
> > >> pLog-svn at devel.lifetype.net
> > >> http://devel.lifetype.net/mailman/listinfo/plog-svn
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.lifetype.net
> > http://devel.lifetype.net/mailman/listinfo/plog-svn



More information about the pLog-svn mailing list