Don't call preg_replace ~80 times per request. Leave the heavy lifting to Special:Version, using the new svn-revision member of $wgExtensionCredits.

This commit is contained in:
Tim Starling 2008-05-06 11:59:58 +00:00
parent af36dab9fa
commit efbfbd44a4
2 changed files with 4 additions and 2 deletions

View file

@ -21,7 +21,8 @@ if ( ! defined( 'MEDIAWIKI' ) )
$wgExtensionFunctions[] = 'wfCite';
$wgExtensionCredits['parserhook'][] = array(
'name' => 'Cite',
'version' => preg_replace('/^.* (\d\d\d\d-\d\d-\d\d) .*$/', '\1', '$LastChangedDate$'), #just the date of the last change
'svn-date' => '$LastChangedDate$',
'svn-revision' => '$LastChangedRevision$',
'author' => 'Ævar Arnfjörð Bjarmason',
'description' => 'Adds <nowiki><ref[ name=id]></nowiki> and <nowiki><references/></nowiki> tags, for citations', // kept for b/c
'descriptionmsg' => 'cite_desc',

View file

@ -15,7 +15,8 @@ if (!defined('MEDIAWIKI')) die();
$wgExtensionCredits['specialpage'][] = array(
'name' => 'Cite',
'version' => preg_replace('/^.* (\d\d\d\d-\d\d-\d\d) .*$/', '\1', '$LastChangedDate$'), #just the date of the last change
'svn-date' => '$LastChangedDate$',
'svn-revision' => '$LastChangedRevision$',
'author' => 'Ævar Arnfjörð Bjarmason',
'description' => 'adds a [[Special:Cite|citation]] special page & toolbox link', // kept for b/c
'descriptionmsg' => 'cite_article_desc',