Skip to content

Commit 0e4dce8

Browse files
committed
Release v4.4.6
1 parent 2c1a1bc commit 0e4dce8

5 files changed

Lines changed: 50 additions & 47 deletions

File tree

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ It has been built from the
1111

1212
More information about the plans for version 4 can be found in [CodeIgniter 4](https://forum.codeigniter.com/forumdisplay.php?fid=28) on the forums.
1313

14-
The user guide corresponding to the latest version of the framework can be found
15-
[here](https://codeigniter4.github.io/userguide/).
14+
You can read the [user guide](https://codeigniter.com/user_guide/)
15+
corresponding to the latest version of the framework.
1616

1717
## Installation & updates
1818

@@ -55,10 +55,11 @@ PHP version 7.4 or higher is required, with the following extensions installed:
5555
- [intl](http://php.net/manual/en/intl.requirements.php)
5656
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
5757

58-
> **Warning**
59-
> The end of life date for PHP 7.4 was November 28, 2022. If you are
60-
> still using PHP 7.4, you should upgrade immediately. The end of life date
61-
> for PHP 8.0 will be November 26, 2023.
58+
> [!WARNING]
59+
> The end of life date for PHP 7.4 was November 28, 2022.
60+
> The end of life date for PHP 8.0 was November 26, 2023.
61+
> If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
62+
> The end of life date for PHP 8.1 will be November 25, 2024.
6263
6364
Additionally, make sure that the following extensions are enabled in your PHP:
6465

app/Config/App.php

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ class App extends BaseConfig
1414
* URL to your CodeIgniter root. Typically, this will be your base URL,
1515
* WITH a trailing slash:
1616
*
17-
* http://example.com/
17+
* E.g., http://example.com/
1818
*/
1919
public string $baseURL = 'http://localhost:8080/';
2020

2121
/**
2222
* Allowed Hostnames in the Site URL other than the hostname in the baseURL.
2323
* If you want to accept multiple Hostnames, set this.
2424
*
25-
* E.g. When your site URL ($baseURL) is 'http://example.com/', and your site
26-
* also accepts 'http://media.example.com/' and
27-
* 'http://accounts.example.com/':
28-
* ['media.example.com', 'accounts.example.com']
25+
* E.g.,
26+
* When your site URL ($baseURL) is 'http://example.com/', and your site
27+
* also accepts 'http://media.example.com/' and 'http://accounts.example.com/':
28+
* ['media.example.com', 'accounts.example.com']
2929
*
3030
* @var list<string>
3131
*/
@@ -36,9 +36,9 @@ class App extends BaseConfig
3636
* Index File
3737
* --------------------------------------------------------------------------
3838
*
39-
* Typically this will be your index.php file, unless you've renamed it to
40-
* something else. If you are using mod_rewrite to remove the page set this
41-
* variable so that it is blank.
39+
* Typically, this will be your `index.php` file, unless you've renamed it to
40+
* something else. If you have configured your web server to remove this file
41+
* from your site URIs, set this variable to an empty string.
4242
*/
4343
public string $indexPage = 'index.php';
4444

@@ -48,12 +48,12 @@ class App extends BaseConfig
4848
* --------------------------------------------------------------------------
4949
*
5050
* This item determines which server global should be used to retrieve the
51-
* URI string. The default setting of 'REQUEST_URI' works for most servers.
51+
* URI string. The default setting of 'REQUEST_URI' works for most servers.
5252
* If your links do not seem to work, try one of the other delicious flavors:
5353
*
54-
* 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
55-
* 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
56-
* 'PATH_INFO' Uses $_SERVER['PATH_INFO']
54+
* 'REQUEST_URI': Uses $_SERVER['REQUEST_URI']
55+
* 'QUERY_STRING': Uses $_SERVER['QUERY_STRING']
56+
* 'PATH_INFO': Uses $_SERVER['PATH_INFO']
5757
*
5858
* WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
5959
*/
@@ -94,7 +94,7 @@ class App extends BaseConfig
9494
*
9595
* IncomingRequest::setLocale() also uses this list.
9696
*
97-
* @var string[]
97+
* @var list<string>
9898
*/
9999
public array $supportedLocales = ['en'];
100100

@@ -106,7 +106,8 @@ class App extends BaseConfig
106106
* The default timezone that will be used in your application to display
107107
* dates with the date helper, and can be retrieved through app_timezone()
108108
*
109-
* @see https://www.php.net/manual/en/timezones.php for list of timezones supported by PHP.
109+
* @see https://www.php.net/manual/en/timezones.php for list of timezones
110+
* supported by PHP.
110111
*/
111112
public string $appTimezone = 'UTC';
112113

@@ -130,7 +131,7 @@ class App extends BaseConfig
130131
* If true, this will force every request made to this application to be
131132
* made via a secure connection (HTTPS). If the incoming request is not
132133
* secure, the user will be redirected to a secure version of the page
133-
* and the HTTP Strict Transport Security header will be set.
134+
* and the HTTP Strict Transport Security (HSTS) header will be set.
134135
*/
135136
public bool $forceGlobalSecureRequests = false;
136137

app/Config/Routing.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,12 @@ class Routing extends BaseRouting
6363

6464
/**
6565
* Sets the class/method that should be called if routing doesn't
66-
* find a match. It can be either a closure or the controller/method
67-
* name exactly like a route is defined: Users::index
66+
* find a match. It can be the controller/method name like: Users::index
6867
*
6968
* This setting is passed to the Router class and handled there.
7069
*
7170
* If you want to use a closure, you will have to set it in the
72-
* class constructor or the routes file by calling:
71+
* routes file by calling:
7372
*
7473
* $routes->set404Override(function() {
7574
* // Do something here

app/Views/welcome_message.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@
150150
.further h2:first-of-type {
151151
padding-top: 0;
152152
}
153+
.svg-stroke {
154+
fill: none;
155+
stroke: #000;
156+
stroke-width: 32px;
157+
}
153158
footer {
154159
background-color: rgba(221, 72, 20, .8);
155160
text-align: center;
@@ -206,14 +211,14 @@
206211
</a>
207212
</li>
208213
<li class="menu-toggle">
209-
<button onclick="toggleMenu();">&#9776;</button>
214+
<button id="menuToggle">&#9776;</button>
210215
</li>
211216
<li class="menu-item hidden"><a href="#">Home</a></li>
212-
<li class="menu-item hidden"><a href="https://codeigniter4.github.io/userguide/" target="_blank">Docs</a>
217+
<li class="menu-item hidden"><a href="https://codeigniter.com/user_guide/" target="_blank">Docs</a>
213218
</li>
214219
<li class="menu-item hidden"><a href="https://forum.codeigniter.com/" target="_blank">Community</a></li>
215220
<li class="menu-item hidden"><a
216-
href="https://github.com/codeigniter4/CodeIgniter4/blob/develop/CONTRIBUTING.md" target="_blank">Contribute</a>
221+
href="https://codeigniter.com/contribute" target="_blank">Contribute</a>
217222
</li>
218223
</ul>
219224
</div>
@@ -253,17 +258,17 @@
253258
<h1>Go further</h1>
254259

255260
<h2>
256-
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><rect x='32' y='96' width='64' height='368' rx='16' ry='16' style='fill:none;stroke:#000;stroke-linejoin:round;stroke-width:32px'/><line x1='112' y1='224' x2='240' y2='224' style='fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px'/><line x1='112' y1='400' x2='240' y2='400' style='fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px'/><rect x='112' y='160' width='128' height='304' rx='16' ry='16' style='fill:none;stroke:#000;stroke-linejoin:round;stroke-width:32px'/><rect x='256' y='48' width='96' height='416' rx='16' ry='16' style='fill:none;stroke:#000;stroke-linejoin:round;stroke-width:32px'/><path d='M422.46,96.11l-40.4,4.25c-11.12,1.17-19.18,11.57-17.93,23.1l34.92,321.59c1.26,11.53,11.37,20,22.49,18.84l40.4-4.25c11.12-1.17,19.18-11.57,17.93-23.1L445,115C443.69,103.42,433.58,94.94,422.46,96.11Z' style='fill:none;stroke:#000;stroke-linejoin:round;stroke-width:32px'/></svg>
261+
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><rect x='32' y='96' width='64' height='368' rx='16' ry='16' class="svg-stroke" /><line x1='112' y1='224' x2='240' y2='224' class="svg-stroke" /><line x1='112' y1='400' x2='240' y2='400' class="svg-stroke" /><rect x='112' y='160' width='128' height='304' rx='16' ry='16' class="svg-stroke" /><rect x='256' y='48' width='96' height='416' rx='16' ry='16' class="svg-stroke" /><path d='M422.46,96.11l-40.4,4.25c-11.12,1.17-19.18,11.57-17.93,23.1l34.92,321.59c1.26,11.53,11.37,20,22.49,18.84l40.4-4.25c11.12-1.17,19.18-11.57,17.93-23.1L445,115C443.69,103.42,433.58,94.94,422.46,96.11Z' class="svg-stroke"/></svg>
257262
Learn
258263
</h2>
259264

260265
<p>The User Guide contains an introduction, tutorial, a number of "how to"
261266
guides, and then reference documentation for the components that make up
262-
the framework. Check the <a href="https://codeigniter4.github.io/userguide"
267+
the framework. Check the <a href="https://codeigniter.com/user_guide/"
263268
target="_blank">User Guide</a> !</p>
264269

265270
<h2>
266-
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M431,320.6c-1-3.6,1.2-8.6,3.3-12.2a33.68,33.68,0,0,1,2.1-3.1A162,162,0,0,0,464,215c.3-92.2-77.5-167-173.7-167C206.4,48,136.4,105.1,120,180.9a160.7,160.7,0,0,0-3.7,34.2c0,92.3,74.8,169.1,171,169.1,15.3,0,35.9-4.6,47.2-7.7s22.5-7.2,25.4-8.3a26.44,26.44,0,0,1,9.3-1.7,26,26,0,0,1,10.1,2L436,388.6a13.52,13.52,0,0,0,3.9,1,8,8,0,0,0,8-8,12.85,12.85,0,0,0-.5-2.7Z' style='fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px'/><path d='M66.46,232a146.23,146.23,0,0,0,6.39,152.67c2.31,3.49,3.61,6.19,3.21,8s-11.93,61.87-11.93,61.87a8,8,0,0,0,2.71,7.68A8.17,8.17,0,0,0,72,464a7.26,7.26,0,0,0,2.91-.6l56.21-22a15.7,15.7,0,0,1,12,.2c18.94,7.38,39.88,12,60.83,12A159.21,159.21,0,0,0,284,432.11' style='fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px'/></svg>
271+
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M431,320.6c-1-3.6,1.2-8.6,3.3-12.2a33.68,33.68,0,0,1,2.1-3.1A162,162,0,0,0,464,215c.3-92.2-77.5-167-173.7-167C206.4,48,136.4,105.1,120,180.9a160.7,160.7,0,0,0-3.7,34.2c0,92.3,74.8,169.1,171,169.1,15.3,0,35.9-4.6,47.2-7.7s22.5-7.2,25.4-8.3a26.44,26.44,0,0,1,9.3-1.7,26,26,0,0,1,10.1,2L436,388.6a13.52,13.52,0,0,0,3.9,1,8,8,0,0,0,8-8,12.85,12.85,0,0,0-.5-2.7Z' class="svg-stroke" /><path d='M66.46,232a146.23,146.23,0,0,0,6.39,152.67c2.31,3.49,3.61,6.19,3.21,8s-11.93,61.87-11.93,61.87a8,8,0,0,0,2.71,7.68A8.17,8.17,0,0,0,72,464a7.26,7.26,0,0,0,2.91-.6l56.21-22a15.7,15.7,0,0,1,12,.2c18.94,7.38,39.88,12,60.83,12A159.21,159.21,0,0,0,284,432.11' class="svg-stroke" /></svg>
267272
Discuss
268273
</h2>
269274

@@ -274,7 +279,7 @@
274279
target="_blank">chat on Slack</a> !</p>
275280

276281
<h2>
277-
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><line x1='176' y1='48' x2='336' y2='48' style='fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px'/><line x1='118' y1='304' x2='394' y2='304' style='fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px'/><path d='M208,48v93.48a64.09,64.09,0,0,1-9.88,34.18L73.21,373.49C48.4,412.78,76.63,464,123.08,464H388.92c46.45,0,74.68-51.22,49.87-90.51L313.87,175.66A64.09,64.09,0,0,1,304,141.48V48' style='fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px'/></svg>
282+
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><line x1='176' y1='48' x2='336' y2='48' class="svg-stroke" /><line x1='118' y1='304' x2='394' y2='304' class="svg-stroke" /><path d='M208,48v93.48a64.09,64.09,0,0,1-9.88,34.18L73.21,373.49C48.4,412.78,76.63,464,123.08,464H388.92c46.45,0,74.68-51.22,49.87-90.51L313.87,175.66A64.09,64.09,0,0,1,304,141.48V48' class="svg-stroke" /></svg>
278283
Contribute
279284
</h2>
280285

@@ -309,7 +314,8 @@
309314

310315
<!-- SCRIPTS -->
311316

312-
<script>
317+
<script {csp-script-nonce}>
318+
document.getElementById("menuToggle").addEventListener('click', toggleMenu);
313319
function toggleMenu() {
314320
var menuItems = document.getElementsByClassName('menu-item');
315321
for (var i = 0; i < menuItems.length; i++) {

tests/README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ use to test your application. Those details can be found in the documentation.
77

88
## Resources
99

10-
* [CodeIgniter 4 User Guide on Testing](https://codeigniter4.github.io/userguide/testing/index.html)
10+
* [CodeIgniter 4 User Guide on Testing](https://codeigniter.com/user_guide/testing/index.html)
1111
* [PHPUnit docs](https://phpunit.de/documentation.html)
1212
* [Any tutorials on Unit testing in CI4?](https://forum.codeigniter.com/showthread.php?tid=81830)
1313

1414
## Requirements
1515

1616
It is recommended to use the latest version of PHPUnit. At the time of this
17-
writing we are running version 9.x. Support for this has been built into the
17+
writing, we are running version 9.x. Support for this has been built into the
1818
**composer.json** file that ships with CodeIgniter and can easily be installed
1919
via [Composer](https://getcomposer.org/) if you don't already have it installed globally.
2020

@@ -35,10 +35,10 @@ for code coverage to be calculated successfully. After installing `XDebug`, you
3535

3636
A number of the tests use a running database.
3737
In order to set up the database edit the details for the `tests` group in
38-
**app/Config/Database.php** or **phpunit.xml**.
38+
**app/Config/Database.php** or **.env**.
3939
Make sure that you provide a database engine that is currently running on your machine.
4040
More details on a test database setup are in the
41-
[Testing Your Database](https://codeigniter4.github.io/userguide/testing/database.html) section of the documentation.
41+
[Testing Your Database](https://codeigniter.com/user_guide/testing/database.html) section of the documentation.
4242

4343
## Running the tests
4444

@@ -92,12 +92,11 @@ HTML code coverage reports.
9292
## Test Cases
9393

9494
Every test needs a *test case*, or class that your tests extend. CodeIgniter 4
95-
provides a few that you may use directly:
96-
* `CodeIgniter\Test\CIUnitTestCase` - for basic tests with no other service needs
97-
* `CodeIgniter\Test\DatabaseTestTrait` - for tests that need database access
95+
provides one class that you may use directly:
96+
* `CodeIgniter\Test\CIUnitTestCase`
9897

99-
Most of the time you will want to write your own test cases to hold functions and services
100-
common to your test suites.
98+
Most of the time you will want to write your own test cases that extend `CIUnitTestCase`
99+
to hold functions and services common to your test suites.
101100

102101
## Creating Tests
103102

@@ -112,11 +111,8 @@ Review the links above and always pay attention to your code coverage.
112111

113112
### Database Tests
114113

115-
Tests can include migrating, seeding, and testing against a mock or live<sup>1</sup> database.
114+
Tests can include migrating, seeding, and testing against a mock or live database.
116115
Be sure to modify the test case (or create your own) to point to your seed and migrations
117116
and include any additional steps to be run before tests in the `setUp()` method.
118-
119-
<sup>1</sup> Note: If you are using database tests that require a live database connection
120-
you will need to rename **phpunit.xml.dist** to **phpunit.xml**, uncomment the database
121-
configuration lines and add your connection details. Prevent **phpunit.xml** from being
122-
tracked in your repo by adding it to **.gitignore**.
117+
See [Testing Your Database](https://codeigniter.com/user_guide/testing/database.html)
118+
for details.

0 commit comments

Comments
 (0)