Skip to content

Changing description of autoloading to "The composer way" #1996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 16, 2012
Prev Previous commit
Next Next commit
Changing text which refers to the old app/autoload.php to mention "th…
…e Composer" way.
  • Loading branch information
Sgoettschkes committed Dec 2, 2012
commit fc3e6b91f9a87871d67dc37b146e8dbd231059b6
20 changes: 5 additions & 15 deletions book/page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,13 @@ You'll learn more about each of these directories in later chapters.

.. sidebar:: Autoloading

When Symfony is loading, a special file - ``app/autoload.php`` - is included.
This file is responsible for configuring the autoloader, which will autoload
your application files from the ``src/`` directory and third-party libraries
from the ``vendor/`` directory.
When Symfony is loading, a special file - ``vendor/autoload.php`` - is
included. This file is created by Composer and will autoload all
application files living in the `src/` folder as well as all
third-party libraries mentioned in the ``composer.json`` file.

Because of the autoloader, you never need to worry about using ``include``
or ``require`` statements. Instead, Symfony2 uses the namespace of a class
or ``require`` statements. Instead, Composer uses the namespace of a class
to determine its location and automatically includes the file on your
behalf the instant you need a class.

Expand All @@ -527,11 +527,6 @@ You'll learn more about each of these directories in later chapters.
Path:
src/Acme/HelloBundle/Controller/HelloController.php

Typically, the only time you'll need to worry about the ``app/autoload.php``
file is when you're including a new third-party library in the ``vendor/``
directory. For more information on autoloading, see
:doc:`How to autoload Classes</components/class_loader>`.

The Source (``src``) Directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -599,11 +594,6 @@ method of the ``AppKernel`` class::
With the ``registerBundles()`` method, you have total control over which bundles
are used by your application (including the core Symfony bundles).

.. tip::

A bundle can live *anywhere* as long as it can be autoloaded (via the
autoloader configured at ``app/autoload.php``).

Creating a Bundle
~~~~~~~~~~~~~~~~~

Expand Down