 +
 +        // If path is a directory and the included file exists, load it
 +        if (is_dir($path)) {
-+          if (!file_exists($f= realpath($path.DIRECTORY_SEPARATOR.strtr($str, '.', DIRECTORY_SEPARATOR).'.class.php'))) {
++          if (!file_exists($f= $path.DIRECTORY_SEPARATOR.strtr($str, '.', DIRECTORY_SEPARATOR).'.class.php')) {
 +            continue;
 +          }
 +          

+    }
+    
+    /**
+     * (Insert method's description here)
+     *
+     * @access  
+     * @param   
+     * @return  
+     */
+    function getResourceAsStream($string) {
+      return $this->archive->getStream($string);

+     * @return  bool
+     */
+    function providesClass($class) {
+      return $this->archive->contains(strtr($class, '.', '/').'.class.php');
+    }
+    
+    /**
+     * Fetch instance of classloader by the path to the archive
+     *
+     * @model   static
+     * @access  public
+     * @param   string path
+     * @return  &lang.archive.ArchiveClassLoader
+     */
+    function &instanceFor($path) {
+      static $pool= array();
+      
+      if (isset($pool[$path])) {
+        return $pool[$path];
+      }
+      
+      $instance= &new ArchiveClassLoader(new ArchiveReader($path));
+      $pool[$path]= $instance;
+      return $instance;
+    }
   }
 ?>
Index: lang/archive/Archive.class.php
===================================================================
--- lang/archive/Archive.class.php	(revision 8050)
+++ lang/archive/Archive.class.php	(working copy)
@@ -4,13 +4,8 @@
  * $Id$
  */
  
-  uses('lang.ElementNotFoundException');
+  uses('lang.ElementNotFoundException', 'io.EncapsedStream');
 
-  define('ARCHIVE_READ',             0x0000);
-  define('ARCHIVE_CREATE',           0x0001);
-  define('ARCHIVE_HEADER_SIZE',      0x0100);
-  define('ARCHIVE_INDEX_ENTRY_SIZE', 0x0100);
-
   /**
    * Archives contain a collection of classes.
    *
@@ -97,6 +92,25 @@
     }
     
     /**
