Example #1
0
 public function deliver(PageCacheRecord $record)
 {
     $response = new Response();
     $headers = array();
     if (defined('APP_CHARSET')) {
         $headers["Content-Type"] = "text/html; charset=" . APP_CHARSET;
     }
     $headers = array_merge($headers, $record->getCacheRecordHeaders());
     $response->headers->add($headers);
     $response->setContent($record->getCacheRecordContent());
     return $response;
 }
 /**
  * @inheritdoc
  */
 public function create($content, $code = Response::HTTP_OK, array $headers = array())
 {
     return \Concrete\Core\Http\Response::create($content, $code, $headers);
 }
 /**
  * Sends the file.
  */
 public function sendContent()
 {
     if (!$this->isSuccessful()) {
         parent::sendContent();
         return;
     }
     if (0 === $this->maxlen) {
         return;
     }
     $out = fopen('php://output', 'wb');
     $file = $this->filesystem->readStream($this->file->getPath());
     stream_copy_to_stream($file, $out, $this->maxlen, $this->offset);
     fclose($out);
     fclose($file);
 }
Example #4
0
 public function preview($pThemeID)
 {
     $vl = $this->getValueListFromRequest($pThemeID);
     $pt = PageTheme::getByID($pThemeID);
     $pt->enablePreviewRequest();
     $sheets = $pt->getThemeCustomizableStyleSheets();
     // for each customizable stylesheet in the theme, we take the value list
     // and send its variables through the LESS parser.
     foreach ($sheets as $sheet) {
         $sheet->setValueList($vl);
         // we save each sheet to the preview location.
         $sheet->output();
     }
     // and finally, we pass our modified theme into the updated view, which we send back in the iframe.
     $req = Request::getInstance();
     $req->setCurrentPage($this->page);
     $controller = $this->page->getPageController();
     $view = $controller->getViewObject();
     $view->setCustomPageTheme($pt);
     $req->setCustomRequestUser(-1);
     $response = new Response();
     $content = $view->render();
     $response->setContent($content);
     return $response;
 }
Example #5
0
 /**
  * Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9.
  *
  * @link http://support.microsoft.com/kb/323308
  */
 protected function ensureIEOverSSLCompatibility(Symfony\Component\HttpFoundation\Request $request)
 {
     return parent::ensureIEOverSSLCompatibility($request);
 }