Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Kompresja i dekompresja kodu - Co polecacie ?
Elber
post 13.06.2012, 13:00:30
Post #1





Grupa: Zarejestrowani
Postów: 381
Pomógł: 12
Dołączył: 9.07.2007

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


Witam,

chcę skompresować i potem dekompresować kod pewnej aplikacji którą napisałem wink.gif I zastanawiam się czego do tego użyć, których funkcji aby to było dość szybkie i wydajne przy dekompresji. Teraz próbuję czegoś takiego:


  1. function compress($file) {
  2. if (!file_exists("skompresowane")) {
  3. mkdir("skompresowane");
  4. }
  5. echo "<br>Kodowanie pliku: $file";
  6. $string = file_get_contents($file);
  7. $kod = gzcompress($string, 9);
  8. file_put_contents("skompresowane/" . $file, $kod);
  9. echo "<br>Skompresowany plik: skompresowane/$file<br>";
  10. return null;
  11. }
  12.  
  13. function decompress($file) {
  14. $string = file_get_contents($file);
  15. $string = gzinflate($string);
  16. file_put_contents("/tmp/" . $file, $string);
  17. include("/tmp/" . $file);
  18. return null;
  19. }


Jednak gzinflate nie wszędzie działa (lub czegoś mi brakuje) smile.gif


--------------------
GG: 564555
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 23.05.2025 - 12:08