Fix comment to note return type on error
[lhc/web/wiklou.git] / includes / Cdb.php
index 20cb7e3..ab42987 100644 (file)
@@ -13,7 +13,7 @@ abstract class CdbReader {
                if ( self::haveExtension() ) {
                        return new CdbReader_DBA( $fileName );
                } else {
-                       wfDebug( 'Warning: no dba extension found, using emulation.' );
+                       wfDebug( "Warning: no dba extension found, using emulation.\n" );
                        return new CdbReader_PHP( $fileName );
                }
        }
@@ -61,7 +61,7 @@ abstract class CdbWriter {
                if ( CdbReader::haveExtension() ) {
                        return new CdbWriter_DBA( $fileName );
                } else {
-                       wfDebug( 'Warning: no dba extension found, using emulation.' );
+                       wfDebug( "Warning: no dba extension found, using emulation.\n" );
                        return new CdbWriter_PHP( $fileName );
                }
        }
@@ -98,7 +98,8 @@ class CdbReader_DBA {
        }
 
        function close() {
-               dba_close( $this->handle );
+               if( isset($this->handle) )
+                       dba_close( $this->handle );
                unset( $this->handle );
        }
 
@@ -128,7 +129,8 @@ class CdbWriter_DBA {
        }
 
        function close() {
-               dba_close( $this->handle );
+               if( isset($this->handle) )
+                       dba_close( $this->handle );
                if ( wfIsWindows() ) {
                        unlink( $this->realFileName );
                }