From 75b7e19066c504708b721dca3cd39fe5ea45ac6b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 8 May 2017 21:04:54 +1200 Subject: [PATCH 1/8] API Remove deprecated SS_HOST --- src/Control/Director.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Control/Director.php b/src/Control/Director.php index ac4ee9d03..19aa27e7b 100644 --- a/src/Control/Director.php +++ b/src/Control/Director.php @@ -575,17 +575,6 @@ class Director implements TemplateGlobalProvider } } - // Legacy ss4-alpha environment var - /** - * @todo remove at 4.0.0-beta1 - * @deprecated 4.0.0-beta1 - */ - $legacyHostname = getenv('SS_HOST'); - if ($legacyHostname) { - Deprecation::notice('4.0', 'SS_HOST will be removed in ss 4.0.0-beta1'); - return $legacyHostname; - } - // Fail over to server_name (least reliable) return isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : gethostname(); } From 1d438d3fb5eb822081c7e428d57c271bf3aee180 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 8 May 2017 21:05:11 +1200 Subject: [PATCH 2/8] API Remove deprecated FormAction::createTag() --- docs/en/04_Changelogs/4.0.0.md | 3 ++- src/Forms/FormField.php | 16 ---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index 362c1d3e4..f1d7058e5 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -1318,7 +1318,8 @@ A very small number of methods were chosen for deprecation, and will be removed * `LimitWordCountXML` is removed. Use `LimitWordCount` instead. * `BigSummary` is removed. Use `Summary` instead. * Most limit methods on `DBHTMLText` now plain text rather than attempt to manipulate the underlying HTML. - * `FormField::Title` and `FormField::RightTitle` are now cast as plain text by default (but can be overridden). +* `FormField::Title` and `FormField::RightTitle` are now cast as plain text by default (but can be overridden). +* `FormField#createTag()` has been renamed to `FormField::create_tag()` * `Hierarchy` class has had much of it's functionality refactored out into `MarkedSet`: * `isMarked` * `isTreeOpened` diff --git a/src/Forms/FormField.php b/src/Forms/FormField.php index 076fb0f52..93e2e7314 100644 --- a/src/Forms/FormField.php +++ b/src/Forms/FormField.php @@ -1260,22 +1260,6 @@ class FormField extends RequestHandler return strtolower(preg_replace('/Field$/', '', $type->getShortName())); } - /** - * @deprecated 4.0 Use FormField::create_tag() - * - * @param string $tag - * @param array $attributes - * @param null|string $content - * - * @return string - */ - public function createTag($tag, $attributes, $content = null) - { - Deprecation::notice('4.0', 'Use FormField::create_tag()'); - - return self::create_tag($tag, $attributes, $content); - } - /** * Abstract method each {@link FormField} subclass must implement, determines whether the field * is valid or not based on the value. From 81e5c7ac4017fe5813e9eebb5edb5cc38a41dfa1 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 8 May 2017 21:07:16 +1200 Subject: [PATCH 3/8] API Removed deprecated Session::set_config() --- docs/en/04_Changelogs/4.0.0.md | 3 ++- src/Control/Session.php | 22 ---------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index f1d7058e5..58770dcb6 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -1283,6 +1283,7 @@ After (`mysite/_config/config.yml`): - `getModules` - `getConfigDirs` - `getConfigs` +* Removed `Session::set_config()` and `Session::get_config()`. Use the `Session.timeout` config setting instead #### General and Core Deprecated API @@ -1817,4 +1818,4 @@ New `TimeField` methods replace `getConfig()` / `setConfig()` you will need to define this method and return a short name describing the login method. * `MemberLoginForm` has a new constructor argument for the authenticator class, athough tis is usually constructed by `MemberAuthenticator` and won't affect normal use. - * `Authenticator` methods `register` and `unregister` are deprecated in favor of using `Config` \ No newline at end of file + * `Authenticator` methods `register` and `unregister` are deprecated in favor of using `Config` diff --git a/src/Control/Session.php b/src/Control/Session.php index 0cabfcfe0..e502516f6 100644 --- a/src/Control/Session.php +++ b/src/Control/Session.php @@ -544,26 +544,4 @@ class Session { self::current_session()->inst_destroy($removeCookie); } - - /** - * Set the timeout of a Session value - * - * @deprecated 4.0 Use the "Session.timeout" config setting instead - * - * @param int $timeout Time until a session expires in seconds. Defaults to expire when browser is closed. - */ - public static function set_timeout($timeout) - { - Deprecation::notice('4.0', 'Use the "Session.timeout" config setting instead'); - Config::inst()->update('SilverStripe\\Control\\Session', 'timeout', (int) $timeout); - } - - /** - * @deprecated 4.0 Use the "Session.timeout" config setting instead - */ - public static function get_timeout() - { - Deprecation::notice('4.0', 'Use the "Session.timeout" config setting instead'); - return Config::inst()->get('SilverStripe\\Control\\Session', 'timeout'); - } } From 2a7c76e9e99eb2ae315671191ba3575c827a0108 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 8 May 2017 21:09:13 +1200 Subject: [PATCH 4/8] API Removed deprecated DatabaseAdmin#clearAllData() --- docs/en/04_Changelogs/4.0.0.md | 1 + src/ORM/DatabaseAdmin.php | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index 58770dcb6..33e4373af 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -1380,6 +1380,7 @@ A very small number of methods were chosen for deprecation, and will be removed * `DataObjectSchema` class added to assist with mapping between classes and tables. * `DBMoney` values are now treated as empty only if `Amount` field is null. If an `Amount` value is provided without a `Currency` specified, it will be formatted as per the current locale. +* Removed `DatabaseAdmin#clearAllData()`. Use `DB::get_conn()->clearAllData()` instead The below methods have been added or had their functionality updated to `DBDate`, `DBTime` and `DBDatetime` * `getTimestamp()` added to get the respective date / time as unix timestamp (seconds since 1970-01-01) diff --git a/src/ORM/DatabaseAdmin.php b/src/ORM/DatabaseAdmin.php index e81ef6250..5f63b1fef 100644 --- a/src/ORM/DatabaseAdmin.php +++ b/src/ORM/DatabaseAdmin.php @@ -361,17 +361,6 @@ class DatabaseAdmin extends Controller ClassInfo::reset_db_cache(); } - /** - * Clear all data out of the database - * - * @deprecated since version 4.0 - */ - public function clearAllData() - { - Deprecation::notice('4.0', 'Use DB::get_conn()->clearAllData() instead'); - DB::get_conn()->clearAllData(); - } - /** * Remove invalid records from tables - that is, records that don't have * corresponding records in their parent class tables. From 5784a7d2d7c4c5ec27765498660f9a71cbdb7f48 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 8 May 2017 21:10:17 +1200 Subject: [PATCH 5/8] API Removed deprecated Security::set_login_recording() --- docs/en/04_Changelogs/4.0.0.md | 2 ++ src/Security/Security.php | 23 ----------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index 33e4373af..04d87df3d 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -1284,6 +1284,8 @@ After (`mysite/_config/config.yml`): - `getConfigDirs` - `getConfigs` * Removed `Session::set_config()` and `Session::get_config()`. Use the `Session.timeout` config setting instead +* Removed `Security::set_login_recording()` and `Security::get_login_recording()`. + Use the `Security.login_recording` config setting instead. #### General and Core Deprecated API diff --git a/src/Security/Security.php b/src/Security/Security.php index 6c912010c..8cc9ac41e 100644 --- a/src/Security/Security.php +++ b/src/Security/Security.php @@ -1137,29 +1137,6 @@ class Security extends Controller implements TemplateGlobalProvider return true; } - /** - * Enable or disable recording of login attempts - * through the {@link LoginRecord} object. - * - * @deprecated 4.0 Use the "Security.login_recording" config setting instead - * @param boolean $bool - */ - public static function set_login_recording($bool) - { - Deprecation::notice('4.0', 'Use the "Security.login_recording" config setting instead'); - self::$login_recording = (bool)$bool; - } - - /** - * @deprecated 4.0 Use the "Security.login_recording" config setting instead - * @return boolean - */ - public static function login_recording() - { - Deprecation::notice('4.0', 'Use the "Security.login_recording" config setting instead'); - return self::$login_recording; - } - /** * @config * @var string Set the default login dest From 670dfd2ea096802d586c8fe41f0a17a4deb8ea4f Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 8 May 2017 21:11:41 +1200 Subject: [PATCH 6/8] Changed deprecation of SSViewer::set_theme() We introduced SSViewer::set_themes() in 4.0 only, and its quite a commonly used method --- src/View/SSViewer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/View/SSViewer.php b/src/View/SSViewer.php index 8ad0ee926..543bf0334 100644 --- a/src/View/SSViewer.php +++ b/src/View/SSViewer.php @@ -188,7 +188,7 @@ class SSViewer implements Flushable } /** - * @deprecated 4.0 Use the "SSViewer.theme" config setting instead + * @deprecated 4.0.0:5.0.0 Use the "SSViewer#set_themes" instead * @param string $theme The "base theme" name (without underscores). */ public static function set_theme($theme) From cec983b628f3ee8780126a940351ca6268d2ff4b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 8 May 2017 21:15:45 +1200 Subject: [PATCH 7/8] API Removed deprecated ModelAsController::find_old_page() --- docs/en/04_Changelogs/4.0.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index 04d87df3d..e9bbbc4eb 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -1286,6 +1286,7 @@ After (`mysite/_config/config.yml`): * Removed `Session::set_config()` and `Session::get_config()`. Use the `Session.timeout` config setting instead * Removed `Security::set_login_recording()` and `Security::get_login_recording()`. Use the `Security.login_recording` config setting instead. +* Removed `ModelAsController::find_old_page()`. Use `OldPageRedirector::find_old_page()` instead #### General and Core Deprecated API From 7c2f49d443833dd151c137f6f596210b37399ba8 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 8 May 2017 21:17:28 +1200 Subject: [PATCH 8/8] API Removed RootURLController:set_default_homepage_link() --- docs/en/04_Changelogs/4.0.0.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index e9bbbc4eb..c7eb6de75 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -1286,7 +1286,9 @@ After (`mysite/_config/config.yml`): * Removed `Session::set_config()` and `Session::get_config()`. Use the `Session.timeout` config setting instead * Removed `Security::set_login_recording()` and `Security::get_login_recording()`. Use the `Security.login_recording` config setting instead. -* Removed `ModelAsController::find_old_page()`. Use `OldPageRedirector::find_old_page()` instead +* Removed `ModelAsController::find_old_page()`. Use `OldPageRedirector::find_old_page()` instead +* Removed `RootURLController:set_default_homepage_link()` and `RootURLController::get_default_homepage_link()`. + Use the `RootURLController.default_homepage_link` config setting instead. #### General and Core Deprecated API