diff --git a/user_guide_src/source/changelogs/index.rst b/user_guide_src/source/changelogs/index.rst index c632e339285b..20dbba79199c 100644 --- a/user_guide_src/source/changelogs/index.rst +++ b/user_guide_src/source/changelogs/index.rst @@ -3,32 +3,32 @@ Change Logs ########### Version |version| -==================================================== +================= **List of all CodeIgniter4 releases** See all the changes. .. toctree:: - :titlesonly: + :titlesonly: - v4.1.2 - v4.1.1 - v4.1.0 - v4.0.5 - v4.0.4 - v4.0.3 - v4.0.0 - v4.0.0-rc.4 - v4.0.0-rc.3 - v4.0.0-rc.2 - v4.0.0-rc.1 - v4.0.0-beta.4 - v4.0.0-beta.3 - v4.0.0-beta.2 - v4.0.0-beta.1 - v4.0.0-alpha.5 - v4.0.0-alpha.4 - v4.0.0-alpha.3 - v4.0.0-alpha.2 - v4.0.0-alpha.1 + v4.1.2 + v4.1.1 + v4.1.0 + v4.0.5 + v4.0.4 + v4.0.3 + v4.0.0 + v4.0.0-rc.4 + v4.0.0-rc.3 + v4.0.0-rc.2 + v4.0.0-rc.1 + v4.0.0-beta.4 + v4.0.0-beta.3 + v4.0.0-beta.2 + v4.0.0-beta.1 + v4.0.0-alpha.5 + v4.0.0-alpha.4 + v4.0.0-alpha.3 + v4.0.0-alpha.2 + v4.0.0-alpha.1 diff --git a/user_guide_src/source/changelogs/v4.0.0-alpha.1.rst b/user_guide_src/source/changelogs/v4.0.0-alpha.1.rst index 1637d0a894c0..f6b760279797 100644 --- a/user_guide_src/source/changelogs/v4.0.0-alpha.1.rst +++ b/user_guide_src/source/changelogs/v4.0.0-alpha.1.rst @@ -1,5 +1,5 @@ Version 4.0.0-alpha.1 -================================= +===================== Release Date: September 28, 2018 @@ -63,8 +63,8 @@ New packages list: - Language - \\ Language - Log - - Logger, LoggerAwareTrait - - \\ Handlers ... Base, ChromeLogger, File, HandlerInterface + - Logger, LoggerAwareTrait + - \\ Handlers ... Base, ChromeLogger, File, HandlerInterface - Pager - \\ Pager, PagerInterface, PagerRenderer - Router @@ -72,8 +72,8 @@ New packages list: - Security - \\ Security - Session - - \\ Session, SessionInterface - - \\ Handlers ... Base, File, Memcached, Redis + - \\ Session, SessionInterface + - \\ Handlers ... Base, File, Memcached, Redis - Test - \\ CIDatabaseTestCase, CIUnitTestCase, FeatureResponse, FeatureTestCase, ReflectionHelper - \\ Filters \\ CITestStreamFilter @@ -88,4 +88,4 @@ New packages list: - Validation - \\ CreditCardRules, FileRules, FormatRules, Rules, Validation, ValidationInterface - View - - \\ Cell, Filters, Parser, Plugins, RendererInterface, View + - \\ Cell, Filters, Parser, Plugins, RendererInterface, View diff --git a/user_guide_src/source/changelogs/v4.0.0-alpha.2.rst b/user_guide_src/source/changelogs/v4.0.0-alpha.2.rst index f3972721c5a8..a99b431f3a89 100644 --- a/user_guide_src/source/changelogs/v4.0.0-alpha.2.rst +++ b/user_guide_src/source/changelogs/v4.0.0-alpha.2.rst @@ -1,5 +1,5 @@ Version 4.0.0-alpha.2 -================================= +===================== Release Date: Oct 26, 2018 @@ -24,7 +24,7 @@ system / - CLI/ - CommandRunner #1350, #1356 - Commands/ - - Server/Serve #1313 + - Server/Serve #1313 - Config/ - AutoloadConfig #1271 - Services #1341 diff --git a/user_guide_src/source/changelogs/v4.0.0-alpha.3.rst b/user_guide_src/source/changelogs/v4.0.0-alpha.3.rst index 26ad9acaa0e7..f9e9dc537af4 100644 --- a/user_guide_src/source/changelogs/v4.0.0-alpha.3.rst +++ b/user_guide_src/source/changelogs/v4.0.0-alpha.3.rst @@ -1,5 +1,5 @@ Version 4.0.0-alpha.3 -==================================================== +===================== Release Date: November 30, 2018 diff --git a/user_guide_src/source/changelogs/v4.0.0-alpha.4.rst b/user_guide_src/source/changelogs/v4.0.0-alpha.4.rst index e3973a1508e0..7119aee9e33c 100644 --- a/user_guide_src/source/changelogs/v4.0.0-alpha.4.rst +++ b/user_guide_src/source/changelogs/v4.0.0-alpha.4.rst @@ -1,5 +1,5 @@ Version 4.0.0-alpha.4 -==================================================== +===================== Release Date: Dec 15, 2018 diff --git a/user_guide_src/source/changelogs/v4.0.0-alpha.5.rst b/user_guide_src/source/changelogs/v4.0.0-alpha.5.rst index 966e46750592..7c6dd471a38a 100644 --- a/user_guide_src/source/changelogs/v4.0.0-alpha.5.rst +++ b/user_guide_src/source/changelogs/v4.0.0-alpha.5.rst @@ -1,5 +1,5 @@ Version 4.0.0-alpha.5 -==================================================== +===================== Release Date: Jan 30, 2019 diff --git a/user_guide_src/source/changelogs/v4.0.0-beta.1.rst b/user_guide_src/source/changelogs/v4.0.0-beta.1.rst index dcecc4f465ac..64a46373e23b 100644 --- a/user_guide_src/source/changelogs/v4.0.0-beta.1.rst +++ b/user_guide_src/source/changelogs/v4.0.0-beta.1.rst @@ -1,7 +1,7 @@ Version 4.0.0-beta.1 -==================================================== +==================== -Release Date: Not released +Release Date: Mar 1, 2019 Highlights: diff --git a/user_guide_src/source/changelogs/v4.0.0-beta.2.rst b/user_guide_src/source/changelogs/v4.0.0-beta.2.rst index d902eb6925a7..acb5559d97eb 100644 --- a/user_guide_src/source/changelogs/v4.0.0-beta.2.rst +++ b/user_guide_src/source/changelogs/v4.0.0-beta.2.rst @@ -1,5 +1,5 @@ Version 4.0.0-beta.2 -==================================================== +==================== Release Date: April 4, 2019 diff --git a/user_guide_src/source/changelogs/v4.0.0-beta.3.rst b/user_guide_src/source/changelogs/v4.0.0-beta.3.rst index 7aa1404303fb..cdf27969fb2e 100644 --- a/user_guide_src/source/changelogs/v4.0.0-beta.3.rst +++ b/user_guide_src/source/changelogs/v4.0.0-beta.3.rst @@ -1,7 +1,7 @@ Version 4.0.0-beta.3 -==================================================== +==================== -Release Date: Not released +Release Date: May 7, 2019 Highlights: diff --git a/user_guide_src/source/changelogs/v4.0.0-beta.4.rst b/user_guide_src/source/changelogs/v4.0.0-beta.4.rst index 8cc220bc1f92..9530c782888f 100644 --- a/user_guide_src/source/changelogs/v4.0.0-beta.4.rst +++ b/user_guide_src/source/changelogs/v4.0.0-beta.4.rst @@ -1,7 +1,7 @@ Version 4.0.0-beta.4 -==================================================== +==================== -Release Date: Not released +Release Date: Jul 25, 2019 Highlights: diff --git a/user_guide_src/source/changelogs/v4.0.0-rc.1.rst b/user_guide_src/source/changelogs/v4.0.0-rc.1.rst index 1a3ec75e4c87..30232eb6dbfc 100644 --- a/user_guide_src/source/changelogs/v4.0.0-rc.1.rst +++ b/user_guide_src/source/changelogs/v4.0.0-rc.1.rst @@ -1,7 +1,7 @@ Version 4.0.0-rc.1 -==================================================== +================== -Release Date: Not released +Release Date: Sep 3, 2019 **RC.1 release of CodeIgniter4** diff --git a/user_guide_src/source/changelogs/v4.0.0-rc.2.rst b/user_guide_src/source/changelogs/v4.0.0-rc.2.rst index 01bb9bae3391..28768bd15192 100644 --- a/user_guide_src/source/changelogs/v4.0.0-rc.2.rst +++ b/user_guide_src/source/changelogs/v4.0.0-rc.2.rst @@ -1,5 +1,5 @@ Version 4.0.0-rc.2 -==================================================== +================== Release Date: Sept 27, 2019 diff --git a/user_guide_src/source/changelogs/v4.0.0-rc.3.rst b/user_guide_src/source/changelogs/v4.0.0-rc.3.rst index 76028c1a96d4..b282fdaf22a0 100644 --- a/user_guide_src/source/changelogs/v4.0.0-rc.3.rst +++ b/user_guide_src/source/changelogs/v4.0.0-rc.3.rst @@ -1,5 +1,5 @@ Version 4.0.0-rc.3 -==================================================== +================== Release Date: Oct 19, 2019 diff --git a/user_guide_src/source/changelogs/v4.0.0-rc.4.rst b/user_guide_src/source/changelogs/v4.0.0-rc.4.rst index ab2008c34dcb..b5693913b7bc 100644 --- a/user_guide_src/source/changelogs/v4.0.0-rc.4.rst +++ b/user_guide_src/source/changelogs/v4.0.0-rc.4.rst @@ -1,5 +1,5 @@ Version 4.0.0-rc.4 -==================================================== +================== Release Date: February 6, 2020 diff --git a/user_guide_src/source/changelogs/v4.0.0.rst b/user_guide_src/source/changelogs/v4.0.0.rst index d78e8aab6aad..2ca08f540eb3 100644 --- a/user_guide_src/source/changelogs/v4.0.0.rst +++ b/user_guide_src/source/changelogs/v4.0.0.rst @@ -1,5 +1,5 @@ Version 4.0.0 -==================================================== +============= Release Date: February 24, 2020 diff --git a/user_guide_src/source/changelogs/v4.0.3.rst b/user_guide_src/source/changelogs/v4.0.3.rst index 8663247fb4ab..9c741725b9c7 100644 --- a/user_guide_src/source/changelogs/v4.0.3.rst +++ b/user_guide_src/source/changelogs/v4.0.3.rst @@ -1,5 +1,5 @@ Version 4.0.3 -==================================================== +============= Release Date: May 1, 2020 diff --git a/user_guide_src/source/changelogs/v4.0.4.rst b/user_guide_src/source/changelogs/v4.0.4.rst index 75a7b25a35db..3860473e6630 100644 --- a/user_guide_src/source/changelogs/v4.0.4.rst +++ b/user_guide_src/source/changelogs/v4.0.4.rst @@ -1,5 +1,5 @@ Version 4.0.4 -==================================================== +============= Release Date: July 15, 2020 diff --git a/user_guide_src/source/changelogs/v4.0.5.rst b/user_guide_src/source/changelogs/v4.0.5.rst index 1db5a850d4c1..16f83e4dcf63 100644 --- a/user_guide_src/source/changelogs/v4.0.5.rst +++ b/user_guide_src/source/changelogs/v4.0.5.rst @@ -1,5 +1,5 @@ Version 4.0.5 -==================================================== +============= Release Date: January 31, 2021 diff --git a/user_guide_src/source/changelogs/v4.1.0.rst b/user_guide_src/source/changelogs/v4.1.0.rst index 4a92002cc490..8512455ae475 100644 --- a/user_guide_src/source/changelogs/v4.1.0.rst +++ b/user_guide_src/source/changelogs/v4.1.0.rst @@ -1,5 +1,5 @@ Version 4.1.0 -==================================================== +============= Release Date: January 31, 2021 @@ -11,10 +11,10 @@ Changes: Removed: -- `Autoloader::loadLegacy()` method was previously used for migration of non-namespaced classes in transition to CodeIgniter v4. Since `4.1.0`, this support was removed. +- ``Autoloader::loadLegacy()`` method was previously used for migration of non-namespaced classes in transition to CodeIgniter v4. Since ``4.1.0``, this support was removed. Bugs Fixed: Deprecations: -- Deprecated `Model::fillPlaceholders(array $rules, array $data)` method, use `fillPlaceholders(array $rules, array $data)` from Validation instead. +- Deprecated ``Model::fillPlaceholders(array $rules, array $data)`` method, use ``fillPlaceholders(array $rules, array $data)`` from Validation instead. diff --git a/user_guide_src/source/changelogs/v4.1.1.rst b/user_guide_src/source/changelogs/v4.1.1.rst index d3d9f0030489..f83719042f93 100644 --- a/user_guide_src/source/changelogs/v4.1.1.rst +++ b/user_guide_src/source/changelogs/v4.1.1.rst @@ -1,5 +1,5 @@ Version 4.1.1 -==================================================== +============= Release Date: February 1, 2021 @@ -7,6 +7,6 @@ Release Date: February 1, 2021 Bugs Fixed: -- Fixed an issue where **.gitattributes** was preventing framework downloads. +- Fixed an issue where ``.gitattributes`` was preventing framework downloads. Note that this fix was also applied retroactively to ``4.0.5`` on the **framework** repo. diff --git a/user_guide_src/source/changelogs/v4.1.2.rst b/user_guide_src/source/changelogs/v4.1.2.rst index c2d646643060..247959002fb0 100644 --- a/user_guide_src/source/changelogs/v4.1.2.rst +++ b/user_guide_src/source/changelogs/v4.1.2.rst @@ -1,5 +1,5 @@ Version 4.1.2 -==================================================== +============= Release Date: Not released diff --git a/user_guide_src/source/installation/index.rst b/user_guide_src/source/installation/index.rst index fe409028898b..37a4e61751a0 100644 --- a/user_guide_src/source/installation/index.rst +++ b/user_guide_src/source/installation/index.rst @@ -26,7 +26,7 @@ However you choose to install and run CodeIgniter4, the `user guide `_ is accessible online. .. note:: Before using CodeIgniter 4, make sure that your server meets the - :doc:`requirements `, in particular the PHP - version and the PHP extensions that are needed. - You may find that you have to uncomment the ``php.ini`` "extension" - lines to enable "curl" and "intl", for instance. + :doc:`requirements `, in particular the PHP + version and the PHP extensions that are needed. + You may find that you have to uncomment the ``php.ini`` "extension" + lines to enable "curl" and "intl", for instance. diff --git a/user_guide_src/source/installation/installing_composer.rst b/user_guide_src/source/installation/installing_composer.rst index f70b95561b71..16e5d1b2015f 100644 --- a/user_guide_src/source/installation/installing_composer.rst +++ b/user_guide_src/source/installation/installing_composer.rst @@ -1,5 +1,5 @@ Composer Installation -############################################################################### +##################### .. contents:: :local: @@ -18,7 +18,7 @@ webapp, when you clone the repository to a new system. App Starter -============================================================ +=========== The `CodeIgniter 4 app starter `_ repository holds a skeleton application, with a composer dependency on @@ -28,7 +28,7 @@ This installation technique would suit a developer who wishes to start a new CodeIgniter4 based project. Installation & Set Up -------------------------------------------------------- +--------------------- In the folder above your project root:: @@ -51,7 +51,7 @@ A sample such installation command, using the default project-root "appstarter": After installation you should follow the steps in the "Upgrading" section. Upgrading -------------------------------------------------------- +--------- Whenever there is a new release, then from the command line in your project root:: @@ -71,17 +71,17 @@ would be appropriate to do so here too, i.e., ``composer update --no-dev``. Read the upgrade instructions, and check designated ``app/Config`` folders for affected changes. Pros -------------------------------------------------------- +---- Simple installation; easy to update Cons -------------------------------------------------------- +---- You still need to check for ``app/Config`` changes after updating Structure -------------------------------------------------------- +--------- Folders in your project after set up: @@ -90,7 +90,7 @@ Folders in your project after set up: - vendor/codeigniter4/framework/app & public (compare with yours after updating when using ``--prefer-source``) Latest Dev -------------------------------------------------------- +---------- The App Starter repo comes with a ``builds`` scripts to switch Composer sources between the current stable release and the latest development branch of the framework. Use this script @@ -114,7 +114,7 @@ After using the ``builds`` command be sure to run ``composer update`` to sync yo folder with the latest target build. Adding CodeIgniter4 to an Existing Project -============================================================ +========================================== The same `CodeIgniter 4 framework `_ repository described in "Manual Installation" can also be added to an @@ -131,7 +131,7 @@ As with the earlier two composer install methods, you can omit installing phpunit and its dependencies by adding the ``--no-dev`` argument to the ``composer require`` command. Set Up -------------------------------------------------------- +------ Copy the ``app``, ``public``, and ``writable`` folders from ``vendor/codeigniter4/framework`` to your project root @@ -143,7 +143,7 @@ You will have to adjust the system path to refer to the vendor one, e.g., ``ROOT - the ``$systemDirectory`` variable in ``app/Config/Paths.php`` Upgrading -------------------------------------------------------- +--------- Whenever there is a new release, then from the command line in your project root:: @@ -153,17 +153,17 @@ Read the upgrade instructions, and check designated ``app/Config`` folders for affected changes. Pros -------------------------------------------------------- +---- Relatively simple installation; easy to update Cons -------------------------------------------------------- +---- You still need to check for ``app/Config`` changes after updating Structure -------------------------------------------------------- +--------- Folders in your project after set up: @@ -172,7 +172,7 @@ Folders in your project after set up: Translations Installation -============================================================ +========================= If you want to take advantage of the system message translations, they can be added to your project in a similar fashion. diff --git a/user_guide_src/source/installation/installing_manual.rst b/user_guide_src/source/installation/installing_manual.rst index 0e668674e8dc..1224e84d2830 100644 --- a/user_guide_src/source/installation/installing_manual.rst +++ b/user_guide_src/source/installation/installing_manual.rst @@ -1,5 +1,5 @@ Manual Installation -############################################################################### +################### The `CodeIgniter 4 framework `_ repository holds the released versions of the framework. @@ -13,18 +13,18 @@ folder! for `CodeIgniter 3 `_. Installation -============================================================ +============ Download the `latest version `_, and extract it to become your project root. Setting Up -------------------------------------------------------- +---------- None Upgrading -------------------------------------------------------- +--------- Download a new copy of the framework, and then follow the upgrade instructions in the release notice or changelog to merge that with your project. @@ -33,24 +33,24 @@ Typically, you replace the ``system`` folder, and check designated ``app/Config`` folders for affected changes. Pros -------------------------------------------------------- +---- Download and run Cons -------------------------------------------------------- +---- You are responsible for merge conflicts when updating Structure -------------------------------------------------------- +--------- Folders in your project after set up: app, public, system, writable Translations Installation -============================================================ +========================= If you want to take advantage of the system message translations, they can be added to your project in a similar fashion. diff --git a/user_guide_src/source/installation/running.rst b/user_guide_src/source/installation/running.rst index 6ff82f119a36..4d00260ffcea 100644 --- a/user_guide_src/source/installation/running.rst +++ b/user_guide_src/source/installation/running.rst @@ -1,5 +1,5 @@ Running Your App -############################################################################### +################ .. contents:: :local: @@ -13,7 +13,7 @@ If you’re new to CodeIgniter, please read the :doc:`Getting Started `_. .htaccess -------------------------------------------------------- +--------- The “mod_rewrite” module enables URLs without “index.php” in them, and is assumed in our user guide. @@ -100,7 +100,7 @@ in the "AllowOverride" setting:: Virtual Hosting -------------------------------------------------------- +--------------- We recommend using “virtual hosting” to run your apps. You can set up different aliases for each of the apps you work on, @@ -130,14 +130,14 @@ If your project folder is not a subfolder of the Apache document root, then your element may need a nested element to grant the web server access to the files. Testing -------------------------------------------------------- +------- With the above configuration, your webapp would be accessed with the URL ``http://myproject.local`` in your browser. Apache needs to be restarted whenever you change its configuration. Hosting with Nginx -================================================= +================== Nginx is the second most widely used HTTP server for web hosting. Here you can find an example configuration using PHP 7.3 FPM (unix sockets) under Ubuntu Server. @@ -176,7 +176,7 @@ This configuration enables URLs without “index.php” in them and using CodeIg } Hosting with Vagrant -================================================= +==================== Virtualization is an effective way to test your webapp in the environment you plan to deploy on, even if you develop on a different one. @@ -187,7 +187,7 @@ The codebase comes with a ``VagrantFile.dist``, that can be copied to ``VagrantF and tailored for your system, for instance enabling access to specific database or caching engines. Setting Up -------------------------------------------------------- +---------- It assumes that you have installed `VirtualBox `_ and `Vagrant `_ @@ -199,7 +199,7 @@ The Vagrant configuration file assumes you have set up a `ubuntu/bionic64 Vagran vagrant box add ubuntu/bionic64 Testing -------------------------------------------------------- +------- Once set up, you can then launch your webapp inside a VM, with the command:: @@ -210,7 +210,7 @@ report for your build at ``http://localhost:8081`` and the user guide for it at ``http://localhost:8082``. Bootstrapping the App -================================================= +===================== In some scenarios you will want to load the framework without actually running the whole application. This is particularly useful for unit testing your project, but may also be diff --git a/user_guide_src/source/installation/troubleshooting.rst b/user_guide_src/source/installation/troubleshooting.rst index 7aaa5ad658ea..dc15798d9839 100644 --- a/user_guide_src/source/installation/troubleshooting.rst +++ b/user_guide_src/source/installation/troubleshooting.rst @@ -5,7 +5,7 @@ Troubleshooting Here are some common installation problems, and suggested workarounds. How do I know if my install is working? ------------------------------------------------------------------------- +--------------------------------------- From the command line, at your project root:: @@ -55,7 +55,7 @@ CodeIgniter equivalent, ``php spark serve`` from your project root. .. |CodeIgniter4 Welcome| image:: ../images/welcome.png What's with an unhelpful "Whoops!" page? ------------------------------------------------------- +---------------------------------------- You find that your app is displaying a page with "Whoops!" and then the text line "We seem to have hit a snag. Please try again later...". @@ -70,7 +70,7 @@ You can see the error in the debug toolbar display by setting your environment t Don't forget to reset the environment to "production" once you fix the problem! CodeIgniter Error Logs -------------------------------------------------------- +---------------------- CodeIgniter logs error messages, according to the settings in `app/Config/Logger.php`. diff --git a/user_guide_src/source/installation/upgrade_412.rst b/user_guide_src/source/installation/upgrade_412.rst index 6f18a1d6bb16..34480b61b521 100644 --- a/user_guide_src/source/installation/upgrade_412.rst +++ b/user_guide_src/source/installation/upgrade_412.rst @@ -1,6 +1,6 @@ -###################################### +############################# Upgrading from 4.1.1 to 4.1.2 -###################################### +############################# **BaseConnection::query() return values** @@ -9,7 +9,7 @@ even if the query failed. This method will now return ``false`` for failed queri Exception if ``DBDebug==true``) and will return booleans for write-type queries. Review any use of ``query()`` method and be assess whether the value might be boolean instead of Result object. For a better idea of what queries are write-type queries, check ``BaseConnection::isWriteType()`` -and any DBMS-specific override ``isWriteType()`` in the relevant Connection class. +and any DBMS-specific override ``isWriteType()`` in the relevant Connection class. **ConnectionInterface::isWriteType() declaration added** @@ -26,24 +26,24 @@ classes have been deprecated and their methods moved to ``DatabaseTestTrait`` an ``FeatureTestTrait`` respectively. Update your test cases to extend the main test case and use any traits you need. For example:: - use CodeIgniter\Test\DatabaseTestCase; + use CodeIgniter\Test\DatabaseTestCase; - class MyDatabaseTest extends DatabaseTestCase - { - public function testBadRow() - { + class MyDatabaseTest extends DatabaseTestCase + { + public function testBadRow() + { ... becomes:: - use CodeIgniter\Test\CIUnitTestCase; - use CodeIgniter\Test\DatabaseTestTrait; + use CodeIgniter\Test\CIUnitTestCase; + use CodeIgniter\Test\DatabaseTestTrait; - class MyDatabaseTest extends CIUnitTestCase - { - use DatabaseTestTrait; + class MyDatabaseTest extends CIUnitTestCase + { + use DatabaseTestTrait; - public function testBadRow() - { + public function testBadRow() + { Finally, ``ControllerTester`` has been superseded by ``ControllerTestTrait`` to standardize approach and take advantage of the updated response testing (below). @@ -55,5 +55,6 @@ The tools for testing responses have been consolidated and improved. A new set of methods and properties expected from both those classes. In most cases these changes will be "behind the scenes" by ``ControllerTestTrait`` and ``FeatureTestCase``, but two changes to be aware of: + * ``TestResponse``'s ``$request`` and ``$response`` properties are protected and should only be access through their getter methods, ``request()`` and ``response()`` * ``TestResponse`` does not have ``getBody()`` and ``setBody()`` methods, but rather uses the Response methods directly, e.g.: ``$body = $result->response()->getBody();`` diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst index 0670a87153c1..676e76110306 100644 --- a/user_guide_src/source/installation/upgrade_4xx.rst +++ b/user_guide_src/source/installation/upgrade_4xx.rst @@ -98,7 +98,8 @@ General Adjustments **Events** - Hooks have been replaced by Events. -- Instead of CI3's ``$hook['post_controller_constructor']`` you now use ``Events::on('post_controller_constructor', ['MyClass', 'MyFunction']);``, with the namespace ``CodeIgniter\Events\Events;``. +- 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. **Extending the framework** @@ -119,8 +120,13 @@ Upgrading Libraries following namespaced conventions for your component. - Some libraries from CodeIgniter 3 no longer exists in Version 4. For all these libraries, you have to find a new way to implement your functions. These - libraries are `Calendaring `_, `FTP `_, `Javascript `_, `Shopping Cart `_, `Trackback `_, - `XML-RPC /-Server `_, and `Zip Encoding `_. + libraries are `Calendaring `_, + `FTP `_, + `Javascript `_, + `Shopping Cart `_, + `Trackback `_, + `XML-RPC /-Server `_, + and `Zip Encoding `_. - All the other libraries, which exist in both CodeIgniter versions, can be upgraded with some adjustments. The most important and mostly used libraries received an Upgrade Guide, which will help you with simple steps and examples to adjust your code. diff --git a/user_guide_src/source/installation/upgrade_configuration.rst b/user_guide_src/source/installation/upgrade_configuration.rst index 9875bf827c88..18908f7a72c2 100644 --- a/user_guide_src/source/installation/upgrade_configuration.rst +++ b/user_guide_src/source/installation/upgrade_configuration.rst @@ -9,7 +9,7 @@ Documentations ============== - `Config Documentation Codeigniter 3.X `_ -- `Configuration Documentation Codeigniter 4.X `_ +- :doc:`Configuration Documentation Codeigniter 4.X ` What has been changed @@ -22,10 +22,17 @@ What has been changed Upgrade Guide ============= -1. You have to change the values in the default CI4 config files according to the changes in the CI3 files. The config names are pretty much the same as in CI3. -2. If you are using custom config files in your CI3 project you have to create those files as new php classes in your CI4 project in ``app/Config/``. These classes should be in the ``Config`` namespace and should extend ``CodeIgniter\Config\BaseConfig``. -3. Once you have created all custom config classes, you have to copy the variables from the CI3 config into the new CI4 config class as public class properties. -4. Now, you have to change the config fetching syntax everywhere you fetch config values. The CI3 syntax is something like ``$this->config->item('item_name');``. You have to change this into ``config('MyConfigFile')->item_name;``. Alternatively, you can use the object-oriented approach: ``CodeIgniter\Config\Config::get('MyConfigFile')->item_name;`` +1. You have to change the values in the default CI4 config files according to the + changes in the CI3 files. The config names are pretty much the same as in CI3. +2. If you are using custom config files in your CI3 project you have to create those + files as new php classes in your CI4 project in ``app/Config/``. These classes + should be in the ``Config`` namespace and should extend ``CodeIgniter\Config\BaseConfig``. +3. Once you have created all custom config classes, you have to copy the variables + from the CI3 config into the new CI4 config class as public class properties. +4. Now, you have to change the config fetching syntax everywhere you fetch config + values. The CI3 syntax is something like ``$this->config->item('item_name');``. + You have to change this into ``config('MyConfigFile')->item_name;``. Alternatively, + you can use the object-oriented approach: ``CodeIgniter\Config\Config::get('MyConfigFile')->item_name;`` Code Example ============ diff --git a/user_guide_src/source/installation/upgrade_controllers.rst b/user_guide_src/source/installation/upgrade_controllers.rst index dd71961cdf17..4af4449f0832 100644 --- a/user_guide_src/source/installation/upgrade_controllers.rst +++ b/user_guide_src/source/installation/upgrade_controllers.rst @@ -9,7 +9,7 @@ Documentations ============== - `Controller Documentation Codeigniter 3.X `_ -- `Controller Documentation Codeigniter 4.X `_ +- :doc:`Controller Documentation Codeigniter 4.X ` What has been changed ===================== @@ -17,7 +17,8 @@ What has been changed - Since namespaces have been added to CodeIgniter 4, the controllers must be changed to support namespaces. - Controllers don’t use constructors any more (to invoke CI “magic”) unless those are part of base controllers you make. - CI provides Request and Response objects for you to work with - more powerful than the CI3-way. -- If you want a base controller (``MY_Controller`` in CI3), make it where you like, e.g., BaseController extends Controller, and then have your controllers extend it +- If you want a base controller (``MY_Controller`` in CI3), make it where you like, + e.g., BaseController extends Controller, and then have your controllers extend it Upgrade Guide ============= @@ -26,9 +27,13 @@ Upgrade Guide 2. Add this line just after the opening php tag: ``namespace App\Controllers;`` 3. Replace ``extends CI_Controller`` with ``extends BaseController``. -If you use sub-directories in your controller structure, you have to change the namespace according to that. -For example, you have a version 3 controller located in ``application/controllers/users/auth/Register.php``, the namespace has to be ``namespace App\Controllers\Users\Auth;`` and the controller path in the version 4 should look like this: ``app/Controllers/Users/Auth/Register.php``. Make sure to have the first letters of the sub-directories as capitalized. -After that you have to insert a "use" statement below the namespace definition in order to extend the "BaseController": ``use App\Controllers\BaseController;`` +| If you use sub-directories in your controller structure, you have to change the namespace according to that. +| For example, you have a version 3 controller located in ``application/controllers/users/auth/Register.php``, + the namespace has to be ``namespace App\Controllers\Users\Auth;`` and the controller path in the version 4 + should look like this: ``app/Controllers/Users/Auth/Register.php``. Make sure to have the first letters of + the sub-directories as capitalized. +| After that you have to insert a "use" statement below the namespace definition in order to extend the "BaseController": + ``use App\Controllers\BaseController;`` Code Example ============ diff --git a/user_guide_src/source/installation/upgrade_migrations.rst b/user_guide_src/source/installation/upgrade_migrations.rst index 1a5c62911ac7..c0d0446c1412 100644 --- a/user_guide_src/source/installation/upgrade_migrations.rst +++ b/user_guide_src/source/installation/upgrade_migrations.rst @@ -8,8 +8,8 @@ Upgrade Migrations Documentations ============== -- `Database Migrations Documentation Codeigniter 3.X `_ -- `Database Migrations Documentation Codeigniter 4.X `_ +- `Database Migrations Documentation Codeigniter 3.X `_ +- :doc:`Database Migrations Documentation Codeigniter 4.X ` What has been changed ===================== diff --git a/user_guide_src/source/installation/upgrade_models.rst b/user_guide_src/source/installation/upgrade_models.rst index 2b1e071d12bf..15e5bb47c54d 100644 --- a/user_guide_src/source/installation/upgrade_models.rst +++ b/user_guide_src/source/installation/upgrade_models.rst @@ -9,7 +9,8 @@ Documentations ============== - `Model Documentation Codeigniter 3.X `_ -- `Model Documentation Codeigniter 4.X `_ +- :doc:`Model Documentation Codeigniter 4.X ` + What has been changed ===================== diff --git a/user_guide_src/source/installation/upgrade_views.rst b/user_guide_src/source/installation/upgrade_views.rst index ae5fa0410df2..4da9ce84301d 100644 --- a/user_guide_src/source/installation/upgrade_views.rst +++ b/user_guide_src/source/installation/upgrade_views.rst @@ -9,12 +9,13 @@ Documentations ============== - `View Documentation Codeigniter 3.X `_ -- `View Documentation Codeigniter 4.X `_ +- :doc:`View Documentation Codeigniter 4.X ` What has been changed ===================== -- Your views look much like before, but they are invoked differently … instead of CI3’s ``$this->load->view(x);``, you can use ``echo view(x);``. +- Your views look much like before, but they are invoked differently … instead of CI3’s + ``$this->load->view(x);``, you can use ``echo view(x);``. - CI4 supports view “cells”, to build your response in pieces. - The template parser is still there, and substantially enhanced. @@ -22,7 +23,8 @@ Upgrade Guide ============= 1. First, move all views to the folder ``app/Views`` -2. Change the loading syntax of views in every script where you load views from ``$this->load->view('directory_name/file_name')`` to ``echo view('directory_name/file_name');`` +2. Change the loading syntax of views in every script where you load views from + ``$this->load->view('directory_name/file_name')`` to ``echo view('directory_name/file_name');`` 3. (optional) You can change the echo syntax in views from ```` to ```` Code Example