Http::getProxy() method to get proxy configuration
[lhc/web/wiklou.git] / includes / db / IDatabase.php
index cb0b25f..19eb126 100644 (file)
@@ -159,6 +159,12 @@ interface IDatabase {
         */
        public function lastDoneWrites();
 
+       /**
+        * @return bool Whether there is a transaction open with possible write queries
+        * @since 1.27
+        */
+       public function writesPending();
+
        /**
         * Returns true if there is a transaction open with possible write
         * queries or transaction pre-commit/idle callbacks waiting on it to finish.
@@ -699,16 +705,18 @@ interface IDatabase {
         *
         * Takes the same arguments as IDatabase::select().
         *
-        * @param string $table Table name
+        * @since 1.27 Added $join_conds parameter
+        *
+        * @param array|string $tables Table names
         * @param string $vars Unused
         * @param array|string $conds Filters on the table
         * @param string $fname Function name for profiling
         * @param array $options Options for select
+        * @param array $join_conds Join conditions (since 1.27)
         * @return int Row count
-        * @since 1.24
         */
        public function selectRowCount(
-               $table, $vars = '*', $conds = '', $fname = __METHOD__, $options = array()
+               $tables, $vars = '*', $conds = '', $fname = __METHOD__, $options = array(), $join_conds = array()
        );
 
        /**
@@ -1365,6 +1373,21 @@ interface IDatabase {
         */
        public function getLag();
 
+       /**
+        * Get the slave lag when the current transaction started
+        * or a general lag estimate if not transaction is active
+        *
+        * This is useful when transactions might use snapshot isolation
+        * (e.g. REPEATABLE-READ in innodb), so the "real" lag of that data
+        * is this lag plus transaction duration. If they don't, it is still
+        * safe to be pessimistic. In AUTO-COMMIT mode, this still gives an
+        * indication of the staleness of subsequent reads.
+        *
+        * @return array ('lag': seconds, 'since': UNIX timestamp of BEGIN)
+        * @since 1.27
+        */
+       public function getSessionLagStatus();
+
        /**
         * Return the maximum number of items allowed in a list, or 0 for unlimited.
         *
@@ -1494,4 +1517,10 @@ interface IDatabase {
         *   restore the initial value
         */
        public function setBigSelects( $value = true );
+
+       /**
+        * @return bool Whether this DB is read-only
+        * @since 1.27
+        */
+       public function isReadOnly();
 }