Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

relative smarty dir?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
atreyu
Smarty n00b


Joined: 18 Sep 2003
Posts: 2
Location: Adelaide, AU

PostPosted: Thu Sep 18, 2003 3:13 am    Post subject: relative smarty dir? Reply with quote

Is it possible to setup smarty with using relative directory names.
I have no idea of the directory structure where my site is hosted so other than having smarty in each directory so it's in the "." part of include path I can't get smarty to work

say I setup a site with dir structure something like
/smarty
/shop
/

templates, templates_c, configs & cache I'm not sure where to put yet ... but for files in the root dir doing define(SMARTY_DIR, './smarty') don't work and further in shop define(SMARTY_DIR, '../smarty') doesn't either ... so is this approach possible at all (if not, why?)

Thanks in advance!
Back to top
View user's profile Send private message
atreyu
Smarty n00b


Joined: 18 Sep 2003
Posts: 2
Location: Adelaide, AU

PostPosted: Thu Sep 18, 2003 6:27 am    Post subject: Reply with quote

dammit ... just posted a reply and then proved myself wrong ...

Code:
require( realpath("../smarty/Smarty.class.php") );


does work .... why it didn't / wasn't before is beyond me but now it does Mad

Question ... how / why does define('DIR_SEP', DIRECTORY_SEPARATOR); work ... I can't find any info about DIRECTORY_SEPARATOR being a predefined variable in PHP (that define is like the first "code" line of Smarty.class.php so nothing else is included before it happens yet it causes no error) ...if it is PHP var ...when was it intro'd ie what version of PHP?

Cheers
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Sep 18, 2003 8:34 am    Post subject: Reply with quote

regarding DIRECTORY_SEPARATOR:
it's listed in http://php.net/manual/en/reserved.constants.standard.php
and the NEWS-file that comes with php says it was added with php-4.0.6 .

BTW: DIR_SEP is deprecated in smarty. smarty itself uses php's DIRECTORY_SEPARATOR everywhere in it's code. it's just still there because third-party applications that use smarty may rely on the fact that smarty defines DIR_SEP.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP