当前位置: 首页>>代码示例>>PHP>>正文


PHP SMW\Settings类代码示例

本文整理汇总了PHP中SMW\Settings的典型用法代码示例。如果您正苦于以下问题:PHP Settings类的具体用法?PHP Settings怎么用?PHP Settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Settings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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);
 }
开发者ID:ReachingOut,项目名称:SemanticMediaWiki,代码行数:7,代码来源:OutputPageParserOutputTest.php

示例2: 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);
 }
开发者ID:ReachingOut,项目名称:SemanticMediaWiki,代码行数:34,代码来源:SharedDependencyContainer.php

示例3: testPropertyTablesWithValidCustomizableProperties

 /**
  * @depends testGetPropertyTables
  */
 public function testPropertyTablesWithValidCustomizableProperties()
 {
     $instance = $this->acquireInstance();
     $instance->setConfiguration(Settings::newFromArray(array('smwgFixedProperties' => array(), 'smwgPageSpecialProperties' => array('_MDAT', '_MEDIA'))));
     $this->assertCount($this->defaultPropertyTableCount + 2, $instance->getPropertyTables());
     $instance->clear();
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:10,代码来源:SQLStoreTest.php

示例4: getInstance

 /**
  * Returns a static instance with an invoked global settings array
  *
  * @par Example:
  * @code
  *  \SMW\NamespaceExaminer::getInstance()->isSemanticEnabled( NS_MAIN )
  * @endcode
  *
  * @note Used in smwfIsSemanticsProcessed
  *
  * @since 1.9
  *
  * @return NamespaceExaminer
  */
 public static function getInstance()
 {
     if (self::$instance === null) {
         self::$instance = self::newFromArray(Settings::newFromGlobals()->get('smwgNamespacesWithSemanticLinks'));
     }
     return self::$instance;
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:21,代码来源:NamespaceExaminer.php

示例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);
     /**
      * CacheHandler object definition
      *
      * @since  1.9
      *
      * @return CacheHandler
      */
     $this->registerObject('CacheHandler', function (DependencyBuilder $builder) {
         return CacheHandler::newFromId($builder->newObject('Settings')->get('smwgCacheType'));
     }, DependencyObject::SCOPE_SINGLETON);
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:36,代码来源:SharedDependencyContainer.php

示例6: registerSettings

 private function registerSettings()
 {
     $this->applicationFactory->registerObject('Settings', Settings::newFromGlobals($this->globalVars));
     if (CompatibilityMode::extensionNotEnabled()) {
         CompatibilityMode::disableSemantics();
     }
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:7,代码来源:Setup.php

示例7: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $settings = Settings::newFromArray(array('smwgFactboxUseCache' => true, 'smwgCacheType' => 'hash'));
     $this->applicationFactory->registerObject('Settings', $settings);
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:7,代码来源:SkinAfterContentTest.php

示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->skin = $this->getMockBuilder('\\Skin')->disableOriginalConstructor()->getMock();
     $this->settings = Settings::newFromArray(array('smwgPDefaultType' => '_wpg', 'smwgPropertyLowUsageThreshold' => 5, 'smwgPropertyZeroCountDisplay' => true));
     $this->dataItemFactory = new DataItemFactory();
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:8,代码来源:PropertiesQueryPageTest.php

示例9: testGetDefaultStore

 public function testGetDefaultStore()
 {
     $instance = StoreFactory::getStore();
     $this->assertInstanceOf(Settings::newFromGlobals()->get('smwgDefaultStore'), $instance);
     $this->assertSame(StoreFactory::getStore(), $instance);
     StoreFactory::clear();
     $this->assertNotSame(StoreFactory::getStore(), $instance);
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:8,代码来源:StoreFactoryTest.php

示例10: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->skin = $this->getMockBuilder('\\Skin')->disableOriginalConstructor()->getMock();
     $this->settings = Settings::newFromArray(array());
     $this->dataItemFactory = new DataItemFactory();
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:8,代码来源:WantedPropertiesQueryPageTest.php

示例11: tearDown

 protected function tearDown()
 {
     ApplicationFactory::clear();
     NamespaceExaminer::clear();
     PropertyRegistry::clear();
     Settings::clear();
     Exporter::getInstance()->clear();
     parent::tearDown();
 }
开发者ID:brandonphuong,项目名称:mediawiki,代码行数:9,代码来源:MwDBaseUnitTestCase.php

示例12: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $settings = Settings::newFromArray(array('smwgCacheType' => 'hash', 'smwgEnableUpdateJobs' => false));
     $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->applicationFactory->registerObject('Store', $store);
     $this->applicationFactory->registerObject('Settings', $settings);
 }
开发者ID:ReachingOut,项目名称:SemanticMediaWiki,代码行数:9,代码来源:UpdateJobTest.php

示例13: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $settings = Settings::newFromArray(array('smwgFactboxUseCache' => true, 'smwgCacheType' => 'hash', 'smwgLinksInValues' => false, 'smwgInlineErrors' => true));
     $this->applicationFactory->registerObject('Settings', $settings);
     $this->cache = $this->applicationFactory->newCacheFactory()->newFixedInMemoryCache();
     $this->applicationFactory->registerObject('Cache', $this->cache);
 }
开发者ID:ReachingOut,项目名称:SemanticMediaWiki,代码行数:9,代码来源:ArticlePurgeTest.php

示例14: testProcess

 /**
  * @dataProvider skinTemplateDataProvider
  */
 public function testProcess($setup, $expected)
 {
     $toolbox = '';
     ApplicationFactory::getInstance()->registerObject('Settings', Settings::newFromArray($setup['settings']));
     $instance = new BaseTemplateToolbox($setup['skinTemplate'], $toolbox);
     $this->assertTrue($instance->process());
     if ($expected['count'] == 0) {
         return $this->assertEmpty($toolbox);
     }
     $this->assertCount($expected['count'], $toolbox['smw-browse']);
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:14,代码来源:BaseTemplateToolboxTest.php

示例15: testProcess

 public function testProcess()
 {
     $oldTitle = MockTitle::buildMock('old');
     $newTitle = MockTitle::buildMock('new');
     $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $store->expects($this->once())->method('changeTitle')->with($this->equalTo($oldTitle), $this->equalTo($newTitle), $this->anything(), $this->anything());
     $this->applicationFactory->registerObject('Settings', Settings::newFromArray(array('smwgCacheType' => 'hash', 'smwgAutoRefreshOnPageMove' => true)));
     $this->applicationFactory->registerObject('Store', $store);
     $instance = new TitleMoveComplete($oldTitle, $newTitle, new MockSuperUser(), 0, 0);
     $this->assertTrue($instance->process());
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:11,代码来源:TitleMoveCompleteTest.php


注:本文中的SMW\Settings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。