Ejemplo n.º 1
0
 /**
  * Constructor for the OIK_autoload class
  */
 function __construct()
 {
     self::$loads = array();
     $loads_more = apply_filters("oik_query_autoload_classes", self::$loads);
     self::$loads = $loads_more;
     $this->classes = null;
     //self::loads( $loads_more );
     spl_autoload_register(array($this, 'autoload'));
 }
Ejemplo n.º 2
0
 /**
  * Load the OIK_Autoload logic
  * 
  * You might think that the fact that you invoke oik_require_lib( "oik_autoload" ); 
  * would be enough to tell the autoload library that you'll be using autoloading for your classes.
  * But I think it's better to implicitely invoke either oik_require_class() or oik_autoload() to instantiate the
  * autoloading logic when you know that OO code will be used.
  * 
  * Notice we use oik_require_file() to load a class file manually
  */
 function oik_autoload()
 {
     if (!class_exists("OIK_Autoload")) {
         //echo "Loading OIK_Autoload" ;
         oik_require_file("class-oik-autoload.php", "oik-autoload");
     }
     if (class_exists("OIK_Autoload")) {
         $oik_autoload = OIK_Autoload::instance();
     } else {
         bw_trace2("Class OIK_Autoload does not exist");
         die;
     }
     return $oik_autoload;
 }