[pLog-svn] r1684 - plog/trunk/class/view

ork at devel.plogworld.net ork at devel.plogworld.net
Sat Apr 2 17:21:53 GMT 2005


Author: ork
Date: 2005-04-02 17:21:52 +0000 (Sat, 02 Apr 2005)
New Revision: 1684

Modified:
   plog/trunk/class/view/view.class.php
Log:
i dont think its a good idea to call phpsniff() on every request.. as long as we're part of a session its sufficient to call it once .. 


Modified: plog/trunk/class/view/view.class.php
===================================================================
--- plog/trunk/class/view/view.class.php	2005-04-02 11:48:36 UTC (rev 1683)
+++ plog/trunk/class/view/view.class.php	2005-04-02 17:21:52 UTC (rev 1684)
@@ -301,15 +301,19 @@
          */
         function render()
         {
-			// send the headers we've been assigned if any, alognside the conten-type header
-			foreach( $this->_headers as $header )
-				header( $header );
-			
-			$this->sendContentType();
-			
-			// 'browser' object that all views will have, so that we can gather information
-			// about the client...
-			$this->setValue( "browser", new phpSniff());
+            // send the headers we've been assigned if any, alognside the conten-type header
+            foreach( $this->_headers as $header )
+            header( $header );
+
+            $this->sendContentType();
+
+            // 'browser' object that all views will have, so that we can gather information
+            // about the client...
+            if ($this->getSessionValue("phpSniffObject") == "") {
+                // as long as we're part of a session, the client won't change :)
+                $this->setSessionValue("phpSniffObject", new phpSniff());
+            }
+            $this->setValue( "browser", $this->getSessionValue["phpSniffObject"] );
         }
-     }
-?>
\ No newline at end of file
+    }
+?>




More information about the pLog-svn mailing list