Ejemplo n.º 1
0
 /**
  * Returns the singleton instance of the class.
  *
  * @return Tribe__Events__Autoloader
  */
 public static function instance()
 {
     if (!self::$instance instanceof Tribe__Events__Autoloader) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
/**
 * Requires the autoloader class from the main plugin class and sets up
 * autoloading.
 */
function tribe_init_woo_tickets_autoloading()
{
    if (!class_exists('Tribe__Events__Autoloader')) {
        return;
    }
    $autoloader = Tribe__Events__Autoloader::instance();
    $autoloader->register_prefix('Tribe__Events__Tickets__Woo__', dirname(__FILE__) . '/src/Tribe');
    // deprecated classes are registered in a class to path fashion
    foreach (glob(dirname(__FILE__) . '/src/deprecated/*.php') as $file) {
        $class_name = str_replace('.php', '', basename($file));
        $autoloader->register_class($class_name, $file);
    }
    $autoloader->register_autoloader();
}
Ejemplo n.º 3
0
 protected function init_autoloading()
 {
     $autoloader = Tribe__Events__Autoloader::instance();
     $prefixes = array('Tribe__Events__' => $this->pluginPath . 'src/Tribe');
     $autoloader->register_prefixes($prefixes);
     // deprecated classes are registered in a class to path fashion
     foreach (glob($this->pluginPath . 'src/deprecated/*.php') as $file) {
         $class_name = str_replace('.php', '', basename($file));
         $autoloader->register_class($class_name, $file);
     }
     $autoloader->register_autoloader();
 }