dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Introduce IDatabase::buildSubstring
[lhc/web/wiklou.git]
/
includes
/
libs
/
rdbms
/
database
/
DBConnRef.php
diff --git
a/includes/libs/rdbms/database/DBConnRef.php
b/includes/libs/rdbms/database/DBConnRef.php
index
fb4122d
..
910d42f
100644
(file)
--- a/
includes/libs/rdbms/database/DBConnRef.php
+++ b/
includes/libs/rdbms/database/DBConnRef.php
@@
-23,16
+23,17
@@
class DBConnRef implements IDatabase {
const FLD_INDEX = 0;
const FLD_GROUP = 1;
const FLD_DOMAIN = 2;
const FLD_INDEX = 0;
const FLD_GROUP = 1;
const FLD_DOMAIN = 2;
+ const FLD_FLAGS = 3;
/**
* @param ILoadBalancer $lb Connection manager for $conn
/**
* @param ILoadBalancer $lb Connection manager for $conn
- * @param Database|array $conn
New connection handle or (server index, query groups, domain
)
+ * @param Database|array $conn
Database handle or (server index, query groups, domain, flags
)
*/
public function __construct( ILoadBalancer $lb, $conn ) {
$this->lb = $lb;
if ( $conn instanceof Database ) {
$this->conn = $conn; // live handle
*/
public function __construct( ILoadBalancer $lb, $conn ) {
$this->lb = $lb;
if ( $conn instanceof Database ) {
$this->conn = $conn; // live handle
- } elseif ( count( $conn ) >=
3
&& $conn[self::FLD_DOMAIN] !== false ) {
+ } elseif ( count( $conn ) >=
4
&& $conn[self::FLD_DOMAIN] !== false ) {
$this->params = $conn;
} else {
throw new InvalidArgumentException( "Missing lazy connection arguments." );
$this->params = $conn;
} else {
throw new InvalidArgumentException( "Missing lazy connection arguments." );
@@
-41,8
+42,8
@@
class DBConnRef implements IDatabase {
function __call( $name, array $arguments ) {
if ( $this->conn === null ) {
function __call( $name, array $arguments ) {
if ( $this->conn === null ) {
- list( $db, $groups, $wiki ) = $this->params;
- $this->conn = $this->lb->getConnection( $db, $groups, $wiki );
+ list( $db, $groups, $wiki
, $flags
) = $this->params;
+ $this->conn = $this->lb->getConnection( $db, $groups, $wiki
, $flags
);
}
return call_user_func_array( [ $this->conn, $name ], $arguments );
}
return call_user_func_array( [ $this->conn, $name ], $arguments );
@@
-349,6
+350,10
@@
class DBConnRef implements IDatabase {
return $this->__call( __FUNCTION__, func_get_args() );
}
return $this->__call( __FUNCTION__, func_get_args() );
}
+ public function buildSubstring( $input, $startPosition, $length = null ) {
+ return $this->__call( __FUNCTION__, func_get_args() );
+ }
+
public function buildStringCast( $field ) {
return $this->__call( __FUNCTION__, func_get_args() );
}
public function buildStringCast( $field ) {
return $this->__call( __FUNCTION__, func_get_args() );
}
@@
-424,6
+429,13
@@
class DBConnRef implements IDatabase {
return $this->__call( __FUNCTION__, func_get_args() );
}
return $this->__call( __FUNCTION__, func_get_args() );
}
+ public function unionConditionPermutations(
+ $table, $vars, array $permute_conds, $extra_conds = '', $fname = __METHOD__,
+ $options = [], $join_conds = []
+ ) {
+ return $this->__call( __FUNCTION__, func_get_args() );
+ }
+
public function conditional( $cond, $trueVal, $falseVal ) {
return $this->__call( __FUNCTION__, func_get_args() );
}
public function conditional( $cond, $trueVal, $falseVal ) {
return $this->__call( __FUNCTION__, func_get_args() );
}