Skip to content

Commit

Permalink
docs: add "Improve Performance"
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 5, 2023
1 parent e5d7d3f commit 1ac4ff6
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions user_guide_src/source/concepts/autoloader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,36 @@ By default, it looks for Composer's autoload file at
``ROOTPATH . 'vendor/autoload.php'``. If you need to change the location of that file for any reason, you can modify
the value defined in **app/Config/Constants.php**.

Priority of Autoloaders
=======================

If the same namespace is defined in both CodeIgniter and Composer, Composer's
autoloader will be the first one to get a chance to locate the file.

.. note:: Prior to v4.5.0, if the same namespace was defined in both CodeIgniter and Composer, CodeIgniter's autoloader was
the first one to get a chance to locate the file.

.. _autoloader-composer-support-improve-performance:

Improve Performance
===================

.. versionadded:: 4.5.0

When you use Composer, you could improve the performance of autoloading with
Composer's classmap dump.

Add your ``App`` namespace in your **composer.json**, and run ``composer dump-autoload``.

.. code-block:: text
{
...
"autoload": {
"psr-4": {
"App\\": "app/",
},
...
},
...
}

0 comments on commit 1ac4ff6

Please sign in to comment.