build(ci4): update CodeIgniter to v4.3.6

This commit is contained in:
Yassine Doghri 2023-07-06 15:56:05 +00:00
parent 4ccb363a3d
commit 981277ae14
31 changed files with 387 additions and 160 deletions

View File

@ -14,7 +14,7 @@ use ViewThemes\Theme;
* This can be looked at as a `master helper` file that is loaded early on, and may also contain additional functions
* that you'd like to use throughout your entire application
*
* @link: https://codeigniter4.github.io/CodeIgniter4/
* @see: https://codeigniter.com/user_guide/extending/common.html
*/
if (! function_exists('view')) {

View File

@ -14,18 +14,27 @@ class App extends BaseConfig
* Base Site URL
* --------------------------------------------------------------------------
*
* URL to your CodeIgniter root. Typically this will be your base URL,
* URL to your CodeIgniter root. Typically, this will be your base URL,
* WITH a trailing slash:
*
* http://example.com/
*
* If this is not set then CodeIgniter will try guess the protocol, domain
* and path to your installation. However, you should always configure this
* explicitly and never rely on auto-guessing, especially in production
* environments.
*/
public string $baseURL = 'http://localhost:8080/';
/**
* Allowed Hostnames in the Site URL other than the hostname in the baseURL.
* If you want to accept multiple Hostnames, set this.
*
* E.g. When your site URL ($baseURL) is 'http://example.com/', and your site
* also accepts 'http://media.example.com/' and
* 'http://accounts.example.com/':
* ['media.example.com', 'accounts.example.com']
*
* @var string[]
* @phpstan-var list<string>
*/
public array $allowedHostnames = [];
/**
* --------------------------------------------------------------------------
* Index File
@ -87,6 +96,8 @@ class App extends BaseConfig
* by the application in descending order of priority. If no match is
* found, the first locale will be used.
*
* IncomingRequest::setLocale() also uses this list.
*
* @var string[]
*/
public array $supportedLocales = ['en', 'fr', 'pl', 'de', 'pt-BR', 'nn-NO', 'es', 'zh-Hans', 'ca'];
@ -98,6 +109,8 @@ class App extends BaseConfig
*
* The default timezone that will be used in your application to display
* dates with the date helper, and can be retrieved through app_timezone()
*
* @see https://www.php.net/manual/en/timezones.php for list of timezones supported by PHP.
*/
public string $appTimezone = 'UTC';
@ -135,6 +148,8 @@ class App extends BaseConfig
* - `CodeIgniter\Session\Handlers\DatabaseHandler`
* - `CodeIgniter\Session\Handlers\MemcachedHandler`
* - `CodeIgniter\Session\Handlers\RedisHandler`
*
* @deprecated use Config\Session::$driver instead.
*/
public string $sessionDriver = FileHandler::class;
@ -144,6 +159,8 @@ class App extends BaseConfig
* --------------------------------------------------------------------------
*
* The session cookie name, must contain only [0-9a-z_-] characters
*
* @deprecated use Config\Session::$cookieName instead.
*/
public string $sessionCookieName = 'ci_session';
@ -154,6 +171,8 @@ class App extends BaseConfig
*
* The number of SECONDS you want the session to last.
* Setting to 0 (zero) means expire when the browser is closed.
*
* @deprecated use Config\Session::$expiration instead.
*/
public int $sessionExpiration = 7200;
@ -171,6 +190,8 @@ class App extends BaseConfig
* Please read up the manual for the format with other session drivers.
*
* IMPORTANT: You are REQUIRED to set a valid save path!
*
* @deprecated use Config\Session::$savePath instead.
*/
public string $sessionSavePath = WRITEPATH . 'session';
@ -183,6 +204,8 @@ class App extends BaseConfig
*
* WARNING: If you're using the database driver, don't forget to update
* your session table's PRIMARY KEY when changing this setting.
*
* @deprecated use Config\Session::$matchIP instead.
*/
public bool $sessionMatchIP = false;
@ -192,6 +215,8 @@ class App extends BaseConfig
* --------------------------------------------------------------------------
*
* How many seconds between CI regenerating the session ID.
*
* @deprecated use Config\Session::$timeToUpdate instead.
*/
public int $sessionTimeToUpdate = 300;
@ -203,9 +228,22 @@ class App extends BaseConfig
* Whether to destroy session data associated with the old session ID
* when auto-regenerating the session ID. When set to FALSE, the data
* will be later deleted by the garbage collector.
*
* @deprecated use Config\Session::$regenerateDestroy instead.
*/
public bool $sessionRegenerateDestroy = false;
/**
* --------------------------------------------------------------------------
* Session Database Group
* --------------------------------------------------------------------------
*
* DB Group for the database session.
*
* @deprecated use Config\Session::$DBGroup instead.
*/
public ?string $sessionDBGroup = null;
/**
* --------------------------------------------------------------------------
* Cookie Prefix
@ -283,7 +321,7 @@ class App extends BaseConfig
*
* @deprecated `Config\Cookie` $samesite property is used.
*/
public string $cookieSameSite = 'Lax';
public ?string $cookieSameSite = 'Lax';
/**
* --------------------------------------------------------------------------

View File

@ -93,12 +93,27 @@ class Autoload extends AutoloadConfig
* or for loading functions.
*
* Prototype:
* ```
*
* $files = [
* '/path/to/my/file.php',
* ];
* ```
* @var array<int, string>
*
* @var string[]
* @phpstan-var list<string>
*/
public $files = [APPPATH . 'Libraries/ViewComponents/Helpers/view_components_helper.php'];
/**
* -------------------------------------------------------------------
* Helpers
* -------------------------------------------------------------------
* Prototype:
* $helpers = [
* 'form',
* ];
*
* @var string[]
* @phpstan-var list<string>
*/
public $helpers = [];
}

View File

@ -35,7 +35,7 @@ class Database extends Config
'DBDriver' => 'MySQLi',
'DBPrefix' => 'cp_',
'pConnect' => false,
'DBDebug' => ENVIRONMENT !== 'production',
'DBDebug' => true,
'charset' => 'utf8mb4',
'DBCollat' => 'utf8mb4_unicode_ci',
'swapPre' => '',
@ -61,7 +61,7 @@ class Database extends Config
'DBPrefix' => 'db_',
// Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
'DBDebug' => true,
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
@ -71,6 +71,7 @@ class Database extends Config
'failover' => [],
'port' => 3306,
'foreignKeys' => true,
'busyTimeout' => 1000,
];
//--------------------------------------------------------------------

View File

@ -32,4 +32,14 @@ class DocTypes
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">',
];
/**
* Whether to remove the solidus (`/`) character for void HTML elements (e.g. `<input>`)
* for HTML5 compatibility.
*
* Set to:
* `true` - to be HTML5 compatible
* `false` - to be XHTML compatible
*/
public bool $html5 = true;
}

View File

@ -12,7 +12,7 @@ class Email extends BaseConfig
public string $fromName = 'Castopod';
public string $recipients;
public string $recipients = '';
/**
* The "user agent"

View File

@ -58,4 +58,37 @@ class Encryption extends BaseConfig
* HMAC digest to use, e.g. 'SHA512' or 'SHA256'. Default value is 'SHA512'.
*/
public string $digest = 'SHA512';
/**
* Whether the cipher-text should be raw. If set to false, then it will be base64 encoded.
* This setting is only used by OpenSSLHandler.
*
* Set to false for CI3 Encryption compatibility.
*/
public bool $rawData = true;
/**
* Encryption key info.
* This setting is only used by OpenSSLHandler.
*
* Set to 'encryption' for CI3 Encryption compatibility.
*/
public string $encryptKeyInfo = '';
/**
* Authentication key info.
* This setting is only used by OpenSSLHandler.
*
* Set to 'authentication' for CI3 Encryption compatibility.
*/
public string $authKeyInfo = '';
/**
* Cipher to use.
* This setting is only used by OpenSSLHandler.
*
* Set to 'AES-128-CBC' to decrypt encrypted data that encrypted
* by CI3 Encryption default configuration.
*/
public string $cipher = 'AES-256-CTR';
}

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Config;
use CodeIgniter\Config\BaseConfig;
use Psr\Log\LogLevel;
/**
* Setup how the exception handler works.
@ -55,4 +56,28 @@ class Exceptions extends BaseConfig
* @var string[]
*/
public array $sensitiveDataInTrace = [];
/**
* --------------------------------------------------------------------------
* LOG DEPRECATIONS INSTEAD OF THROWING?
* --------------------------------------------------------------------------
* By default, CodeIgniter converts deprecations into exceptions. Also,
* starting in PHP 8.1 will cause a lot of deprecated usage warnings.
* Use this option to temporarily cease the warnings and instead log those.
* This option also works for user deprecations.
*/
public bool $logDeprecations = true;
/**
* --------------------------------------------------------------------------
* LOG LEVEL THRESHOLD FOR DEPRECATIONS
* --------------------------------------------------------------------------
* If `$logDeprecations` is set to `true`, this sets the log level
* to which the deprecation will be logged. This should be one of the log
* levels recognized by PSR-3.
*
* The related `Config\Logger::$threshold` should be adjusted, if needed,
* to capture logging the deprecations.
*/
public string $deprecationLogLevel = LogLevel::WARNING;
}

View File

@ -28,6 +28,8 @@ class Generators extends BaseConfig
* @var array<string, string>
*/
public array $views = [
'make:cell' => 'CodeIgniter\Commands\Generators\Views\cell.tpl.php',
'make:cell_view' => 'CodeIgniter\Commands\Generators\Views\cell_view.tpl.php',
'make:command' => 'CodeIgniter\Commands\Generators\Views\command.tpl.php',
'make:config' => 'CodeIgniter\Commands\Generators\Views\config.tpl.php',
'make:controller' => 'CodeIgniter\Commands\Generators\Views\controller.tpl.php',

View File

@ -30,6 +30,15 @@ class Honeypot extends BaseConfig
/**
* Honeypot container
*
* If you enabled CSP, you can remove `style="display:none"`.
*/
public string $container = '<div style="display:none">{template}</div>';
/**
* The id attribute for Honeypot container tag
*
* Used when CSP is enabled.
*/
public string $containerId = 'hpc';
}

View File

@ -5,7 +5,7 @@ declare(strict_types=1);
namespace Config;
use CodeIgniter\Config\BaseConfig;
use Kint\Renderer\Renderer;
use Kint\Renderer\AbstractRenderer;
/**
* --------------------------------------------------------------------------
@ -46,7 +46,7 @@ class Kint extends BaseConfig
public bool $richFolder = false;
public int $richSort = Renderer::SORT_FULL;
public int $richSort = AbstractRenderer::SORT_FULL;
/**
* @var string[]

View File

@ -40,7 +40,7 @@ class Logger extends BaseConfig
*
* @var int|int[]
*/
public int | array $threshold = 4;
public int | array $threshold = (ENVIRONMENT === 'production') ? 4 : 9;
/**
* --------------------------------------------------------------------------

View File

@ -50,10 +50,13 @@ class Mimes
'application/x-binary',
'application/x-macbinary',
],
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => ['application/octet-stream', 'application/x-msdownload'],
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => ['application/octet-stream',
'application/vnd.microsoft.portable-executable',
'application/x-dosexec',
'application/x-msdownload'],
'class' => 'application/octet-stream',
'psd' => ['application/x-photoshop', 'image/vnd.adobe.photoshop'],
'so' => 'application/octet-stream',

View File

@ -33,6 +33,29 @@ class Modules extends BaseModules
*/
public $discoverInComposer = true;
/**
* The Composer package list for Auto-Discovery
* This setting is optional.
*
* E.g.:
* [
* 'only' => [
* // List up all packages to auto-discover
* 'codeigniter4/shield',
* ],
* ]
* or
* [
* 'exclude' => [
* // List up packages to exclude.
* 'pestphp/pest',
* ],
* ]
*
* @var array{only?:string[], exclude?:string[]}
*/
public $composerPackages = [];
/**
* --------------------------------------------------------------------------
* Auto-Discovery Rules

View File

@ -22,7 +22,7 @@ class Pager extends BaseConfig
*
* @var array<string, string>
*/
public $templates = [
public array $templates = [
'default_full' => 'App\Views\pager\default_full',
'default_simple' => 'CodeIgniter\Pager\Views\default_simple',
'default_head' => 'CodeIgniter\Pager\Views\default_head',

View File

@ -7,12 +7,6 @@ namespace Config;
// Create a new instance of our RouteCollection class.
$routes = Services::routes();
// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (is_file(SYSTEMPATH . 'Config/Routes.php')) {
require SYSTEMPATH . 'Config/Routes.php';
}
/**
* --------------------------------------------------------------------
* Router Setup

View File

@ -82,7 +82,7 @@ class Security extends BaseConfig
*
* Redirect to previous page with error on failure.
*/
public bool $redirect = true;
public bool $redirect = false;
/**
* --------------------------------------------------------------------------

104
app/Config/Session.php Normal file
View File

@ -0,0 +1,104 @@
<?php
declare(strict_types=1);
namespace Config;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Session\Handlers\BaseHandler;
use CodeIgniter\Session\Handlers\FileHandler;
class Session extends BaseConfig
{
/**
* --------------------------------------------------------------------------
* Session Driver
* --------------------------------------------------------------------------
*
* The session storage driver to use:
* - `CodeIgniter\Session\Handlers\FileHandler`
* - `CodeIgniter\Session\Handlers\DatabaseHandler`
* - `CodeIgniter\Session\Handlers\MemcachedHandler`
* - `CodeIgniter\Session\Handlers\RedisHandler`
*
* @phpstan-var class-string<BaseHandler>
*/
public string $driver = FileHandler::class;
/**
* --------------------------------------------------------------------------
* Session Cookie Name
* --------------------------------------------------------------------------
*
* The session cookie name, must contain only [0-9a-z_-] characters
*/
public string $cookieName = 'ci_session';
/**
* --------------------------------------------------------------------------
* Session Expiration
* --------------------------------------------------------------------------
*
* The number of SECONDS you want the session to last.
* Setting to 0 (zero) means expire when the browser is closed.
*/
public int $expiration = 7200;
/**
* --------------------------------------------------------------------------
* Session Save Path
* --------------------------------------------------------------------------
*
* The location to save sessions to and is driver dependent.
*
* For the 'files' driver, it's a path to a writable directory.
* WARNING: Only absolute paths are supported!
*
* For the 'database' driver, it's a table name.
* Please read up the manual for the format with other session drivers.
*
* IMPORTANT: You are REQUIRED to set a valid save path!
*/
public string $savePath = WRITEPATH . 'session';
/**
* --------------------------------------------------------------------------
* Session Match IP
* --------------------------------------------------------------------------
*
* Whether to match the user's IP address when reading the session data.
*
* WARNING: If you're using the database driver, don't forget to update
* your session table's PRIMARY KEY when changing this setting.
*/
public bool $matchIP = false;
/**
* --------------------------------------------------------------------------
* Session Time to Update
* --------------------------------------------------------------------------
*
* How many seconds between CI regenerating the session ID.
*/
public int $timeToUpdate = 300;
/**
* --------------------------------------------------------------------------
* Session Regenerate Destroy
* --------------------------------------------------------------------------
*
* Whether to destroy session data associated with the old session ID
* when auto-regenerating the session ID. When set to FALSE, the data
* will be later deleted by the garbage collector.
*/
public bool $regenerateDestroy = false;
/**
* --------------------------------------------------------------------------
* Session Database Group
* --------------------------------------------------------------------------
*
* DB Group for the database session.
*/
public ?string $DBGroup = null;
}

View File

@ -6,10 +6,10 @@ namespace Config;
use App\Validation\FileRules as AppFileRules;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Validation\CreditCardRules;
use CodeIgniter\Validation\FileRules;
use CodeIgniter\Validation\FormatRules;
use CodeIgniter\Validation\Rules;
use CodeIgniter\Validation\StrictRules\CreditCardRules;
use CodeIgniter\Validation\StrictRules\FileRules;
use CodeIgniter\Validation\StrictRules\FormatRules;
use CodeIgniter\Validation\StrictRules\Rules;
class Validation extends BaseConfig
{

View File

@ -7,6 +7,7 @@ namespace App\Controllers;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\Response;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use ViewThemes\Theme;
@ -28,6 +29,13 @@ abstract class BaseController extends Controller
*/
protected $request;
/**
* Instance of the main response object.
*
* @var Response
*/
protected $response;
/**
* An array of helpers to be loaded automatically upon
* class instantiation. These helpers will be available

View File

@ -15,6 +15,13 @@ use CodeIgniter\HTTP\Response;
class ColorsController extends Controller
{
/**
* Instance of the main response object.
*
* @var Response
*/
protected $response;
public function index(): Response
{
$cacheName = 'colors.css';

View File

@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>404 Page Not Found</title>
<title><?= lang('Errors.pageNotFound') ?></title>
<link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
<?= service('vite')->asset('styles/index.css', 'css') ?>
</head>
@ -14,13 +14,13 @@
<body class="flex flex-col items-center justify-center min-h-screen px-2 text-center bg-base theme-<?= service('settings')
->get('App.theme') ?>">
<?= svg('castopod-mascot_confused', 'h-64') ?>
<h1 class="mt-4 text-3xl font-bold font-display md:text-4xl lg:text-5xl">404 - File Not Found</h1>
<h1 class="mt-4 text-3xl font-bold font-display md:text-4xl lg:text-5xl">404</h1>
<p class="mb-6 text-lg text-skin-muted md:text-xl lg:text-2xl">
<?php if (isset($message) && $message !== '(null)'): ?>
<?= esc($message) ?>
<?php else: ?>
Sorry! Cannot seem to find the page you were looking for.
<?= lang('Errors.sorryCannotFind') ?>
<?php endif; ?>
</p>
<a href="<?= previous_url() ?>" class="inline-flex items-center justify-center px-3 py-1 text-sm font-semibold rounded-full shadow-xs text-accent-contrast focus:ring-accent md:px-4 md:py-2 md:text-base bg-accent-base hover:bg-accent-hover"><?= lang('Common.go_back') ?></a>

View File

@ -1,6 +1,12 @@
<?php declare(strict_types=1);
<?php
$error_id = uniqid('error', true); ?>
declare(strict_types=1);
use CodeIgniter\CodeIgniter;
use Config\Services;
$errorId = uniqid('error', true);
?>
<!doctype html>
<html>
<head>
@ -8,11 +14,11 @@ $error_id = uniqid('error', true); ?>
<meta name="robots" content="noindex">
<title><?= esc($title) ?></title>
<style type="text/css">
<style>
<?= preg_replace('#[\r\n\t ]+#', ' ', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.css')) ?>
</style>
<script type="text/javascript">
<script>
<?= file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.js') ?>
</script>
</head>
@ -79,16 +85,16 @@ $error_id = uniqid('error', true); ?>
<?php if (isset($row['class'])) : ?>
&nbsp;&nbsp;&mdash;&nbsp;&nbsp;<?= esc($row['class'] . $row['type'] . $row['function']) ?>
<?php if (! empty($row['args'])) : ?>
<?php $args_id = $error_id . 'args' . $index ?>
( <a href="#" onclick="return toggle('<?= esc($args_id, 'attr') ?>');">arguments</a> )
<div class="args" id="<?= esc($args_id, 'attr') ?>">
<?php $argsId = $errorId . 'args' . $index ?>
( <a href="#" onclick="return toggle('<?= esc($argsId, 'attr') ?>');">arguments</a> )
<div class="args" id="<?= esc($argsId, 'attr') ?>">
<table cellspacing="0">
<?php
$params = null;
$params = null;
// Reflection by name is not available for closure function
if (substr($row['function'], -1) !== '}') {
$mirror = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']);
$mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
$params = $mirror->getParameters();
}
@ -191,7 +197,7 @@ $error_id = uniqid('error', true); ?>
<!-- Request -->
<div class="content" id="request">
<?php $request = \Config\Services::request(); ?>
<?php $request = Services::request(); ?>
<table>
<tbody>
@ -309,7 +315,7 @@ $error_id = uniqid('error', true); ?>
<!-- Response -->
<?php
$response = \Config\Services::response();
$response = Services::response();
$response->setStatusCode(http_response_code());
?>
<div class="content" id="response">
@ -334,11 +340,11 @@ $response->setStatusCode(http_response_code());
</tr>
</thead>
<tbody>
<?php foreach ($headers as $name => $value) : ?>
<tr>
<td><?= esc($name, 'html') ?></td>
<td><?= esc($response->getHeaderLine($name), 'html') ?></td>
</tr>
<?php foreach (array_keys($headers) as $name) : ?>
<tr>
<td><?= esc($name, 'html') ?></td>
<td><?= esc($response->getHeaderLine($name), 'html') ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
@ -389,7 +395,7 @@ $response->setStatusCode(http_response_code());
<p>
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(\CodeIgniter\CodeIgniter::CI_VERSION) ?>
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?>
</p>
</div>

View File

@ -7,7 +7,7 @@
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Whoops!</title>
<title><?= lang('Errors.whoops') ?></title>
<link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
<?= service('vite')->asset('styles/index.css', 'css') ?>
<?php if (auth()->loggedIn()): ?>
@ -21,8 +21,8 @@
<div class="flex flex-col items-center justify-center flex-1 gap-6">
<div class="flex flex-col items-center">
<?= svg('castopod-mascot_confused', 'w-full max-w-xs p-6') ?>
<h1 class="text-3xl font-bold font-display md:text-4xl lg:text-5xl">Whoops!</h1>
<p class="text-lg text-skin-muted md:text-xl lg:text-2xl">We seem to have hit a snag. Please try again later...</p>
<h1 class="text-3xl font-bold font-display md:text-4xl lg:text-5xl"><?= lang('Errors.whoops') ?></h1>
<p class="text-lg text-skin-muted md:text-xl lg:text-2xl"><?= lang('Errors.weHitASnag') ?></p>
</div>
<div class="flex flex-col items-start max-w-xl">
<h2 class="font-mono font-semibold"><?= esc($title), esc($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h2>

View File

@ -7,7 +7,7 @@
"license": "AGPL-3.0-or-later",
"require": {
"php": "^8.1",
"codeigniter4/framework": "v4.2.12",
"codeigniter4/framework": "v4.3.6",
"james-heinrich/getid3": "^2.0.0-beta5",
"whichbrowser/parser": "^v2.1.7",
"geoip2/geoip2": "v2.13.0",
@ -23,7 +23,7 @@
"chrisjean/php-ico": "^1.0.4",
"melbahja/seo": "^v2.1.1",
"codeigniter4/shield": "v1.0.0-beta.6",
"aws/aws-sdk-php": "^3.275.2",
"aws/aws-sdk-php": "^3.275.3",
"mpratt/embera": "^2.0.34",
"codeigniter4/tasks": "dev-develop",
"yassinedoghri/podcast-feed": "dev-main"
@ -33,10 +33,15 @@
"phpunit/phpunit": "^10.2.3",
"captainhook/captainhook": "^5.16.4",
"symplify/easy-coding-standard": "^11.5.0",
"phpstan/phpstan": "^1.10.23",
"phpstan/phpstan": "^1.10.25",
"rector/rector": "^0.17.2",
"symplify/coding-standard": "^11.4.1"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"autoload": {
"exclude-from-classmap": [
"**/Database/Migrations/**"

107
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "658d8ad2579bb70845c1150757868314",
"content-hash": "50b45bbec65f3100f25ba9b161be7762",
"packages": [
{
"name": "adaures/ipcat-php",
@ -120,16 +120,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.275.2",
"version": "3.275.3",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "4506d631caf6097fd73009d57707e61b95efe92c"
"reference": "bbdf8e8d5df0b44ee83d5a751f316fc9f9dd2849"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/4506d631caf6097fd73009d57707e61b95efe92c",
"reference": "4506d631caf6097fd73009d57707e61b95efe92c",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/bbdf8e8d5df0b44ee83d5a751f316fc9f9dd2849",
"reference": "bbdf8e8d5df0b44ee83d5a751f316fc9f9dd2849",
"shasum": ""
},
"require": {
@ -205,9 +205,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.275.2"
"source": "https://github.com/aws/aws-sdk-php/tree/3.275.3"
},
"time": "2023-07-03T18:27:31+00:00"
"time": "2023-07-05T18:22:08+00:00"
},
{
"name": "brick/math",
@ -304,23 +304,22 @@
},
{
"name": "codeigniter4/framework",
"version": "v4.2.12",
"version": "v4.3.6",
"source": {
"type": "git",
"url": "https://github.com/codeigniter4/framework.git",
"reference": "bc3f312a3ebaf53394fa099b090b7a52a29375c2"
"reference": "e3921233a20daf05ae9d2b50ca41ce97748e1d6d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/codeigniter4/framework/zipball/bc3f312a3ebaf53394fa099b090b7a52a29375c2",
"reference": "bc3f312a3ebaf53394fa099b090b7a52a29375c2",
"url": "https://api.github.com/repos/codeigniter4/framework/zipball/e3921233a20daf05ae9d2b50ca41ce97748e1d6d",
"reference": "e3921233a20daf05ae9d2b50ca41ce97748e1d6d",
"shasum": ""
},
"require": {
"ext-intl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"kint-php/kint": "^4.2",
"laminas/laminas-escaper": "^2.9",
"php": "^7.4 || ^8.0",
"psr/log": "^1.1"
@ -329,6 +328,7 @@
"codeigniter/coding-standard": "^1.5",
"fakerphp/faker": "^1.9",
"friendsofphp/php-cs-fixer": "3.13.0",
"kint-php/kint": "^5.0.4",
"mikey179/vfsstream": "^1.6",
"nexusphp/cs-config": "^3.6",
"phpunit/phpunit": "^9.1",
@ -370,7 +370,7 @@
"slack": "https://codeigniterchat.slack.com",
"source": "https://github.com/codeigniter4/CodeIgniter4"
},
"time": "2023-01-09T06:53:50+00:00"
"time": "2023-06-17T23:13:38+00:00"
},
{
"name": "codeigniter4/settings",
@ -1189,63 +1189,6 @@
},
"time": "2022-10-28T11:52:26+00:00"
},
{
"name": "kint-php/kint",
"version": "4.2.3",
"source": {
"type": "git",
"url": "https://github.com/kint-php/kint.git",
"reference": "7601bfd95ccc50a1b903c2764b31d00919e8edd9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kint-php/kint/zipball/7601bfd95ccc50a1b903c2764b31d00919e8edd9",
"reference": "7601bfd95ccc50a1b903c2764b31d00919e8edd9",
"shasum": ""
},
"require": {
"php": ">=5.6"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpspec/prophecy-phpunit": "^2",
"phpunit/phpunit": "^9.0",
"seld/phar-utils": "^1.0",
"symfony/finder": "^3.0 || ^4.0 || ^5.0",
"vimeo/psalm": "^4.0"
},
"suggest": {
"kint-php/kint-helpers": "Provides extra helper functions",
"kint-php/kint-twig": "Provides d() and s() functions in twig templates"
},
"type": "library",
"autoload": {
"files": ["init.php"],
"psr-4": {
"Kint\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": ["MIT"],
"authors": [
{
"name": "Jonathan Vollebregt",
"homepage": "https://github.com/jnvsor"
},
{
"name": "Contributors",
"homepage": "https://github.com/kint-php/kint/graphs/contributors"
}
],
"description": "Kint - debugging tool for PHP developers",
"homepage": "https://kint-php.github.io/kint/",
"keywords": ["debug", "kint", "php"],
"support": {
"issues": "https://github.com/kint-php/kint/issues",
"source": "https://github.com/kint-php/kint/tree/4.2.3"
},
"time": "2022-10-01T20:16:33+00:00"
},
{
"name": "laminas/laminas-escaper",
"version": "2.12.0",
@ -3610,16 +3553,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.20.0",
"version": "v3.21.1",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "0e8249e0b15e2bc022fbbd1090ce29d071481e69"
"reference": "229b55b3eae4729a8e2a321441ba40fcb3720b86"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/0e8249e0b15e2bc022fbbd1090ce29d071481e69",
"reference": "0e8249e0b15e2bc022fbbd1090ce29d071481e69",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/229b55b3eae4729a8e2a321441ba40fcb3720b86",
"reference": "229b55b3eae4729a8e2a321441ba40fcb3720b86",
"shasum": ""
},
"require": {
@ -3629,7 +3572,7 @@
"doctrine/lexer": "^2 || ^3",
"ext-json": "*",
"ext-tokenizer": "*",
"php": "^7.4 || ^8.0",
"php": "^8.0.1",
"sebastian/diff": "^4.0 || ^5.0",
"symfony/console": "^5.4 || ^6.0",
"symfony/event-dispatcher": "^5.4 || ^6.0",
@ -3690,7 +3633,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.20.0"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.21.1"
},
"funding": [
{
@ -3698,7 +3641,7 @@
"type": "github"
}
],
"time": "2023-06-27T20:22:39+00:00"
"time": "2023-07-05T21:50:25+00:00"
},
{
"name": "mikey179/vfsstream",
@ -3952,16 +3895,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.10.23",
"version": "1.10.25",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "65ab678d1248a8bc6fde456f0d7ff3562a61a4cd"
"reference": "578f4e70d117f9a90699324c555922800ac38d8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/65ab678d1248a8bc6fde456f0d7ff3562a61a4cd",
"reference": "65ab678d1248a8bc6fde456f0d7ff3562a61a4cd",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/578f4e70d117f9a90699324c555922800ac38d8c",
"reference": "578f4e70d117f9a90699324c555922800ac38d8c",
"shasum": ""
},
"require": {
@ -4000,7 +3943,7 @@
"type": "tidelift"
}
],
"time": "2023-07-04T13:32:44+00:00"
"time": "2023-07-06T12:11:37+00:00"
},
{
"name": "phpunit/php-code-coverage",

23
env
View File

@ -24,15 +24,6 @@
# If you have trouble with `.`, you could also use `_`.
# app_baseURL = ''
# app.forceGlobalSecureRequests = false
# app.sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'
# app.sessionCookieName = 'ci_session'
# app.sessionExpiration = 7200
# app.sessionSavePath = null
# app.sessionMatchIP = false
# app.sessionTimeToUpdate = 300
# app.sessionRegenerateDestroy = false
# app.CSPEnabled = false
#--------------------------------------------------------------------
@ -124,9 +115,21 @@
# security.cookieName = 'csrf_cookie_name'
# security.expires = 7200
# security.regenerate = true
# security.redirect = true
# security.redirect = false
# security.samesite = 'Lax'
#--------------------------------------------------------------------
# SESSION
#--------------------------------------------------------------------
# session.driver = 'CodeIgniter\Session\Handlers\FileHandler'
# session.cookieName = 'ci_session'
# session.expiration = 7200
# session.savePath = null
# session.matchIP = false
# session.timeToUpdate = 300
# session.regenerateDestroy = false
#--------------------------------------------------------------------
# LOGGER
#--------------------------------------------------------------------

View File

@ -1,6 +1,7 @@
parameters:
tmpDir: build/phpstan
level: 6
checkGenericClassInNonGenericObjectType: false
paths:
- app
- tests

View File

@ -1,5 +1,5 @@
# Disable directory browsing
Options All -Indexes
Options -Indexes
# ----------------------------------------------------------------------
# Rewrite engine

View File

@ -53,7 +53,7 @@ require_once SYSTEMPATH . 'Config/DotEnv.php';
* ---------------------------------------------------------------
*
* The CodeIgniter class contains the core functionality to make
* the application run, and does all of the dirty work to get
* the application run, and does all the dirty work to get
* the pieces all working together.
*/
@ -66,7 +66,7 @@ $app->setContext($context);
*---------------------------------------------------------------
* LAUNCH THE APPLICATION
*---------------------------------------------------------------
* Now that everything is setup, it's time to actually fire
* Now that everything is set up, it's time to actually fire
* up the engines and make this app do its thang.
*/

9
spark
View File

@ -81,10 +81,9 @@ require_once SYSTEMPATH . 'Config/DotEnv.php';
// Grab our CodeIgniter
$app = Config\Services::codeigniter();
$app->initialize();
$app->setContext('spark');
// Grab our Console
$console = new CodeIgniter\CLI\Console($app);
$console = new CodeIgniter\CLI\Console();
// Show basic information before we do anything else.
if (is_int($suppress = array_search('--no-header', $_SERVER['argv'], true))) {
@ -95,8 +94,6 @@ if (is_int($suppress = array_search('--no-header', $_SERVER['argv'], true))) {
$console->showHeader($suppress);
// fire off the command in the main framework.
$response = $console->run();
$exit = $console->run();
if ($response->getStatusCode() >= 300) {
exit($response->getStatusCode());
}
exit(is_int($exit) ? $exit : EXIT_SUCCESS);