/** * Returns the singleton instance of the class. * * @return Tribe__Autoloader */ public static function instance() { if (!self::$instance instanceof Tribe__Autoloader) { self::$instance = new self(); } return self::$instance; }
/** * Requires the autoloader class from the main plugin class and sets up * autoloading. */ function tribe_init_tickets_plus_autoloading() { if (!class_exists('Tribe__Autoloader')) { return; } $autoloader = Tribe__Autoloader::instance(); $autoloader->register_prefix('Tribe__Tickets_Plus__', dirname(__FILE__) . '/src/Tribe'); $autoloader->register_autoloader(); }
/** * Setup the autoloader for common files */ protected function init_autoloading() { if (!class_exists('Tribe__Autoloader')) { require_once dirname(__FILE__) . '/Autoloader.php'; } $prefixes = array('Tribe__' => dirname(__FILE__)); $autoloader = Tribe__Autoloader::instance(); $autoloader->register_prefixes($prefixes); $autoloader->register_autoloader(); }
/** * Requires the autoloader class from the main plugin class and sets up * autoloading. */ function tribe_init_filterbar_autoloading() { if (!class_exists('Tribe__Autoloader')) { return; } $autoloader = Tribe__Autoloader::instance(); $autoloader->register_prefix('Tribe__Events__Filterbar__', 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(); }
/** * Setup the autoloader for common files */ protected function init_autoloading() { if (!class_exists('Tribe__Autoloader')) { require_once dirname(__FILE__) . '/Autoloader.php'; } $autoloader = Tribe__Autoloader::instance(); $prefixes = array('Tribe__' => dirname(__FILE__)); $autoloader->register_prefixes($prefixes); foreach (glob($this->plugin_path . 'src/deprecated/*.php') as $file) { $class_name = str_replace('.php', '', basename($file)); $autoloader->register_class($class_name, $file); } $autoloader->register_autoloader(); }
/** * Sets up autoloading */ protected function init_autoloading() { $prefixes = array('Tribe__Tickets__' => $this->plugin_path . 'src/Tribe'); if (!class_exists('Tribe__Autoloader')) { require_once $GLOBALS['tribe-common-info']['dir'] . '/Autoloader.php'; $prefixes['Tribe__'] = $GLOBALS['tribe-common-info']['dir']; } $autoloader = Tribe__Autoloader::instance(); $autoloader->register_prefixes($prefixes); require_once $this->plugin_path . 'src/template-tags/tickets.php'; // deprecated classes are registered in a class to path fashion foreach (glob($this->plugin_path . '{common/src,src}/deprecated/*.php', GLOB_BRACE) as $file) { $class_name = str_replace('.php', '', basename($file)); $autoloader->register_class($class_name, $file); } $autoloader->register_autoloader(); }
<?php $common = dirname(__FILE__) . '/src'; require_once $common . '/Tribe/Autoloader.php'; $autoloader = Tribe__Autoloader::instance(); $autoloader->register_prefix('Tribe__', $common . '/Tribe'); $autoloader->register_autoloader();
protected function init_autoloading() { $prefixes = array('Tribe__Events__' => $this->plugin_path . 'src/Tribe', 'ForceUTF8__' => $this->plugin_path . 'vendor/ForceUTF8'); if (!class_exists('Tribe__Autoloader')) { require_once $GLOBALS['tribe-common-info']['dir'] . '/Autoloader.php'; $prefixes['Tribe__'] = $GLOBALS['tribe-common-info']['dir']; } $autoloader = Tribe__Autoloader::instance(); $autoloader->register_prefixes($prefixes); // deprecated classes are registered in a class to path fashion foreach (glob($this->plugin_path . 'src/deprecated/*.php') as $file) { $class_name = str_replace('.php', '', basename($file)); $autoloader->register_class($class_name, $file); } $autoloader->register_autoloader(); }