Also fixed a php example block comment
Change-Id: Ib6967180ad0d45aec7b7d4b6d383723e2c95fefa
* // Time-to-live (in seconds)
* $cache::TTL_DAY,
* // Function that derives the new key value
* // Time-to-live (in seconds)
* $cache::TTL_DAY,
* // Function that derives the new key value
- * return function ( $id, $oldValue, &$ttl, array &$setOpts ) {
+ * function ( $id, $oldValue, &$ttl, array &$setOpts ) {
* $dbr = wfGetDB( DB_REPLICA );
* // Account for any snapshot/replica DB lag
* $setOpts += Database::getCacheSetOptions( $dbr );
* $dbr = wfGetDB( DB_REPLICA );
* // Account for any snapshot/replica DB lag
* $setOpts += Database::getCacheSetOptions( $dbr );
// Wrap $callback to match the getWithSetCallback() format while passing $id to $callback
$id = null;
// Wrap $callback to match the getWithSetCallback() format while passing $id to $callback
$id = null;
- $func = function ( $oldValue, &$ttl, array $setOpts, $oldAsOf ) use ( $callback, &$id ) {
+ $func = function ( $oldValue, &$ttl, array &$setOpts, $oldAsOf ) use ( $callback, &$id ) {
return $callback( $id, $oldValue, $ttl, $setOpts, $oldAsOf );
};
return $callback( $id, $oldValue, $ttl, $setOpts, $oldAsOf );
};