]> git.mxchange.org Git - shipsimu.git/commitdiff
Extended headers added
authorRoland Häder <roland@mxchange.org>
Thu, 15 May 2008 19:45:44 +0000 (19:45 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 15 May 2008 19:45:44 +0000 (19:45 +0000)
application/ship-simu/main/factories/class_ShipSimuNewsFactory.php
inc/classes/main/response/class_HttpResponse.php

index 7e60b34f85a6bec411fbf3f478a213d0e16d7120..6b345531f04f9b0a6a58cfa0cbec56dd5a085eed 100644 (file)
@@ -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]
index 05e6f987cf659ca54c4639d52806628649f287cd..dea248185cd33cf0e886768c13ad1a8000ba67e7 100644 (file)
@@ -20,6 +20,9 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The extended headers are taken from phpMyAdmin setup tool, written by
+ * Michal Cihar <michal@cihar.com>, 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}");
                        }