Example #1
0
 /**
  * Lance le controller indiqué dans Request
  * Remplit le body de Response à partir de la Vue
  * @exception Minz_Exception
  */
 public function run($ob = true)
 {
     $cache = new Minz_Cache();
     // Le ob_start est dupliqué : sans ça il y a un bug sous Firefox
     // ici on l'appelle avec 'ob_gzhandler', après sans.
     // Vraisemblablement la compression fonctionne mais c'est sale
     // J'ignore les effets de bord :(
     if ($ob) {
         ob_start('ob_gzhandler');
     }
     if (Minz_Cache::isEnabled() && !$cache->expired()) {
         if ($ob) {
             ob_start();
         }
         $cache->render();
         if ($ob) {
             $text = ob_get_clean();
         }
     } else {
         $text = '';
         //TODO: Clean this code
         while (Minz_Request::$reseted) {
             Minz_Request::$reseted = false;
             try {
                 $this->createController('FreshRSS_' . Minz_Request::controllerName() . '_Controller');
                 $this->controller->init();
                 $this->controller->firstAction();
                 $this->launchAction(Minz_Request::actionName() . 'Action');
                 $this->controller->lastAction();
                 if (!Minz_Request::$reseted) {
                     if ($ob) {
                         ob_start();
                     }
                     $this->controller->view()->build();
                     if ($ob) {
                         $text = ob_get_clean();
                     }
                 }
             } catch (Minz_Exception $e) {
                 throw $e;
             }
         }
         if (Minz_Cache::isEnabled()) {
             $cache->cache($text);
         }
     }
     Minz_Response::setBody($text);
 }
Example #2
0
 /**
  * Lance le controller indiqué dans Request
  * Remplit le body de Response à partir de la Vue
  * @exception Minz_Exception
  */
 public function run()
 {
     do {
         self::$needsReset = false;
         try {
             $this->createController(Minz_Request::controllerName());
             $this->controller->init();
             $this->controller->firstAction();
             if (!self::$needsReset) {
                 $this->launchAction(Minz_Request::actionName() . 'Action');
             }
             $this->controller->lastAction();
             if (!self::$needsReset) {
                 $this->controller->view()->build();
             }
         } catch (Minz_Exception $e) {
             throw $e;
         }
     } while (self::$needsReset);
 }
Example #3
0
 /**
  * Constructeur
  * Détermine si on utilise un layout ou non
  */
 public function __construct()
 {
     $this->view_filename = APP_PATH . self::VIEWS_PATH_NAME . '/' . Minz_Request::controllerName() . '/' . Minz_Request::actionName() . '.phtml';
     self::$title = Minz_Configuration::title();
 }
Example #4
0
 /**
  * Constructeur
  * Détermine si on utilise un layout ou non
  */
 public function __construct()
 {
     $this->change_view(Minz_Request::controllerName(), Minz_Request::actionName());
     $conf = Minz_Configuration::get('system');
     self::$title = $conf->title;
 }