Skip to content

Commit 0f62c42

Browse files
committed
Merge branch '5.next' into 6.x
2 parents 354e571 + a3e9aec commit 0f62c42

143 files changed

Lines changed: 772 additions & 575 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616

1717
jobs:
1818
build:
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-24.04
2020
strategy:
2121
matrix:
2222
doc-type: ['HTML', 'EPUB', 'PDF']
@@ -33,10 +33,10 @@ jobs:
3333
python -m pip install --upgrade pip
3434
pip install -r requirements.txt
3535
36-
- name: Install packages
37-
run: |
38-
sudo apt update
39-
sudo apt install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-lang-all
36+
- uses: awalsh128/cache-apt-pkgs-action@v1
37+
with:
38+
packages: texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-lang-all
39+
version: ubuntu-24.04
4040

4141
- name: Build Docs
4242
run: |

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM debian:bookworm
22

3-
ENV DEBIAN_FRONTEND noninteractive
3+
ENV DEBIAN_FRONTEND=noninteractive
44

55
LABEL Description="This image is used to create an environment to contribute to the cakephp/docs"
66

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
5.3 Migration Guide
2+
###################
3+
4+
The 5.3.0 release is a backwards compatible with 5.0. It adds new functionality
5+
and introduces new deprecations. Any functionality deprecated in 5.x will be
6+
removed in 6.0.0.
7+
8+
Behavior Changes
9+
================
10+
11+
View
12+
----
13+
14+
- The ``format()`` and ``currency()`` methods of ``NumberHelper`` now accept also null as input and can return any default string here.
15+
This allows for easier templates, in particular baked ones. Make sure to adjust any extending helper (plugin or app level) by adding that type.
16+
17+
Deprecations
18+
============
19+
20+
ORM
21+
---
22+
23+
- Calling behavior methods on table instances is now deprecated. To call
24+
a method of an attached behavior you need to use
25+
``$table->getBehavior('Sluggable')->slugify()`` instead of ``$table->slugify()``.
26+
27+
New Features
28+
============
29+
30+
TODO

en/console-commands/option-parsers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ Building a ConsoleOptionParser from an Array
208208
Option parsers can also be defined as arrays. Within the array, you can define
209209
keys for ``arguments``, ``options``, ``description`` and ``epilog``. The values
210210
for arguments, and options, should follow the format that
211-
:php:func:`\\Cake\\Console\\ConsoleOptionParser::addArguments()` and
212-
:php:func:`\\Cake\\Console\\ConsoleOptionParser::addOptions()` use. You can also
211+
:php:func:`Cake\\Console\\ConsoleOptionParser::addArguments()` and
212+
:php:func:`Cake\\Console\\ConsoleOptionParser::addOptions()` use. You can also
213213
use ``buildFromArray`` on its own, to build an option parser::
214214

215215
public function getOptionParser()

en/controllers.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The App Controller
3939

4040
As stated in the introduction, the ``AppController`` class is the parent class
4141
to all of your application's controllers. ``AppController`` itself extends the
42-
:php:class:`\\Cake\\Controller\\Controller` class included in CakePHP.
42+
:php:class:`Cake\\Controller\\Controller` class included in CakePHP.
4343
``AppController`` is defined in **src/Controller/AppController.php** as
4444
follows::
4545

@@ -77,7 +77,7 @@ Request Flow
7777
============
7878

7979
When a request is made to a CakePHP application, CakePHP's
80-
:php:class:`\\Cake\\Routing\\Router` and :php:class:`\\Cake\\Routing\\Dispatcher`
80+
:php:class:`Cake\\Routing\\Router` and :php:class:`Cake\\Routing\\Dispatcher`
8181
classes use :ref:`routes-configuration` to find and create the correct
8282
controller instance. The request data is encapsulated in a request object.
8383
CakePHP puts all of the important request information into the ``$this->request``
@@ -130,7 +130,7 @@ once a controller action has completed, CakePHP will handle rendering and
130130
delivering the View.
131131

132132
If for some reason you'd like to skip the default behavior, you can return a
133-
:php:class:`\\Cake\\Http\\Response` object from the action with the fully
133+
:php:class:`Cake\\Http\\Response` object from the action with the fully
134134
created response.
135135

136136
In order for you to use a controller effectively in your own application, we'll
@@ -548,7 +548,7 @@ methods are implemented by your controllers
548548
Called during the ``Controller.beforeRender`` event which occurs after
549549
controller action logic, but before the view is rendered. This callback is
550550
not used often, but may be needed if you are calling
551-
:php:meth:`\\Cake\\Controller\\Controller::render()` manually before the end
551+
:php:meth:`Cake\\Controller\\Controller::render()` manually before the end
552552
of a given action.
553553

554554
.. php:method:: afterFilter(EventInterface $event)

en/controllers/components/form-protection.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ in your ``initialize()`` method.
1919
your forms. In addition, you must **not** override any of the fields' "name"
2020
attributes. The FormProtection Component looks for certain indicators that are
2121
created and managed by the FormHelper (especially those created in
22-
:php:meth:`\\Cake\\View\\Helper\\FormHelper::create()` and
23-
:php:meth:`\\Cake\\View\\Helper\\FormHelper::end()`). Dynamically altering
22+
:php:meth:`~Cake\\View\\Helper\\FormHelper::create()` and
23+
:php:meth:`~Cake\\View\\Helper\\FormHelper::end()`). Dynamically altering
2424
the fields that are submitted in a POST request, such as disabling, deleting
2525
or creating new fields via JavaScript, is likely to cause the form token
2626
validation to fail.

en/controllers/request-response.rst

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Request Body Data
133133
.. php:method:: getData($name, $default = null)
134134
135135
All POST data normally available through PHP's ``$_POST`` global variable can be
136-
accessed using :php:meth:`\\Cake\\Http\\ServerRequest::getData()`. For example::
136+
accessed using :php:meth:`Cake\\Http\\ServerRequest::getData()`. For example::
137137

138138
// An input with a name attribute equal to 'title' is accessible at
139139
$title = $this->request->getData('title');
@@ -160,7 +160,7 @@ If you want to access all the data parameters you can use
160160
File Uploads
161161
------------
162162

163-
Uploaded files can be accessed through the request body data, using the :php:meth:`\\Cake\\Http\\ServerRequest::getData()`
163+
Uploaded files can be accessed through the request body data, using the :php:meth:`Cake\\Http\\ServerRequest::getData()`
164164
method described above. For example, a file from an input element with a name attribute of ``attachment``, can
165165
be accessed like this::
166166

@@ -195,11 +195,11 @@ origins, which makes testing file uploads possible.
195195
.. php:method:: getUploadedFile($path)
196196
197197
Returns the uploaded file at a specific path. The path uses the same dot syntax as the
198-
:php:meth:`\\Cake\\Http\\ServerRequest::getData()` method::
198+
:php:meth:`Cake\\Http\\ServerRequest::getData()` method::
199199

200200
$attachment = $this->request->getUploadedFile('attachment');
201201

202-
Unlike :php:meth:`\\Cake\\Http\\ServerRequest::getData()`, :php:meth:`\\Cake\\Http\\ServerRequest::getUploadedFile()` would
202+
Unlike :php:meth:`Cake\\Http\\ServerRequest::getData()`, :php:meth:`Cake\\Http\\ServerRequest::getUploadedFile()` would
203203
only return data when an actual file upload exists for the given path, if there is regular, non-file request body data
204204
present at the given path, then this method will return ``null``, just like it would for any non-existent path.
205205

@@ -244,9 +244,9 @@ replace all possibly existing uploaded files::
244244
.. note::
245245

246246
Uploaded files that have been added to the request via this method, will *not* be available in the request body
247-
data, ie you cannot retrieve them via :php:meth:`\\Cake\\Http\\ServerRequest::getData()`! If you need them in the
248-
request data (too), then you have to set them via :php:meth:`\\Cake\\Http\\ServerRequest::withData()` or
249-
:php:meth:`\\Cake\\Http\\ServerRequest::withParsedBody()`.
247+
data, ie you cannot retrieve them via :php:meth:`Cake\\Http\\ServerRequest::getData()`! If you need them in the
248+
request data (too), then you have to set them via :php:meth:`Cake\\Http\\ServerRequest::withData()` or
249+
:php:meth:`Cake\\Http\\ServerRequest::withParsedBody()`.
250250

251251
PUT, PATCH or DELETE Data
252252
-------------------------
@@ -345,7 +345,7 @@ conditions, as well as inspect other application specific request criteria::
345345
$isPost = $this->request->is('post');
346346

347347
You can also extend the request detectors that are available, by using
348-
:php:meth:`\\Cake\\Http\\ServerRequest::addDetector()` to create new kinds of
348+
:php:meth:`Cake\\Http\\ServerRequest::addDetector()` to create new kinds of
349349
detectors. There are different types of detectors that you can create:
350350

351351
* Environment value comparison - Compares a value fetched from :php:func:`env()`
@@ -435,9 +435,9 @@ There are several built-in detectors that you can use:
435435
'application/xml' or 'text/xml'.
436436

437437
``ServerRequest`` also includes methods like
438-
:php:meth:`\\Cake\\Http\\ServerRequest::domain()`,
439-
:php:meth:`\\Cake\\Http\\ServerRequest::subdomains()` and
440-
:php:meth:`\\Cake\\Http\\ServerRequest::host()` to make applications that use
438+
:php:meth:`Cake\\Http\\ServerRequest::domain()`,
439+
:php:meth:`Cake\\Http\\ServerRequest::subdomains()` and
440+
:php:meth:`Cake\\Http\\ServerRequest::host()` to make applications that use
441441
subdomains simpler.
442442

443443
Session Data
@@ -606,7 +606,7 @@ Request cookies can be read through a number of methods::
606606
// Get a CookieCollection instance
607607
$cookies = $this->request->getCookieCollection()
608608

609-
See the :php:class:`\\Cake\\Http\\Cookie\\CookieCollection` documentation for how
609+
See the :php:class:`Cake\\Http\\Cookie\\CookieCollection` documentation for how
610610
to work with cookie collection.
611611

612612

@@ -649,7 +649,7 @@ Response
649649

650650
.. php:class:: Response
651651
652-
:php:class:`\\Cake\\Http\\Response` is the default response class in CakePHP.
652+
:php:class:`Cake\\Http\\Response` is the default response class in CakePHP.
653653
It encapsulates a number of features and functionality for generating HTTP
654654
responses in your application. It also assists in testing, as it can be
655655
mocked/stubbed allowing you to inspect headers that will be sent.
@@ -668,7 +668,7 @@ Dealing with Content Types
668668
.. php:method:: withType($contentType = null)
669669
670670
You can control the Content-Type of your application's responses with
671-
:php:meth:`\\Cake\\Http\\Response::withType()`. If your application needs to deal
671+
:php:meth:`Cake\\Http\\Response::withType()`. If your application needs to deal
672672
with content types that are not built into Response, you can map them with
673673
``setTypeMap()`` as well::
674674

@@ -690,7 +690,7 @@ Sending Files
690690
.. php:method:: withFile(string $path, array $options = [])
691691
692692
There are times when you want to send files as responses for your requests.
693-
You can accomplish that by using :php:meth:`\\Cake\\Http\\Response::withFile()`::
693+
You can accomplish that by using :php:meth:`Cake\\Http\\Response::withFile()`::
694694

695695
public function sendFile($id)
696696
{
@@ -704,8 +704,8 @@ You can accomplish that by using :php:meth:`\\Cake\\Http\\Response::withFile()`:
704704
As shown in the above example, you must pass the file path to the method.
705705
CakePHP will send a proper content type header if it's a known file type listed
706706
in `Cake\\Http\\Response::$_mimeTypes`. You can add new types prior to calling
707-
:php:meth:`\\Cake\\Http\\Response::withFile()` by using the
708-
:php:meth:`\\Cake\\Http\\Response::withType()` method.
707+
:php:meth:`Cake\\Http\\Response::withFile()` by using the
708+
:php:meth:`Cake\\Http\\Response::withType()` method.
709709

710710
If you want, you can also force a file to be downloaded instead of displayed in
711711
the browser by specifying the options::
@@ -753,7 +753,7 @@ Setting Headers
753753

754754
.. php:method:: withHeader($header, $value)
755755
756-
Setting headers is done with the :php:meth:`\\Cake\\Http\\Response::withHeader()`
756+
Setting headers is done with the :php:meth:`Cake\\Http\\Response::withHeader()`
757757
method. Like all of the PSR-7 interface methods, this method returns a *new*
758758
instance with the new header::
759759

@@ -771,7 +771,7 @@ Headers are not sent when set. Instead, they are held until the response is
771771
emitted by ``Cake\Http\Server``.
772772

773773
You can now use the convenience method
774-
:php:meth:`\\Cake\\Http\\Response::withLocation()` to directly set or get the
774+
:php:meth:`Cake\\Http\\Response::withLocation()` to directly set or get the
775775
redirect location header.
776776

777777
Setting the Body
@@ -837,7 +837,7 @@ Interacting with Browser Caching
837837
.. php:method:: withDisabledCache()
838838
839839
You sometimes need to force browsers not to cache the results of a controller
840-
action. :php:meth:`\\Cake\\Http\\Response::withDisabledCache()` is intended for just
840+
action. :php:meth:`Cake\\Http\\Response::withDisabledCache()` is intended for just
841841
that::
842842

843843
public function index()
@@ -854,7 +854,7 @@ that::
854854
.. php:method:: withCache($since, $time = '+1 day')
855855
856856
You can also tell clients that you want them to cache responses. By using
857-
:php:meth:`\\Cake\\Http\\Response::withCache()`::
857+
:php:meth:`Cake\\Http\\Response::withCache()`::
858858

859859
public function index()
860860
{
@@ -882,7 +882,7 @@ Rather than forcing you to code the logic for caching and for invalidating
882882
(refreshing) it once the data has changed, HTTP uses two models, expiration and
883883
validation, which usually are much simpler to use.
884884

885-
Apart from using :php:meth:`\\Cake\\Http\\Response::withCache()`, you can also use
885+
Apart from using :php:meth:`Cake\\Http\\Response::withCache()`, you can also use
886886
many other methods to fine-tune HTTP cache headers to take advantage of browser
887887
or reverse proxy caching.
888888

@@ -1044,7 +1044,7 @@ the response content, and sends the `304 Not Modified` header::
10441044
Setting Cookies
10451045
---------------
10461046

1047-
Cookies can be added to response using either an array or a :php:class:`\\Cake\\Http\\Cookie\\Cookie`
1047+
Cookies can be added to response using either an array or a :php:class:`Cake\\Http\\Cookie\\Cookie`
10481048
object::
10491049

10501050
use Cake\Http\Cookie\Cookie;

en/core-libraries/caching.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ build your own backend. The built-in caching engines are:
3636
operations.
3737

3838
Regardless of the CacheEngine you choose to use, your application interacts with
39-
:php:class:`\\Cake\\Cache\\Cache`.
39+
:php:class:`Cake\\Cache\\Cache`.
4040

4141
.. _cache-configuration:
4242

@@ -110,8 +110,8 @@ You can also configure Cache engines at runtime::
110110
Cache::setConfig('other', $object);
111111

112112
The name of these engine configurations ('short' and 'long') are used as the ``$config``
113-
parameter for :php:meth:`\\Cake\\Cache\\Cache::write()` and
114-
:php:meth:`\\Cake\\Cache\\Cache::read()`. When configuring cache engines you can
113+
parameter for :php:meth:`Cake\\Cache\\Cache::write()` and
114+
:php:meth:`Cake\\Cache\\Cache::read()`. When configuring cache engines you can
115115
refer to the class name using the following syntaxes::
116116

117117
// Short name (in App\ or Cake namespaces)
@@ -243,8 +243,8 @@ Removing Configured Cache Engines
243243
.. php:staticmethod:: drop($key)
244244
245245
Once a configuration is created you cannot change it. Instead you should drop
246-
the configuration and re-create it using :php:meth:`\\Cake\\Cache\\Cache::drop()` and
247-
:php:meth:`\\Cake\\Cache\\Cache::setConfig()`. Dropping a cache engine will remove
246+
the configuration and re-create it using :php:meth:`Cake\\Cache\\Cache::drop()` and
247+
:php:meth:`Cake\\Cache\\Cache::setConfig()`. Dropping a cache engine will remove
248248
the config and destroy the adapter if it was constructed.
249249

250250
Writing to a Cache
@@ -488,7 +488,7 @@ Using Cache to Store Common Query Results
488488
You can greatly improve the performance of your application by putting results
489489
that infrequently change, or that are subject to heavy reads into the cache.
490490
A perfect example of this are the results from
491-
:php:meth:`\\Cake\\ORM\\Table::find()`. The Query object allows you to cache
491+
:php:meth:`Cake\\ORM\\Table::find()`. The Query object allows you to cache
492492
results using the ``cache()`` method. See the :ref:`caching-query-results` section
493493
for more information.
494494

@@ -594,7 +594,7 @@ dot syntax::
594594
// ...
595595
]);
596596

597-
Custom Cache engines must extend :php:class:`\\Cake\\Cache\\CacheEngine` which
597+
Custom Cache engines must extend :php:class:`Cake\\Cache\\CacheEngine` which
598598
defines a number of abstract methods as well as provides a few initialization
599599
methods.
600600

en/core-libraries/collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ This last example uses ``toList()`` unlike other examples, which is important
169169
when we're getting results with possibly duplicate keys. By using ``toList()``
170170
we'll be guaranteed to get all values even if there are duplicate keys.
171171

172-
Unlike :php:meth:`\\Cake\\Utility\\Hash::extract()` this method only supports the
172+
Unlike :php:meth:`Cake\\Utility\\Hash::extract()` this method only supports the
173173
``{*}`` wildcard. All other wildcard and attributes matchers are not supported.
174174

175175
.. php:method:: combine($keyPath, $valuePath, $groupPath = null)

en/core-libraries/form.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In the above example we see the 3 hook methods that forms provide:
5353

5454
* ``_buildSchema`` is used to define the schema data that is used by FormHelper
5555
to create an HTML form. You can define field type, length, and precision.
56-
* ``validationDefault`` Gets a :php:class:`\\Cake\\Validation\\Validator` instance
56+
* ``validationDefault`` Gets a :php:class:`Cake\\Validation\\Validator` instance
5757
that you can attach validators to.
5858
* ``_execute`` lets you define the behavior you want to happen when
5959
``execute()`` is called and the data is valid.

0 commit comments

Comments
 (0)