Exemplo n.º 1
0
 /**
  *
  */
 public function prepareResponse()
 {
     $this->response = $this->application->returnResponse();
     if ($this->applicationConfig->get("accept-control-allow-origin") != NULL) {
         $accepts = explode(",", $this->applicationConfig->get("accept-control-allow-origin"));
         foreach ($accepts as $accept) {
             $this->response->setHeader("Access-Control-Allow-Origin: " . $accept, false);
         }
     }
     $this->response->process();
 }
Exemplo n.º 2
0
 /**
  *
  */
 public function shutdown()
 {
     if ($this->devmode) {
         $monitor = new Monitor();
         $this->response->addValue("memory_usage", $monitor->getUsedMemory());
         $this->response->addValue("memory_peak", $monitor->getPeak());
         $this->stopwatch->end();
         $this->response->addValue("time_elapsed", $this->stopwatch->getTimeElapsed());
     }
     if ($this->applicationConfig->get("accept-control-allow-origin") != NULL) {
         $accepts = explode(",", $this->applicationConfig->get("accept-control-allow-origin"));
         foreach ($accepts as $accept) {
             $this->response->setHeader("Access-Control-Allow-Origin: " . $accept, false);
         }
     }
     $this->response->process();
 }