        }
        xp::registry('sapi', $a);
      }
-@@ -223,10 +240,44 @@
+@@ -223,10 +240,55 @@
      xp::registry('errors', $errors);
    }
    // }}}
 +  
 +  // {{{ string __xp_load_archive_bytes(string archive, string filename)
 +  //     Loads a file from an archive
-+  function __xp_load_archive_bytes($archive, $filename) {
-+    static $h= array();
-+    static $bootstrap= array();
++  function __xp_load_archive_bytes($archivePath, $filename) {
++    static $archive= array();
++    
++    if (!isset($archive[$archivePath])) {
++      $archive[$archivePath]= array();
++      $current= &$archive[$archivePath];
  
-+    // Bootstrap loading, only to be used for core classes.
-+    if (!is_resource($h[$archive])) {
-+      $h[$archive]= fopen($archive, 'rb');
-+      $header= unpack('a3id/c1version/i1indexsize/a*reserved', fread($h[$archive], 0x0100));
-+      for ($bootstrap[$archive]= array(), $i= 0; $i < $header['indexsize']; $i++) {
++      // Bootstrap loading, only to be used for core classes.
++      $current['handle']= fopen($archivePath, 'rb');
++      $header= unpack('a3id/c1version/i1indexsize/a*reserved', fread($current['handle'], 0x0100));
++      for ($current['index']= array(), $i= 0; $i < $header['indexsize']; $i++) {
 +        $entry= unpack(
 +          'a80id/a80filename/a80path/i1size/i1offset/a*reserved', 
-+          fread($h[$archive], 0x0100)
++          fread($current['handle'], 0x0100)
 +        );
-+        $bootstrap[$archive][$entry['id']]= array($entry['size'], $entry['offset']);
++        $current['index'][$entry['id']]= array($entry['size'], $entry['offset']);
 +      }
 +    }
++    
++    $current= &$archive[$archivePath];
 +
-+    if (!isset($bootstrap[$archive][$filename])) return FALSE;
-+    fseek($h[$archive], 0x0100 + sizeof($bootstrap[$archive]) * 0x0100 + $bootstrap[$archive][$filename][1], SEEK_SET);
-+    $bytes= fread($h[$archive], $bootstrap[$archive][$filename][0]);
++    if (!isset($current['index'][$filename])) return FALSE;
++    fseek($current['handle'], 0x0100 + sizeof($current['index']) * 0x0100 + $current['index'][$filename][1], SEEK_SET);
++    $bytes= fread($current['handle'], $current['index'][$filename][0]);
 +    return $bytes;
 +  }
 +  // }}}

+     * @return  bool
+     */
+    function providesClass($class) {
+      return $this->archive->contains($class);
+    }    
   }
 ?>
Index: lang/archive/Archive.class.php
===================================================================
--- lang/archive/Archive.class.php	(revision 7907)
+++ lang/archive/Archive.class.php	(working copy)
@@ -97,6 +97,25 @@
     }
     
     /**

+    $include= &xp::registry('include_path');
+
+    if (0 == sizeof($include)) {
+      $include= array();
+      /*foreach (array_flip(explode(':', ini_get('include_path'))) as $part => $dummy) {
+        if (FALSE !== ($p= realpath($part))) {
+          $include[$p]= FALSE;
+        }
+      }*/
+      $include= array_flip(explode(':', ini_get('include_path')));
+      
+      xp::registry('include_path', $include);
+    }
+    
     foreach (func_get_args() as $str) {
       if (class_exists($class= xp::reflect($str))) continue;
 
@@ -245,17 +307,46 @@
         }
         $str= substr($str, strrpos($str, '/')+ 1);
         $class= xp::reflect($str);
