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


PHP SiteTree::remove_extension方法代码示例

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


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

示例1: execute

 /**
  * @param InputInterface $input
  * @param OutputInterface $output
  * @throws Exception
  * @returns null
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if (!Check::fileToUrlMapping()) {
         die('ERROR: Please set a valid path in $_FILE_TO_URL_MAPPING before running the seeder' . PHP_EOL);
     }
     if (\SiteTree::has_extension('SiteTreeLinkTracking')) {
         \SiteTree::remove_extension('SiteTreeLinkTracking');
     }
     // Customer overrides delete to check for admin
     // major hack to enable ADMIN permissions
     // login throws cookie warning, this will hide the error message
     error_reporting(0);
     try {
         if ($admin = \Member::default_admin()) {
             $admin->logIn();
         }
     } catch (\Exception $e) {
     }
     error_reporting(E_ALL);
     $writer = new RecordWriter();
     if ($input->getOption('batch')) {
         $batchSize = intval($input->getOption('size'));
         $writer = new BatchedSeedWriter($batchSize);
     }
     $seeder = new Seeder($writer, new CliOutputFormatter());
     $className = $input->getOption('class');
     $key = $input->getOption('key');
     if ($input->getOption('force')) {
         $seeder->setIgnoreSeeds(true);
     }
     $seeder->seed($className, $key);
     return;
 }
开发者ID:stevie-mayhew,项目名称:silverstripe-seeder,代码行数:39,代码来源:Seed.php

示例2: tearDown

 public function tearDown()
 {
     parent::tearDown();
     Config::inst()->unnest();
     SiteTree::remove_extension("FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");
     if (file_exists(BASE_PATH . '/assets/FilesystemPublisherTest-static-folder')) {
         Filesystem::removeFolder(BASE_PATH . '/assets/FilesystemPublisherTest-static-folder');
     }
     // Purge DB from StaticPagesQueue items.
     self::empty_temp_db();
 }
开发者ID:spark-green,项目名称:silverstripe-staticpublishqueue,代码行数:11,代码来源:FilesystemPublisherTest.php

示例3: testURLSegmentPrioritizesExtensionVotes

 public function testURLSegmentPrioritizesExtensionVotes()
 {
     $sitetree = new SiteTree();
     $sitetree->URLSegment = 'unique-segment';
     $this->assertTrue($sitetree->validURLSegment());
     SiteTree::add_extension('SiteTreeTest_Extension');
     $sitetree = new SiteTree();
     $sitetree->URLSegment = 'unique-segment';
     $this->assertFalse($sitetree->validURLSegment());
     SiteTree::remove_extension('SiteTreeTest_Extension');
 }
开发者ID:fanggu,项目名称:loveyourwater_ss_v3.1.6,代码行数:11,代码来源:SiteTreeTest.php

示例4: testContentTypeJSON

 public function testContentTypeJSON()
 {
     SiteTree::remove_extension('FilesystemPublisher');
     SiteTree::add_extension("FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/', 'php')");
     $l1 = new StaticPublisherTestPage();
     $l1->URLSegment = 'mimetype';
     $l1->write();
     $l1->doPublish();
     $response = Director::test('mimetype/json');
     $this->assertEquals($response->getHeader('Content-Type'), 'application/json', 'Content-Type should be application/json');
 }
开发者ID:helpfulrobot,项目名称:silverstripe-staticpublisher,代码行数:11,代码来源:FilesystemPublisherTest.php

示例5: disable

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

示例6:

<?php

/**
 * Created by Nivanka Fonseka (nivanka@silverstripers.com).
 * User: nivankafonseka
 * Date: 4/6/15
 * Time: 2:03 PM
 * To change this template use File | Settings | File Templates.
 */
SiteTree::remove_extension('Hierarchy');
Object::add_extension('SiteTree', 'NewsHierarchy');
开发者ID:silverstripers,项目名称:silverstripe-news,代码行数:11,代码来源:_config.php

示例7: define

<?php

/**
 * Created by Nivanka Fonseka (nivanka@silverstripers.com).
 * User: nivankafonseka
 * Date: 7/22/15
 * Time: 6:06 PM
 * To change this template use File | Settings | File Templates.
 */
define('CLOUDINARY_BASE', dirname(__FILE__));
define('CLOUDINARY_RELATIVE', basename(dirname(__FILE__)));
require_once CLOUDINARY_BASE . '/thirdparty/Cloudinary/Cloudinary.php';
require_once CLOUDINARY_BASE . '/thirdparty/Cloudinary/Uploader.php';
require_once CLOUDINARY_BASE . '/thirdparty/Cloudinary/Api.php';
CMSMenu::remove_menu_item('CloudinaryFileAddController');
CloudinaryConfigs::ReplaceFileFields();
ShortcodeParser::get('default')->register('cloudinary', array('CloudinaryFile', 'cloudinary_files'));
ShortcodeParser::get('default')->register('cloudinary_image', array('CloudinaryFile', 'cloudinary_markdown'));
SiteTree::remove_extension('SiteTreeLinkTracking');
Object::add_extension('SiteTree', 'CloudinarySiteTreeLinkTracking');
开发者ID:helpfulrobot,项目名称:mademedia-silverstripe-cloudinary,代码行数:20,代码来源:_config.php


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