mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE Removed Director::get_site_mode() and set_site_mode(), functionality no longer required
API CHANGE Removed Director::add_callback(), use custom extension on controller instead API CHANGE Removed Director::currentPage(), use get_current_page() instead
This commit is contained in:
parent
cd6115b85b
commit
4bd97cfd79
@ -21,12 +21,7 @@ class Director {
|
|||||||
* @var SiteTree
|
* @var SiteTree
|
||||||
*/
|
*/
|
||||||
private static $current_page;
|
private static $current_page;
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated 2.4
|
|
||||||
*/
|
|
||||||
static $siteMode;
|
|
||||||
|
|
||||||
static $alternateBaseFolder;
|
static $alternateBaseFolder;
|
||||||
|
|
||||||
static $alternateBaseURL;
|
static $alternateBaseURL;
|
||||||
@ -37,12 +32,6 @@ class Director {
|
|||||||
|
|
||||||
static protected $environment_type;
|
static protected $environment_type;
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated 2.4
|
|
||||||
*/
|
|
||||||
static protected $callbacks;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add URL matching rules to the Director.
|
* Add URL matching rules to the Director.
|
||||||
*
|
*
|
||||||
@ -324,13 +313,6 @@ class Director {
|
|||||||
public static function set_current_page($page) {
|
public static function set_current_page($page) {
|
||||||
self::$current_page = $page;
|
self::$current_page = $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated 2.4 Use {@link Director::get_current_page()}.
|
|
||||||
*/
|
|
||||||
static function currentPage() {
|
|
||||||
return self::get_current_page();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turns the given URL into an absolute URL.
|
* Turns the given URL into an absolute URL.
|
||||||
@ -689,49 +671,6 @@ class Director {
|
|||||||
return (php_sapi_name() == "cli");
|
return (php_sapi_name() == "cli");
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Site mode methods
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated 2.4
|
|
||||||
*/
|
|
||||||
static function set_site_mode($mode) {
|
|
||||||
user_error (
|
|
||||||
'Director::set_site_mode() is deprecated as the functionality is no longer neccesary.', E_USER_NOTICE
|
|
||||||
);
|
|
||||||
|
|
||||||
Director::$siteMode = $mode;
|
|
||||||
|
|
||||||
if(isset(self::$callbacks[$mode])) {
|
|
||||||
foreach(self::$callbacks[$mode] as $extension) {
|
|
||||||
call_user_func($extension);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated 2.4
|
|
||||||
*/
|
|
||||||
static function get_site_mode() {
|
|
||||||
user_error (
|
|
||||||
'Director::set_site_mode() is deprecated as the functionality is no longer neccesary.', E_USER_NOTICE
|
|
||||||
);
|
|
||||||
|
|
||||||
return Director::$siteMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated 2.4 Use a custom extension on your controller.
|
|
||||||
*/
|
|
||||||
static function add_callback($function, $mode = 'site') {
|
|
||||||
user_error (
|
|
||||||
'Director::add_callback() is deprecated, please use a custom extension on your controller', E_USER_NOTICE
|
|
||||||
);
|
|
||||||
|
|
||||||
self::$callbacks[$mode][] = $function;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Environment type methods
|
// Environment type methods
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user