Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] read from fiile speed
Black-Berry
post
Post #1





Grupa: Zarejestrowani
Postów: 663
Pomógł: 6
Dołączył: 3.06.2007
Skąd: Kraków

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


Dałoby się to jakoś przyspieszyć ? Za bardzo muli przy 1.000 plików 50ms.

  1. <?php            
  2. $folder = opendir($this->folder);
  3. while (($file = readdir($folder)) !== false) {
  4.    if ($file != '.' and $file != '..') {
  5.        //saving info about all sessions to a variable for other use...
  6.        $sessionFile = fopen($this->folder.$file, 'r');
  7.        $data = fread($sessionFile, filesize($this->folder.$file)+1);
  8.        $activesSessionsList[] = unserialize($data);
  9.        fclose($sessionFile);
  10.    }
  11. }
  12. closedir($folder);
  13. ?>


Może nie serializiwać albo inaczej odczytywać z pliku ? Czy to coś da ?


--------------------
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 21.08.2025 - 22:41