Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions en/bake/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,6 @@ And the resultant baked class (**src/Shell/FooShell.php**) looks like this::

}

.. note::

Prior to version 1.5.0 bake used a custom erb-style tags inside .ctp template files.

* ``<%`` A Bake template php open tag
* ``%>`` A Bake template php close tag
* ``<%=`` A Bake template php short-echo tag
* ``<%-`` A Bake template php open tag, stripping any leading whitespace
before the tag
* ``-%>`` A Bake template php close tag, stripping trailing whitespace after
the tag

.. _creating-a-bake-theme:

Creating a Bake Theme
Expand Down
1 change: 0 additions & 1 deletion en/console-and-shells.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ send the email with::
use Cake\Mailer\Email;

$email = new Email();
// Prior to 3.4 use domain()
$email->setDomain('www.example.org');

This asserts that the generated message IDs are valid and fit to the domain the
Expand Down
4 changes: 0 additions & 4 deletions en/console-and-shells/option-parsers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,6 @@ in either an array or a string, you can set the value of the description::

// Set multiple lines at once
$parser->setDescription(['line one', 'line two']);
// Prior to 3.4
$parser->description(['line one', 'line two']);

// Read the current value
$parser->getDescription();
Expand All @@ -375,8 +373,6 @@ can set the value of the epilog::

// Set multiple lines at once
$parser->setEpilog(['line one', 'line two']);
// Prior to 3.4
$parser->epilog(['line one', 'line two']);

// Read the current value
$parser->getEpilog();
Expand Down
3 changes: 0 additions & 3 deletions en/console-and-shells/plugin-shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ This will add the following to your **src/Application.php**::
// In the bootstrap method add:
$this->addPlugin('MyPlugin');

// Prior to 3.6, add the following to config/bootstrap.php
Plugin::load('MyPlugin');

If you are loading a plugin that only provides CLI tools - like bake - you can
update your ``bootstrap_cli.php`` with::

Expand Down
3 changes: 0 additions & 3 deletions en/console-and-shells/schema-cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ cached metadata as well::

# Clear a single table
bin/cake schema_cache clear articles

.. note::
Prior to 3.6 you should use ``orm_cache`` instead of ``schema_cache``.
7 changes: 1 addition & 6 deletions en/controllers/components/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -545,18 +545,13 @@ In order to display the session error messages that Auth generates, you
need to add the following code to your layout. Add the following two
lines to the **templates/Layout/default.php** file in the body section::

// Only this is necessary after 3.4.0
echo $this->Flash->render();

// Prior to 3.4.0 this will be required as well.
echo $this->Flash->render('auth');

You can customize the error messages and flash settings ``AuthComponent``
uses. Using ``flash`` config you can configure the parameters
``AuthComponent`` uses for setting flash messages. The available keys are

- ``key`` - The key to use, defaults to 'default'. Prior to 3.4.0, the key
defaulted to 'auth'.
- ``key`` - The key to use, defaults to 'default'.
- ``element`` - The element name to use for rendering, defaults to null.
- ``params`` - The array of additional parameters to use, defaults to ``[]``.

Expand Down
1 change: 0 additions & 1 deletion en/controllers/components/pagination.rst
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ page count.
So you could either let the normal error page be rendered or use a try catch
block and take appropriate action when a ``NotFoundException`` is caught::

// Prior to 3.6 use Cake\Network\Exception\NotFoundException
use Cake\Http\Exception\NotFoundException;

public function index()
Expand Down
10 changes: 1 addition & 9 deletions en/controllers/components/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,11 @@ require secure SSL requests::
if ($exception instanceof SecurityException && $exception->getType() === 'secure') {
return $this->redirect('https://' . env('SERVER_NAME') . Router::url($this->request->getRequestTarget()));
}

throw $exception;
}
}

.. note::

Use ``$this->request->here()`` for CakePHP versions prior to 3.4.0

This example would force all actions that had admin routing to require secure
SSL requests. When the request is black holed, it will call the nominated
``forceSSL()`` callback which will redirect non-secure requests to secure
Expand Down Expand Up @@ -273,10 +269,6 @@ There may be cases where you want to disable all security checks for an action
}
}

.. note::

Use ``$this->Security->config()`` for CakePHP versions prior to 3.4.0

This example would disable all security checks for the edit action.

.. meta::
Expand Down
53 changes: 0 additions & 53 deletions en/controllers/request-response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ The request exposes routing parameters through the ``getParam()`` method::

$controllerName = $this->request->getParam('controller');

// Prior to 3.4.0
$controllerName = $this->request->param('controller');

To get all routing parameters as an array use ``getAttribute()``::

$parameters = $this->request->getAttribute('params');
Expand Down Expand Up @@ -80,9 +77,6 @@ Query string parameters can be read using the ``getQuery()`` method::
// URL is /posts/index?page=1&sort=title
$page = $this->request->getQuery('page');

// Prior to 3.4.0
$page = $this->request->query('page');

You can either directly access the query property, or you can use
``getQuery()`` method to read the URL query array in an error-free manner.
Any keys that do not exist will return ``null``::
Expand Down Expand Up @@ -196,11 +190,6 @@ subdirectory. The attributes you can use are::
// Holds /subdir/
$base = $request->getAttribute('webroot');

// Prior to 3.4.0
$webroot = $request->webroot;
$base = $request->base;
$here = $request->here();

.. _check-the-request:

Checking Request Conditions
Expand Down Expand Up @@ -340,9 +329,6 @@ Returns the HTTP method the request was made with::
// Output POST
echo $request->getMethod();

// Prior to 3.4.0
echo $request->method();

Restricting Which HTTP method an Action Accepts
-----------------------------------------------

Expand Down Expand Up @@ -374,9 +360,6 @@ for the request. For example::
// Check if a header exists
$hasAcceptHeader = $this->request->hasHeader('Accept');

// Prior to 3.4.0
$userAgent = $this->request->header('User-Agent');

While some apache installs don't make the ``Authorization`` header accessible,
CakePHP will make it available through apache specific methods as required.

Expand Down Expand Up @@ -514,9 +497,6 @@ with content types that are not built into Response, you can map them with
// Set the response Content-Type to vcard.
$this->response = $this->response->withType('vcf');

// Prior to 3.4.0
$this->response->type('vcf');

Usually, you'll want to map additional content types in your controller's
:php:meth:`~Controller::beforeFilter()` callback, so you can leverage the
automatic view switching features of :php:class:`RequestHandlerComponent` if you
Expand All @@ -541,13 +521,6 @@ You can accomplish that by using :php:meth:`Cake\\Http\\Response::withFile()`::
return $response;
}

// Prior to 3.4.0
$file = $this->Attachments->getFile($id);
$this->response->file($file['path']);
// Return the response to prevent controller from trying to render
// a view.
return $this->response;

As shown in the above example, you must pass the file path to the method.
CakePHP will send a proper content type header if it's a known file type listed
in `Cake\\Http\\Response::$_mimeTypes`. You can add new types prior to calling
Expand All @@ -562,12 +535,6 @@ the browser by specifying the options::
['download' => true, 'name' => 'foo']
);

// Prior to 3.4.0
$this->response->file(
$file['path'],
['download' => true, 'name' => 'foo']
);

The supported options are:

name
Expand Down Expand Up @@ -630,9 +597,6 @@ instance with the new header::
// Append a value to an existing header
$response = $response->withAddedHeader('Set-Cookie', 'remember_me=1');

// Prior to 3.4.0 - Set a header
$this->response->header('Location', 'http://example.com');

Headers are not sent when set. Instead, they are held until the response is
emitted by ``Cake\Http\Server``.

Expand Down Expand Up @@ -664,9 +628,6 @@ To set the response body, use the ``withBody()`` method, which is provided by th

$response = $response->withBody($stream);

// Prior to 3.4.0 - Set the body
$this->response->body('My Body');

Be sure that ``$stream`` is a :php:class:`Psr\\Http\\Message\\StreamInterface` object.
See below on how to create a new stream.

Expand Down Expand Up @@ -694,14 +655,6 @@ stream to the client::
});
$response = $response->withBody($stream);

// Prior to 3.4.0 you can use the following to create streaming responses.
$file = fopen('/some/file.png', 'r');
$this->response->body(function () use ($file) {
rewind($file);
fpassthru($file);
fclose($file);
});

Setting the Character Set
-------------------------

Expand All @@ -711,9 +664,6 @@ Sets the charset that will be used in the response::

$this->response = $this->response->withCharset('UTF-8');

// Prior to 3.4.0
$this->response->charset('UTF-8');

Interacting with Browser Caching
--------------------------------

Expand All @@ -727,9 +677,6 @@ that::
{
// Disable caching
$this->response = $this->response->withDisabledCache();

// Prior to 3.4.0
$this->response->disableCache();
}

.. warning::
Expand Down
3 changes: 1 addition & 2 deletions en/core-libraries/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ build your own backend. The built-in caching engines are:
work well in files.
* ``Apcu`` APCu cache uses the PHP `APCu <http://php.net/apcu>`_ extension.
This extension uses shared memory on the webserver to store objects.
This makes it very fast, and able to provide atomic read/write features. Prior
to 3.6.0 ``ApcuEngine`` was named ``ApcEngine``.
This makes it very fast, and able to provide atomic read/write features.
* ``Wincache`` Wincache uses the `Wincache <http://php.net/wincache>`_
extension. Wincache is similar to APC in features and performance, but
optimized for Windows and IIS.
Expand Down
6 changes: 0 additions & 6 deletions en/core-libraries/email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ change the configuration data. An example transport configuration looks like::
use Cake\Mailer\TransportFactory;

// Sample Mail configuration
// Prior to 3.7.0 use Email::configTransport()
TransportFactory::setConfig('default', [
'className' => 'Mail'
]);
Expand Down Expand Up @@ -171,11 +170,6 @@ useful when working with environment variables or :term:`PaaS` providers::
'url' => 'smtp://my@gmail.com:secret@smtp.gmail.com:587?tls=true',
]);

// Prior to 3.7.0 use
Email::configTransport('default', [
'url' => 'smtp://my@gmail.com:secret@smtp.gmail.com:587?tls=true',
]);

When using a DSN string you can define any additional parameters/options as
query string arguments.

Expand Down
1 change: 0 additions & 1 deletion en/core-libraries/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ a more direct approach and only listen to the event you really need::
->on('Model.afterSave', function($event, $entity)
{
// For example we can send an email to the admin
// Prior to 3.4 use from()/to()/subject() methods
$email = new Email('default');
$email->setFrom(['info@yoursite.com' => 'Your Site'])
->setTo('admin@yoursite.com')
Expand Down
11 changes: 1 addition & 10 deletions en/core-libraries/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,6 @@ Values set with this method will overwrite existing data in the form object::
}
}

Prior to 3.7.0 you must set default values for form by modifying the request::

// Set default values on get
if ($this->request->is('get')) {
// Values from the User Model e.g.
$this->request->data('name', 'John Doe');
$this->request->data('email','john.doe@example.com');
}

Values should only be defined if the request method is GET, otherwise
you will overwrite your previous POST Data which might have validation errors
that need corrections.
Expand All @@ -159,7 +150,7 @@ Getting Form Errors

Once a form has been validated you can retrieve the errors from it::

$errors = $form->getErrors(); // $form->errors(); // prior to 3.7.0
$errors = $form->getErrors();
/* $errors contains
[
'email' => ['A valid email address is required']
Expand Down
14 changes: 0 additions & 14 deletions en/core-libraries/httpclient.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ CakePHP includes a PSR-18 compliant HTTP client which can be used for
making requests. It is a great way to communicate with webservices, and
remote APIs.

.. versionchanged:: 3.3.0
Prior to 3.3.0 you should use ``Cake\Network\Http\Client``.

Doing Requests
==============

Expand Down Expand Up @@ -373,11 +370,6 @@ You read the entire response body as a string::
// Read the entire response as a string.
$response->getStringBody();

// Prior to 3.7.0 use
$response->body();
// or
$response->body;

You can also access the stream object for the response and use its methods::

// Get a Psr\Http\Message\StreamInterface containing the response body
Expand All @@ -402,17 +394,11 @@ XML data is decoded into a ``SimpleXMLElement`` tree::
$response = $http->get('http://example.com/test.xml');
$xml = $response->getXml();

// Prior to 3.7.0
$xml = $response->xml;

// Get some JSON
$http = new Client();
$response = $http->get('http://example.com/test.json');
$json = $response->getJson();

// Prior to 3.7.0
$json = $response->json;

The decoded response data is stored in the response object, so accessing it
multiple times has no additional cost.

Expand Down
Loading