Kill $wgEnablePopups

It's not a feature flag because it disables whole extension as opposed to a
particular feature. It would result in weird situations where the extension is
present in Special:Version but does not work for no obvious reason. If an
extension needs to be disabled on WMF, its registration file should not be included,
as opposed to "feature flags". This, however, does not mean that I'm opposed to
real feature flags:)

Change-Id: I09bae50241057f727881f33d6f97f69cec7c0a10
This commit is contained in:
Max Semenik 2014-02-10 13:18:19 +04:00
parent 7cadfed0be
commit 6b0057a521
2 changed files with 5 additions and 14 deletions

View file

@ -21,11 +21,8 @@
class PopupsHooks { class PopupsHooks {
public static function onBeforePageDisplay( OutputPage &$out, Skin &$skin) { public static function onBeforePageDisplay( OutputPage &$out, Skin &$skin) {
global $wgEnablePopups; // Depends on PageImages & TextExtracts extensions
if ( class_exists( 'ApiQueryExtracts' )
// Enable only if explicitly enabled. Also depends on PageImages & TextExtracts extensions
if ( $wgEnablePopups
&& class_exists( 'ApiQueryExtracts' )
&& class_exists( 'ApiQueryPageImages' ) && class_exists( 'ApiQueryPageImages' )
) { ) {
$out->addModules( array( 'ext.popups' ) ); $out->addModules( array( 'ext.popups' ) );

View file

@ -22,15 +22,6 @@
* @ingroup extensions * @ingroup extensions
*/ */
/**
* Adds navigation popups to link on an article
* @var bool
*/
$wgEnablePopups = true;
$localBasePath = dirname( __DIR__ ) . '/Popups';
$remoteExtPath = 'Popups';
$wgExtensionCredits['other'][] = array( $wgExtensionCredits['other'][] = array(
'author' => array( 'Prateek Saxena', 'Yair Rand' ), 'author' => array( 'Prateek Saxena', 'Yair Rand' ),
'descriptionmsg' => 'popups-desc', 'descriptionmsg' => 'popups-desc',
@ -39,6 +30,9 @@ $wgExtensionCredits['other'][] = array(
'url' => 'https://www.mediawiki.org/wiki/Extension:Popups', 'url' => 'https://www.mediawiki.org/wiki/Extension:Popups',
); );
$localBasePath = dirname( __DIR__ ) . '/Popups';
$remoteExtPath = 'Popups';
$wgResourceModules = array_merge( $wgResourceModules, array( $wgResourceModules = array_merge( $wgResourceModules, array(
"ext.popups" => array( "ext.popups" => array(
'scripts' => 'resources/ext.popups.core.js', 'scripts' => 'resources/ext.popups.core.js',