Skip to content

Commit

Permalink
Merge pull request #9417 from codeigniter4/4.6
Browse files Browse the repository at this point in the history
4.6.0 Merge code
  • Loading branch information
paulbalandan authored Jan 19, 2025
2 parents 0aad98b + 6fca121 commit 3be476e
Show file tree
Hide file tree
Showing 471 changed files with 13,516 additions and 8,008 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ body:
description: Which PHP versions did you run your code?
multiple: true
options:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'
validations:
required: true

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
matrix:
php-version:
- '8.1'
- '8.3'
- '8.4'

steps:
- name: Checkout base branch for PR
Expand Down Expand Up @@ -65,3 +65,5 @@ jobs:

- name: Run lint
run: composer cs
env:
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.php-version == '8.4' }}
15 changes: 4 additions & 11 deletions .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ jobs:
- '8.1'
- '8.2'
- '8.3'
include:
- php-version: '8.3'
composer-option: '--ignore-platform-req=php'
- '8.4'

uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
Expand All @@ -88,6 +86,7 @@ jobs:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
db-platform:
- MySQLi
- OCI8
Expand All @@ -100,8 +99,6 @@ jobs:
- php-version: '8.1'
db-platform: MySQLi
mysql-version: '5.7'
- php-version: '8.3'
composer-option: '--ignore-platform-req=php'

uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
Expand Down Expand Up @@ -129,9 +126,7 @@ jobs:
- '8.1'
- '8.2'
- '8.3'
include:
- php-version: '8.3'
composer-option: '--ignore-platform-req=php'
- '8.4'

uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
Expand All @@ -157,9 +152,7 @@ jobs:
- '8.1'
- '8.2'
- '8.3'
include:
- php-version: '8.3'
composer-option: '--ignore-platform-req=php'
- '8.4'

uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.3']
php-versions: ['8.1', '8.4']
steps:
- name: Checkout base branch for PR
if: github.event_name == 'pull_request'
Expand Down
10 changes: 5 additions & 5 deletions admin/framework/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
"php": "^8.1",
"ext-intl": "*",
"ext-mbstring": "*",
"laminas/laminas-escaper": "^2.13",
"laminas/laminas-escaper": "^2.14",
"psr/log": "^3.0"
},
"require-dev": {
"codeigniter/coding-standard": "^1.7",
"fakerphp/faker": "^1.9",
"fakerphp/faker": "^1.24",
"friendsofphp/php-cs-fixer": "^3.47.1",
"kint-php/kint": "^5.0.4",
"mikey179/vfsstream": "^1.6",
"kint-php/kint": "^6.0",
"mikey179/vfsstream": "^1.6.12",
"nexusphp/cs-config": "^3.6",
"phpunit/phpunit": "^10.5.16 || ^11.2",
"predis/predis": "^1.1 || ^2.0"
"predis/predis": "^1.1 || ^2.3"
},
"suggest": {
"ext-curl": "If you use CURLRequest class",
Expand Down
14 changes: 2 additions & 12 deletions app/Config/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ class Cache extends BaseConfig
*/
public string $backupHandler = 'dummy';

/**
* --------------------------------------------------------------------------
* Cache Directory Path
* --------------------------------------------------------------------------
*
* The path to where cache files should be stored, if using a file-based
* system.
*
* @deprecated Use the driver-specific variant under $file
*/
public string $storePath = WRITEPATH . 'cache/';

/**
* --------------------------------------------------------------------------
* Key Prefix
Expand Down Expand Up @@ -86,6 +74,7 @@ class Cache extends BaseConfig
* --------------------------------------------------------------------------
* File settings
* --------------------------------------------------------------------------
*
* Your file storage preferences can be specified below, if you are using
* the File driver.
*
Expand All @@ -100,6 +89,7 @@ class Cache extends BaseConfig
* -------------------------------------------------------------------------
* Memcached settings
* -------------------------------------------------------------------------
*
* Your Memcached servers can be specified below, if you are using
* the Memcached drivers.
*
Expand Down
15 changes: 0 additions & 15 deletions app/Config/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,3 @@
defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error
defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code

/**
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_LOW instead.
*/
define('EVENT_PRIORITY_LOW', 200);

/**
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_NORMAL instead.
*/
define('EVENT_PRIORITY_NORMAL', 100);

/**
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_HIGH instead.
*/
define('EVENT_PRIORITY_HIGH', 10);
2 changes: 2 additions & 0 deletions app/Config/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Database extends Config
'failover' => [],
'port' => 3306,
'numberNative' => false,
'foundRows' => false,
'dateFormat' => [
'date' => 'Y-m-d',
'datetime' => 'Y-m-d H:i:s',
Expand All @@ -64,6 +65,7 @@ class Database extends Config
// 'failover' => [],
// 'foreignKeys' => true,
// 'busyTimeout' => 1000,
// 'synchronous' => null,
// 'dateFormat' => [
// 'date' => 'Y-m-d',
// 'datetime' => 'Y-m-d H:i:s',
Expand Down
12 changes: 10 additions & 2 deletions app/Config/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
class Feature extends BaseConfig
{
/**
* Use improved new auto routing instead of the default legacy version.
* Use improved new auto routing instead of the legacy version.
*/
public bool $autoRoutesImproved = false;
public bool $autoRoutesImproved = true;

/**
* Use filter execution order in 4.4 or before.
Expand All @@ -26,4 +26,12 @@ class Feature extends BaseConfig
* If false, `limit(0)` returns no records. (the behavior of 3.1.9 or later in version 3.x.)
*/
public bool $limitZeroAsAll = true;

/**
* Use strict location negotiation.
*
* By default, the locale is selected based on a loose comparison of the language code (ISO 639-1)
* Enabling strict comparison will also consider the region code (ISO 3166-1 alpha-2).
*/
public bool $strictLocaleNegotiation = false;
}
13 changes: 0 additions & 13 deletions app/Config/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Config;

use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Format\FormatterInterface;
use CodeIgniter\Format\JSONFormatter;
use CodeIgniter\Format\XMLFormatter;

Expand Down Expand Up @@ -62,16 +61,4 @@ class Format extends BaseConfig
'application/xml' => 0,
'text/xml' => 0,
];

/**
* A Factory method to return the appropriate formatter for the given mime type.
*
* @return FormatterInterface
*
* @deprecated This is an alias of `\CodeIgniter\Format\Format::getFormatter`. Use that instead.
*/
public function getFormatter(string $mime)
{
return service('format')->getFormatter($mime);
}
}
2 changes: 0 additions & 2 deletions app/Config/Kint.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Config;

use Kint\Parser\ConstructablePluginInterface;
use Kint\Renderer\AbstractRenderer;
use Kint\Renderer\Rich\TabPluginInterface;
use Kint\Renderer\Rich\ValuePluginInterface;

Expand Down Expand Up @@ -41,7 +40,6 @@ class Kint
*/
public string $richTheme = 'aante-light.css';
public bool $richFolder = false;
public int $richSort = AbstractRenderer::SORT_FULL;

/**
* @var array<string, class-string<ValuePluginInterface>>|null
Expand Down
2 changes: 1 addition & 1 deletion app/Config/Routing.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,5 @@ class Routing extends BaseRouting
*
* Default: false
*/
public bool $translateUriToCamelCase = false;
public bool $translateUriToCamelCase = true;
}
17 changes: 0 additions & 17 deletions app/Config/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,4 @@ class Security extends BaseConfig
* @see https://codeigniter4.github.io/userguide/libraries/security.html#redirection-on-failure
*/
public bool $redirect = (ENVIRONMENT === 'production');

/**
* --------------------------------------------------------------------------
* CSRF SameSite
* --------------------------------------------------------------------------
*
* Setting for CSRF SameSite cookie token.
*
* Allowed values are: None - Lax - Strict - ''.
*
* Defaults to `Lax` as recommended in this link:
*
* @see https://portswigger.net/web-security/csrf/samesite-cookies
*
* @deprecated `Config\Cookie` $samesite property is used.
*/
public string $samesite = 'Lax';
}
10 changes: 7 additions & 3 deletions app/Views/errors/html/debug.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ p.lead {
.header {
background: var(--light-bg-color);
color: var(--dark-text-color);
margin-top: 2.17rem;
}
.header .container {
padding: 1rem;
Expand All @@ -65,10 +66,13 @@ p.lead {
}

.environment {
background: var(--dark-bg-color);
color: var(--light-text-color);
background: var(--brand-primary-color);
color: var(--main-bg-color);
text-align: center;
padding: 0.2rem;
padding: calc(4px + 0.2083vw);
width: 100%;
margin-top: -2.14rem;
position: fixed;
}

.source {
Expand Down
84 changes: 84 additions & 0 deletions app/Views/errors/html/error_400.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?= lang('Errors.badRequest') ?></title>

<style>
div.logo {
height: 200px;
width: 155px;
display: inline-block;
opacity: 0.08;
position: absolute;
top: 2rem;
left: 50%;
margin-left: -73px;
}
body {
height: 100%;
background: #fafafa;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #777;
font-weight: 300;
}
h1 {
font-weight: lighter;
letter-spacing: normal;
font-size: 3rem;
margin-top: 0;
margin-bottom: 0;
color: #222;
}
.wrap {
max-width: 1024px;
margin: 5rem auto;
padding: 2rem;
background: #fff;
text-align: center;
border: 1px solid #efefef;
border-radius: 0.5rem;
position: relative;
}
pre {
white-space: normal;
margin-top: 1.5rem;
}
code {
background: #fafafa;
border: 1px solid #efefef;
padding: 0.5rem 1rem;
border-radius: 5px;
display: block;
}
p {
margin-top: 1.5rem;
}
.footer {
margin-top: 2rem;
border-top: 1px solid #efefef;
padding: 1em 2em 0 2em;
font-size: 85%;
color: #999;
}
a:active,
a:link,
a:visited {
color: #dd4814;
}
</style>
</head>
<body>
<div class="wrap">
<h1>400</h1>

<p>
<?php if (ENVIRONMENT !== 'production') : ?>
<?= nl2br(esc($message)) ?>
<?php else : ?>
<?= lang('Errors.sorryBadRequest') ?>
<?php endif; ?>
</p>
</div>
</body>
</html>
Loading

0 comments on commit 3be476e

Please sign in to comment.