Skip to content

Commit e1af618

Browse files
committed
Update User Guide
1 parent d9a22b7 commit e1af618

4 files changed

Lines changed: 97 additions & 11 deletions

File tree

changelogs/v4.7.0.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ <h4><a class="toc-backref" href="#id8" role="doc-backlink">Encryption Handlers</
492492
</section>
493493
</section>
494494
<section id="interface-changes">
495-
<h3><a class="toc-backref" href="#id9" role="doc-backlink">Interface Changes</a><a class="headerlink" href="#interface-changes" title="Permalink to this heading"></a></h3>
495+
<span id="v470-interface-changes"></span><h3><a class="toc-backref" href="#id9" role="doc-backlink">Interface Changes</a><a class="headerlink" href="#interface-changes" title="Permalink to this heading"></a></h3>
496496
<p><strong>NOTE:</strong> If you’ve implemented your own classes that implement these interfaces from scratch, you will need to update your implementations to include the new methods to ensure compatibility.</p>
497497
<ul class="simple">
498498
<li><p><strong>Cache:</strong> The <code class="docutils literal notranslate"><span class="pre">CacheInterface</span></code> now includes the <code class="docutils literal notranslate"><span class="pre">deleteMatching()</span></code> method.</p></li>
@@ -502,7 +502,7 @@ <h3><a class="toc-backref" href="#id9" role="doc-backlink">Interface Changes</a>
502502
</ul>
503503
</section>
504504
<section id="method-signature-changes">
505-
<h3><a class="toc-backref" href="#id10" role="doc-backlink">Method Signature Changes</a><a class="headerlink" href="#method-signature-changes" title="Permalink to this heading"></a></h3>
505+
<span id="v470-method-signature-changes"></span><h3><a class="toc-backref" href="#id10" role="doc-backlink">Method Signature Changes</a><a class="headerlink" href="#method-signature-changes" title="Permalink to this heading"></a></h3>
506506
<ul class="simple">
507507
<li><p><strong>BaseModel:</strong> The type of the <code class="docutils literal notranslate"><span class="pre">$row</span></code> parameter for the <code class="docutils literal notranslate"><span class="pre">cleanValidationRules()</span></code> method has been changed from <code class="docutils literal notranslate"><span class="pre">?array</span> <span class="pre">$row</span> <span class="pre">=</span> <span class="pre">null</span></code> to <code class="docutils literal notranslate"><span class="pre">array</span> <span class="pre">$row</span></code>.</p></li>
508508
<li><p><strong>PageCache:</strong> The <code class="docutils literal notranslate"><span class="pre">PageCache</span></code> filter constructor now accepts an optional <code class="docutils literal notranslate"><span class="pre">Cache</span></code> configuration parameter: <code class="docutils literal notranslate"><span class="pre">__construct(?Cache</span> <span class="pre">$config</span> <span class="pre">=</span> <span class="pre">null)</span></code>. This allows dependency injection for testing purposes. While this is technically a breaking change if you extend the <code class="docutils literal notranslate"><span class="pre">PageCache</span></code> class with your own constructor, it should not affect most users as the parameter has a default value.</p></li>
@@ -580,13 +580,13 @@ <h3><a class="toc-backref" href="#id10" role="doc-backlink">Method Signature Cha
580580
</ul>
581581
</section>
582582
<section id="property-signature-changes">
583-
<h3><a class="toc-backref" href="#id11" role="doc-backlink">Property Signature Changes</a><a class="headerlink" href="#property-signature-changes" title="Permalink to this heading"></a></h3>
583+
<span id="v470-property-signature-changes"></span><h3><a class="toc-backref" href="#id11" role="doc-backlink">Property Signature Changes</a><a class="headerlink" href="#property-signature-changes" title="Permalink to this heading"></a></h3>
584584
<ul class="simple">
585585
<li><p><strong>Entity:</strong> The protected property <code class="docutils literal notranslate"><span class="pre">CodeIgniter\Entity\Entity::$dataCaster</span></code> type has been changed from <code class="docutils literal notranslate"><span class="pre">DataCaster</span></code> to <code class="docutils literal notranslate"><span class="pre">?DataCaster</span></code> (nullable).</p></li>
586586
</ul>
587587
</section>
588588
<section id="removed-deprecated-items">
589-
<h3><a class="toc-backref" href="#id12" role="doc-backlink">Removed Deprecated Items</a><a class="headerlink" href="#removed-deprecated-items" title="Permalink to this heading"></a></h3>
589+
<span id="v470-removed-deprecated-items"></span><h3><a class="toc-backref" href="#id12" role="doc-backlink">Removed Deprecated Items</a><a class="headerlink" href="#removed-deprecated-items" title="Permalink to this heading"></a></h3>
590590
<ul class="simple">
591591
<li><p><strong>BaseModel:</strong> The deprecated method <code class="docutils literal notranslate"><span class="pre">transformDataRowToArray()</span></code> has been removed.</p></li>
592592
<li><p><strong>Cache:</strong> The deprecated return type <code class="docutils literal notranslate"><span class="pre">false</span></code> for <code class="docutils literal notranslate"><span class="pre">CodeIgniter\Cache\CacheInterface::getMetaData()</span></code> has been replaced with <code class="docutils literal notranslate"><span class="pre">null</span></code> type.</p></li>

installation/upgrade_470.html

Lines changed: 92 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,16 +303,102 @@ <h1>Upgrading from 4.6.x to 4.7.0<a class="headerlink" href="#upgrading-from-4-6
303303
</ul>
304304
<nav class="contents local" id="contents">
305305
<ul class="simple">
306-
<li><p><a class="reference internal" href="#project-files" id="id1">Project Files</a></p>
306+
<li><p><a class="reference internal" href="#breaking-changes" id="id1">Breaking Changes</a></p>
307307
<ul>
308-
<li><p><a class="reference internal" href="#content-changes" id="id2">Content Changes</a></p></li>
309-
<li><p><a class="reference internal" href="#all-changes" id="id3">All Changes</a></p></li>
308+
<li><p><a class="reference internal" href="#php-8-2-required" id="id2">PHP 8.2 Required</a></p></li>
309+
<li><p><a class="reference internal" href="#validation-regex-match-placeholders" id="id3">Validation <code class="docutils literal notranslate"><span class="pre">regex_match</span></code> Placeholders</a></p></li>
310+
<li><p><a class="reference internal" href="#model-primary-key-validation-timing-and-exceptions" id="id4">Model Primary Key Validation Timing and Exceptions</a></p></li>
311+
<li><p><a class="reference internal" href="#entity-change-detection-is-now-deep" id="id5">Entity Change Detection Is Now Deep</a></p></li>
312+
<li><p><a class="reference internal" href="#encryption-handler-key-state" id="id6">Encryption Handler Key State</a></p></li>
313+
<li><p><a class="reference internal" href="#interface-changes" id="id7">Interface Changes</a></p></li>
314+
<li><p><a class="reference internal" href="#method-signature-changes" id="id8">Method Signature Changes</a></p></li>
315+
<li><p><a class="reference internal" href="#property-signature-changes" id="id9">Property Signature Changes</a></p></li>
316+
<li><p><a class="reference internal" href="#removed-deprecated-items" id="id10">Removed Deprecated Items</a></p></li>
317+
</ul>
318+
</li>
319+
<li><p><a class="reference internal" href="#project-files" id="id11">Project Files</a></p>
320+
<ul>
321+
<li><p><a class="reference internal" href="#content-changes" id="id12">Content Changes</a></p></li>
322+
<li><p><a class="reference internal" href="#all-changes" id="id13">All Changes</a></p></li>
310323
</ul>
311324
</li>
312325
</ul>
313326
</nav>
327+
<section id="breaking-changes">
328+
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Breaking Changes</a><a class="headerlink" href="#breaking-changes" title="Permalink to this heading"></a></h2>
329+
<section id="php-8-2-required">
330+
<h3><a class="toc-backref" href="#id2" role="doc-backlink">PHP 8.2 Required</a><a class="headerlink" href="#php-8-2-required" title="Permalink to this heading"></a></h3>
331+
<p>The minimum PHP requirement has been updated to <strong>PHP 8.2</strong>.</p>
332+
<p>If your current runtime is older than PHP 8.2, upgrade PHP first before
333+
upgrading CodeIgniter.</p>
334+
</section>
335+
<section id="validation-regex-match-placeholders">
336+
<h3><a class="toc-backref" href="#id3" role="doc-backlink">Validation <code class="docutils literal notranslate"><span class="pre">regex_match</span></code> Placeholders</a><a class="headerlink" href="#validation-regex-match-placeholders" title="Permalink to this heading"></a></h3>
337+
<p>Placeholders in the <code class="docutils literal notranslate"><span class="pre">regex_match</span></code> validation rule must now use double curly
338+
braces.</p>
339+
<p>If you previously used single braces like
340+
<code class="docutils literal notranslate"><span class="pre">regex_match[/^{placeholder}$/]</span></code>, update it to:
341+
<code class="docutils literal notranslate"><span class="pre">regex_match[/^{{placeholder}}$/]</span></code>.</p>
342+
<p>This avoids ambiguity with regex quantifiers such as <code class="docutils literal notranslate"><span class="pre">{1,3}</span></code>.</p>
343+
</section>
344+
<section id="model-primary-key-validation-timing-and-exceptions">
345+
<h3><a class="toc-backref" href="#id4" role="doc-backlink">Model Primary Key Validation Timing and Exceptions</a><a class="headerlink" href="#model-primary-key-validation-timing-and-exceptions" title="Permalink to this heading"></a></h3>
346+
<p>The <code class="docutils literal notranslate"><span class="pre">insertBatch()</span></code> and <code class="docutils literal notranslate"><span class="pre">updateBatch()</span></code> methods now honor model settings
347+
like <code class="docutils literal notranslate"><span class="pre">updateOnlyChanged</span></code> and <code class="docutils literal notranslate"><span class="pre">allowEmptyInserts</span></code>. This change ensures
348+
consistent handling across all insert/update operations.</p>
349+
<p>Primary key values are now validated before database queries in
350+
<code class="docutils literal notranslate"><span class="pre">insert()</span></code>/<code class="docutils literal notranslate"><span class="pre">insertBatch()</span></code> (without auto-increment), <code class="docutils literal notranslate"><span class="pre">update()</span></code>, and
351+
<code class="docutils literal notranslate"><span class="pre">delete()</span></code>.</p>
352+
<p>Invalid primary key values now throw <code class="docutils literal notranslate"><span class="pre">InvalidArgumentException</span></code> instead of
353+
database-layer <code class="docutils literal notranslate"><span class="pre">DatabaseException</span></code>.</p>
354+
<p>If your code catches <code class="docutils literal notranslate"><span class="pre">DatabaseException</span></code> for invalid primary keys, update it
355+
to handle <code class="docutils literal notranslate"><span class="pre">InvalidArgumentException</span></code> as well.</p>
356+
</section>
357+
<section id="entity-change-detection-is-now-deep">
358+
<h3><a class="toc-backref" href="#id5" role="doc-backlink">Entity Change Detection Is Now Deep</a><a class="headerlink" href="#entity-change-detection-is-now-deep" title="Permalink to this heading"></a></h3>
359+
<p><code class="docutils literal notranslate"><span class="pre">Entity::hasChanged()</span></code> and <code class="docutils literal notranslate"><span class="pre">Entity::syncOriginal()</span></code> now perform deep
360+
comparison for arrays and objects.</p>
361+
<p>If you relied on the previous shallow (reference-based) behavior, review your
362+
entity update flows and tests because nested changes are now detected.</p>
363+
<p>Also, <code class="docutils literal notranslate"><span class="pre">Entity::toRawArray()</span></code> now recursively converts arrays of entities when
364+
<code class="docutils literal notranslate"><span class="pre">$recursive</span></code> is <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p>
365+
</section>
366+
<section id="encryption-handler-key-state">
367+
<h3><a class="toc-backref" href="#id6" role="doc-backlink">Encryption Handler Key State</a><a class="headerlink" href="#encryption-handler-key-state" title="Permalink to this heading"></a></h3>
368+
<p><code class="docutils literal notranslate"><span class="pre">OpenSSLHandler</span></code> and <code class="docutils literal notranslate"><span class="pre">SodiumHandler</span></code> no longer mutate the handler’s internal
369+
key when a key is passed via <code class="docutils literal notranslate"><span class="pre">$params</span></code> to <code class="docutils literal notranslate"><span class="pre">encrypt()</span></code>/<code class="docutils literal notranslate"><span class="pre">decrypt()</span></code>.</p>
370+
<p>If your code depended on passing a key once and reusing it implicitly later,
371+
move to explicit key configuration in <code class="docutils literal notranslate"><span class="pre">Config\\Encryption</span></code> (or pass a custom
372+
config when creating the encrypter service).</p>
373+
</section>
374+
<section id="interface-changes">
375+
<h3><a class="toc-backref" href="#id7" role="doc-backlink">Interface Changes</a><a class="headerlink" href="#interface-changes" title="Permalink to this heading"></a></h3>
376+
<p>Some interface changes have been made. Classes that implement framework
377+
interfaces should update their APIs to reflect these changes.</p>
378+
<p>See <a class="reference internal" href="../changelogs/v4.7.0.html#v470-interface-changes"><span class="std std-ref">ChangeLog</span></a> for details.</p>
379+
</section>
380+
<section id="method-signature-changes">
381+
<h3><a class="toc-backref" href="#id8" role="doc-backlink">Method Signature Changes</a><a class="headerlink" href="#method-signature-changes" title="Permalink to this heading"></a></h3>
382+
<p>Some method signature changes have been made. Classes that extend framework
383+
classes should update their method signatures to keep LSP compatibility.</p>
384+
<p>See <a class="reference internal" href="../changelogs/v4.7.0.html#v470-method-signature-changes"><span class="std std-ref">ChangeLog</span></a> for details.</p>
385+
</section>
386+
<section id="property-signature-changes">
387+
<h3><a class="toc-backref" href="#id9" role="doc-backlink">Property Signature Changes</a><a class="headerlink" href="#property-signature-changes" title="Permalink to this heading"></a></h3>
388+
<p>Some property type signatures have changed (for example nullable
389+
<code class="docutils literal notranslate"><span class="pre">Entity::$dataCaster</span></code>). If you extend these classes, update your code
390+
accordingly.</p>
391+
<p>See <a class="reference internal" href="../changelogs/v4.7.0.html#v470-property-signature-changes"><span class="std std-ref">ChangeLog</span></a> for details.</p>
392+
</section>
393+
<section id="removed-deprecated-items">
394+
<h3><a class="toc-backref" href="#id10" role="doc-backlink">Removed Deprecated Items</a><a class="headerlink" href="#removed-deprecated-items" title="Permalink to this heading"></a></h3>
395+
<p>Some deprecated items have been removed. If your app still uses or extends
396+
these APIs, update your code before upgrading.</p>
397+
<p>See <a class="reference internal" href="../changelogs/v4.7.0.html#v470-removed-deprecated-items"><span class="std std-ref">ChangeLog</span></a> for details.</p>
398+
</section>
399+
</section>
314400
<section id="project-files">
315-
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Project Files</a><a class="headerlink" href="#project-files" title="Permalink to this heading"></a></h2>
401+
<h2><a class="toc-backref" href="#id11" role="doc-backlink">Project Files</a><a class="headerlink" href="#project-files" title="Permalink to this heading"></a></h2>
316402
<p>Some files in the <strong>project space</strong> (root, app, public, writable) received updates. Due to
317403
these files being outside of the <strong>system</strong> scope they will not be changed without your intervention.</p>
318404
<div class="admonition note">
@@ -322,7 +408,7 @@ <h2><a class="toc-backref" href="#id1" role="doc-backlink">Project Files</a><a c
322408
<a class="reference external" href="https://packagist.org/explore/?query=codeigniter4%20updates">Explore on Packagist</a>.</p>
323409
</div>
324410
<section id="content-changes">
325-
<h3><a class="toc-backref" href="#id2" role="doc-backlink">Content Changes</a><a class="headerlink" href="#content-changes" title="Permalink to this heading"></a></h3>
411+
<h3><a class="toc-backref" href="#id12" role="doc-backlink">Content Changes</a><a class="headerlink" href="#content-changes" title="Permalink to this heading"></a></h3>
326412
<p>The following files received significant changes (including deprecations or visual adjustments)
327413
and it is recommended that you merge the updated versions with your application:</p>
328414
<section id="config">
@@ -344,7 +430,7 @@ <h4>Config<a class="headerlink" href="#config" title="Permalink to this heading"
344430
</section>
345431
</section>
346432
<section id="all-changes">
347-
<h3><a class="toc-backref" href="#id3" role="doc-backlink">All Changes</a><a class="headerlink" href="#all-changes" title="Permalink to this heading"></a></h3>
433+
<h3><a class="toc-backref" href="#id13" role="doc-backlink">All Changes</a><a class="headerlink" href="#all-changes" title="Permalink to this heading"></a></h3>
348434
<p>This is a list of all files in the <strong>project space</strong> that received changes;
349435
many will be simple comments or formatting that have no effect on the runtime:</p>
350436
<ul class="simple">

objects.inv

35 Bytes
Binary file not shown.

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)