本文整理汇总了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;
}
示例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();
}
示例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');
}
示例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');
}
示例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');
}
}
示例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');
示例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');