From 3d9c48e0066be8f20fa08f8517f9cbb943504de5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 15 May 2008 19:45:44 +0000 Subject: [PATCH] Extended headers added --- .../factories/class_ShipSimuNewsFactory.php | 10 ++++++++++ .../main/response/class_HttpResponse.php | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/application/ship-simu/main/factories/class_ShipSimuNewsFactory.php b/application/ship-simu/main/factories/class_ShipSimuNewsFactory.php index 7e60b34..6b34553 100644 --- a/application/ship-simu/main/factories/class_ShipSimuNewsFactory.php +++ b/application/ship-simu/main/factories/class_ShipSimuNewsFactory.php @@ -54,6 +54,16 @@ class ShipSimuNewsFactory extends BaseFrameworkSystem { // Return the prepared instance return $factoryInstance; } + + /** + * Create the news object itself here depending on the request + * + * @param $requestInstance An instance of a request class + * @return $newsInstance An instance of a news class + */ + public function createNewObject (Requestable $requestInstance) { + // Do some stuff here + } } // [EOF] diff --git a/inc/classes/main/response/class_HttpResponse.php b/inc/classes/main/response/class_HttpResponse.php index 05e6f98..dea2481 100644 --- a/inc/classes/main/response/class_HttpResponse.php +++ b/inc/classes/main/response/class_HttpResponse.php @@ -20,6 +20,9 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * The extended headers are taken from phpMyAdmin setup tool, written by + * Michal Cihar , licensed under GNU GPL 2.0. */ class HttpResponse extends BaseFrameworkSystem implements Responseable { /** @@ -126,6 +129,22 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { } elseif (!headers_sent()) { // Send headers out header("HTTP/1.0 {$this->responseStatus}"); + + // Used later + $now = gmdate('D, d M Y H:i:s') . ' GMT'; + + // General header for no caching + header('Expires: ' . $now); // rfc2616 - Section 14.21 + header('Last-Modified: ' . $now); + header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1 + header('Pragma: no-cache'); // HTTP/1.0 + + // whether to show html header? + if ($action != 'download') { + + // Define the charset to be used + header('Content-Type: text/html; charset=utf-8'); + foreach ($this->responseHeaders as $name=>$value) { header("{$name}: {$value}"); } -- 2.39.2