X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fparser%2FPreprocessor.php;h=368d79ef4993ca245a1e072500c1f0cc6887ccae;hb=f0a28890a000b2c3259438a6b733ed46749c6e2a;hp=df5d4995b499d43d21f1cfd123d2f55df4f52a26;hpb=0183ae1453588efe8c8f8318224fcdfa1d1e225c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Preprocessor.php b/includes/parser/Preprocessor.php index df5d4995b4..368d79ef49 100644 --- a/includes/parser/Preprocessor.php +++ b/includes/parser/Preprocessor.php @@ -33,23 +33,23 @@ abstract class Preprocessor { /** * @var array Brace matching rules. */ - protected $rules = array( - '{' => array( + protected $rules = [ + '{' => [ 'end' => '}', - 'names' => array( + 'names' => [ 2 => 'template', 3 => 'tplarg', - ), + ], 'min' => 2, 'max' => 3, - ), - '[' => array( + ], + '[' => [ 'end' => ']', - 'names' => array( 2 => null ), + 'names' => [ 2 => null ], 'min' => 2, 'max' => 2, - ) - ); + ] + ]; /** * Store a document tree in the cache. @@ -67,9 +67,7 @@ abstract class Preprocessor { } $key = wfMemcKey( - // TODO: Once we require PHP 5.5, use static::class instead of - // get_called_class() or get_class( $this ). - defined( 'static::CACHE_PREFIX' ) ? static::CACHE_PREFIX : get_called_class(), + defined( 'static::CACHE_PREFIX' ) ? static::CACHE_PREFIX : static::class, md5( $text ), $flags ); $value = sprintf( "%08d", static::CACHE_VERSION ) . $tree; @@ -100,9 +98,7 @@ abstract class Preprocessor { $cache = ObjectCache::getInstance( $config->get( 'MainCacheType' ) ); $key = wfMemcKey( - // TODO: Once we require PHP 5.5, use static::class instead of - // get_called_class() or get_class( $this ). - defined( 'static::CACHE_PREFIX' ) ? static::CACHE_PREFIX : get_called_class(), + defined( 'static::CACHE_PREFIX' ) ? static::CACHE_PREFIX : static::class, md5( $text ), $flags ); $value = $cache->get( $key );