Re: Found some incompatibilities
"Jan Rosier" <[email protected]>
| Newsgroups | gmane.comp.php.smarty.devel |
|---|---|
| Message-ID | <00de01c40103$7d7de9b0$8f00a8c0@victoria> |
>> 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 *
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php