Page MenuHomeWickedGov Phorge

Manager.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

Manager.php

<?php
namespace MobileFrontend\Amc;
use MediaWiki\Config\Config;
use MediaWiki\Config\ConfigException;
use MobileContext;
/**
* Advanced Mobile Contributions Manager
*
* @package MobileFrontend\Amc
*/
final class Manager {
/**
* A config name used to enable/disable the AMC mode
*/
private const AMC_MODE_CONFIG_NAME = 'MFAdvancedMobileContributions';
/**
* Mode identifier used in feature configs
*/
private const AMC_MODE_IDENTIFIER = 'amc';
/**
* Change tag
* All edits when has AMC enabled will be tagged with AMC_EDIT_TAG
*/
public const AMC_EDIT_TAG = 'advanced mobile edit';
/**
* MobileContext used to retrieve shouldDisplayMobileView and user information
*
* @var MobileContext
*/
private $mobileContext;
/**
* System config
* @var Config
*/
private $config;
/**
* @param Config $config
* @param MobileContext $mobileContext
*/
public function __construct( Config $config, MobileContext $mobileContext ) {
$this->config = $config;
$this->mobileContext = $mobileContext;
}
/**
* Returns information if the AMC mode is available for current session
* @return bool
* @throws ConfigException
*/
public function isAvailable() {
return $this->mobileContext->shouldDisplayMobileView()
&& $this->config->get( self::AMC_MODE_CONFIG_NAME )
&& !$this->mobileContext->getUser()->isAnon();
}
/**
* Get the mode identifier (used in configs)
*
* @return string
*/
public function getModeIdentifier() {
return self::AMC_MODE_IDENTIFIER;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Oct 4, 00:05 (2 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
42/51/23a9c065f72aab949a6f805ba5ec
Default Alt Text
Manager.php (1 KB)

Event Timeline