Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Mar 18, 2024
2 parents 3e9a9c9 + fd6d674 commit a3a7aa7
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer, phive
tools: composer
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3

- name: Validate composer.json
Expand Down
15 changes: 4 additions & 11 deletions app/Views/errors/html/debug.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ body {
}
h1 {
font-weight: lighter;
letter-spacing: 0.8;
font-size: 3rem;
color: var(--dark-text-color);
margin: 0;
Expand All @@ -44,7 +43,7 @@ p.lead {
color: var(--dark-text-color);
}
.header .container {
padding: 1rem 1.75rem 1.75rem 1.75rem;
padding: 1rem;
}
.header h1 {
font-size: 2.5rem;
Expand All @@ -65,14 +64,11 @@ p.lead {
display: inline;
}

.footer {
.environment {
background: var(--dark-bg-color);
color: var(--light-text-color);
}
.footer .container {
border-top: 1px solid #e7e7e7;
margin-top: 1rem;
text-align: center;
padding: 0.2rem;
}

.source {
Expand Down Expand Up @@ -112,7 +108,7 @@ p.lead {
}
.tabs a:link,
.tabs a:visited {
padding: 0rem 1rem;
padding: 0 1rem;
line-height: 2.7;
text-decoration: none;
color: var(--dark-text-color);
Expand Down Expand Up @@ -152,9 +148,6 @@ p.lead {
border-radius: 5px;
color: #31708f;
}
ul, ol {
line-height: 1.8;
}

table {
width: 100%;
Expand Down
19 changes: 6 additions & 13 deletions app/Views/errors/html/error_exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@

<!-- Header -->
<div class="header">
<div class="environment">
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> --
Environment: <?= ENVIRONMENT ?>
</div>
<div class="container">
<h1><?= esc($title), esc($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1>
<p>
Expand Down Expand Up @@ -420,18 +426,5 @@
</div> <!-- /container -->
<?php endif; ?>

<div class="footer">
<div class="container">

<p>
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> --
Environment: <?= ENVIRONMENT ?>
</p>

</div>
</div>

</body>
</html>
22 changes: 10 additions & 12 deletions system/Commands/Utilities/Routes/ControllerMethodReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,17 @@ private function getRouteWithoutController(
string $classname,
string $methodName
): array {
$output = [];

if ($classShortname === $defaultController) {
$pattern = '#' . preg_quote(lcfirst($defaultController), '#') . '\z#';
$routeWithoutController = rtrim(preg_replace($pattern, '', $uriByClass), '/');
$routeWithoutController = $routeWithoutController ?: '/';

$output[] = [
'route' => $routeWithoutController,
'handler' => '\\' . $classname . '::' . $methodName,
];
if ($classShortname !== $defaultController) {
return [];
}

return $output;
$pattern = '#' . preg_quote(lcfirst($defaultController), '#') . '\z#';
$routeWithoutController = rtrim(preg_replace($pattern, '', $uriByClass), '/');
$routeWithoutController = $routeWithoutController ?: '/';

return [[
'route' => $routeWithoutController,
'handler' => '\\' . $classname . '::' . $methodName,
]];
}
}
2 changes: 1 addition & 1 deletion tests/system/Database/Live/SQLite3/GetFieldDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function createForge(): void
'database' => 'database.db',
'DBDebug' => true,
];
$this->db = db_connect($config);
$this->db = db_connect($config, false);
$this->forge = Database::forge($config);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/system/Database/Live/SQLite3/GetIndexDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function setUp(): void
'database' => 'database.db',
'DBDebug' => true,
];
$this->db = db_connect($config);
$this->db = db_connect($config, false);
$this->forge = Database::forge($config);
}

Expand Down
4 changes: 4 additions & 0 deletions tests/system/Database/Migrations/MigrationRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,10 @@ public function testMigrationUsesSameConnectionAsMigrationRunner(): void
$this->assertCount(2, $tables);
$this->assertSame('migrations', $tables[0]);
$this->assertSame('foo', $tables[1]);

if (is_file($config['database'])) {
unlink($config['database']);
}
}

protected function resetTables($db = null): void
Expand Down
16 changes: 16 additions & 0 deletions user_guide_src/source/database/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,19 @@ Explanation of Values:
etc.) not all values will be needed. For example, when using ``SQLite3`` you
will not need to supply a username or password, and the database name
will be the path to your database file.

MySQLi
======

hostname
--------

Configuring a Socket Connection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To connect to a MySQL server over a filesystem socket, the path to the socket should be specified in
the ``'hostname'`` setting. CodeIgniter's MySQLi driver will notice this and configure the
connection properly.

.. literalinclude:: configuration/011.php
:lines: 11-18
21 changes: 21 additions & 0 deletions user_guide_src/source/database/configuration/011.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Config;

use CodeIgniter\Database\Config;

class Database extends Config
{
// ...

// MySQLi over a socket
public array $default = [
// ...
'hostname' => '/cloudsql/toolbox-tests:europe-north1:toolbox-db',
// ...
'DBDriver' => 'MySQLi',
// ...
];

// ...
}
17 changes: 17 additions & 0 deletions user_guide_src/source/general/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ the application configuration files in the **app/Config** folder.
:local:
:depth: 2


What are Configuration Classes?
*******************************

Configuration classes are utilized to define system default configuration values.
System configuration values are typically *static*. Configuration classes are
intended to retain the settings that configure how the application operates,
rather than responding to each user's individual settings.

It is not recommended to alter values set during the instantiation of a
configuration class later during execution. In other words, it is recommended to
treat configuration classes as immutable or readonly classes. This is especially
important if you utilize :ref:`factories-config-caching`.

Configuration values can be hard-coded in the class files or obtained from
environment variables at instantiation.

Working with Configuration Files
********************************

Expand Down
8 changes: 8 additions & 0 deletions user_guide_src/source/installation/upgrade_447.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ Please refer to the upgrade instructions corresponding to your installation meth
Mandatory File Changes
**********************

Error Files
===========

The error page has been updated. Please update the following files:

- app/Views/errors/html/debug.css
- app/Views/errors/html/error_exception.php

****************
Breaking Changes
****************
Expand Down
2 changes: 2 additions & 0 deletions user_guide_src/source/libraries/official_packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Among the many features, it includes:
* Per-user permission overrides,
* and more...

.. _settings:

********
Settings
********
Expand Down

0 comments on commit a3a7aa7

Please sign in to comment.