Ejemplo n.º 1
0
 protected function __construct()
 {
     $this->params = array('get' => array(), 'post' => array(), 'cookie' => array(), 'put' => array(), 'rawput' => array());
     if (Hayate_Config::getInstance()->get('xss_clean', true)) {
         foreach ($_GET as $key => $val) {
             $this->params['get'][$key] = htmlentities($val, ENT_QUOTES, 'utf-8');
         }
         foreach ($_POST as $key => $val) {
             $this->params['post'][$key] = htmlentities($val, ENT_QUOTES, 'utf-8');
         }
         foreach ($_COOKIE as $key => $val) {
             $this->params['cookie'][$key] = htmlentities($val, ENT_QUOTES, 'utf-8');
         }
     }
     if (Hayate_Request::getInstance()->isPut()) {
         $this->loadPut();
     }
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     $this->request = Hayate_Request::getInstance();
     $this->input = Hayate_Input::getInstance();
     Hayate_Event::add('hayate.post_dispatch', array($this, '_postDispatch'));
 }
Ejemplo n.º 3
0
 public function run()
 {
     //$mem = ((memory_get_peak_usage(true) / 1024) / 1024) . 'Mb';
     //var_dump($mem);
     static $run;
     // there will be only one
     if (true === $run) {
         return;
     }
     $request = Hayate_Request::getInstance();
     $dispatcher = Hayate_Dispatcher::getInstance();
     Hayate_Event::run('hayate.pre_dispatch', array($dispatcher));
     do {
         $request->dispatched(true);
         $dispatcher->dispatch();
         if ($request->dispatched()) {
             Hayate_Event::run('hayate.post_dispatch', array($dispatcher, $request));
         }
     } while (false === $request->dispatched());
     Hayate_Event::run('hayate.send_headers');
     Hayate_Event::run('hayate.render');
     $run = true;
     Hayate_Event::run('hayate.shutdown');
     //$mem = ((memory_get_peak_usage(true) / 1024) / 1024) . 'Mb';
     //var_dump($mem);
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     $this->request = Hayate_Request::getInstance();
     $this->input = Hayate_Input::getInstance();
 }