CVS update: /cowiki/includes/cowiki/class/dao/

[email protected] 6 May 2005 02:04:33 -0000
Newsgroups gmane.comp.php.cowiki.cvs
Message-ID <[email protected]>
User: dgorski 
Date: 2005/05/05 19:04:33

Modified:
   cowiki/includes/cowiki/class/dao/class.StorageMySQLi.php

Log:
 Added __destruct() and __close()

File Changes:

Directory: /cowiki/includes/cowiki/class/dao/
=============================================

File [changed]: class.StorageMySQLi.php
Url: http://cowiki.tigris.org/source/browse/cowiki/includes/cowiki/class/dao/class.StorageMySQLi.php?r1=1.13&r2=1.14
Delta lines:  +29 -2
--------------------
--- class.StorageMySQLi.php	3 May 2005 01:46:00 -0000	1.13
+++ class.StorageMySQLi.php	6 May 2005 02:04:30 -0000	1.14
@@ -2,7 +2,7 @@
 
 /**
  *
- * $Id: class.StorageMySQLi.php,v 1.13 2005/05/03 01:46:00 dgorski Exp $
+ * $Id: class.StorageMySQLi.php,v 1.14 2005/05/06 02:04:30 dgorski Exp $
  *
  * This file is part of coWiki. coWiki is free software under the terms of
  * the GNU General Public License (GPL). Read the LICENSE file. If you did
@@ -17,7 +17,7 @@
  * @author      Daniel T. Gorski, <[email protected]>
  * @copyright   (C) Daniel T. Gorski, {@link http://www.develnet.org}
  * @license     http://www.gnu.org/licenses/gpl.html
- * @version     $Revision: 1.13 $
+ * @version     $Revision: 1.14 $
  *
  */
 
@@ -63,6 +63,14 @@
 
     // --------------------------------------------------------------------
 
+    public function __destruct() {
+        if ($this->rLink) {
+            @mysqli_close($this->rLink);
+        }
+    }
+
+    // --------------------------------------------------------------------
+
     /**
      * Connect. Overwrite the parent method.
      *
@@ -237,6 +245,25 @@
      */
     public function freeResult($rResult) {
         @mysqli_free_result($rResult);
+    }
+
+    // --------------------------------------------------------------------
+
+    /**
+     * Close current connection
+     *
+     * @access  public
+     * @return  void
+     *
+     * @author  Daniel T. Gorski, <[email protected]>
+     * @since   coWiki 0.4.0
+     *
+     * @todo    [D11N]  Check description
+     */
+    public function close() {
+        if ($this->rLink) {
+            @mysqli_close($this->rLink);
+        }
     }
 
 } // of class