mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Removed "overview of changes" upgrading docs duplication
This commit is contained in:
parent
1b06be1a64
commit
9b6fb70c5d
@ -1151,68 +1151,3 @@ has been added to assist in migration of legacy files (see [file migration docum
|
||||
### Any other script that needs running.
|
||||
|
||||
Some third party modules may include their own migration tasks. Take a minute to consult the release notes of your third party dependencies to make sure you have miss anything.
|
||||
|
||||
## List of Major API Changes
|
||||
|
||||
This is a list of the most common API changes that might affect you.
|
||||
|
||||
Read the changelogs for a comprehensive list of everything that is new in SilverStripe 4:
|
||||
* (SilverStripe 4.0.0 change logs)[/changelogs/4.0.0/]
|
||||
* (SilverStripe 4.1.0 change logs)[/changelogs/4.1.0/]
|
||||
* (SilverStripe 4.2.0 change logs)[/changelogs/4.2.0/].
|
||||
|
||||
[Object class replaced by traits](/changelogs/4.0.0#object-replace)
|
||||
The `Object` class has been superceded by three traits:
|
||||
- `Injectable`: Provides `MyClass::create()` and `MyClass::singleton()`
|
||||
- `Configurable`: Provides `MyClass::config()`
|
||||
- `Extensible`: Provides all methods related to extensions (E.g. add_extension()).
|
||||
`$this->class` no longer recommended, should use `static::class` or `get_class($classObject)` instead.
|
||||
|
||||
[Rewrite literal table names](/changelogs/4.0.0#literal-table-names)
|
||||
Use `$table = SilverStripe\ORM\DataObject::getSchema()->tableForField($model, $field)` instead of `$model` directly.
|
||||
|
||||
[Rewrite literal class names](/changelogs/4.0.0#literal-class-names)
|
||||
For example, referencing the class name `'Member'` should be `Member::class` or if you're in YML config it should be `SilverStripe\Security\Member`.
|
||||
|
||||
[Template locations and references](/changelogs/4.0.0#template-locations)
|
||||
Templates require the folder path inside the templates folder, and Core templates are placed in paths following the class namespace, e.g. `FormField` is now `SilverStripe/Forms/FormField`.
|
||||
When using the `<% include %>` syntax, you can leave out the `Includes` folder in the path.
|
||||
|
||||
[Config settings should be set to `private static`](/changelogs/4.0.0#private-static)
|
||||
We no longer support `public static $config_item` on classes, it now needs to be `private static $config_item`.
|
||||
|
||||
[Module paths can't be hardcoded](/changelogs/4.0.0#module-paths)
|
||||
Modules may not be placed in a deterministic folder (e.g. `/framework`),
|
||||
you should use getters on the [Module](api:SilverStripe\Core\Manifest\Module) object instead.
|
||||
|
||||
Please see the changelogs for more details on ways that the getters on the `Module` object could be used.
|
||||
|
||||
[Adapt tooling to modules in vendor folder](#vendor-folder)
|
||||
SilverStripe modules are now placed in the `vendor` folder like many other composer package.
|
||||
|
||||
Modules need to declare which files need to be exposed via the new [vendor-plugin](https://github.com/silverstripe/vendor-plugin), using symlinks to link to files from the publically accessible `resources` folder.
|
||||
|
||||
[SS_Log replaced with PSR-3 logging](/changelogs/4.0.0#psr3-logging)
|
||||
SilverStripe 4 introduces [PSR-3](http://www.php-fig.org/psr/psr-3/) compatible logger interfaces. Services can access the logger using the LoggerInterface::class service.
|
||||
|
||||
Please see the changelogs for more details on how to implement logging.
|
||||
|
||||
[Upgrade `app/_config.php`](/changelogs/4.0.0#config-php)
|
||||
The globals `$database` and `$databaseConfig` are deprecated. You should upgrade your site `_config.php` files to use the [.env configuration](#env).
|
||||
`conf/ConfigureFromEnv.php` is no longer used, and references to this file should be deleted.
|
||||
|
||||
[Session object removes static methods](/changelogs/4.0.0#session)
|
||||
Session object is no longer statically accessible via `Session::inst()`. Instead, `Session` is a member of the current request.
|
||||
|
||||
[Extensions are now singletons](#extensions-singletons)
|
||||
This means that state stored in private/protected variables are now shared across all objects which use this extension.
|
||||
It is recommended to refactor the variables to be stored against the owner object.
|
||||
|
||||
[Explicit text casting on template variables](/changelogs/4.0.0#template-casting)
|
||||
Calling `$MyField` on a DataObject in templates will by default cast MyField as `Text` which means it will be safely encoded.
|
||||
You can change the casting for this by defining a casting config on the DataObject:
|
||||
```php
|
||||
private static $casting = [
|
||||
'MyField' => 'HTMLText'
|
||||
];
|
||||
```
|
||||
|
@ -12,6 +12,44 @@ For users upgrading to later versions, please see the specific [4.1.0](4.1.0) an
|
||||
|
||||
## Overview {#overview}
|
||||
|
||||
### For Content Authors
|
||||
|
||||
### For Developers
|
||||
|
||||
|
||||
* [Object class replaced by traits](/changelogs/4.0.0#object-replace)
|
||||
`Injectable`: Provides `MyClass::create()` and `MyClass::singleton()`.
|
||||
`Configurable`: Provides `MyClass::config()`.
|
||||
`Extensible`: Provides all methods related to extensions (E.g. add_extension()).
|
||||
`$this->class` no longer recommended, should use `static::class` or `get_class($classObject)` instead.
|
||||
* [Rewrite literal table names](/changelogs/4.0.0#literal-table-names)
|
||||
Use `$table = SilverStripe\ORM\DataObject::getSchema()->tableForField($model, $field)` instead of `$model` directly.
|
||||
* [Rewrite literal class names](/changelogs/4.0.0#literal-class-names)
|
||||
For example, referencing the class name `'Member'` should be `Member::class` or if you're in YML config it should be `SilverStripe\Security\Member`.
|
||||
* [Template locations and references](/changelogs/4.0.0#template-locations)
|
||||
Templates require the folder path inside the templates folder, and Core templates are placed in paths following the class namespace, e.g. `FormField` is now `SilverStripe/Forms/FormField`. When using the `<% include %>` syntax, you can leave out the `Includes` folder in the path.
|
||||
* [Config settings should be set to `private static`](/changelogs/4.0.0#private-static)
|
||||
We no longer support `public static $config_item` on classes, it now needs to be `private static $config_item`.
|
||||
* [Module paths can't be hardcoded](/changelogs/4.0.0#module-paths)
|
||||
Modules may not be placed in a deterministic folder (e.g. `/framework`),
|
||||
you should use getters on the [Module](api:SilverStripe\Core\Manifest\Module) object instead.
|
||||
* [Adapt tooling to modules in vendor folder](#vendor-folder)
|
||||
SilverStripe modules are now placed in the `vendor` folder like many other composer package.
|
||||
* Modules need to declare which files need to be exposed via the new [vendor-plugin](https://github.com/silverstripe/vendor-plugin),
|
||||
using symlinks to link to files from the publically accessible `resources` folder.
|
||||
* [SS_Log replaced with PSR-3 logging](/changelogs/4.0.0#psr3-logging)
|
||||
SilverStripe 4 introduces [PSR-3](http://www.php-fig.org/psr/psr-3/) compatible logger interfaces. Services can access the logger using the LoggerInterface::class service.
|
||||
* [Upgrade `mysite/_config.php`](/changelogs/4.0.0#config-php)
|
||||
The globals `$database` and `$databaseConfig` are deprecated. You should upgrade your site `_config.php` files to use the [.env configuration](#env).
|
||||
`conf/ConfigureFromEnv.php` is no longer used, and references to this file should be deleted.
|
||||
* [Session object removes static methods](/changelogs/4.0.0#session)
|
||||
Session object is no longer statically accessible via `Session::inst()`. Instead, `Session` is a member of the current request.
|
||||
* [Extensions are now singletons](#extensions-singletons)
|
||||
This means that state stored in private/protected variables are now shared across all objects which use this extension.
|
||||
It is recommended to refactor the variables to be stored against the owner object.
|
||||
* [Explicit text casting on template variables](/changelogs/4.0.0#template-casting)
|
||||
Calling `$MyField` on a DataObject in templates will by default cast MyField as `Text` which means it will be safely encoded.
|
||||
|
||||
* Minimum version dependencies have increased; PHP 5.6 and Internet Explorer 11 (or other modern browser)
|
||||
are required.
|
||||
* All code earlier marked as deprecated for 4.0 has now been removed (check our
|
||||
|
Loading…
Reference in New Issue
Block a user