/**
  * Reset MVC instance
  *
  * Unregisters plugins and helpers, and destroys MVC layout instance.
  * 
  * @return void
  */
 public static function resetMvcInstance()
 {
     if (null !== self::$_mvcInstance) {
         $layout = self::$_mvcInstance;
         $pluginClass = $layout->getPluginClass();
         $front = Zend_Controller_Front::getInstance();
         if ($front->hasPlugin($pluginClass)) {
             $front->unregisterPlugin($pluginClass);
         }
         if (Zend_Controller_Action_HelperBroker::hasHelper('layout')) {
             Zend_Controller_Action_HelperBroker::removeHelper('layout');
         }
         unset($layout);
         self::$_mvcInstance = null;
     }
 }
Exemple #2
0
 /**
  * Static method for initialization with MVC support
  * 
  * @param  string|array|Zend_Config $options 
  * @return Zend_Layout
  */
 public static function startMvc($options = null)
 {
     if (null === self::$_mvcInstance) {
         self::$_mvcInstance = new self($options, true);
     } else {
         self::$_mvcInstance->setOptions($options);
     }
     return self::$_mvcInstance;
 }