diff options
Diffstat (limited to 'SemanticMediaWiki/includes/specials/SpecialPage.php')
-rw-r--r-- | SemanticMediaWiki/includes/specials/SpecialPage.php | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/SemanticMediaWiki/includes/specials/SpecialPage.php b/SemanticMediaWiki/includes/specials/SpecialPage.php new file mode 100644 index 00000000..bbd6b535 --- /dev/null +++ b/SemanticMediaWiki/includes/specials/SpecialPage.php @@ -0,0 +1,94 @@ +<?php + +namespace SMW; + +/** + * Semantic MediaWiki SpecialPage base class + * + * @file + * + * @license GNU GPL v2+ + * @since 1.9 + * + * @author mwjames + */ + +/** + * Semantic MediaWiki SpecialPage base class + * + * @ingroup SpecialPage + * @codeCoverageIgnore + */ +class SpecialPage extends \SpecialPage { + + /** @var Store */ + protected $store = null; + + /** @var Settings */ + protected $settings = null; + + /** + * @see SpecialPage::__construct + * + * @since 1.9 + * + * @param $name + * @param $restriction + */ + public function __construct( $name = '', $restriction = '' ) { + parent::__construct( $name, $restriction ); + $this->store = StoreFactory::getStore(); + } + + /** + * Sets store instance + * + * @since 1.9 + * + * @param Store $store + */ + public function setStore( Store $store ) { + $this->store = $store; + return $this; + } + + /** + * Returns store object + * + * @since 1.9 + * + * @return Store + */ + public function getStore() { + return $this->store; + } + + /** + * Sets Settings object + * + * @since 1.9 + * + * @param Settings $settings + */ + public function setSettings( Settings $settings ) { + $this->settings = $settings; + return $this; + } + + /** + * Returns Settings object + * + * @since 1.9 + * + * @return Store + */ + public function getSettings() { + + if ( $this->settings === null ) { + $this->settings = Settings::newFromGlobals(); + } + + return $this->settings; + } + +} |