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


PHP Object::remove_extension方法代码示例

本文整理汇总了PHP中Object::remove_extension方法的典型用法代码示例。如果您正苦于以下问题:PHP Object::remove_extension方法的具体用法?PHP Object::remove_extension怎么用?PHP Object::remove_extension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Object的用法示例。


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

示例1: set_up_once

	static function set_up_once() {
		// needs to recreate the database schema with language properties
		self::kill_temp_db();

		// store old defaults	
		if(class_exists('Translatable')) {
			self::$origTranslatableSettings['has_extension'] = singleton('SiteTree')->hasExtension('Translatable');
			self::$origTranslatableSettings['default_locale'] = Translatable::default_locale();
			
			// overwrite locale
			Translatable::set_default_locale("en_US");

			// refresh the extended statics - different fields in $db with Translatable enabled
			if(self::$origTranslatableSettings['has_extension']) {
				Object::remove_extension('SiteTree', 'Translatable');
				Object::remove_extension('SiteConfig', 'Translatable');
			}
		}

		// recreate database with new settings
		$dbname = self::create_temp_db();
		DB::set_alternative_database_name($dbname);

		parent::set_up_once();
	}
开发者ID:redema,项目名称:silverstripe-cms,代码行数:25,代码来源:SiteTreeTest.php

示例2: testRebuildZendSearchLuceneIndex

 function testRebuildZendSearchLuceneIndex()
 {
     // Setup
     Object::remove_extension('ContentController', 'ZendSearchLuceneContentController');
     Object::remove_extension('SiteConfig', 'ZendSearchLuceneSiteConfig');
     Object::remove_extension('LeftAndMain', 'ZendSearchLuceneCMSDecorator');
     Object::remove_extension('SiteTree', 'ZendSearchLuceneSearchable');
     Object::remove_extension('File', 'ZendSearchLuceneSearchable');
     ZendSearchLuceneSearchable::$pageLength = 10;
     ZendSearchLuceneSearchable::$alwaysShowPages = 3;
     ZendSearchLuceneSearchable::$maxShowPages = 8;
     ZendSearchLuceneSearchable::$encoding = 'utf-8';
     ZendSearchLuceneSearchable::$cacheDirectory = TEMP_FOLDER;
     ZendSearchLuceneWrapper::$indexName = 'Test';
     ZendSearchLuceneSearchable::enable();
     $index = ZendSearchLuceneWrapper::getIndex(true);
     // Blank database
     $this->assertEquals(0, $index->count());
     // Count number of SiteTree and File objects
     $SiteTreeCount = DataObject::get('SiteTree')->count();
     $FileCount = DataObject::get('File')->count();
     $IndexableCount = $SiteTreeCount + $FileCount;
     // Re-index database
     $obj = new ZendSearchLuceneCMSDecorator();
     $obj->rebuildZendSearchLuceneIndex();
     // Has correct number of items?
     $this->assertEquals($IndexableCount, ZendSearchLuceneWrapper::getIndex()->count());
 }
开发者ID:veronico12,项目名称:lucene-silverstripe-plugin,代码行数:28,代码来源:ZendLuceneSearchCMSDecoratorTest.php

示例3: tearDown

 function tearDown()
 {
     Object::remove_extension("SiteTree", "FilesystemPublisher('../FilesystemPublisherTest-static-folder/')");
     SiteTree::$write_homepage_map = true;
     FilesystemPublisher::$domain_based_caching = $this->orig['domain_based_caching'];
     parent::tearDown();
 }
开发者ID:Raiser,项目名称:Praktikum,代码行数:7,代码来源:FilesystemPublisherTest.php

示例4: remove

 /**
  * Removes commenting from a {@link DataObject}. Does not remove existing comments
  * but does remove the extension.
  *
  * @param string $class Class to remove {@link CommentsExtension} from
  */
 public static function remove($class)
 {
     if (isset(self::$enabled_classes[$class])) {
         unset(self::$enabled_classes[$class]);
     }
     Object::remove_extension($class, 'CommentsExtension');
 }
开发者ID:roed,项目名称:silverstripe-comments,代码行数:13,代码来源:Commenting.php

示例5: testEnableWithCustomClasses

 public function testEnableWithCustomClasses()
 {
     FulltextSearchable::enable(array('File'));
     $this->assertTrue(Object::has_extension('File', 'FulltextSearchable'));
     // TODO This shouldn't need all arguments included
     Object::remove_extension('File', 'FulltextSearchable(\'"Filename","Title","Content"\')');
     $this->assertFalse(Object::has_extension('File', 'FulltextSearchable'));
 }
开发者ID:normann,项目名称:sapphire,代码行数:8,代码来源:FulltextSearchableTest.php

示例6: remove_weight

 public static function remove_weight($weight)
 {
     self::$weights = array_diff(self::$weights, array($weight));
     $class = "NewsWeight{$weight}";
     if (ClassInfo::exists($class)) {
         Object::remove_extension('NewsHolder', $class);
     }
 }
开发者ID:redema,项目名称:silverstripe-news,代码行数:8,代码来源:NewsPage.php

示例7: tearDown

 function tearDown()
 {
     parent::tearDown();
     Object::remove_extension("SiteTree", "FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");
     FilesystemPublisher::$domain_based_caching = $this->orig['domain_based_caching'];
     if (file_exists(BASE_PATH . '/assets/FilesystemPublisherTest-static-folder')) {
         Filesystem::removeFolder(BASE_PATH . '/assets/FilesystemPublisherTest-static-folder');
     }
 }
开发者ID:nzjoel,项目名称:silverstripe-cms,代码行数:9,代码来源:FilesystemPublisherTest.php

示例8: tear_down_once

 static function tear_down_once()
 {
     if (!self::$origTranslatableSettings['has_extension']) {
         Object::remove_extension('SiteTree', 'Translatable');
     }
     Translatable::set_default_locale(self::$origTranslatableSettings['default_locale']);
     self::kill_temp_db();
     self::create_temp_db();
     parent::tear_down_once();
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:10,代码来源:TranslatableSearchFormTest.php

示例9: testUpdateCMSActions

 function testUpdateCMSActions()
 {
     // Setup
     Object::remove_extension('ContentController', 'ZendSearchLuceneContentController');
     Object::remove_extension('SiteConfig', 'ZendSearchLuceneSiteConfig');
     Object::remove_extension('LeftAndMain', 'ZendSearchLuceneCMSDecorator');
     Object::remove_extension('SiteTree', 'ZendSearchLuceneSearchable');
     Object::remove_extension('File', 'ZendSearchLuceneSearchable');
     ZendSearchLuceneSearchable::$pageLength = 10;
     ZendSearchLuceneSearchable::$alwaysShowPages = 3;
     ZendSearchLuceneSearchable::$maxShowPages = 8;
     ZendSearchLuceneSearchable::$encoding = 'utf-8';
     ZendSearchLuceneSearchable::$cacheDirectory = TEMP_FOLDER;
     ZendSearchLuceneWrapper::$indexName = 'Test';
     ZendSearchLuceneSearchable::enable(array());
     $config = SiteConfig::current_site_config();
     $this->assertTrue(is_object($config->getCMSActions()->fieldByName('rebuildZendSearchLuceneIndex')));
 }
开发者ID:veronico12,项目名称:lucene-silverstripe-plugin,代码行数:18,代码来源:ZendSearchLuceneSiteConfigTest.php

示例10: tearDownOnce

 /**
  * tearDown method that's called once per test class rather once per test method.
  */
 function tearDownOnce()
 {
     // If we have made changes to the extensions present, then migrate the database schema.
     if ($this->extensionsToReapply || $this->extensionsToRemove) {
         // Remove extensions added for testing
         foreach ($this->extensionsToRemove as $class => $extensions) {
             foreach ($extensions as $extension) {
                 Object::remove_extension($class, $extension);
             }
         }
         // Reapply ones removed
         foreach ($this->extensionsToReapply as $class => $extensions) {
             foreach ($extensions as $extension) {
                 Object::add_extension($class, $extension);
             }
         }
     }
     if ($this->extensionsToReapply || $this->extensionsToRemove || $this->extraDataObjects) {
         $this->resetDBSchema();
     }
 }
开发者ID:hamishcampbell,项目名称:silverstripe-sapphire,代码行数:24,代码来源:SapphireTest.php

示例11: removeExtensions

 /**
  * Remove given extensions from Member. This is useful for
  * removing extensions that could produce a biased
  * test result, as some extensions applied by project
  * code or modules can do this.
  * 
  * @param array $extensions
  * @return array The removed extensions
  */
 protected function removeExtensions($extensions)
 {
     if ($extensions) {
         foreach ($extensions as $extension) {
             Object::remove_extension('Member', $extension);
         }
     }
     return $extensions;
 }
开发者ID:nomidi,项目名称:sapphire,代码行数:18,代码来源:MemberTest.php

示例12: testOnAfterDelete

 public function testOnAfterDelete()
 {
     // Setup
     Object::remove_extension('SiteTree', 'ZendSearchLuceneSearchable');
     Object::remove_extension('File', 'ZendSearchLuceneSearchable');
     ZendSearchLuceneSearchable::$pageLength = 10;
     ZendSearchLuceneSearchable::$alwaysShowPages = 3;
     ZendSearchLuceneSearchable::$maxShowPages = 8;
     ZendSearchLuceneSearchable::$encoding = 'utf-8';
     ZendSearchLuceneSearchable::$cacheDirectory = TEMP_FOLDER;
     ZendSearchLuceneWrapper::$indexName = 'Test';
     ZendSearchLuceneSearchable::enable();
     // Blank the index
     ZendSearchLuceneWrapper::getIndex(true);
     // There shouldn't be anything with asdf in there
     $this->assertEquals(0, count(ZendSearchLuceneWrapper::find('asdf')));
     $page = DataObject::get_one('Page');
     $page->Content = 'asdf';
     $page->write();
     // There should now be a result
     $this->assertGreaterThan(0, count(ZendSearchLuceneWrapper::find('asdf')));
     $page->delete();
     // There should now be no result again
     $this->assertEquals(0, count(ZendSearchLuceneWrapper::find('asdf')));
 }
开发者ID:helpfulrobot,项目名称:asecondwill-lucene,代码行数:25,代码来源:A00_ZendSearchLuceneSearchableTest.php

示例13: disable

 /**
  * Disable the multilingual feature
  *
  * @deprecated 2.4 Use Object::remove_extension('SiteTree', 'Translatable')
  */
 static function disable()
 {
     Object::remove_extension('SiteTree', 'Translatable');
 }
开发者ID:eLBirador,项目名称:AllAboutCity,代码行数:9,代码来源:Translatable.php

示例14: remove_sortable_class

 public static function remove_sortable_class($class)
 {
     Object::remove_extension($class, 'SortableDataObject');
 }
开发者ID:TindallRiley,项目名称:DataObjectManager,代码行数:4,代码来源:SortableDataObject.php

示例15: disable

 /**
  * Disable the multilingual feature
  *
  * @deprecated 2.4 Use Object::remove_extension('SiteTree', 'Translatable')
  */
 static function disable()
 {
     if (class_exists('SiteTree')) {
         Object::remove_extension('SiteTree', 'Translatable');
     }
 }
开发者ID:roed,项目名称:silverstripe-translatable,代码行数:11,代码来源:Translatable.php


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