mediawiki-skins-Vector/includes/Constants.php
jdlrobson c8642b2fbe Use feature management for search in header
This will allow us to add the A/B testing requirement for logged in
users.

In preparation for the new A/B test requirement, a custom requirement
is added as the feature management system does not
support OR operations and the desired effect is the case where:

* the SearchInHeader feature flag has been enabled
* OR the SearchInHeaderABTest feature flag has been enabled and the user is bucketed

Bug: T259250
Change-Id: If948603bd598e1b5597345f4268736417f4c3a24
2020-09-13 23:00:16 +00:00

144 lines
3.2 KiB
PHP

<?php
namespace Vector;
use FatalError;
/**
* A namespace for Vector constants for internal Vector usage only. **Do not rely on this file as an
* API as it may change without warning at any time.**
* @package Vector
* @internal
*/
final class Constants {
/**
* This is tightly coupled to the ConfigRegistry field in skin.json.
* @var string
*/
public const SKIN_NAME = 'vector';
// These are tightly coupled to PREF_KEY_SKIN_VERSION and skin.json's configs. See skin.json for
// documentation.
/**
* @var string
*/
public const SKIN_VERSION_LEGACY = '1';
/**
* @var string
*/
public const SKIN_VERSION_LATEST = '2';
/**
* @var string
*/
public const SERVICE_CONFIG = 'Vector.Config';
/**
* @var string
*/
public const SERVICE_FEATURE_MANAGER = 'Vector.FeatureManager';
// These are tightly coupled to skin.json's config.
/**
* @var string
*/
public const CONFIG_KEY_SHOW_SKIN_PREFERENCES = 'VectorShowSkinPreferences';
/**
* @var string
*/
public const CONFIG_KEY_DEFAULT_SKIN_VERSION = 'VectorDefaultSkinVersion';
/**
* @var string
*/
public const CONFIG_KEY_DEFAULT_SKIN_VERSION_FOR_EXISTING_ACCOUNTS =
'VectorDefaultSkinVersionForExistingAccounts';
/**
* @var string
*/
public const CONFIG_KEY_DEFAULT_SKIN_VERSION_FOR_NEW_ACCOUNTS =
'VectorDefaultSkinVersionForNewAccounts';
/**
* @var string
*/
public const CONFIG_KEY_DEFAULT_SIDEBAR_VISIBLE_FOR_AUTHORISED_USER =
'VectorDefaultSidebarVisibleForAuthorisedUser';
/**
* @var string
*/
public const CONFIG_KEY_DEFAULT_SIDEBAR_VISIBLE_FOR_ANONYMOUS_USER =
'VectorDefaultSidebarVisibleForAnonymousUser';
/**
* @var string
*/
public const CONFIG_KEY_LAYOUT_MAX_WIDTH = 'VectorLayoutMaxWidth';
/**
* @var string
*/
public const CONFIG_SEARCH_IN_HEADER = 'VectorIsSearchInHeader';
/**
* @var string
*/
public const REQUIREMENT_SEARCH_IN_HEADER = 'VectorIsSearchInHeaderIsEnabled';
/**
* @var string
*/
public const PREF_KEY_SKIN_VERSION = 'VectorSkinVersion';
/**
* @var string
*/
public const PREF_KEY_SIDEBAR_VISIBLE = 'VectorSidebarVisible';
// These are used in the Feature Management System.
/**
* Also known as `$wgFullyInitialised`. Set to true in core/includes/Setup.php.
* @var string
*/
public const CONFIG_KEY_FULLY_INITIALISED = 'FullyInitialised';
/**
* @var string
*/
public const REQUIREMENT_FULLY_INITIALISED = 'FullyInitialised';
/**
* @var string
*/
public const REQUIREMENT_LATEST_SKIN_VERSION = 'LatestSkinVersion';
/**
* @var string
*/
public const FEATURE_LATEST_SKIN = 'LatestSkin';
/**
* @var string
*/
public const FEATURE_SEARCH_IN_HEADER = 'TemporarySearchInHeader';
/**
* @var string
*/
public const CONFIG_KEY_DISABLE_SIDEBAR_PERSISTENCE = 'VectorDisableSidebarPersistence';
// These are used for query parameters.
/**
* Override the skin version user preference and site Config. See readme.
* @var string
*/
public const QUERY_PARAM_SKIN_VERSION = 'useskinversion';
/**
* This class is for namespacing constants only. Forbid construction.
* @throws FatalError
*/
private function __construct() {
throw new FatalError( "Cannot construct a utility class." );
}
}