示例#1
0
	/**
	 * Register autoloader.
	 * @return void
	 */
	public function register()
	{
		$this->list = $this->getCache()->load($this->getKey(), callback($this, '_rebuildCallback'));

		if (isset($this->list[strtolower(__CLASS__)]) && class_exists('NNetteLoader', FALSE)) {
			NNetteLoader::getInstance()->unregister();
		}

		parent::register();
	}
示例#2
0
	/**
	 * Returns singleton instance with lazy instantiation.
	 * @return NNetteLoader
	 */
	public static function getInstance()
	{
		if (self::$instance === NULL) {
			self::$instance = new self;
		}
		return self::$instance;
	}
示例#3
0
 function register()
 {
     $cache = $this->getCache();
     $key = $this->getKey();
     if (isset($cache[$key])) {
         $this->list = $cache[$key];
     } else {
         $this->rebuild();
     }
     if (isset($this->list[strtolower(__CLASS__)]) && class_exists('NNetteLoader', FALSE)) {
         NNetteLoader::getInstance()->unregister();
     }
     parent::register();
 }
示例#4
0
define('NETTE', TRUE);
define('NETTE_DIR', dirname(__FILE__));
define('NETTE_VERSION_ID', 20000); // v2.0.0
define('NETTE_PACKAGE', 'PHP 5.2 prefixed');



require_once dirname(__FILE__) . '/common/exceptions.php';
require_once dirname(__FILE__) . '/common/Object.php';
require_once dirname(__FILE__) . '/Utils/LimitedScope.php';
require_once dirname(__FILE__) . '/Loaders/AutoLoader.php';
require_once dirname(__FILE__) . '/Loaders/NetteLoader.php';


NNetteLoader::getInstance()->register();

require_once dirname(__FILE__) . '/Diagnostics/Helpers.php';
require_once dirname(__FILE__) . '/Utils/Html.php';
NDebugger::_init();

NSafeStream::register();



/**
 * NCallback factory.
 * @param  mixed   class, object, function, callback
 * @param  string  method
 * @return NCallback
 */