Esempio n. 1
0
 /**
  * Reset the singleton instance
  *
  * @return void
  */
 public static function resetInstance()
 {
     self::$_instance = null;
 }
Esempio n. 2
0
 /**
  * Register {@link autoload()} with spl_autoload()
  *
  * @deprecated Since 1.8.0
  * @param string $class (optional)
  * @param boolean $enabled (optional)
  * @return void
  * @throws Postman_Zend_Exception if spl_autoload() is not found
  * or if the specified class does not have an autoload() method.
  */
 public static function registerAutoload($class = 'Postman_Zend_Loader', $enabled = true)
 {
     trigger_error(__CLASS__ . '::' . __METHOD__ . ' is deprecated as of 1.8.0 and will be removed with 2.0.0; use Postman_Zend_Loader_Autoloader instead', E_USER_NOTICE);
     require_once 'Zend/Loader/Autoloader.php';
     $autoloader = Postman_Zend_Loader_Autoloader::getInstance();
     $autoloader->setFallbackAutoloader(true);
     if ('Postman_Zend_Loader' != $class) {
         self::loadClass($class);
         $methods = get_class_methods($class);
         if (!in_array('autoload', (array) $methods)) {
             require_once 'Zend/Exception.php';
             throw new Postman_Zend_Exception("The class \"{$class}\" does not have an autoload() method");
         }
         $callback = array($class, 'autoload');
         if ($enabled) {
             $autoloader->pushAutoloader($callback);
         } else {
             $autoloader->removeAutoloader($callback);
         }
     }
 }