note 57706 deleted from ref.zlib by nlopess
| From: | nlopess@php.net | Date: | Wed, 12 Oct 2005 08:00:59 +0000 |
| Subject: | note 57706 deleted from ref.zlib by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96885@lists.php.net to get a copy of this message | ||
Note Submitter: Yunus Emre Yilmaz
----
I writed a simple mass .gz compressor , I hope can be helpful.
<?
set_time_limit(0);
function dosyaGZ($dosya,$yeniDosya){
# GEt file contents
$icerik = file_get_contents($dosya);
# Sýkýþtýr
$oturum = gzopen($yeniDosya,"w9");
gzwrite($oturum,$icerik);
gzclose($oturum);
}
# variables #
$dizi = scandir('C:\Program Files\xampp\htdocs\test3');
$sayi = count($dizi) -1;
$dosyaAdi = 'gz.php';
# compress for every array key#
for ($i=2; $i<= $sayi; $i++) {
if(!eregi('gz.php',$dizi[$i])) {
dosyaGZ("$dizi[$i]","".$dizi[$i].".gz");
echo "<li><b>$dizi[$i].gz</b> created.<br /> ";
}
}
?>