[icinga-checkins] icinga.org: icinga-web/jmosshammer/default: * Provded oracle fix for session garbage collector

git at icinga.org git at icinga.org
Sun Jun 26 11:22:17 CEST 2011


Module: icinga-web
Branch: jmosshammer/default
Commit: 25d93fb5c7ec1d60cb691272c1381d71748a3030
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=25d93fb5c7ec1d60cb691272c1381d71748a3030

Author: Marius Hein <marius.hein at netways.de>
Date:   Sat Jun 25 13:20:52 2011 +0200

* Provded oracle fix for session garbage collector

---

 .../storage/AppKitDoctrineSessionStorage.class.php |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php b/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
index caf2eaf..b45bfef 100755
--- a/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
+++ b/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
@@ -42,9 +42,13 @@ class AppKitDoctrineSessionStorage extends AgaviSessionStorage {
 	}
 	
 	public function sessionGC($lifetime) {
-		$maxlifetime = time()-$lifetime;
+		$date = new DateTime();
+		$date->sub(new DateInterval(sprintf('PT%dS', $lifetime)));
+
+		$this->getContext()->getLoggerManager()->log('Deleting sessions older that '. $date->format('c'), AgaviLogger::DEBUG);
+
 		$result = Doctrine_Query::create()
-		->andWhere('session_created < ?', array(date("c",$maxlifetime)))
+		->andWhere('session_created < ?', array($date->format('Y-m-d H:i:s')))
 		->delete('NsmSession')
 		->execute();
 		
@@ -105,4 +109,4 @@ class AppKitDoctrineSessionStorage extends AgaviSessionStorage {
 
 class AppKitDoctrineSessionStorageException extends AppKitException {}
 
-?>
\ No newline at end of file
+?>





More information about the icinga-checkins mailing list