mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
829 lines
61 KiB
HTML
829 lines
61 KiB
HTML
<!DOCTYPE html>
|
|
<html class="writer-html5" lang="en" >
|
|
<head>
|
|
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Upgrading from 4.2.12 to 4.3.0 — CodeIgniter 4.4.2 documentation</title>
|
|
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
|
<link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" />
|
|
<link rel="stylesheet" href="../_static/css/citheme_dark.css" type="text/css" />
|
|
<link rel="shortcut icon" href="../_static/favicon.ico"/>
|
|
<!--[if lt IE 9]>
|
|
<script src="../_static/js/html5shiv.min.js"></script>
|
|
<![endif]-->
|
|
|
|
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
|
|
<script src="../_static/jquery.js"></script>
|
|
<script src="../_static/underscore.js"></script>
|
|
<script src="../_static/doctools.js"></script>
|
|
<script src="../_static/js/citheme.js"></script>
|
|
<script src="../_static/js/carbon.js"></script>
|
|
<script src="../_static/js/theme.js"></script>
|
|
<link rel="index" title="Index" href="../genindex.html" />
|
|
<link rel="search" title="Search" href="../search.html" />
|
|
<link rel="next" title="Upgrading from 4.2.11 to 4.2.12" href="upgrade_4212.html" />
|
|
<link rel="prev" title="Upgrading from 4.3.0 to 4.3.1" href="upgrade_431.html" />
|
|
</head>
|
|
|
|
<body class="wy-body-for-nav">
|
|
<div class="wy-grid-for-nav">
|
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
<div class="wy-side-scroll">
|
|
<div class="wy-side-nav-search" >
|
|
|
|
|
|
|
|
<a href="../index.html">
|
|
|
|
<img src="../_static/ci-logo-text.svg" class="logo" alt="Logo"/>
|
|
</a>
|
|
<div role="search">
|
|
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
|
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
</div>
|
|
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../intro/index.html">Welcome to CodeIgniter4</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../intro/index.html">Welcome to CodeIgniter4</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../intro/requirements.html">Server Requirements</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../intro/credits.html">Credits</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../intro/psr.html">PSR Compliance</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../license.html">License Agreement</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="current">
|
|
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Installation</a><ul class="current">
|
|
<li class="toctree-l2"><a class="reference internal" href="installing_composer.html">Composer Installation</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="installing_manual.html">Manual Installation</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="running.html">Running Your App</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../changelogs/index.html">Change Logs</a></li>
|
|
<li class="toctree-l2 current"><a class="reference internal" href="upgrading.html">Upgrading From a Previous Version</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="repositories.html">CodeIgniter Repositories</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Build Your First Application</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static Pages</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News Section</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create News Items</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../concepts/index.html">CodeIgniter4 Overview</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../concepts/structure.html">Application Structure</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../concepts/mvc.html">Models, Views, and Controllers</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../concepts/autoloader.html">Autoloading Files</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../concepts/services.html">Services</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../concepts/factories.html">Factories</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../concepts/http.html">Working with HTTP Requests</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../concepts/security.html">Security Guidelines</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/configuration.html">Configuration</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helper Functions</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Global Functions and Constants</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/logging.html">Logging Information</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Web Page Caching</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/ajax.html">AJAX Requests</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/modules.html">Code Modules</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../incoming/index.html">Controllers and Routing</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../incoming/routing.html">URI Routing</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../incoming/controllers.html">Controllers</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../incoming/filters.html">Controller Filters</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../incoming/message.html">HTTP Messages</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../incoming/request.html">Request Class</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../incoming/incomingrequest.html">IncomingRequest Class</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../incoming/content_negotiation.html">Content Negotiation</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../incoming/methodspoofing.html">HTTP Method Spoofing</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../incoming/restful.html">RESTful Resource Handling</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../outgoing/index.html">Building Responses</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/views.html">Views</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/view_cells.html">View Cells</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/view_renderer.html">View Renderer</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/view_layouts.html">View Layouts</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/view_parser.html">View Parser</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/view_decorators.html">View Decorators</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/table.html">HTML Table Class</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/response.html">HTTP Responses</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/api_responses.html">API Response Trait</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/localization.html">Localization</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../outgoing/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Working with Databases</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/events.html">Database Events</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../models/index.html">Modeling Data</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../models/model.html">Using CodeIgniter's Model</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../models/entities.html">Using Entity Classes</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../dbmgmt/index.html">Managing Databases</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../dbmgmt/forge.html">Database Manipulation with Database Forge</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../dbmgmt/migration.html">Database Migrations</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../dbmgmt/seeds.html">Database Seeding</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../dbmgmt/db_commands.html">Database Commands</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Library Reference</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/cookies.html">Cookies</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/curlrequest.html">CURLRequest Class</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Service</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/files.html">Working with Files</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_collections.html">File Collections</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/honeypot.html">Honeypot Class</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/images.html">Image Manipulation Class</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/publisher.html">Publisher</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/throttler.html">Throttler</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/time.html">Times and Dates</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/uploaded_files.html">Working with Uploaded Files</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">Working with URIs</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../libraries/validation.html">Validation</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/filesystem_helper.html">Filesystem Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/test_helper.html">Test Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../testing/index.html">Testing</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../testing/overview.html">Getting Started</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../testing/database.html">Database</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../testing/fabricator.html">Generating Data</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../testing/controllers.html">Controller Testing</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../testing/feature.html">HTTP Testing</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../testing/response.html">Testing Responses</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../testing/benchmark.html">Benchmarking</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../testing/debugging.html">Debugging Your Application</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../testing/mocking.html">Mocking</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../cli/index.html">Command Line Usage</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../cli/cli_overview.html">CLI Overview</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../cli/cli_controllers.html">Running Controllers via CLI</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../cli/spark_commands.html">Spark Commands</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../cli/cli_commands.html">Creating Spark Commands</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../cli/cli_generators.html">CLI Generators</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../cli/cli_library.html">CLI Library</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../cli/cli_request.html">CLIRequest Class</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../extending/index.html">Extending CodeIgniter</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../extending/core_classes.html">Creating Core System Classes</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../extending/common.html">Replacing Common Functions</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../extending/events.html">Events</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../extending/basecontroller.html">Extending the Controller</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../extending/authentication.html">Authentication</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../extending/composer_packages.html">Creating Composer Packages</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../extending/contributing.html">Contributing to CodeIgniter</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../libraries/official_packages.html">Official Packages</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
<a href="../index.html">CodeIgniter</a>
|
|
</nav>
|
|
|
|
<div class="wy-nav-content">
|
|
<div class="rst-content">
|
|
<a class="btn btn-neutral float-right" href="https://github.com/codeigniter4/CodeIgniter4/edit/develop/user_guide_src/source/installation/upgrade_430.rst">Edit this page</a>
|
|
|
|
<div role="navigation" aria-label="Page navigation">
|
|
<ul class="wy-breadcrumbs">
|
|
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
|
<li class="breadcrumb-item"><a href="index.html">Installation</a></li>
|
|
<li class="breadcrumb-item"><a href="upgrading.html">Upgrading From a Previous Version</a></li>
|
|
<li class="breadcrumb-item active">Upgrading from 4.2.12 to 4.3.0</li>
|
|
<li class="wy-breadcrumbs-aside">
|
|
</li>
|
|
</ul>
|
|
<hr/>
|
|
</div>
|
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
<div itemprop="articleBody">
|
|
|
|
<section id="upgrading-from-4-2-12-to-4-3-0">
|
|
<h1>Upgrading from 4.2.12 to 4.3.0<a class="headerlink" href="#upgrading-from-4-2-12-to-4-3-0" title="Permalink to this headline"></a></h1>
|
|
<p>Please refer to the upgrade instructions corresponding to your installation method.</p>
|
|
<ul class="simple">
|
|
<li><p><a class="reference internal" href="installing_composer.html#app-starter-upgrading"><span class="std std-ref">Composer Installation App Starter Upgrading</span></a></p></li>
|
|
<li><p><a class="reference internal" href="installing_composer.html#adding-codeigniter4-upgrading"><span class="std std-ref">Composer Installation Adding CodeIgniter4 to an Existing Project Upgrading</span></a></p></li>
|
|
<li><p><a class="reference internal" href="installing_manual.html#installing-manual-upgrading"><span class="std std-ref">Manual Installation Upgrading</span></a></p></li>
|
|
</ul>
|
|
<div class="contents local topic" id="contents">
|
|
<ul class="simple">
|
|
<li><p><a class="reference internal" href="#composer-version" id="id1">Composer Version</a></p></li>
|
|
<li><p><a class="reference internal" href="#mandatory-file-changes" id="id2">Mandatory File Changes</a></p>
|
|
<ul>
|
|
<li><p><a class="reference internal" href="#spark" id="id3">spark</a></p></li>
|
|
<li><p><a class="reference internal" href="#config-files" id="id4">Config Files</a></p></li>
|
|
<li><p><a class="reference internal" href="#composer-json" id="id5">composer.json</a></p></li>
|
|
</ul>
|
|
</li>
|
|
<li><p><a class="reference internal" href="#breaking-changes" id="id6">Breaking Changes</a></p>
|
|
<ul>
|
|
<li><p><a class="reference internal" href="#database-exception-changes" id="id7">Database Exception Changes</a></p></li>
|
|
<li><p><a class="reference internal" href="#http-status-code-and-exit-code-of-uncaught-exceptions" id="id8">HTTP Status Code and Exit Code of Uncaught Exceptions</a></p></li>
|
|
<li><p><a class="reference internal" href="#redirect-withinput-and-validation-errors" id="id9">redirect()->withInput() and Validation Errors</a></p></li>
|
|
<li><p><a class="reference internal" href="#validation-changes" id="id10">Validation Changes</a></p></li>
|
|
<li><p><a class="reference internal" href="#time-fixes" id="id11">Time Fixes</a></p></li>
|
|
<li><p><a class="reference internal" href="#capturing-stderr-and-stdout-streams-in-tests" id="id12">Capturing STDERR and STDOUT streams in Tests</a></p></li>
|
|
<li><p><a class="reference internal" href="#interface-changes" id="id13">Interface Changes</a></p></li>
|
|
<li><p><a class="reference internal" href="#foreign-key-data" id="id14">Foreign Key Data</a></p></li>
|
|
</ul>
|
|
</li>
|
|
<li><p><a class="reference internal" href="#breaking-enhancements" id="id15">Breaking Enhancements</a></p>
|
|
<ul>
|
|
<li><p><a class="reference internal" href="#multiple-domain-support" id="id16">Multiple Domain Support</a></p></li>
|
|
<li><p><a class="reference internal" href="#database" id="id17">Database</a></p></li>
|
|
<li><p><a class="reference internal" href="#honeypot-and-csp" id="id18">Honeypot and CSP</a></p></li>
|
|
<li><p><a class="reference internal" href="#others" id="id19">Others</a></p></li>
|
|
</ul>
|
|
</li>
|
|
<li><p><a class="reference internal" href="#project-files" id="id20">Project Files</a></p>
|
|
<ul>
|
|
<li><p><a class="reference internal" href="#content-changes" id="id21">Content Changes</a></p></li>
|
|
<li><p><a class="reference internal" href="#all-changes" id="id22">All Changes</a></p></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<section id="composer-version">
|
|
<h2><a class="toc-backref" href="#id1">Composer Version</a><a class="headerlink" href="#composer-version" title="Permalink to this headline"></a></h2>
|
|
<div class="admonition important">
|
|
<p class="admonition-title">Important</p>
|
|
<p>If you use Composer, CodeIgniter v4.3.0 requires
|
|
Composer 2.0.14 or later.</p>
|
|
</div>
|
|
<p>If you are using older version of Composer, upgrade your <code class="docutils literal notranslate"><span class="pre">composer</span></code> tool,
|
|
and delete the <strong>vendor/</strong> directory, and run <code class="docutils literal notranslate"><span class="pre">composer</span> <span class="pre">update</span></code> again.</p>
|
|
<p>The procedure, for example, is as follows:</p>
|
|
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">composer self-update</span>
|
|
<span class="go">rm -rf vendor/</span>
|
|
<span class="go">composer update</span>
|
|
</pre></div>
|
|
</div>
|
|
</section>
|
|
<section id="mandatory-file-changes">
|
|
<h2><a class="toc-backref" href="#id2">Mandatory File Changes</a><a class="headerlink" href="#mandatory-file-changes" title="Permalink to this headline"></a></h2>
|
|
<section id="spark">
|
|
<h3><a class="toc-backref" href="#id3">spark</a><a class="headerlink" href="#spark" title="Permalink to this headline"></a></h3>
|
|
<p>The following files received significant changes and
|
|
<strong>you must merge the updated versions</strong> with your application:</p>
|
|
<ul class="simple">
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">spark</span></code></p></li>
|
|
</ul>
|
|
<div class="admonition important">
|
|
<p class="admonition-title">Important</p>
|
|
<p>If you do not update this file, Spark commands will not work at all after running <code class="docutils literal notranslate"><span class="pre">composer</span> <span class="pre">update</span></code>.</p>
|
|
<p>The upgrade procedure, for example, is as follows:</p>
|
|
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">composer update</span>
|
|
<span class="go">cp vendor/codeigniter4/framework/spark .</span>
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section id="config-files">
|
|
<h3><a class="toc-backref" href="#id4">Config Files</a><a class="headerlink" href="#config-files" title="Permalink to this headline"></a></h3>
|
|
<section id="app-config-kint-php">
|
|
<h4>app/Config/Kint.php<a class="headerlink" href="#app-config-kint-php" title="Permalink to this headline"></a></h4>
|
|
<ul>
|
|
<li><p><strong>app/Config/Kint.php</strong> has been updated for Kint 5.0.</p></li>
|
|
<li><p>You need to replace:</p>
|
|
<blockquote>
|
|
<div><ul class="simple">
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">Kint\Renderer\Renderer</span></code> with <code class="docutils literal notranslate"><span class="pre">Kint\Renderer\AbstractRenderer</span></code></p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">Renderer::SORT_FULL</span></code> with <code class="docutils literal notranslate"><span class="pre">AbstractRenderer::SORT_FULL</span></code></p></li>
|
|
</ul>
|
|
</div></blockquote>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section id="app-config-exceptions-php">
|
|
<h4>app/Config/Exceptions.php<a class="headerlink" href="#app-config-exceptions-php" title="Permalink to this headline"></a></h4>
|
|
<ul class="simple">
|
|
<li><p>If you are using PHP 8.2, you need to add new properties <code class="docutils literal notranslate"><span class="pre">$logDeprecations</span></code> and <code class="docutils literal notranslate"><span class="pre">$deprecationLogLevel</span></code>.</p></li>
|
|
</ul>
|
|
</section>
|
|
<section id="mock-config-classes">
|
|
<h4>Mock Config Classes<a class="headerlink" href="#mock-config-classes" title="Permalink to this headline"></a></h4>
|
|
<ul>
|
|
<li><p>If you are using the following Mock Config classes in testing, you need to update the corresponding Config files in <strong>app/Config</strong>:</p>
|
|
<blockquote>
|
|
<div><ul class="simple">
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">MockAppConfig</span></code> (<code class="docutils literal notranslate"><span class="pre">Config\App</span></code>)</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">MockCLIConfig</span></code> (<code class="docutils literal notranslate"><span class="pre">Config\App</span></code>)</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">MockSecurityConfig</span></code> (<code class="docutils literal notranslate"><span class="pre">Config\Security</span></code>)</p></li>
|
|
</ul>
|
|
</div></blockquote>
|
|
</li>
|
|
<li><p>Add <strong>types</strong> to the properties in these Config classes. You may need to fix the property values to match the property types.</p></li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
<section id="composer-json">
|
|
<h3><a class="toc-backref" href="#id5">composer.json</a><a class="headerlink" href="#composer-json" title="Permalink to this headline"></a></h3>
|
|
<p>If you installed CodeIgnter manually, and are using Composer,
|
|
you need to remove the following lines, and run <code class="docutils literal notranslate"><span class="pre">composer</span> <span class="pre">update</span></code>.</p>
|
|
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>{
|
|
...
|
|
"require": {
|
|
...
|
|
"kint-php/kint": "^4.2", <-- Remove this line
|
|
...
|
|
},
|
|
...
|
|
"scripts": {
|
|
"post-update-cmd": [
|
|
"CodeIgniter\\ComposerScripts::postUpdate" <-- Remove this line
|
|
],
|
|
"test": "phpunit"
|
|
},
|
|
...
|
|
}
|
|
</pre></div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section id="breaking-changes">
|
|
<h2><a class="toc-backref" href="#id6">Breaking Changes</a><a class="headerlink" href="#breaking-changes" title="Permalink to this headline"></a></h2>
|
|
<section id="database-exception-changes">
|
|
<h3><a class="toc-backref" href="#id7">Database Exception Changes</a><a class="headerlink" href="#database-exception-changes" title="Permalink to this headline"></a></h3>
|
|
<ul class="simple">
|
|
<li><p>The exception classes may be changed when database errors occur. If you catch the exceptions,
|
|
you must confirm that your code can catch the exceptions.</p></li>
|
|
<li><p>Now a few exceptions will be thrown even if <code class="docutils literal notranslate"><span class="pre">CI_DEBUG</span></code> is false.</p></li>
|
|
<li><p>During transactions, exceptions are not thrown by default even if <code class="docutils literal notranslate"><span class="pre">DBDebug</span></code> is true. If you want
|
|
exceptions to be thrown, you need to call <code class="docutils literal notranslate"><span class="pre">transException(true)</span></code>.
|
|
See <a class="reference internal" href="../database/transactions.html#transactions-throwing-exceptions"><span class="std std-ref">Throwing Exceptions</span></a>.</p></li>
|
|
<li><p>See <a class="reference internal" href="../changelogs/v4.3.0.html#exceptions-when-database-errors-occur"><span class="std std-ref">Exceptions when Database Errors Occur</span></a> for details.</p></li>
|
|
</ul>
|
|
</section>
|
|
<section id="http-status-code-and-exit-code-of-uncaught-exceptions">
|
|
<h3><a class="toc-backref" href="#id8">HTTP Status Code and Exit Code of Uncaught Exceptions</a><a class="headerlink" href="#http-status-code-and-exit-code-of-uncaught-exceptions" title="Permalink to this headline"></a></h3>
|
|
<ul class="simple">
|
|
<li><p>If you expect <em>Exception code</em> as <em>HTTP status code</em>, the HTTP status code will be changed.
|
|
In that case, you need to implement <code class="docutils literal notranslate"><span class="pre">HTTPExceptionInterface</span></code> in the Exception. See <a class="reference internal" href="../general/errors.html#error-specify-http-status-code"><span class="std std-ref">Specify HTTP Status Code in Your Exception</span></a>.</p></li>
|
|
<li><p>If you expect <em>Exit code</em> based on <em>Exception code</em>, the Exit code will be changed.
|
|
In that case, you need to implement <code class="docutils literal notranslate"><span class="pre">HasExitCodeInterface</span></code> in the Exception. See <a class="reference internal" href="../general/errors.html#error-specify-exit-code"><span class="std std-ref">Specify Exit Code in Your Exception</span></a>.</p></li>
|
|
</ul>
|
|
</section>
|
|
<section id="redirect-withinput-and-validation-errors">
|
|
<h3><a class="toc-backref" href="#id9">redirect()->withInput() and Validation Errors</a><a class="headerlink" href="#redirect-withinput-and-validation-errors" title="Permalink to this headline"></a></h3>
|
|
<p><code class="docutils literal notranslate"><span class="pre">redirect()->withInput()</span></code> and Validation errors had an undocumented behavior.
|
|
If you redirect with <code class="docutils literal notranslate"><span class="pre">withInput()</span></code>, CodeIgniter stores the validation errors
|
|
in the session, and you can get the errors in the redirected page from
|
|
a validation object <em>before a new validation is run</em>:</p>
|
|
<div class="highlight-html+php notranslate"><div class="highlight"><pre><span></span><span class="c1">// In the controller</span>
|
|
<span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="nv">$this</span><span class="o">-></span><span class="na">validate</span><span class="p">(</span><span class="nv">$rules</span><span class="p">))</span> <span class="p">{</span>
|
|
<span class="k">return</span> <span class="nx">redirect</span><span class="p">()</span><span class="o">-></span><span class="na">back</span><span class="p">()</span><span class="o">-></span><span class="na">withInput</span><span class="p">();</span>
|
|
<span class="p">}</span>
|
|
|
|
<span class="c1">// In the view of the redirected page</span>
|
|
<span class="o"><?=</span> <span class="nx">service</span><span class="p">(</span><span class="s1">'Validation'</span><span class="p">)</span><span class="o">-></span><span class="na">listErrors</span><span class="p">()</span> <span class="cp">?></span>
|
|
</pre></div>
|
|
</div>
|
|
<p>This behavior was a bug and fixed in v4.3.0.</p>
|
|
<p>If you have code that depends on the bug, you need to change the code.
|
|
Use new Form helpers, <a class="reference internal" href="../helpers/form_helper.html#validation_errors" title="validation_errors"><code class="xref php php-func docutils literal notranslate"><span class="pre">validation_errors()</span></code></a>, <a class="reference internal" href="../helpers/form_helper.html#validation_list_errors" title="validation_list_errors"><code class="xref php php-func docutils literal notranslate"><span class="pre">validation_list_errors()</span></code></a> and <a class="reference internal" href="../helpers/form_helper.html#validation_show_error" title="validation_show_error"><code class="xref php php-func docutils literal notranslate"><span class="pre">validation_show_error()</span></code></a> to display Validation Errors,
|
|
instead of the Validation object.</p>
|
|
</section>
|
|
<section id="validation-changes">
|
|
<h3><a class="toc-backref" href="#id10">Validation Changes</a><a class="headerlink" href="#validation-changes" title="Permalink to this headline"></a></h3>
|
|
<ul class="simple">
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">ValidationInterface</span></code> has been changed. Implemented classes should likewise add the methods and the parameters so as not to break LSP. See <a class="reference internal" href="../changelogs/v4.3.0.html#v430-validation-changes"><span class="std std-ref">Validation Changes</span></a> for details.</p></li>
|
|
<li><p>The return value of <code class="docutils literal notranslate"><span class="pre">Validation::loadRuleGroup()</span></code> has been changed <code class="docutils literal notranslate"><span class="pre">null</span></code> to <code class="docutils literal notranslate"><span class="pre">[]</span></code> when the <code class="docutils literal notranslate"><span class="pre">$group</span></code> is empty. Update the code if you depend on the behavior.</p></li>
|
|
</ul>
|
|
</section>
|
|
<section id="time-fixes">
|
|
<h3><a class="toc-backref" href="#id11">Time Fixes</a><a class="headerlink" href="#time-fixes" title="Permalink to this headline"></a></h3>
|
|
<ul class="simple">
|
|
<li><p>Due to bug fixes, some methods in <a class="reference internal" href="../libraries/time.html"><span class="doc">Time</span></a> have changed from mutable behavior to immutable; <code class="docutils literal notranslate"><span class="pre">Time</span></code> now extends <code class="docutils literal notranslate"><span class="pre">DateTimeImmutable</span></code>. See <a class="reference internal" href="../changelogs/v4.3.0.html#v430-time-fix"><span class="std std-ref">ChangeLog</span></a> for details.</p></li>
|
|
<li><p>If you need the behavior of <code class="docutils literal notranslate"><span class="pre">Time</span></code> before the modification, a compatible <code class="docutils literal notranslate"><span class="pre">TimeLegacy</span></code> class has been added. Please replace all <code class="docutils literal notranslate"><span class="pre">Time</span></code> with <code class="docutils literal notranslate"><span class="pre">TimeLegacy</span></code> in your application code.</p></li>
|
|
<li><p>But <code class="docutils literal notranslate"><span class="pre">TimeLegacy</span></code> is deprecated. So we recommend you update your code.</p></li>
|
|
</ul>
|
|
<p>E.g.:</p>
|
|
<div class="highlight-html+php notranslate"><div class="highlight"><pre><span></span><span class="c1">// Before</span>
|
|
<span class="nv">$time</span> <span class="o">=</span> <span class="nx">Time</span><span class="o">::</span><span class="na">now</span><span class="p">();</span>
|
|
<span class="c1">// ...</span>
|
|
<span class="k">if</span> <span class="p">(</span><span class="nv">$time</span> <span class="nx">instanceof</span> <span class="nx">DateTime</span><span class="p">)</span> <span class="p">{</span>
|
|
<span class="c1">// ...</span>
|
|
<span class="p">}</span>
|
|
|
|
<span class="c1">// After</span>
|
|
<span class="nv">$time</span> <span class="o">=</span> <span class="nx">Time</span><span class="o">::</span><span class="na">now</span><span class="p">();</span>
|
|
<span class="c1">// ...</span>
|
|
<span class="k">if</span> <span class="p">(</span><span class="nv">$time</span> <span class="nx">instanceof</span> <span class="nx">DateTimeInterface</span><span class="p">)</span> <span class="p">{</span>
|
|
<span class="c1">// ...</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<div class="highlight-html+php notranslate"><div class="highlight"><pre><span></span><span class="c1">// Before</span>
|
|
<span class="nv">$time1</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Time</span><span class="p">(</span><span class="s1">'2022-10-31 12:00'</span><span class="p">);</span>
|
|
<span class="nv">$time2</span> <span class="o">=</span> <span class="nv">$time1</span><span class="o">-></span><span class="na">modify</span><span class="p">(</span><span class="s1">'+1 day'</span><span class="p">);</span>
|
|
<span class="k">echo</span> <span class="nv">$time1</span><span class="p">;</span> <span class="c1">// 2022-11-01 12:00:00</span>
|
|
<span class="k">echo</span> <span class="nv">$time2</span><span class="p">;</span> <span class="c1">// 2022-11-01 12:00:00</span>
|
|
|
|
<span class="c1">// After</span>
|
|
<span class="nv">$time1</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Time</span><span class="p">(</span><span class="s1">'2022-10-31 12:00'</span><span class="p">);</span>
|
|
<span class="nv">$time2</span> <span class="o">=</span> <span class="nv">$time1</span><span class="o">-></span><span class="na">modify</span><span class="p">(</span><span class="s1">'+1 day'</span><span class="p">);</span>
|
|
<span class="k">echo</span> <span class="nv">$time1</span><span class="p">;</span> <span class="c1">// 2022-10-31 12:00:00</span>
|
|
<span class="k">echo</span> <span class="nv">$time2</span><span class="p">;</span> <span class="c1">// 2022-11-01 12:00:00</span>
|
|
</pre></div>
|
|
</div>
|
|
</section>
|
|
<section id="capturing-stderr-and-stdout-streams-in-tests">
|
|
<span id="upgrade-430-stream-filter"></span><h3><a class="toc-backref" href="#id12">Capturing STDERR and STDOUT streams in Tests</a><a class="headerlink" href="#capturing-stderr-and-stdout-streams-in-tests" title="Permalink to this headline"></a></h3>
|
|
<p>The way error and output streams are captured has changed. Now instead of:</p>
|
|
<div class="highlight-html+php notranslate"><div class="highlight"><pre><span></span><span class="k">use</span> <span class="nx">CodeIgniter\Test\Filters\CITestStreamFilter</span><span class="p">;</span>
|
|
|
|
<span class="k">protected</span> <span class="k">function</span> <span class="nf">setUp</span><span class="p">()</span><span class="o">:</span> <span class="nx">void</span>
|
|
<span class="p">{</span>
|
|
<span class="nx">CITestStreamFilter</span><span class="o">::</span><span class="nv">$buffer</span> <span class="o">=</span> <span class="s1">''</span><span class="p">;</span>
|
|
<span class="nv">$this</span><span class="o">-></span><span class="na">streamFilter</span> <span class="o">=</span> <span class="nb">stream_filter_append</span><span class="p">(</span><span class="nx">STDOUT</span><span class="p">,</span> <span class="s1">'CITestStreamFilter'</span><span class="p">);</span>
|
|
<span class="nv">$this</span><span class="o">-></span><span class="na">streamFilter</span> <span class="o">=</span> <span class="nb">stream_filter_append</span><span class="p">(</span><span class="nx">STDERR</span><span class="p">,</span> <span class="s1">'CITestStreamFilter'</span><span class="p">);</span>
|
|
<span class="p">}</span>
|
|
|
|
<span class="k">protected</span> <span class="k">function</span> <span class="nf">tearDown</span><span class="p">()</span><span class="o">:</span> <span class="nx">void</span>
|
|
<span class="p">{</span>
|
|
<span class="nb">stream_filter_remove</span><span class="p">(</span><span class="nv">$this</span><span class="o">-></span><span class="na">streamFilter</span><span class="p">);</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>need to use:</p>
|
|
<div class="highlight-html+php notranslate"><div class="highlight"><pre><span></span><span class="k">use</span> <span class="nx">CodeIgniter\Test\Filters\CITestStreamFilter</span><span class="p">;</span>
|
|
|
|
<span class="k">protected</span> <span class="k">function</span> <span class="nf">setUp</span><span class="p">()</span><span class="o">:</span> <span class="nx">void</span>
|
|
<span class="p">{</span>
|
|
<span class="nx">CITestStreamFilter</span><span class="o">::</span><span class="na">registration</span><span class="p">();</span>
|
|
<span class="nx">CITestStreamFilter</span><span class="o">::</span><span class="na">addOutputFilter</span><span class="p">();</span>
|
|
<span class="nx">CITestStreamFilter</span><span class="o">::</span><span class="na">addErrorFilter</span><span class="p">();</span>
|
|
<span class="p">}</span>
|
|
|
|
<span class="k">protected</span> <span class="k">function</span> <span class="nf">tearDown</span><span class="p">()</span><span class="o">:</span> <span class="nx">void</span>
|
|
<span class="p">{</span>
|
|
<span class="nx">CITestStreamFilter</span><span class="o">::</span><span class="na">removeOutputFilter</span><span class="p">();</span>
|
|
<span class="nx">CITestStreamFilter</span><span class="o">::</span><span class="na">removeErrorFilter</span><span class="p">();</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>Or use the trait <code class="docutils literal notranslate"><span class="pre">CodeIgniter\Test\StreamFilterTrait</span></code>. See <a class="reference internal" href="../testing/overview.html#testing-cli-output"><span class="std std-ref">Testing CLI Output</span></a>.</p>
|
|
</section>
|
|
<section id="interface-changes">
|
|
<h3><a class="toc-backref" href="#id13">Interface Changes</a><a class="headerlink" href="#interface-changes" title="Permalink to this headline"></a></h3>
|
|
<p>Some interfaces has been fixed. See <a class="reference internal" href="../changelogs/v4.3.0.html#v430-interface-changes"><span class="std std-ref">Interface Changes</span></a> for details.</p>
|
|
</section>
|
|
<section id="foreign-key-data">
|
|
<h3><a class="toc-backref" href="#id14">Foreign Key Data</a><a class="headerlink" href="#foreign-key-data" title="Permalink to this headline"></a></h3>
|
|
<ul class="simple">
|
|
<li><p>The data structure returned by <code class="docutils literal notranslate"><span class="pre">BaseConnection::getForeignKeyData()</span></code> has been changed.
|
|
You will need to adjust any code depending on this method to use the new structure.</p></li>
|
|
</ul>
|
|
<p>Example: <code class="docutils literal notranslate"><span class="pre">tableprefix_table_column1_column2_foreign</span></code></p>
|
|
<p>The data returned has the following structure:</p>
|
|
<div class="highlight-html+php notranslate"><div class="highlight"><pre><span></span><span class="sd">/**</span>
|
|
<span class="sd"> * @return array[</span>
|
|
<span class="sd"> * {constraint_name} =></span>
|
|
<span class="sd"> * stdClass[</span>
|
|
<span class="sd"> * 'constraint_name' => string,</span>
|
|
<span class="sd"> * 'table_name' => string,</span>
|
|
<span class="sd"> * 'column_name' => string[],</span>
|
|
<span class="sd"> * 'foreign_table_name' => string,</span>
|
|
<span class="sd"> * 'foreign_column_name' => string[],</span>
|
|
<span class="sd"> * 'on_delete' => string,</span>
|
|
<span class="sd"> * 'on_update' => string,</span>
|
|
<span class="sd"> * 'match' => string</span>
|
|
<span class="sd"> * ]</span>
|
|
<span class="sd"> * ]</span>
|
|
<span class="sd"> */</span>
|
|
</pre></div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section id="breaking-enhancements">
|
|
<h2><a class="toc-backref" href="#id15">Breaking Enhancements</a><a class="headerlink" href="#breaking-enhancements" title="Permalink to this headline"></a></h2>
|
|
<section id="multiple-domain-support">
|
|
<h3><a class="toc-backref" href="#id16">Multiple Domain Support</a><a class="headerlink" href="#multiple-domain-support" title="Permalink to this headline"></a></h3>
|
|
<ul class="simple">
|
|
<li><p>If you set <code class="docutils literal notranslate"><span class="pre">Config\App::$allowedHostnames</span></code>, URL-related functions such as <a class="reference internal" href="../helpers/url_helper.html#base_url" title="base_url"><code class="xref php php-func docutils literal notranslate"><span class="pre">base_url()</span></code></a>, <a class="reference internal" href="../helpers/url_helper.html#current_url" title="current_url"><code class="xref php php-func docutils literal notranslate"><span class="pre">current_url()</span></code></a>, <a class="reference internal" href="../helpers/url_helper.html#site_url" title="site_url"><code class="xref php php-func docutils literal notranslate"><span class="pre">site_url()</span></code></a> will return the URL with the hostname set in <code class="docutils literal notranslate"><span class="pre">Config\App::$allowedHostnames</span></code> if the current URL matches.</p></li>
|
|
</ul>
|
|
</section>
|
|
<section id="database">
|
|
<h3><a class="toc-backref" href="#id17">Database</a><a class="headerlink" href="#database" title="Permalink to this headline"></a></h3>
|
|
<ul class="simple">
|
|
<li><p>The return type of <code class="docutils literal notranslate"><span class="pre">CodeIgniter\Database\Database::loadForge()</span></code> has been changed to <code class="docutils literal notranslate"><span class="pre">Forge</span></code>. Extending classes should likewise change the type.</p></li>
|
|
<li><p>The return type of <code class="docutils literal notranslate"><span class="pre">CodeIgniter\Database\Database::loadUtils()</span></code> has been changed to <code class="docutils literal notranslate"><span class="pre">BaseUtils</span></code>. Extending classes should likewise change the type.</p></li>
|
|
<li><p>The second parameter <code class="docutils literal notranslate"><span class="pre">$index</span></code> of <code class="docutils literal notranslate"><span class="pre">BaseBuilder::updateBatch()</span></code> has changed to <code class="docutils literal notranslate"><span class="pre">$constraints</span></code>. It now accepts types array, string, or <code class="docutils literal notranslate"><span class="pre">RawSql</span></code>. Extending classes should likewise change types.</p></li>
|
|
<li><p>The <code class="docutils literal notranslate"><span class="pre">$set</span></code> parameter of <code class="docutils literal notranslate"><span class="pre">BaseBuilder::insertBatch()</span></code> and <code class="docutils literal notranslate"><span class="pre">BaseBuilder::updateBatch()</span></code> now accepts an object of a single row of data. Extending classes should likewise change the type.</p></li>
|
|
<li><p>The third parameter <code class="docutils literal notranslate"><span class="pre">$index</span></code> of <code class="docutils literal notranslate"><span class="pre">BaseBuilder::_updateBatch()</span></code> has changed to <code class="docutils literal notranslate"><span class="pre">$values</span></code>, and the parameter type has changed to <code class="docutils literal notranslate"><span class="pre">array</span></code>. Extending classes should likewise change the type.</p></li>
|
|
<li><p>The <code class="docutils literal notranslate"><span class="pre">Model::update()</span></code> method now raises a <code class="docutils literal notranslate"><span class="pre">DatabaseException</span></code> if it generates an SQL
|
|
statement without a WHERE clause. If you need to update all records in a table, use Query Builder instead. E.g., <code class="docutils literal notranslate"><span class="pre">$model->builder()->update($data)</span></code>.</p></li>
|
|
</ul>
|
|
</section>
|
|
<section id="honeypot-and-csp">
|
|
<span id="upgrade-430-honeypot-and-csp"></span><h3><a class="toc-backref" href="#id18">Honeypot and CSP</a><a class="headerlink" href="#honeypot-and-csp" title="Permalink to this headline"></a></h3>
|
|
<p>When CSP is enabled, id attribute <code class="docutils literal notranslate"><span class="pre">id="hpc"</span></code> will be injected into the container tag
|
|
for the Honeypot field to hide the field. If the id is already used in your views, you need to change it
|
|
with <code class="docutils literal notranslate"><span class="pre">Config\Honeypot::$containerId</span></code>.
|
|
And you can remove <code class="docutils literal notranslate"><span class="pre">style="display:none"</span></code> in <code class="docutils literal notranslate"><span class="pre">Config\Honeypot::$container</span></code>.</p>
|
|
</section>
|
|
<section id="others">
|
|
<h3><a class="toc-backref" href="#id19">Others</a><a class="headerlink" href="#others" title="Permalink to this headline"></a></h3>
|
|
<ul class="simple">
|
|
<li><p><strong>Helper:</strong> Since void HTML elements (e.g. <code class="docutils literal notranslate"><span class="pre"><input></span></code>) in <code class="docutils literal notranslate"><span class="pre">html_helper</span></code>, <code class="docutils literal notranslate"><span class="pre">form_helper</span></code> or common functions have been changed to be HTML5-compatible by default and you need to be compatible with XHTML, you must set the <code class="docutils literal notranslate"><span class="pre">$html5</span></code> property in <strong>app/Config/DocTypes.php</strong> to <code class="docutils literal notranslate"><span class="pre">false</span></code>.</p></li>
|
|
<li><p><strong>CLI:</strong> Since the launch of Spark Commands was extracted from <code class="docutils literal notranslate"><span class="pre">CodeIgniter\CodeIgniter</span></code>, there may be problems running these commands if the <code class="docutils literal notranslate"><span class="pre">Services::codeigniter()</span></code> service has been overridden.</p></li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
<section id="project-files">
|
|
<h2><a class="toc-backref" href="#id20">Project Files</a><a class="headerlink" href="#project-files" title="Permalink to this headline"></a></h2>
|
|
<p>Numerous files in the <strong>project space</strong> (root, app, public, writable) received updates. Due to
|
|
these files being outside of the <strong>system</strong> scope they will not be changed without your intervention.
|
|
There are some third-party CodeIgniter modules available to assist with merging changes to
|
|
the project space: <a class="reference external" href="https://packagist.org/explore/?query=codeigniter4%20updates">Explore on Packagist</a>.</p>
|
|
<section id="content-changes">
|
|
<h3><a class="toc-backref" href="#id21">Content Changes</a><a class="headerlink" href="#content-changes" title="Permalink to this headline"></a></h3>
|
|
<p>The following files received significant changes (including deprecations or visual adjustments)
|
|
and it is recommended that you merge the updated versions with your application:</p>
|
|
<section id="config">
|
|
<span id="upgrade-430-config"></span><h4>Config<a class="headerlink" href="#config" title="Permalink to this headline"></a></h4>
|
|
<ul class="simple">
|
|
<li><dl class="simple">
|
|
<dt>app/Config/App.php</dt><dd><ul>
|
|
<li><p>The new property <code class="docutils literal notranslate"><span class="pre">$allowedHostnames</span></code> is added to set allowed hostnames in the site URL
|
|
other than the hostname in the <code class="docutils literal notranslate"><span class="pre">$baseURL</span></code>. See <a class="reference internal" href="../changelogs/v4.3.0.html#v430-multiple-domain-support"><span class="std std-ref">Multiple Domain Support</span></a>.</p></li>
|
|
<li><p>The property <code class="docutils literal notranslate"><span class="pre">$appTimezone</span></code> has been changed to <code class="docutils literal notranslate"><span class="pre">UTC</span></code> to avoid being affected
|
|
by daylight saving time.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Autoload.php</dt><dd><ul>
|
|
<li><p>The new property <code class="docutils literal notranslate"><span class="pre">$helpers</span></code> is added to autoload helpers.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Database.php</dt><dd><ul>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">$default['DBDebug']</span></code> and <code class="docutils literal notranslate"><span class="pre">$test['DBDebug']</span></code> are changed to <code class="docutils literal notranslate"><span class="pre">true</span></code> by default.
|
|
See <a class="reference internal" href="../changelogs/v4.3.0.html#exceptions-when-database-errors-occur"><span class="std std-ref">Exceptions when Database Errors Occur</span></a>.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/DocTypes.php</dt><dd><ul>
|
|
<li><p>The property <code class="docutils literal notranslate"><span class="pre">$html5</span></code> to determine whether to remove the solidus (<code class="docutils literal notranslate"><span class="pre">/</span></code>) character for void HTML
|
|
elements (e.g. <code class="docutils literal notranslate"><span class="pre"><input></span></code>) is added, and set to <code class="docutils literal notranslate"><span class="pre">true</span></code> by default for HTML5 compatibility.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Encryption.php</dt><dd><ul>
|
|
<li><p>The new property <code class="docutils literal notranslate"><span class="pre">$rawData</span></code>, <code class="docutils literal notranslate"><span class="pre">$encryptKeyInfo</span></code>, and <code class="docutils literal notranslate"><span class="pre">$authKeyInfo</span></code> are added for CI3
|
|
Encryption compatibility. See <a class="reference internal" href="../libraries/encryption.html#encryption-compatible-with-ci3"><span class="std std-ref">Configuration to Maintain Compatibility with CI3</span></a>.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Exceptions.php</dt><dd><ul>
|
|
<li><p>Two additional public properties were added: <code class="docutils literal notranslate"><span class="pre">$logDeprecations</span></code> and <code class="docutils literal notranslate"><span class="pre">$deprecationLogLevel</span></code>.
|
|
See See <a class="reference internal" href="../general/errors.html#logging-deprecation-warnings"><span class="std std-ref">Logging Deprecation Warnings</span></a> for details.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Honeypot.php</dt><dd><ul>
|
|
<li><p>The new property <code class="docutils literal notranslate"><span class="pre">$containerId</span></code> is added to set id attribute value for the container tag
|
|
when CSP is enabled.</p></li>
|
|
<li><p>The <code class="docutils literal notranslate"><span class="pre">input</span></code> tag in the property <code class="docutils literal notranslate"><span class="pre">$template</span></code> value has been changed to HTML5 compatible.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Logger.php</dt><dd><ul>
|
|
<li><p>The property <code class="docutils literal notranslate"><span class="pre">$threshold</span></code> has been changed to <code class="docutils literal notranslate"><span class="pre">9</span></code> in other than <code class="docutils literal notranslate"><span class="pre">production</span></code>
|
|
environment.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Modules.php</dt><dd><ul>
|
|
<li><p>The new property <code class="docutils literal notranslate"><span class="pre">$composerPackages</span></code> is added to limit Composer package Auto-Discovery for better
|
|
performance.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Routes.php</dt><dd><ul>
|
|
<li><p>Due to the fact that the approach to running Spark Commands has changed, there is no longer a need
|
|
to load the internal routes of the framework (<code class="docutils literal notranslate"><span class="pre">SYSTEMPATH</span> <span class="pre">.</span> <span class="pre">'Config/Routes.php'</span></code>).</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Security.php</dt><dd><ul>
|
|
<li><p>Changed the value of the property <code class="docutils literal notranslate"><span class="pre">$redirect</span></code> to <code class="docutils literal notranslate"><span class="pre">false</span></code> to prevent redirection when a CSRF
|
|
check fails. This is to make it easier to recognize that it is a CSRF error.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Session.php</dt><dd><ul>
|
|
<li><p>Added to handle session configuration.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
<li><dl class="simple">
|
|
<dt>app/Config/Validation.php</dt><dd><ul>
|
|
<li><p>The default Validation Rules have been changed to Strict Rules for better security. See <a class="reference internal" href="../libraries/validation.html#validation-traditional-and-strict-rules"><span class="std std-ref">Traditional and Strict Rules</span></a>.</p></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section id="view-files">
|
|
<h4>View Files<a class="headerlink" href="#view-files" title="Permalink to this headline"></a></h4>
|
|
<p>The following view files have been changed to HTML5 compatible tags.
|
|
Also, error messages are now defined in the <strong>Errors</strong> language file.</p>
|
|
<ul class="simple">
|
|
<li><p>app/Views/errors/html/error_404.php</p></li>
|
|
<li><p>app/Views/errors/html/error_exception.php</p></li>
|
|
<li><p>app/Views/errors/html/production.php</p></li>
|
|
<li><p>app/Views/welcome_message.php</p></li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
<section id="all-changes">
|
|
<h3><a class="toc-backref" href="#id22">All Changes</a><a class="headerlink" href="#all-changes" title="Permalink to this headline"></a></h3>
|
|
<p>This is a list of all files in the <strong>project space</strong> that received changes;
|
|
many will be simple comments or formatting that have no effect on the runtime.
|
|
All atomic type properties in <code class="docutils literal notranslate"><span class="pre">Config</span></code> classes have been typed:</p>
|
|
<ul class="simple">
|
|
<li><p>app/Config/App.php</p></li>
|
|
<li><p>app/Config/Autoload.php</p></li>
|
|
<li><p>app/Config/CURLRequest.php</p></li>
|
|
<li><p>app/Config/Cache.php</p></li>
|
|
<li><p>app/Config/ContentSecurityPolicy.php</p></li>
|
|
<li><p>app/Config/Cookie.php</p></li>
|
|
<li><p>app/Config/Database.php</p></li>
|
|
<li><p>app/Config/DocTypes.php</p></li>
|
|
<li><p>app/Config/Email.php</p></li>
|
|
<li><p>app/Config/Encryption.php</p></li>
|
|
<li><p>app/Config/Exceptions.php</p></li>
|
|
<li><p>app/Config/Feature.php</p></li>
|
|
<li><p>app/Config/Filters.php</p></li>
|
|
<li><p>app/Config/Format.php</p></li>
|
|
<li><p>app/Config/Generators.php</p></li>
|
|
<li><p>app/Config/Honeypot.php</p></li>
|
|
<li><p>app/Config/Images.php</p></li>
|
|
<li><p>app/Config/Kint.php</p></li>
|
|
<li><p>app/Config/Logger.php</p></li>
|
|
<li><p>app/Config/Migrations.php</p></li>
|
|
<li><p>app/Config/Mimes.php</p></li>
|
|
<li><p>app/Config/Modules.php</p></li>
|
|
<li><p>app/Config/Pager.php</p></li>
|
|
<li><p>app/Config/Paths.php</p></li>
|
|
<li><p>app/Config/Routes.php</p></li>
|
|
<li><p>app/Config/Security.php</p></li>
|
|
<li><p>app/Config/Session.php</p></li>
|
|
<li><p>app/Config/Toolbar.php</p></li>
|
|
<li><p>app/Config/UserAgents.php</p></li>
|
|
<li><p>app/Config/Validation.php</p></li>
|
|
<li><p>app/Views/errors/html/error_404.php</p></li>
|
|
<li><p>app/Views/errors/html/error_exception.php</p></li>
|
|
<li><p>app/Views/errors/html/production.php</p></li>
|
|
<li><p>app/Views/welcome_message.php</p></li>
|
|
<li><p>composer.json</p></li>
|
|
<li><p>env</p></li>
|
|
<li><p>phpunit.xml.dist</p></li>
|
|
<li><p>spark</p></li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
</section>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
|
<a href="upgrade_431.html" class="btn btn-neutral float-left" title="Upgrading from 4.3.0 to 4.3.1" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
<a href="upgrade_4212.html" class="btn btn-neutral float-right" title="Upgrading from 4.2.11 to 4.2.12" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
</div>
|
|
|
|
<hr/>
|
|
|
|
<div role="contentinfo">
|
|
<p>© Copyright 2019-2023 CodeIgniter Foundation.
|
|
<span class="lastupdated">Last updated on Oct 22, 2023.
|
|
</span></p>
|
|
</div>
|
|
|
|
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
|
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<script>
|
|
jQuery(function () {
|
|
SphinxRtdTheme.Navigation.enable(false);
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html> |