Re: [SMARTY-DEV] DIR_SEP handling
| From: | messju mohr | Date: | Sun, 04 May 2003 13:00:22 +0000 |
| Subject: | Re: [SMARTY-DEV] DIR_SEP handling | ||
| References: | 1 2 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1335@lists.php.net to get a copy of this message | ||
On Fri, May 02, 2003 at 04:28:31PM -0700, boots wrote:
> I've asked for this before and was told no, so I'll ask in a different
> way hopefully more nicely ;)
AFAIR it was nice enough that time. i just forgot it. sorry.
> Can we (please) remove:
> define('DIR_SEP', DIRECTORY_SEPARATOR);
>
> and instead add:
> function _set_dir_sep() {
> define('DIR_SEP', DIRECTORY_SEPARATOR);
> }
>
> with a call to $this->_set_DIR_SEP() to start off the Smarty()
> constructor? Then the default handling could be overwritten without
> touching the main class.
>
> Either that or rename it SMARTY_DIR_SEP. After all, it is a commonly
> wanted name in the global namespace. Otherwise (IMHO) Smarty should use
> DIRECTORY_SEPARATOR natively.
i'd vote for the last one too. let's mark 'DIR_SEP' as deprecated and
use DIRECTORY_SEPARATOR everywhere.
$ fgrep -r DIR_SEP smarty/libs | wc -l
21
hmm, this should be doable in a finite amount of time :-)
> My original suggestion was simply:
> if (!defined('DIR_SEP')) {
> define('DIR_SEP', DIRECTORY_SEPARATOR);
> }
i have no omissions to this for the time DIR_SEP is deprecated.
... if this doesn't add too much bloat to smarty. ;-)
> I should note that on my w2k box with PHP 4.3, it doesn't matter HOW I
> set DIR_SEP. It is happy with both "/" and "\". Go figure.