Re: [SMARTY-DEV] Found some incompatibilities

From: Date: Thu, 04 Mar 2004 10:09:37 +0000
Subject: Re: [SMARTY-DEV] Found some incompatibilities
References: 1 2 3  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2189@lists.php.net to get a copy of this message
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

« previous php.smarty.dev (#2189) next »