From d794361b8753f529e3a35ccd1278e7b59c92dff3 Mon Sep 17 00:00:00 2001 From: losinshi Date: Thu, 11 Jan 2007 00:39:47 +0000 Subject: [PATCH] increasing performance of the web frontend git-svn-id: file:///home/jan/tmp/wetterstation/trunk@216 dd492736-c11a-0410-ad51-8c26713eaf7f --- webstuff/frontend/php_inc/connection.inc.php | 4 +++- webstuff/frontend/php_inc/module_set.inc.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/webstuff/frontend/php_inc/connection.inc.php b/webstuff/frontend/php_inc/connection.inc.php index 122b49f..0bb8143 100644 --- a/webstuff/frontend/php_inc/connection.inc.php +++ b/webstuff/frontend/php_inc/connection.inc.php @@ -20,7 +20,9 @@ class Connection{ /* Verbindung herstellen (wenn noch net besteht)*/ function _createConn(){ - if($this->conn == NULL){ + //print $this->conn."
"; + $status = pg_connection_status($this->conn); + if($status !== PGSQL_CONNECTION_OK){ $this->conn = pg_connect(Config::getPgConnString()) or die('Verbindungsaufbau fehlgeschlagen: ' . pg_last_error()); } diff --git a/webstuff/frontend/php_inc/module_set.inc.php b/webstuff/frontend/php_inc/module_set.inc.php index b1dd4f4..b54d674 100644 --- a/webstuff/frontend/php_inc/module_set.inc.php +++ b/webstuff/frontend/php_inc/module_set.inc.php @@ -51,7 +51,7 @@ class ModuleSet{ } function &_getConnInstance(){ - if($connInstance == NULL){ + if($this->connInstance == NULL){ $this->connInstance = new Connection(); } return $this->connInstance;