Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zipowanie dużej ilości plików, może być zlecenie
Wertas
post
Post #1





Grupa: Zarejestrowani
Postów: 45
Pomógł: 0
Dołączył: 2.03.2010

Ostrzeżenie: (0%)
-----


Chcę utworzyć skrypt, który będzie pakował bardzo dużą ilość plików do zipa około 50k

  1. include_once("CreateZipFile.inc.php");
  2. $createZipFile=new CreateZipFile;
  3.  
  4. $directoryToZip="repository";
  5. $outputDir=".";
  6. $zipName="CreateZipFileWithPHP.zip";
  7.  
  8. define("ZIP_DIR",1); //
  9.  
  10.  
  11. if(ZIP_DIR)
  12. {
  13. //Code toZip a directory and all its files/subdirectories
  14. $createZipFile->zipDirectory($directoryToZip,$outputDir);
  15. }else
  16. {
  17. //?
  18. }
  19.  
  20. $fd=fopen($zipName, "wb");
  21. $out=fwrite($fd,$createZipFile->getZippedfile());
  22. fclose($fd);
  23. $createZipFile->forceDownload($zipName);
  24. @unlink($zipName);


Ten skrypt działa w miarę przy 2-3 tys plików. Lecz nie jest to jeszcze ten rezultat, który chcę osiągnąć. Przy większej ilości plików dostaję błąd
  1. Fatal error: Maximum execution time of 360 seconds exceeded in C:\xampp\htdocs\filemanager\CreateZipFile.inc.php on line 92
  2.  
  3. $newOffset = strlen(implode("", $this->compressedData));


Czy znacie jakieś rozwiązanie tego problemu? Może jakieś party by się robiły z zipa nie wiem sam, pomóżcie.

http://pastebin.com/iHfT6x69 kod CreateZipFile.inc.php

Ten post edytował Wertas 1.11.2013, 23:21:48
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.09.2025 - 17:34