Example #1
0
 private static function index_blocks()
 {
     $block_index = array();
     while ($info = HCImport::read_next_block()) {
         if (count($block_index) == 0 && $info['type'] != 'STAK') {
             throw new Exception("Not a stack.");
         }
         if (!isset($block_index[$info['type']])) {
             $block_index[$info['type']] = array();
         }
         $block_index[$info['type']][$info['id']] = $info;
     }
     HCImport::$block_index = $block_index;
 }