Skip to content

Commit dca1348

Browse files
committed
docs: update upgrade guide and readme to reflect restored functionality for backward compatibility.
1 parent 1aa03c7 commit dca1348

File tree

2 files changed

+11
-45
lines changed

2 files changed

+11
-45
lines changed

readme.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ This fork commits to:
4141
- Maintaining compatibility with each new PHP version while still supporting PHP 5.4+
4242
- Applying critical security fixes
4343
- Keeping changes minimal to preserve CI3 behavior
44-
- Reverting unnecessary breaking changes in CodeIgniter 3.2.0-dev
44+
- Reverting breaking changes in CodeIgniter 3.2.0-dev to maintain backward compatibility (e.g. restoring the Cart library, Email helper, and other deprecated-but-removed functionality)
4545
- Running the full CI3 test suite on PHP 8.2+
4646

47+
If you find something that was removed in CI 3.2.0-dev and breaks backward compatibility for your application, please open an issue. We're happy to restore it.
48+
4749
This fork does NOT:
4850

4951
- Add new features
@@ -95,6 +97,8 @@ If you prefer the traditional approach of replacing the system directory:
9597

9698
**Please review the upgrade guide:** `upgrade_320.rst <user_guide_src/source/installation/upgrade_320.rst>`_
9799

100+
Note: The upgrade guide has been updated to reflect functionality we've restored for backward compatibility (Cart library, Email helper, etc.).
101+
98102
Steps to upgrade:
99103

100104
1. Review the upgrade guide for breaking changes between 3.1.x and 3.2.0

user_guide_src/source/installation/upgrade_320.rst

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -24,45 +24,17 @@ may be at least runnable, we strongly discourage you from using any PHP versions
2424
the ones listed on the `PHP.net Supported Versions <https://secure.php.net/supported-versions.php>`_
2525
page.
2626

27-
Step 3: Remove calls to ``CI_Model::__construct()``
28-
===================================================
27+
Step 3: Calls to ``CI_Model::__construct()`` (optional cleanup)
28+
===============================================================
2929

3030
The class constructor for ``CI_Model`` never contained vital code or useful
3131
logic, only a single line to log a message. A change in CodeIgniter 3.1.7
3232
moved this log message elsewhere and that naturally made the constructor
33-
completely unnecessary. However, it was left in place to avoid immedate BC
34-
breaks in a minor release.
33+
completely unnecessary.
3534

36-
In version 3.2.0, that constructor is entirely removed, which would result
37-
in fatal errors on attempts to call it. Particularly in code like this:
38-
::
39-
40-
class Some_model extends CI_Model {
41-
42-
public function __construct()
43-
{
44-
parent::__construct(); // calls CI_Model::__construct()
45-
46-
do_some_other_thing();
47-
}
48-
}
49-
50-
All you need to do is remove that ``parent::__construct()`` call. On a side
51-
note, the following seems to be a very common practice:
52-
::
53-
54-
class Some_class extends CI_Something {
55-
56-
public function __construct()
57-
{
58-
parent::__construct();
59-
}
60-
}
61-
62-
Please, do NOT do this! It's pointless; it serves no purpose and doesn't do
63-
anything. If a parent class has a ``__construct()`` method, it will be
64-
inherited by all its child classes and will execute just fine - you DON'T
65-
have to explicitly call it unless you want to extend its logic.
35+
The constructor is kept as an empty method for backwards compatibility, so
36+
existing code calling ``parent::__construct()`` will continue to work.
37+
However, such calls are unnecessary and can be safely removed.
6638

6739
Step 4: Change database connection handling
6840
===========================================
@@ -206,9 +178,6 @@ CodeIgniter versions that have been removed in 3.2.0:
206178
- 'sqlite' database driver (no longer shipped with PHP 5.4+; 'sqlite3' is still available)
207179

208180
- ``CI_Input::is_cli_request()`` (use :php:func:`is_cli()` instead)
209-
- ``CI_Router::fetch_directory()`` (use ``CI_Router::$directory`` instead)
210-
- ``CI_Router::fetch_class()`` (use ``CI_Router::$class`` instead)
211-
- ``CI_Router::fetch_method()`` (use ``CI_Router::$method`` instead)
212181
- ``CI_Config::system_url()`` (encourages insecure practices)
213182
- ``CI_Form_validation::prep_for_form()`` (the *prep_for_form* rule)
214183

@@ -219,17 +188,10 @@ CodeIgniter versions that have been removed in 3.2.0:
219188
- ``nbs()`` :doc:`HTML Helper <../helpers/html_helper>` function (use ``str_repeat()`` with ``'&nbsp;'`` instead)
220189
- ``trim_slashes()`` :doc:`String Helper <../helpers/string_helper>` function (use ``trim()`` with ``'/'`` instead)
221190
- ``repeater()`` :doc:`String Helper <../helpers/string_helper>` function (use ``str_repeat()`` instead)
222-
- ``read_file()`` :doc:`File Helper <../helpers/file_helper>` function (use ``file_get_contents()`` instead)
223191
- ``form_prep()`` :doc:`Form Helper <../helpers/form_helper>` function (use :php:func:`html_escape()` instead)
224192

225193
- The entire *Encrypt Library* (the newer :doc:`Encryption Library <../libraries/encryption>` is still available)
226194
- The entire *Javascript Library* (it was always experimental in the first place)
227-
228-
- The entire *Email Helper*, which only had two functions:
229-
230-
- ``valid_email()`` (use ``filter_var($email, FILTER_VALIDATE_EMAIL)`` instead)
231-
- ``send_email()`` (use ``mail()`` instead)
232-
233195
- The entire *Smiley Helper* (an archived version is available on GitHub: `bcit-ci/ci3-smiley-helper <https://github.com/bcit-ci/ci3-smiley-helper>`_)
234196

235197
- The ``$_after`` parameter from :doc:`Database Forge <../database/forge>` method ``add_column()``.

0 commit comments

Comments
 (0)