function execute($method) { parent::Execute($method); //Flush Output $this->headers->Output(); ob_end_flush(); //Remove from stack PH::Pop(); }
function execute($method = 'GET') { ob_start(); parent::Execute($method); $data = ob_get_contents(); ob_end_clean(); //Pop off the stack PH::Pop(); return $data; }
function execute($method) { if ($method == 'GET') { $this->cache->preExecute(); } //No assumptions $method = strtoupper($method); //Add to Page\Handler Stack PH::Push($this); //Setup output buffering ob_start(); $real_method = $method; $depth = 0; while ($this->page->can($method) || $this->can_fake($method)) { $depth++; if ($this->can_fake($method)) { $method = 'GET'; } $return = $this->page->execute_request($method); if ($return) { ob_clean(); $this->page = $return; } else { if (!$this->page->can($real_method)) { if ($real_method == 'HEAD') { //$contents = ob_get_contents(); //Headers only, no body ob_clean(); } } break; } //Infinite loop? if ($depth > static::MAX_REQUEST_DEPTH) { PH::Pop(); ob_end_flush(); $this->headers->Clear(); throw new PageHandlerException('Max request depth of ' . static::MAX_REQUEST_DEPTH . ' exceeded.'); } } ob_end_flush(); //Nothing was handled if (!$depth) { PH::Pop(); $this->headers->Clear(); throw new PageHandlerException('Invalid or unknown method ' . $method); } //Pass to the cache handler if ($method == 'GET') { $this->cache->postExecute($this->headers); } }