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
Made BagOStuff::cas properly optional
[lhc/web/wiklou.git]
/
includes
/
objectcache
/
SqlBagOStuff.php
diff --git
a/includes/objectcache/SqlBagOStuff.php
b/includes/objectcache/SqlBagOStuff.php
index
03b0166
..
df878f7
100644
(file)
--- a/
includes/objectcache/SqlBagOStuff.php
+++ b/
includes/objectcache/SqlBagOStuff.php
@@
-405,7
+405,7
@@
class SqlBagOStuff extends BagOStuff {
* @param int $exptime
* @return bool
*/
* @param int $exptime
* @return bool
*/
- p
ublic
function cas( $casToken, $key, $value, $exptime = 0 ) {
+ p
rotected
function cas( $casToken, $key, $value, $exptime = 0 ) {
list( $serverIndex, $tableName ) = $this->getTableByKey( $key );
try {
$db = $this->getDB( $serverIndex );
list( $serverIndex, $tableName ) = $this->getTableByKey( $key );
try {
$db = $this->getDB( $serverIndex );
@@
-514,6
+514,14
@@
class SqlBagOStuff extends BagOStuff {
return $newValue;
}
return $newValue;
}
+ public function merge( $key, $callback, $exptime = 0, $attempts = 10 ) {
+ if ( !is_callable( $callback ) ) {
+ throw new Exception( "Got invalid callback." );
+ }
+
+ return $this->mergeViaCas( $key, $callback, $exptime, $attempts );
+ }
+
/**
* @param DatabaseBase $db
* @param string $exptime
/**
* @param DatabaseBase $db
* @param string $exptime