From: Enver ALTIN (enver.altin@frontsite.com.tr)
Date: Wed 10 Mar 2004 - 07:47:32 EST
On Wed, 2004-03-10 at 14:24 +0200, Enver ALTIN wrote:
> Sunucuda PHP 4.3.0'dan daha eski bir sürüm varmış. file_get_contents()
> yok :) cool, eh?
> Şimdi bakıyorum, php4.3.0+ sistemlerde kodun çalışma biçimini bozmadan
> bir workaround eklemeye çalışacağım.
Bunu düzelttim, ama test edemedim. Barış: lotr-rework.tar.gz'yi tekrar
indirirsen yeterli.
Belki gelecekte birilerinin işine yarar diye buraya da yazıyorum:
<?php
// Default buffer size for workaround functions, when needed.
define ("BUFFER_SIZE", 8192);
/*
* string file_get_contents(filename)
*
* A workaround for PHP versions older than 4.3.0
*/
function file_get_contents($filename) {
$result="";
if ($fp=fopen($file, "r")) {
while ($data=fread($fp, BUFFER_SIZE))
$result.=$data;
fclose($fh);
}
return $result;
}
?>
ve utils.php içerisine de:
if (PHP_VERSION<"4.3.0")
require_once("workaround.php");
gibi birşey ekledim. Sanırım yeterli olacak.
-- __________ | | | | Enver ALTIN (a.k.a. skyblue) | | Software developer, IT consultant | FRONT | |==========| FrontSITE Bilgi Teknolojisi A.Ş. |_____SITE_| http://www.frontsite.com.tr/