本文整理汇总了PHP中SMW\ApplicationFactory::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationFactory::getInstance方法的具体用法?PHP ApplicationFactory::getInstance怎么用?PHP ApplicationFactory::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMW\ApplicationFactory
的用法示例。
在下文中一共展示了ApplicationFactory::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
parent::setUp();
$this->applicationFactory = ApplicationFactory::getInstance();
$this->applicationFactory->getSettings()->set('smwgEnableUpdateJobs', false);
$this->applicationFactory->getSettings()->set('smwgDeleteSubjectWithAssociatesRefresh', false);
}
示例2: process
/**
* @since 2.0
*
* @return true
*/
public function process()
{
$settings = ApplicationFactory::getInstance()->getSettings();
$deleteSubjectJob = new DeleteSubjectJob($this->wikiPage->getTitle(), array('asDeferredJob' => $settings->get('smwgDeleteSubjectAsDeferredJob'), 'withAssociates' => $settings->get('smwgDeleteSubjectWithAssociatesRefresh')));
$deleteSubjectJob->execute();
return true;
}
示例3: smwgNamespacesWithSemanticLinksProvider
/**
* @since 1.9
*/
public function smwgNamespacesWithSemanticLinksProvider()
{
$provider = array();
$provider[] = array('GLOBALS', GlobalsProvider::getInstance()->get('smwgNamespacesWithSemanticLinks'));
$provider[] = array('Settings', ApplicationFactory::getInstance()->getSettings()->get('smwgNamespacesWithSemanticLinks'));
return $provider;
}
示例4: setUp
protected function setUp()
{
parent::setUp();
$this->semanticDataValidator = new SemanticDataValidator();
$this->applicationFactory = ApplicationFactory::getInstance();
$this->parserFactory = new ParserFactory();
}
示例5: loadAtInstantiation
/**
* @since 1.9
*/
protected function loadAtInstantiation()
{
/**
* Settings object definition
*
* @since 1.9
*
* @return Settings
*/
$this->registerObject('Settings', function () {
return Settings::newFromGlobals();
}, DependencyObject::SCOPE_SINGLETON);
/**
* Store object definition
*
* @since 1.9
*
* @return Store
*/
$this->registerObject('Store', function (DependencyBuilder $builder) {
return StoreFactory::getStore($builder->newObject('Settings')->get('smwgDefaultStore'));
}, DependencyObject::SCOPE_SINGLETON);
/**
* @since 1.9
*
* @return Cache
*/
$this->registerObject('Cache', function (DependencyBuilder $builder) {
return ApplicationFactory::getInstance()->newCacheFactory()->newMediaWikiCompositeCache();
}, DependencyObject::SCOPE_SINGLETON);
}
示例6: getInstance
/**
* @since 2.3
*
* @return InMemoryPoolCache
*/
public static function getInstance()
{
if (self::$instance === null) {
self::$instance = new self(ApplicationFactory::getInstance()->newCacheFactory());
}
return self::$instance;
}
示例7: testCreateFromString
/**
* @dataProvider queryStringProvider
*/
public function testCreateFromString($queryString, $configuration, $expected)
{
$instance = new ConfigurableQueryCreator(ApplicationFactory::getInstance()->getQueryFactory());
$query = $instance->withConfiguration($configuration)->createFromString($queryString);
$this->assertInstanceOf('\\SMWQuery', $query);
$this->assertSame($expected, $query->getAsString());
}
示例8: __construct
/**
* @since 1.9
*
* @param Title $title
* @param array $params job parameters
* @param integer $id job id
*/
public function __construct(Title $title, $params = array(), $id = 0)
{
parent::__construct('SMW\\UpdateDispatcherJob', $title, $params, $id);
$this->removeDuplicates = true;
$this->applicationFactory = ApplicationFactory::getInstance();
$this->setStore($this->applicationFactory->getStore());
}
示例9: setUp
protected function setUp()
{
parent::setUp();
$utilityFactory = UtilityFactory::getInstance();
$this->fixturesFileProvider = $utilityFactory->newFixturesFactory()->newFixturesFileProvider();
$this->semanticDataValidator = $utilityFactory->newValidatorFactory()->newSemanticDataValidator();
$this->pageEditor = $utilityFactory->newPageEditor();
$this->mwHooksHandler = $utilityFactory->newMwHooksHandler();
$this->mwHooksHandler->deregisterListedHooks();
$this->applicationFactory = ApplicationFactory::getInstance();
$settings = array('smwgPageSpecialProperties' => array('_MEDIA', '_MIME'), 'smwgNamespacesWithSemanticLinks' => array(NS_MAIN => true, NS_FILE => true), 'smwgCacheType' => 'hash');
foreach ($settings as $key => $value) {
$this->applicationFactory->getSettings()->set($key, $value);
}
// $this->getStore()->clear();
// $this->getStore()->setupStore( false );
$this->wgEnableUploads = $GLOBALS['wgEnableUploads'];
$this->wgFileExtensions = $GLOBALS['wgFileExtensions'];
$this->wgVerifyMimeType = $GLOBALS['wgVerifyMimeType'];
$this->mwHooksHandler->register('FileUpload', $this->mwHooksHandler->getHookRegistry()->getHandlerFor('FileUpload'));
$this->mwHooksHandler->register('InternalParseBeforeLinks', $this->mwHooksHandler->getHookRegistry()->getHandlerFor('InternalParseBeforeLinks'));
$this->mwHooksHandler->register('LinksUpdateConstructed', $this->mwHooksHandler->getHookRegistry()->getHandlerFor('LinksUpdateConstructed'));
$GLOBALS['wgEnableUploads'] = true;
$GLOBALS['wgFileExtensions'] = array('txt');
$GLOBALS['wgVerifyMimeType'] = true;
}
示例10: setUp
protected function setUp()
{
parent::setUp();
$this->applicationFactory = ApplicationFactory::getInstance();
$store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
$this->applicationFactory->registerObject('Store', $store);
}
示例11: setUp
protected function setUp()
{
parent::setUp();
$this->applicationFactory = ApplicationFactory::getInstance();
$settings = Settings::newFromArray(array('smwgShowFactbox' => SMW_FACTBOX_NONEMPTY, 'smwgFactboxUseCache' => true, 'smwgCacheType' => 'hash', 'smwgLinksInValues' => false, 'smwgInlineErrors' => true));
$this->applicationFactory->registerObject('Settings', $settings);
}
示例12: newFactbox
/**
* @since 2.0
*
* @param ParserData $parserData
* @param IContextSource $context
*
* @return Factbox
*/
public function newFactbox(ParserData $parserData, IContextSource $context)
{
$applicationFactory = ApplicationFactory::getInstance();
$messageBuilder = $applicationFactory->newMwCollaboratorFactory()->newMessageBuilder();
$messageBuilder->setLanguageFromContext($context);
return new Factbox($applicationFactory->getStore(), $parserData, $messageBuilder);
}
示例13: setUp
protected function setUp()
{
parent::setUp();
$this->checkIfDatabaseCanBeUsedOtherwiseSkipTest();
$this->checkIfStoreCanBeUsedOtherwiseSkipTest();
ApplicationFactory::getInstance()->registerObject('Store', $this->getStore());
}
示例14: setUp
protected function setUp()
{
parent::setUp();
$this->semanticDataFactory = UtilityFactory::getInstance()->newSemanticDataFactory();
$this->semanticDataValidator = UtilityFactory::getInstance()->newValidatorFactory()->newSemanticDataValidator();
$this->applicationFactory = ApplicationFactory::getInstance();
}
示例15: setUp
protected function setUp()
{
parent::setUp();
$this->semanticDataValidator = UtilityFactory::getInstance()->newValidatorFactory()->newSemanticDataValidator();
$this->applicationFactory = ApplicationFactory::getInstance();
$this->applicationFactory->getSettings()->set('smwgQueryDurationEnabled', false);
}