* (bug 20494) OutputPage::getArticleBodyOnly() no longer requires an useless argument
[lhc/web/wiklou.git] / includes / db / Database.php
index 33c7d04..a8659b6 100644 (file)
@@ -234,14 +234,37 @@ abstract class DatabaseBase {
         */
        function isOpen() { return $this->mOpened; }
 
+       /**
+        * Set a flag for this connection
+        *
+        * @param $flag Integer: DBO_* constants from Defines.php:
+        *   - DBO_DEBUG: output some debug info (same as debug())
+        *   - DBO_NOBUFFER: don't buffer results (inverse of bufferResults())
+        *   - DBO_IGNORE: ignore errors (same as ignoreErrors())
+        *   - DBO_TRX: automatically start transactions
+        *   - DBO_DEFAULT: automatically sets DBO_TRX if not in command line mode
+        *       and removes it in command line mode
+        *   - DBO_PERSISTENT: use persistant database connection 
+        */
        function setFlag( $flag ) {
                $this->mFlags |= $flag;
        }
 
+       /**
+        * Clear a flag for this connection
+        *
+        * @param $flag: same as setFlag()'s $flag param
+        */
        function clearFlag( $flag ) {
                $this->mFlags &= ~$flag;
        }
 
+       /**
+        * Returns a boolean whether the flag $flag is set for this connection
+        *
+        * @param $flag: same as setFlag()'s $flag param
+        * @return Boolean
+        */
        function getFlag( $flag ) {
                return !!($this->mFlags & $flag);
        }
@@ -1470,9 +1493,9 @@ abstract class DatabaseBase {
         * Escape string for safe LIKE usage
         */
        function escapeLike( $s ) {
-               $s=str_replace('\\','\\\\',$s);
-               $s=$this->strencode( $s );
-               $s=str_replace(array('%','_'),array('\%','\_'),$s);
+               $s = str_replace( '\\', '\\\\', $s );
+               $s = $this->strencode( $s );
+               $s = str_replace( array( '%', '_' ), array( '\%', '\_' ), $s );
                return $s;
        }