Example #1
0
 function load($max = 0)
 {
     if (!$max) {
         $max = self::MAIN_MAX;
     }
     if (count($this->mains) == $max) {
         return;
     }
     $this->mains = array();
     $path = ConfPath::ipcaBin();
     if (!is_file($path)) {
         print "Warn ! The file is not found: {$path}\n";
         return;
     }
     $f = fopen($path, "rb");
     for ($m = 0; $m < $max; $m++) {
         $line = fread($f, self::ITEM_LENGTH * 4);
         $cells = unpack("f*", $line);
         $this->mains[$m] = array_slice($cells, 0);
     }
     fclose($f);
     Console::p(sprintf("\tIpca.load( {$max} ): %dkb\n", memory_get_peak_usage() / 1000));
 }