[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-dev
Subject:    Re: [SMARTY-DEV] DIR_SEP constant
From:       boots <jayboots () yahoo ! com>
Date:       2003-03-30 5:34:24
[Download RAW message or body]

> but i would also reject to add something like:
> 
> if (!defined('DIR_SEP')) define('DIR_SEP', DIRECTORY_SEPARATOR);
> else if (DIR_SEP!=DIRECTORY_SEPARATOR) trigger_error('cannot define
> DIR_SEP', E_USER_ERROR)
> 
> this would look a bit paranoid.

Agreed.


> i think DIR_SEP is a relict of times where DIRECTORY_SEPARATOR wasn't
> available in php natively. since smarty does not support php before
> 4.0.6 (where DIRECTORY_SEPARATOR was introduced), a cleaner solution
> would be to abandon DIR_SEP fully and only use DIRECTORY_SEPARATOR
> inside smarty. i don't see a reason against this, but this would have
> to be discussed with Monte.

Pefect idea.

> conclusion: if you need a fast solution: lower you error_reporting
> temporarily (while the inclusion of Smarty.class.php) or supress the
> notice with the @-operator. 
> 
> or maybe change the order of the libraries you include, then smarty
> is
> in charge of definig DIR_SEP, and the other libraries complain
> instead
> of smarty (not that serious :)
>
> have fun
> messju

Actually, its not serious that Smarty complains about it either, but it
does seem unnecessary. Especially since we agree not to be paranoid
about it :). After all, any given system should only have one possible
value for DIR_SEP, namely DIRECTORY_SEPARATOR. Perhaps Smarty can be a
little "nicer" to the global namespace and use SMARTY_DIR_SEP if a
local constant is to be kept instead of using DIRECTORY_SEPARATOR,
though I like your idea to use the system supplied constant directly.

Thanks for the reply.
xo boots

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic