X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabase.php;h=60062fbc139d97ae4a086eeb4028da22425d45bf;hb=35093297075bb55490b0c24653e0978333bc2fec;hp=3024b00e98aeba378e47ef11b6afe2856b4519c9;hpb=76f5c309adce9b42320565c42dcd7605bf07135e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 3024b00e98..60062fbc13 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -586,11 +586,17 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware return null; } - public function setLBInfo( $name, $value = null ) { - if ( is_null( $value ) ) { - $this->lbInfo = $name; + public function setLBInfo( $nameOrArray, $value = null ) { + if ( is_array( $nameOrArray ) ) { + $this->lbInfo = $nameOrArray; + } elseif ( is_string( $nameOrArray ) ) { + if ( $value !== null ) { + $this->lbInfo[$nameOrArray] = $value; + } else { + unset( $this->lbInfo[$nameOrArray] ); + } } else { - $this->lbInfo[$name] = $value; + throw new InvalidArgumentException( "Got non-string key" ); } }