Re: [SMARTY-DEV] Found some incompatibilities

From: Date: Wed, 03 Mar 2004 09:39:56 +0000
Subject: Re: [SMARTY-DEV] Found some incompatibilities
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2178@lists.php.net to get a copy of this message
>> 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) if (!function_exists('file_get_contents')) { /** * Reads entire file into a string * PHP 4 >= 4.3.0 * * @param string $file * * @return string */ function file_get_contents($file) { if ($filesize = filesize($file) AND $handle = fopen($file, 'r')) { $content = fread($handle, $filesize); fclose($handle); return $content; } else { return ''; } } } Just my 2 euro cents ;-) Jan Rosier * If anyone utters a sentence and means or understands it, he is operating a calculas according to definite rules. Wittgenstein *

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