/[drupal]/contributions/modules/autoload/autoload.module
ViewVC logotype

Diff of /contributions/modules/autoload/autoload.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.2, Tue Dec 2 05:13:51 2008 UTC revision 1.1.2.3, Tue Dec 2 05:19:39 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: autoload.module,v 1.1.2.1 2008/10/23 04:48:21 crell Exp $  // $Id: autoload.module,v 1.1.2.2 2008/12/02 05:13:51 crell Exp $
3  /**  /**
4   * Implementation of hook_init().   * Implementation of hook_init().
5   */   */
# Line 8  function autoload_init() { Line 8  function autoload_init() {
8  }  }
9    
10  /**  /**
11     * Implementation of hook_flush_caches9).
12     */
13    function autoload_flush_caches() {
14      // Force a rescan of the autload hook.
15      autoload_get_lookup(TRUE);
16    }
17    
18    /**
19   * Autoload function for registered classes.   * Autoload function for registered classes.
20   */   */
21  function autoload_class($class) {  function autoload_class($class) {
# Line 17  function autoload_class($class) { Line 25  function autoload_class($class) {
25      $lookup = autoload_get_lookup();      $lookup = autoload_get_lookup();
26    }    }
27    
28    // If we don't have a record for the class, bypass the cache and try again.     if (!empty($lookup[$class])) {
   if (empty($lookup[$class])) {  
     $lookup = autoload_get_lookup(TRUE);  
   }  
   
   if (!empty($lookup[$class])) {  
29      require_once dirname($_SERVER['SCRIPT_FILENAME']) .'/'. $lookup[$class];      require_once dirname($_SERVER['SCRIPT_FILENAME']) .'/'. $lookup[$class];
30    }    }
31  }  }

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

  ViewVC Help
Powered by ViewVC 1.1.2