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

List:       smarty-dev
Subject:    Re: [SMARTY-DEV] Found some incompatibilities
From:       "Jan Rosier" <rosier () interstroom ! nl>
Date:       2004-03-04 10:09:37
Message-ID: 001801c401d0$ce867480$8f00a8c0 () victoria
[Download RAW message or body]

messju mohr wrote:
> On Wed, Mar 03, 2004 at 10:39:56AM +0100, Jan Rosier wrote:
>>>> On another note: While I looked at _read_file() I noticed that it
>>>> provides functionality to read only sub-parts of a file (only
>>>> $n..$m lines). But this functionality is never used from withing
>>>> Smarty. We could save about 20 lines in core Smarty.class.php if
>>>> we abandon this unused feature.
>>>
>>> Personally, I'd vote to remove those unused lines.
>>>
>>
>> Me too and when we add the following code. The whole function
>> _read_file(...) could be replaced with file_get_contents($file)
>>
.........<snip>
>>
>
> I like that approach. We should return boolean false if the fopen
> fails, though (as the native file_get_contents() does).
>
> There are just two things that make me feel uncomfortable:
>
.........<snip>
>
> #2 we should also change fread() in Config_File.class.php to
> file_get_contents() if we go for this approach. Config_File is known
> to be usable outside of Smarty. If smarty defines it's own
> file_get_contents() for older php-versions, than Config_File would
> break without Smarty and older php versions.
>

This can be fixed if we add the attached file to the distribution and add
the following line to Config_File.class.php and Smarty.class.php

require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Smarty.bc.php');

Greetings,
Jan Rosier




-- 
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