AW: [SMARTY] use 1 compile directory for 2 template directories?
| From: | Mario Deutschmann | Date: | Thu, 29 Aug 2002 06:26:20 +0000 |
| Subject: | AW: [SMARTY] use 1 compile directory for 2 template directories? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-5865@lists.php.net to get a copy of this message | ||
Hi all!
> -----Ursprungliche Nachricht-----
> Von: Peter Billen [mailto:peter@clueless.be]
> Gesendet: Dienstag, 27. August 2002 19:41
> An: smarty-general@lists.php.net
> Betreff: RE: [SMARTY] use 1 compile directory for 2 template
> directories?
>
>
> I (will) have the same problem, since my site also will
> support multiple
> skins/templates.
>
> My question: $XXX->$compile_id =
> $template_dir_a_name.$template_filename
> isn't unique? If 2 users are using the same template, they
> both have the
> same compile id?
that's right. they'll both have the same compile_id. if you've got problems
with same output for different users, have a look at the caching instead of
the compiling-behaviour.
> And what does $template.filename mean? If you method
$template_filename has symbolic meaning. e.g. for "index.tpl" or whatever
your template is named.
> works (which I doubt), isn't it enough to use $XXX->$compile_id =
> $template_dir_a_name ?
you'll get the same compile_id for all templates of the entire
$template_dir_a - directory.
imho it makes no sense! ..?
have a look at the message of "s.kudwien@mcm-web.de":
----8<-----CUT-------8<---------------------------
I just wonder why Smarty doesn't do this job. Using realpath() when
calculating the CRC would unify
path/to/index.tpl and path/to/another/index.tpl (currently, only the
index.tpl that is first compiled gets fetched).
Index: Smarty.class.php
1498c1498
< $_crc32 = crc32($auto_source) . $_dir_sep;
---
> $_crc32 = crc32(realpath($auto_source)) . $_dir_sep;
Or do I break some caching or whatever features here!?
.SMK.
----8<-----CUT-------8<---------------------------
cya
mario
>
> Thanks,
>
> Peter
>
> -----Original Message-----
> From: Mario Deutschmann [mailto:mdeutschmann@pironet-ndh.com]
> Sent: dinsdag 27 augustus 2002 12:20
> To: smarty-general@lists.php.net
> Subject: AW: [SMARTY] use 1 compile directory for 2 template
> directories?
>
> try something like
> $XXX->$compile_id = $template_dir_a_name.$template_filename;
>
> the only important thing is to use different compile_id for templates
> with
> same filename coming from different template directories.
>
> greets
> mario
>
>
>
> > -----Ursprungliche Nachricht-----
> > Von: SE [mailto:sendoh@anet.ne.jp]
> > Gesendet: Dienstag, 27. August 2002 10:39
> > An: smarty-general@lists.php.net
> > Betreff: Re: [SMARTY] use 1 compile directory for 2 template
> > directories?
> >
> >
> > Thanks.
> >
> > but it doesn't say anything about what variable or number i
> > can use for
> > $compile_id.
> > Any ideas?
> >
> >
> > > Hi!
> > >
> > > check manual for "compile_id". that may solve you compile-problem.
> > >
> > > greets
> > > mario
> > >
> > >
> > >
> > >
> > >
> > > > -----Ursprungliche Nachricht-----
> > > > Von: SE [mailto:sendoh@anet.ne.jp]
> > > > Gesendet: Dienstag, 27. August 2002 02:56
> > > > An: smarty-general@lists.php.net
> > > > Betreff: [SMARTY] use 1 compile directory for 2 template
> > directories?
> > > >
> > > >
> > > > When determining if a template file has already been compiled
> > > > or not, does
> > > > smarty look at the directory where the template file is stored?
> > > >
> > > > I have 2 $template_dir directories, and thinking of using 1
> > > > $templates_c
> > > > directory. It seems that sometimes smarty does not compile
> > > > the file if a
> > > > template file with the same name has already been compiled,
> > > > which is in fact
> > > > not the same template file but only with a same file name. Is
> > > > this true, or
> > > > is there any extra settings i need to do to make this work
> > > > right? Or maybe I
> > > > should just use another compile directory?
> > > >
> > > >
> > > > --
> > > > Smarty General Mailing List (http://smarty.php.net/)
> > > > To unsubscribe, visit: ”
> > > > Ccú†‚O_¬»N)http://www.php.net/unsub.php
> > > >
> > >
> > > --
> > > Smarty General Mailing List (http://smarty.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>