Skip to content

Commit 643abc8

Browse files
LordSimalADmadmarkstory
authored
add missing 5.4 docs (#8260)
* add missing 5.4 docs * Apply suggestions from code review Co-authored-by: ADmad <admad.coder@gmail.com> * add missing 5.4 docs * adjust docs * Update docs/en/appendices/5-4-migration-guide.md Co-authored-by: Mark Story <mark@mark-story.com> --------- Co-authored-by: ADmad <admad.coder@gmail.com> Co-authored-by: Mark Story <mark@mark-story.com>
1 parent db6930d commit 643abc8

File tree

2 files changed

+41
-17
lines changed

2 files changed

+41
-17
lines changed

docs/en/appendices/5-4-migration-guide.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,48 @@ bin/cake upgrade rector --rules cakephp54 <path/to/app/src>
1616

1717
## Behavior Changes
1818

19+
### Commands
20+
21+
- `BaseCommand::initialize()` is now being triggered **AFTER** arguments and options have been parsed.
22+
1923
### I18n
2024

21-
`Number::parseFloat()` now returns `null` instead of `0.0` when parsing
22-
fails. This also affects `FloatType` and `DecimalType` database types.
25+
- `Number::parseFloat()` now returns `null` instead of `0.0` when parsing
26+
fails. This also affects `FloatType` and `DecimalType` database types.
2327

2428
### ORM
2529

26-
The default eager loading strategy for `HasMany` and `BelongsToMany` associations
27-
has changed from `select` to `subquery`. If you need the previous behavior,
28-
explicitly set `'strategy' => 'select'` when defining associations.
30+
- The default eager loading strategy for `HasMany` and `BelongsToMany` associations
31+
has changed from `select` to `subquery`. If you need the previous behavior,
32+
explicitly set `'strategy' => 'select'` when defining associations.
2933

3034
### Controller
3135

32-
Loading a component with the same alias as the controller's default table now
33-
triggers a warning. See [Component Alias Conflicts](../controllers/components#component-alias-conflicts).
36+
- Loading a component with the same alias as the controller's default table now
37+
triggers a warning. See [Component Alias Conflicts](../controllers/components#component-alias-conflicts).
3438

3539
## Deprecations
3640

37-
- WIP
41+
### Mailer
42+
43+
- The `Mailer::$name` property is unused and has been deprecated.
3844

3945
## New Features
4046

47+
### Core
48+
49+
- `PluginConfig::getInstalledPlugins()` was added to retrieve a list of all installed plugins
50+
including flags to indicate about their scope and state.
51+
- A backwards compatible Container implementation has been added to the core. You can opt-in to use it instead of the current
52+
`league/container` implementation by setting `App.container` to `cake` inside your `config/app.php`.
53+
See [Dependency Injection Container](../development/dependency-injection) for more details.
54+
55+
### Commands
56+
57+
- You can use `$this->io` and `$this->args` inside your commands to access input/output and argument objects
58+
without needing to pass them down from the `execute()` method. **This will be the default in CakePHP 6.0**
59+
as those arguments will be removed from the `execute()` method signature.
60+
4161
### Controller
4262

4363
- Added `#[RequestToDto]` attribute for automatic mapping of request data to
@@ -75,7 +95,9 @@ triggers a warning. See [Component Alias Conflicts](../controllers/components#co
7595

7696
- Added `Cake\Utility\Fs\Finder` class for fluent file discovery with pattern matching,
7797
depth control, and custom filters. Added `Cake\Utility\Fs\Path` for cross-platform
78-
path manipulation.
98+
path manipulation. See [Filesystem Utilities](../core-libraries/filesystem.md).
99+
- `Security::encrypt()` can now be configured to use longer keys with separate encryption and authentication keys that are derived from the provided key.
100+
You can set `Security.encryptWithRawKey` to enable this behavior. See [here](https://github.com/cakephp/cakephp/pull/19325) for more details.
79101

80102
### Collection
81103

docs/en/console-commands/commands.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,16 @@ You should see the following output:
4848

4949
Hello world.
5050

51-
::: info
52-
The `Arguments` and `ConsoleIo` instances passed to `execute()` are also
53-
available on the command instance as `$this->args` and `$this->io`.
54-
In 6.x, the `execute()` method signature will drop these arguments
55-
and `$this->args` / `$this->io` will be the only way to access
56-
these objects. See the
57-
[6.x command refactor](https://github.com/cakephp/cakephp/pull/18983) for
58-
details.
51+
::: info Added in version 5.4.0
52+
In CakePHP 5.4 and newer, the `Arguments` and `ConsoleIo` instances are also
53+
available on the command instance as `$this->args` and `$this->io` properties.
54+
This lets you access input, output, and arguments inside your command methods
55+
without passing these objects down from `execute()`.
56+
57+
This will become the default in CakePHP 6.0, where the `execute()` method
58+
signature will no longer include `Arguments $args` and `ConsoleIo $io`.
59+
Updating your commands to use `$this->args` and `$this->io` now is
60+
recommended.
5961
:::
6062

6163
Our `execute()` method isn't very interesting let's read some input from the

0 commit comments

Comments
 (0)