From 793bac556f6b22aa59fd6a1663312af9eda4ad01 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 4 Jun 2010 19:13:16 +0000 Subject: [PATCH] Add $version parameter for custom style versions to OutputPage::addScriptFile() so we don't have to bump $wgStyleVersion on the cluster every time we deploy UsabilityInitiative changes. The UsabilityInitiative extension has been using this parameter for ages, but it never seems to have existed. --- includes/OutputPage.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index ed469782b3..9722be80ed 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -183,15 +183,18 @@ class OutputPage { * * @param $file String: filename in skins/common or complete on-server path * (/foo/bar.js) + * @param $version String: style version of the file. Defaults to $wgStyleVersion */ - public function addScriptFile( $file ) { + public function addScriptFile( $file, $version = null ) { global $wgStylePath, $wgStyleVersion; if( substr( $file, 0, 1 ) == '/' || preg_match( '#^[a-z]*://#i', $file ) ) { $path = $file; } else { $path = "{$wgStylePath}/common/{$file}"; } - $this->addScript( Html::linkedScript( wfAppendQuery( $path, $wgStyleVersion ) ) ); + if ( is_null( $version ) ) + $version = $wgStyleVersion; + $this->addScript( Html::linkedScript( wfAppendQuery( $path, $version ) ) ); } /** -- 2.20.1