Skip to content

Commit

Permalink
APICHANGE: add_extension() is now called directly on the class, inste…
Browse files Browse the repository at this point in the history
…ad of on Object
  • Loading branch information
andrewandante authored and Sean Harvey committed Nov 6, 2012
1 parent 381ab72 commit 1722f00
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
ShortcodeParser::get('default')->register('sitetree_link', array('SiteTree', 'link_shortcode_handler'));

Object::add_extension('File', 'SiteTreeFileExtension');
File::add_extension('SiteTreeFileExtension');

// TODO Remove once we can configure CMSMenu through static, nested configuration files
CMSMenu::remove_menu_item('CMSMain');
Expand Down
2 changes: 1 addition & 1 deletion code/staticpublisher/FilesystemPublisher.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Usage: Object::add_extension("SiteTree", "FilesystemPublisher('static-folder', 'html')");
* Usage: SiteTree::add_extension("FilesystemPublisher('static-folder', 'html')");
*
* Usage: To work with Subsite module you need to:
* - Add FilesystemPublisher::$domain_based_caching = true; in mysite/_config.php
Expand Down
4 changes: 2 additions & 2 deletions tests/model/SiteTreeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ static public function set_up_once() {
static public function tear_down_once() {
if(class_exists('Translatable')) {
if(self::$origTranslatableSettings['has_extension']) {
Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable');
SiteTree::add_extension('Translatable');
SiteConfig::add_extension('Translatable');
}


Expand Down
2 changes: 1 addition & 1 deletion tests/staticpublisher/FilesystemPublisherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class FilesystemPublisherTest extends SapphireTest {
public function setUp() {
parent::setUp();

Object::add_extension("SiteTree", "FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");
SiteTree::add_extension("FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");

$this->orig['domain_based_caching'] = FilesystemPublisher::$domain_based_caching;
FilesystemPublisher::$domain_based_caching = false;
Expand Down

0 comments on commit 1722f00

Please sign in to comment.