mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #6884 from open-sausages/pulls/4.0/remove-deprecated-methods
Remove APIs with target deprecation of 4.0
This commit is contained in:
commit
6cd9bec766
@ -1283,6 +1283,12 @@ After (`mysite/_config/config.yml`):
|
||||
- `getModules`
|
||||
- `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.
|
||||
* 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.
|
||||
* Removed `CreditCardField`, `CountryDropdownField`, `PhoneNumberField`, `MemberDatetimeOptionsetField`, `InlineFormAction`.
|
||||
Use custom code instead
|
||||
* Removed `ResetFormAction`, use `FormAction::create()->setAttribute('type', 'reset')` instead
|
||||
@ -1321,7 +1327,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`
|
||||
@ -1381,6 +1388,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)
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user