Skip to content

Commit 36bf74c

Browse files
committed
Merge branch 'develop' into 4.3
2 parents c82cbd6 + 207c13a commit 36bf74c

File tree

13 files changed

+231
-154
lines changed

13 files changed

+231
-154
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [v4.2.4](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.4) (2022-08-13)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.3...v4.2.4)
5+
6+
**Hotfix release to fix download errors (see https://github.com/codeigniter4/CodeIgniter4/pull/6361)**
7+
38
## [v4.2.3](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.3) (2022-08-06)
49
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.2...v4.2.3)
510

system/CodeIgniter.php

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CodeIgniter
4747
/**
4848
* The current version of CodeIgniter Framework
4949
*/
50-
public const CI_VERSION = '4.2.3';
50+
public const CI_VERSION = '4.2.4';
5151

5252
/**
5353
* App startup time.
@@ -465,20 +465,26 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
465465
$this->response = $response;
466466
}
467467

468-
// Cache it without the performance metrics replaced
469-
// so that we can have live speed updates along the way.
470-
// Must be run after filters to preserve the Response headers.
471-
if (static::$cacheTTL > 0) {
472-
$this->cachePage($cacheConfig);
473-
}
468+
// Skip unnecessary processing for special Responses.
469+
if (! $response instanceof DownloadResponse && ! $response instanceof RedirectResponse) {
470+
// Cache it without the performance metrics replaced
471+
// so that we can have live speed updates along the way.
472+
// Must be run after filters to preserve the Response headers.
473+
if (static::$cacheTTL > 0) {
474+
$this->cachePage($cacheConfig);
475+
}
474476

475-
// Update the performance metrics
476-
$output = $this->displayPerformanceMetrics($this->response->getBody());
477-
$this->response->setBody($output);
477+
// Update the performance metrics
478+
$body = $this->response->getBody();
479+
if ($body !== null) {
480+
$output = $this->displayPerformanceMetrics($body);
481+
$this->response->setBody($output);
482+
}
478483

479-
// Save our current URI as the previous URI in the session
480-
// for safer, more accurate use with `previous_url()` helper function.
481-
$this->storePreviousURL(current_url(true));
484+
// Save our current URI as the previous URI in the session
485+
// for safer, more accurate use with `previous_url()` helper function.
486+
$this->storePreviousURL(current_url(true));
487+
}
482488

483489
unset($uri);
484490

user_guide_src/source/changelogs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ See all the changes.
1313
:titlesonly:
1414

1515
v4.3.0
16+
v4.2.5
1617
v4.2.4
1718
v4.2.3
1819
v4.2.2
Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,12 @@
11
Version 4.2.4
22
#############
33

4-
Release Date: Unreleased
4+
Release Date: August 13, 2022
55

66
**4.2.4 release of CodeIgniter4**
77

88
.. contents::
99
:local:
1010
:depth: 2
1111

12-
BREAKING
13-
********
14-
15-
none.
16-
17-
Enhancements
18-
************
19-
20-
none.
21-
22-
Changes
23-
*******
24-
25-
none.
26-
27-
Deprecations
28-
************
29-
30-
none.
31-
32-
Bugs Fixed
33-
**********
34-
35-
See the repo's `CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_ for a complete list of bugs fixed.
12+
**Hotfix release to fix download errors; no other content changes.**
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Version 4.2.5
2+
#############
3+
4+
Release Date: Unreleased
5+
6+
**4.2.5 release of CodeIgniter4**
7+
8+
.. contents::
9+
:local:
10+
:depth: 2
11+
12+
BREAKING
13+
********
14+
15+
none.
16+
17+
Enhancements
18+
************
19+
20+
none.
21+
22+
Changes
23+
*******
24+
25+
none.
26+
27+
Deprecations
28+
************
29+
30+
none.
31+
32+
Bugs Fixed
33+
**********
34+
35+
See the repo's `CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_ for a complete list of bugs fixed.

user_guide_src/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
version = '4.2'
2525

2626
# The full version, including alpha/beta/rc tags.
27-
release = '4.2.3'
27+
release = '4.2.4'
2828

2929
# -- General configuration ---------------------------------------------------
3030

user_guide_src/source/database/query_builder.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,9 @@ run the query:
10461046
Class Reference
10471047
***************
10481048

1049-
.. php:class:: CodeIgniter\\Database\\BaseBuilder
1049+
.. php:namespace:: CodeIgniter\Database
1050+
1051+
.. php:class:: BaseBuilder
10501052
10511053
.. php:method:: db()
10521054

user_guide_src/source/incoming/controllers.rst

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,27 @@ What is a Controller?
1313

1414
A Controller is simply a class file that handles a HTTP request. :doc:`URI Routing <routing>` associates a URI with a controller.
1515

16+
Every controller you create should extend ``BaseController`` class.
17+
This class provides several features that are available to all of your controllers.
18+
19+
Constructor
20+
***********
21+
22+
The CodeIgniter's Controller has a special constructor ``initController()``.
23+
It will be called by the framework after PHP's constructor ``__construct()`` execution.
24+
25+
If you want to override the ``initController()``, don't forget to add ``parent::initController($request, $response, $logger);`` in the method:
26+
27+
.. literalinclude:: controllers/023.php
28+
29+
.. important:: You cannot use ``return`` in the constructor. So ``return redirect()->to('route');`` does not work.
30+
31+
The ``initController()`` method sets the following three properties.
32+
1633
Included Properties
1734
*******************
1835

19-
Every controller you create should extend ``CodeIgniter\Controller`` class.
20-
This class provides several features that are available to all of your controllers.
36+
The CodeIgniter's Controller provides these properties.
2137

2238
**Request Object**
2339

@@ -95,19 +111,22 @@ The method accepts an array of data to validate in the first parameter:
95111

96112
.. literalinclude:: controllers/006.php
97113

98-
Private methods
99-
***************
114+
Protecting Methods
115+
******************
100116

101117
In some cases, you may want certain methods hidden from public access.
102118
To achieve this, simply declare the method as ``private`` or ``protected``.
103-
That will prevent it from being served by a URL request. For example,
104-
if you were to define a method like this for the ``Helloworld`` controller:
119+
That will prevent it from being served by a URL request.
120+
121+
For example, if you were to define a method like this for the ``Helloworld`` controller:
105122

106123
.. literalinclude:: controllers/007.php
107124

108-
then trying to access it using the following URL will not work::
125+
and to define a route (``helloworld/utitilty``) for the method. Then trying to access it using the following URL will not work::
126+
127+
example.com/index.php/helloworld/utility
109128

110-
example.com/index.php/helloworld/utility/
129+
Auto-routing also will not work.
111130

112131
.. _controller-auto-routing-improved:
113132

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Controllers;
4+
5+
use CodeIgniter\HTTP\RequestInterface;
6+
use CodeIgniter\HTTP\ResponseInterface;
7+
use Psr\Log\LoggerInterface;
8+
9+
class Product extends BaseController
10+
{
11+
public function initController(
12+
RequestInterface $request,
13+
ResponseInterface $response,
14+
LoggerInterface $logger
15+
) {
16+
parent::initController($request, $response, $logger);
17+
18+
// Add your code here.
19+
}
20+
21+
// ...
22+
}

user_guide_src/source/incoming/incomingrequest.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ The methods provided by the parent classes that are available are:
250250
* :meth:`CodeIgniter\\HTTP\\Message::getProtocolVersion`
251251
* :meth:`CodeIgniter\\HTTP\\Message::setProtocolVersion`
252252

253-
.. php:class:: CodeIgniter\\HTTP\\IncomingRequest
253+
.. php:namespace:: CodeIgniter\HTTP
254+
255+
.. php:class:: IncomingRequest
254256
255257
.. php:method:: isCLI()
256258

0 commit comments

Comments
 (0)