Feature bump ci to 4.6.0 (#4197)

* Replace tabs with spaces

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Composer package bumps

- Bump codeigniter4/framework to 4.6.0
- Bump codeIgniter/coding-standard to ^1.8
- Bump codeigniter4/devkit to ^1.3
- Updated framework files required by CI4.6.0
- Removed Deprecated variables
- Added new file in the repo from framework

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Reflect PHP 8.4 support
Updates for PHP 8.4 support introduced with the upgrade to CodeIgniter 4.6.x

* Update INSTALL.md

- Revert PHP 8.4 support for now.
- Removed extra space before comma

---------

Signed-off-by: objecttothis <objecttothis@gmail.com>
Co-authored-by: BudsieBuds <bas_hubers@hotmail.com>
This commit is contained in:
objecttothis
2025-04-03 14:16:06 +04:00
committed by GitHub
parent 2c9ae36247
commit 09530c1609
22 changed files with 2044 additions and 781 deletions

View File

@@ -28,3 +28,7 @@ jobs:
uses: dbfx/github-phplint/8.3@master
with:
folder-to-exclude: "! -path \"./vendor/*\" ! -path \"./folder/excluded/*\""
- name: PHP Lint 8.4
uses: dbfx/github-phplint/8.4@master
with:
folder-to-exclude: "! -path \"./vendor/*\" ! -path \"./folder/excluded/*\""

View File

@@ -1,6 +1,6 @@
## Server Requirements
- PHP version `8.1` to `8.3` are supported, PHP version `≤7.4` is NOT supported. Please note that PHP needs to have the extensions `php-json`, `php-gd`, `php-bcmath`, `php-intl`, `php-openssl`, `php-mbstring` , `php-curl` and `php-xml` installed and enabled. An unstable master build can be downloaded in the releases section.
- PHP version `8.1` to `8.3` are supported, PHP version `≤7.4` is NOT supported. Please note that PHP needs to have the extensions `php-json`, `php-gd`, `php-bcmath`, `php-intl`, `php-openssl`, `php-mbstring`, `php-curl` and `php-xml` installed and enabled. An unstable master build can be downloaded in the releases section.
- MySQL `5.7` is supported, also MariaDB replacement `10.x` is supported and might offer better performance.
- Apache `2.4` is supported. Nginx should work fine too, see [wiki page here](https://github.com/opensourcepos/opensourcepos/wiki/Local-Deployment-using-LEMP).
- Raspberry PI based installations proved to work, see [wiki page here](<https://github.com/opensourcepos/opensourcepos/wiki/Installing-on-Raspberry-PI---Orange-PI-(Headless-OSPOS)>).

View File

@@ -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
@@ -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.
*
@@ -100,6 +89,7 @@ class Cache extends BaseConfig
* -------------------------------------------------------------------------
* Memcached settings
* -------------------------------------------------------------------------
*
* Your Memcached servers can be specified below, if you are using
* the Memcached drivers.
*

View File

@@ -82,21 +82,6 @@ defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database
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);
/**
* Global Constants.
*/

View File

@@ -42,13 +42,12 @@ class Database extends Config
'strictOn' => false,
'failover' => [],
'port' => 3306,
'numberNative' => false,
'dateFormat' => [
'date' => 'Y-m-d',
'datetime' => 'Y-m-d H:i:s',
'time' => 'H:i:s',
],
];
],
];
/**
* This database connection is used when
@@ -76,7 +75,6 @@ class Database extends Config
'port' => 3306,
'foreignKeys' => true,
'busyTimeout' => 1000,
'numberNative' => false,
'dateFormat' => [
'date' => 'Y-m-d',
'datetime' => 'Y-m-d H:i:s',
@@ -110,8 +108,7 @@ class Database extends Config
'port' => 3306,
'foreignKeys' => true,
'busyTimeout' => 1000,
'numberNative' => false,
'dateFormat' => [
'dateFormat' => [
'date' => 'Y-m-d',
'datetime' => 'Y-m-d H:i:s',
'time' => 'H:i:s',

View File

@@ -47,10 +47,10 @@ Events::on('pre_system', static function (): void {
*/
if (CI_DEBUG && ! is_cli()) {
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
Services::toolbar()->respond();
service('toolbar')->respond();
// Hot Reload route - for framework use on the hot reloader.
if (ENVIRONMENT === 'development') {
Services::routes()->get('__hot-reload', static function (): void {
service('routes')->get('__hot-reload', static function (): void {
(new HotReloader())->run();
});
}

View File

@@ -10,7 +10,7 @@ use CodeIgniter\Config\BaseConfig;
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 = true;
@@ -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;
}

View File

@@ -3,7 +3,6 @@
namespace Config;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Format\FormatterInterface;
use CodeIgniter\Format\JSONFormatter;
use CodeIgniter\Format\XMLFormatter;
@@ -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 Services::format()->getFormatter($mime);
}
}

View File

@@ -3,7 +3,6 @@
namespace Config;
use Kint\Parser\ConstructablePluginInterface;
use Kint\Renderer\AbstractRenderer;
use Kint\Renderer\Rich\TabPluginInterface;
use Kint\Renderer\Rich\ValuePluginInterface;
@@ -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

View File

@@ -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';
}

View File

@@ -53,6 +53,6 @@ abstract class BaseController extends Controller
// Preload any models, libraries, etc, here.
// E.g.: $this->session = \Config\Services::session();
// E.g.: $this->session = service('session');
}
}

View File

@@ -53,9 +53,9 @@ if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
$function .= $padClass . $error['function'];
}
$args = implode(', ', array_map(static fn ($value) => match (true) {
$args = implode(', ', array_map(static fn ($value): string => match (true) {
is_object($value) => 'Object(' . $value::class . ')',
is_array($value) => count($value) ? '[...]' : '[]',
is_array($value) => $value !== [] ? '[...]' : '[]',
$value === null => 'null', // return the lowercased version
default => var_export($value, true),
}, array_values($error['args'] ?? [])));

View File

@@ -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;
@@ -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 {

View File

@@ -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>

View File

@@ -8,7 +8,6 @@
* @var array $trace
*/
use CodeIgniter\HTTP\Header;
use Config\Services;
use CodeIgniter\CodeIgniter;
$errorId = uniqid('error', true);
@@ -129,7 +128,7 @@ $errorId = uniqid('error', true);
<?php
$params = null;
// Reflection by name is not available for closure function
if (substr($row['function'], -1) !== '}') {
if (! str_ends_with($row['function'], '}')) {
$mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
$params = $mirror->getParameters();
}
@@ -233,7 +232,7 @@ $errorId = uniqid('error', true);
<!-- Request -->
<div class="content" id="request">
<?php $request = Services::request(); ?>
<?php $request = service('request'); ?>
<table>
<tbody>
@@ -327,10 +326,20 @@ $errorId = uniqid('error', true);
</tr>
</thead>
<tbody>
<?php foreach ($headers as $header) : ?>
<?php foreach ($headers as $name => $value) : ?>
<tr>
<td><?= esc($header->getName(), 'html') ?></td>
<td><?= esc($header->getValueLine(), 'html') ?></td>
<td><?= esc($name, 'html') ?></td>
<td>
<?php
if ($value instanceof Header) {
echo esc($value->getValueLine(), 'html');
} else {
foreach ($value as $i => $header) {
echo ' ('. $i+1 . ') ' . esc($header->getValueLine(), 'html');
}
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
@@ -341,7 +350,7 @@ $errorId = uniqid('error', true);
<!-- Response -->
<?php
$response = Services::response();
$response = service('response');
$response->setStatusCode(http_response_code());
?>
<div class="content" id="response">
@@ -354,8 +363,6 @@ $errorId = uniqid('error', true);
<?php $headers = $response->headers(); ?>
<?php if (! empty($headers)) : ?>
<?php natsort($headers) ?>
<h3>Headers</h3>
<table>
@@ -366,10 +373,20 @@ $errorId = uniqid('error', true);
</tr>
</thead>
<tbody>
<?php foreach (array_keys($headers) as $name) : ?>
<?php foreach ($headers as $name => $value) : ?>
<tr>
<td><?= esc($name, 'html') ?></td>
<td><?= esc($response->getHeaderLine($name), 'html') ?></td>
<td>
<?php
if ($value instanceof Header) {
echo esc($response->getHeaderLine($name), 'html');
} else {
foreach ($value as $i => $header) {
echo ' ('. $i+1 . ') ' . esc($header->getValueLine(), 'html');
}
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>

View File

@@ -32,17 +32,17 @@
},
"require": {
"php": "^8.1",
"codeigniter4/framework": "4.5.5",
"codeigniter4/framework": "4.6.0",
"dompdf/dompdf": "^2.0.3",
"ezyang/htmlpurifier": "^4.17",
"laminas/laminas-escaper": "^2.13",
"laminas/laminas-escaper": "2.16.0",
"paragonie/random_compat": "^2.0.21",
"picqer/php-barcode-generator": "^2.4.0",
"tamtamchik/namecase": "^3.0.0"
},
"require-dev": {
"codeigniter/coding-standard": "^1.7",
"codeigniter4/devkit": "^1.2.3",
"codeigniter/coding-standard": "^1.8",
"codeigniter4/devkit": "^1.3",
"fakerphp/faker": "^1.23.0",
"friendsofphp/php-cs-fixer": "^3.47.1",
"kint-php/kint": "^5.0.4",

2570
composer.lock generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -86,7 +86,7 @@ class preload
$phpFiles = new RegexIterator(
$fullTree,
'/.+((?<!Test)+\.php$)/i',
RecursiveRegexIterator::GET_MATCH
RecursiveRegexIterator::GET_MATCH,
);
foreach ($phpFiles as $key => $file) {

View File

@@ -11,7 +11,7 @@ if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
$message = sprintf(
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',
$minPhpVersion,
PHP_VERSION
PHP_VERSION,
);
header('HTTP/1.1 503 Service Unavailable.', true, 503);

View File

@@ -1,11 +1,11 @@
MIT License
Copyright (c) 2013-2024 jekkos
Copyright (c) 2017-2024 objecttothis
Copyright (c) 2013-2025 jekkos
Copyright (c) 2017-2025 objecttothis
Copyright (c) 2017-2024 Steve Ireland
Copyright (c) 2017-2024 odiea
Copyright (c) 2017-2025 odiea
Copyright (c) 2018-2024 WebShells
Copyright (c) 2021-2024 BudsieBuds
Copyright (c) 2021-2025 BudsieBuds
Copyright (c) 2015-2023 FrancescoUK (aka daN4cat)
Copyright (c) 2015-2022 Aamir Shahzad (aka asakpke), RoshanTech, eSite.pk
Copyright (c) 2019-2020 Andriux1990

View File

@@ -6,7 +6,7 @@
],
"dependencies": {
"codeigniter4/framework": {
"version": "v4.5.5",
"version": "v4.6.0",
"license": [
"MIT"
]
@@ -24,7 +24,7 @@
]
},
"laminas/laminas-escaper": {
"version": "2.13.0",
"version": "2.16.0",
"license": [
"BSD-3-Clause"
]

2
spark
View File

@@ -40,7 +40,7 @@ if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
$message = sprintf(
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',
$minPhpVersion,
PHP_VERSION
PHP_VERSION,
);
exit($message);