Fix ObjectCache::newAccelerator with string fallback in PHP 5.3
Because in PHP5.3: php > $a = "hash"; php > echo isset( $a['fallback'] ); 1 php > echo $a['fallback']; h This will fix using MediaWiki with MySQL on PHP5.3 if neither APC, xcache nor wincache are available. Change-Id: Iebf034be75b282e2654cd298713455caf062eda4
This commit is contained in:
parent
288873409c
commit
e6e4ffd2f4
1 changed files with 3 additions and 1 deletions
|
|
@ -198,7 +198,9 @@ class ObjectCache {
|
|||
*/
|
||||
public static function newAccelerator( $params = array(), $fallback = null ) {
|
||||
if ( $fallback === null ) {
|
||||
if ( isset( $params['fallback'] ) ) {
|
||||
// The is_array check here is needed because in PHP 5.3:
|
||||
// $a = 'hash'; isset( $params['fallback'] ); yields true
|
||||
if ( is_array( $params ) && isset( $params['fallback'] ) ) {
|
||||
$fallback = $params['fallback'];
|
||||
} elseif ( !is_array( $params ) ) {
|
||||
$fallback = $params;
|
||||
|
|
|
|||
Loading…
Reference in a new issue