Skip to content

Commit a3a7aa7

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.5
2 parents 3e9a9c9 + fd6d674 commit a3a7aa7

File tree

12 files changed

+91
-39
lines changed

12 files changed

+91
-39
lines changed

.github/workflows/test-deptrac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
uses: shivammathur/setup-php@v2
4444
with:
4545
php-version: '8.1'
46-
tools: composer, phive
46+
tools: composer
4747
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3
4848

4949
- name: Validate composer.json

app/Views/errors/html/debug.css

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ body {
1919
}
2020
h1 {
2121
font-weight: lighter;
22-
letter-spacing: 0.8;
2322
font-size: 3rem;
2423
color: var(--dark-text-color);
2524
margin: 0;
@@ -44,7 +43,7 @@ p.lead {
4443
color: var(--dark-text-color);
4544
}
4645
.header .container {
47-
padding: 1rem 1.75rem 1.75rem 1.75rem;
46+
padding: 1rem;
4847
}
4948
.header h1 {
5049
font-size: 2.5rem;
@@ -65,14 +64,11 @@ p.lead {
6564
display: inline;
6665
}
6766

68-
.footer {
67+
.environment {
6968
background: var(--dark-bg-color);
7069
color: var(--light-text-color);
71-
}
72-
.footer .container {
73-
border-top: 1px solid #e7e7e7;
74-
margin-top: 1rem;
7570
text-align: center;
71+
padding: 0.2rem;
7672
}
7773

7874
.source {
@@ -112,7 +108,7 @@ p.lead {
112108
}
113109
.tabs a:link,
114110
.tabs a:visited {
115-
padding: 0rem 1rem;
111+
padding: 0 1rem;
116112
line-height: 2.7;
117113
text-decoration: none;
118114
color: var(--dark-text-color);
@@ -152,9 +148,6 @@ p.lead {
152148
border-radius: 5px;
153149
color: #31708f;
154150
}
155-
ul, ol {
156-
line-height: 1.8;
157-
}
158151

159152
table {
160153
width: 100%;

app/Views/errors/html/error_exception.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424

2525
<!-- Header -->
2626
<div class="header">
27+
<div class="environment">
28+
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
29+
PHP: <?= esc(PHP_VERSION) ?> &mdash;
30+
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> --
31+
Environment: <?= ENVIRONMENT ?>
32+
</div>
2733
<div class="container">
2834
<h1><?= esc($title), esc($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1>
2935
<p>
@@ -420,18 +426,5 @@
420426
</div> <!-- /container -->
421427
<?php endif; ?>
422428

423-
<div class="footer">
424-
<div class="container">
425-
426-
<p>
427-
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
428-
PHP: <?= esc(PHP_VERSION) ?> &mdash;
429-
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> --
430-
Environment: <?= ENVIRONMENT ?>
431-
</p>
432-
433-
</div>
434-
</div>
435-
436429
</body>
437430
</html>

system/Commands/Utilities/Routes/ControllerMethodReader.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,19 +161,17 @@ private function getRouteWithoutController(
161161
string $classname,
162162
string $methodName
163163
): array {
164-
$output = [];
165-
166-
if ($classShortname === $defaultController) {
167-
$pattern = '#' . preg_quote(lcfirst($defaultController), '#') . '\z#';
168-
$routeWithoutController = rtrim(preg_replace($pattern, '', $uriByClass), '/');
169-
$routeWithoutController = $routeWithoutController ?: '/';
170-
171-
$output[] = [
172-
'route' => $routeWithoutController,
173-
'handler' => '\\' . $classname . '::' . $methodName,
174-
];
164+
if ($classShortname !== $defaultController) {
165+
return [];
175166
}
176167

177-
return $output;
168+
$pattern = '#' . preg_quote(lcfirst($defaultController), '#') . '\z#';
169+
$routeWithoutController = rtrim(preg_replace($pattern, '', $uriByClass), '/');
170+
$routeWithoutController = $routeWithoutController ?: '/';
171+
172+
return [[
173+
'route' => $routeWithoutController,
174+
'handler' => '\\' . $classname . '::' . $methodName,
175+
]];
178176
}
179177
}

tests/system/Database/Live/SQLite3/GetFieldDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function createForge(): void
3434
'database' => 'database.db',
3535
'DBDebug' => true,
3636
];
37-
$this->db = db_connect($config);
37+
$this->db = db_connect($config, false);
3838
$this->forge = Database::forge($config);
3939
}
4040

tests/system/Database/Live/SQLite3/GetIndexDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function setUp(): void
4747
'database' => 'database.db',
4848
'DBDebug' => true,
4949
];
50-
$this->db = db_connect($config);
50+
$this->db = db_connect($config, false);
5151
$this->forge = Database::forge($config);
5252
}
5353

tests/system/Database/Migrations/MigrationRunnerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,10 @@ public function testMigrationUsesSameConnectionAsMigrationRunner(): void
472472
$this->assertCount(2, $tables);
473473
$this->assertSame('migrations', $tables[0]);
474474
$this->assertSame('foo', $tables[1]);
475+
476+
if (is_file($config['database'])) {
477+
unlink($config['database']);
478+
}
475479
}
476480

477481
protected function resetTables($db = null): void

user_guide_src/source/database/configuration.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,19 @@ Explanation of Values:
201201
etc.) not all values will be needed. For example, when using ``SQLite3`` you
202202
will not need to supply a username or password, and the database name
203203
will be the path to your database file.
204+
205+
MySQLi
206+
======
207+
208+
hostname
209+
--------
210+
211+
Configuring a Socket Connection
212+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
213+
214+
To connect to a MySQL server over a filesystem socket, the path to the socket should be specified in
215+
the ``'hostname'`` setting. CodeIgniter's MySQLi driver will notice this and configure the
216+
connection properly.
217+
218+
.. literalinclude:: configuration/011.php
219+
:lines: 11-18
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Config;
4+
5+
use CodeIgniter\Database\Config;
6+
7+
class Database extends Config
8+
{
9+
// ...
10+
11+
// MySQLi over a socket
12+
public array $default = [
13+
// ...
14+
'hostname' => '/cloudsql/toolbox-tests:europe-north1:toolbox-db',
15+
// ...
16+
'DBDriver' => 'MySQLi',
17+
// ...
18+
];
19+
20+
// ...
21+
}

user_guide_src/source/general/configuration.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ the application configuration files in the **app/Config** folder.
1515
:local:
1616
:depth: 2
1717

18+
19+
What are Configuration Classes?
20+
*******************************
21+
22+
Configuration classes are utilized to define system default configuration values.
23+
System configuration values are typically *static*. Configuration classes are
24+
intended to retain the settings that configure how the application operates,
25+
rather than responding to each user's individual settings.
26+
27+
It is not recommended to alter values set during the instantiation of a
28+
configuration class later during execution. In other words, it is recommended to
29+
treat configuration classes as immutable or readonly classes. This is especially
30+
important if you utilize :ref:`factories-config-caching`.
31+
32+
Configuration values can be hard-coded in the class files or obtained from
33+
environment variables at instantiation.
34+
1835
Working with Configuration Files
1936
********************************
2037

user_guide_src/source/installation/upgrade_447.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ Please refer to the upgrade instructions corresponding to your installation meth
1616
Mandatory File Changes
1717
**********************
1818

19+
Error Files
20+
===========
21+
22+
The error page has been updated. Please update the following files:
23+
24+
- app/Views/errors/html/debug.css
25+
- app/Views/errors/html/error_exception.php
26+
1927
****************
2028
Breaking Changes
2129
****************

user_guide_src/source/libraries/official_packages.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Among the many features, it includes:
2929
* Per-user permission overrides,
3030
* and more...
3131

32+
.. _settings:
33+
3234
********
3335
Settings
3436
********

0 commit comments

Comments
 (0)