Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 24, 2023
2 parents 365e4c1 + 6f81e6e commit 3f30502
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions user_guide_src/source/changelogs/v4.4.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Deprecations
Bugs Fixed
**********

- **UserGuide:** Fixed the descriptions for ``pre_system`` and ``post_system``
in :ref:`event-points`.

See the repo's
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_
for a complete list of bugs fixed.
9 changes: 7 additions & 2 deletions user_guide_src/source/extending/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,19 @@ You can stop simulation by passing false:

.. literalinclude:: events/008.php

.. _event-points:

Event Points
============

The following is a list of available event points within the CodeIgniter core code:

* **pre_system** Called very early during system execution. Only the benchmark and events class have been loaded at this point. No routing or other processes have happened.
* **pre_system** Called early during system execution. The URI, Request, and
Response have been instantiated, but page cache checking, routing, and execution
of "before" controller filters have not yet occurred.
* **post_controller_constructor** Called immediately after your controller is instantiated, but prior to any method calls happening.
* **post_system** Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser.
* **post_system** Called right before the final rendered page is sent to the browser,
at the end of system execution, after the execution of "after" controller filters.
* **email** Called after an email sent successfully from ``CodeIgniter\Email\Email``. Receives an array of the ``Email`` class's properties as a parameter.
* **DBQuery** Called after a database query whether successful or not. Receives the ``Query`` object.
* **migrate** Called after a successful migration call to ``latest()`` or ``regress()``. Receives the current properties of ``MigrationRunner`` as well as the name of the method.
6 changes: 6 additions & 0 deletions user_guide_src/source/installation/upgrade_4xx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ Hooks
- Instead of CI3's ``$hook['post_controller_constructor']`` you now use
``Events::on('post_controller_constructor', ['MyClass', 'MyFunction']);``, with the namespace ``CodeIgniter\Events\Events;``.
- Events are always enabled, and are available globally.
- The hook point ``pre_controller`` and ``post_controller`` have been removed.
Use :doc:`../incoming/filters` instead.
- The hook point ``display_override`` and ``cache_override`` have been removed.
Because the base methods have been removed.
- The hook point ``post_system`` has moved just before sending the final rendered
page.

Extending the Framework
=======================
Expand Down
7 changes: 7 additions & 0 deletions user_guide_src/source/libraries/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,9 @@ Rule Parameter Description
======================= ========== ============================================= ===================================================
uploaded Yes Fails if the name of the parameter does not ``uploaded[field_name]``
match the name of any uploaded files.
If you want the file upload to be optional
(not required), do not define this rule.

max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]``
parameter is larger than the second
parameter in kilobytes (kb). Or if the file
Expand All @@ -1018,3 +1021,7 @@ is_image Yes Fails if the file cannot be determined to be
======================= ========== ============================================= ===================================================

The file validation rules apply for both single and multiple file uploads.

.. note:: Only rules specifically created for file validation (like the ones listed in the table above) can be used to validate files.
Therefore, adding any general rules, like ``permit_empty``, to file validation rules array or string, the file validation will not
work correctly.

0 comments on commit 3f30502

Please sign in to comment.