Skip to content

Commit d3cd48c

Browse files
committed
fixes thanks to @wouterj
1 parent 34dc712 commit d3cd48c

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
lines changed

components/class_loader/class_loader.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. index::
2-
single: Class Loader; MapClassLoader
2+
single: Class Loader; PSR-0 Class Loader
33

44
The PSR-0 Class Loader
55
======================
@@ -10,11 +10,11 @@ Introduction
1010
.. versionadded:: 2.1
1111
The ``ClassLoader`` class was added in Symfony 2.1.
1212

13-
If your classes and third-party libraries follow the `PSR-0`_ standards or the
14-
`PEAR`_ naming conventions, you can use the :class:`Symfony\\Component\\ClassLoader\\ClassLoader`
15-
class to load all of your project's classes.
13+
If your classes and third-party libraries follow the `PSR-0`_ standards, you
14+
can use the :class:`Symfony\\Component\\ClassLoader\\ClassLoader` class to
15+
load all of your project's classes.
1616

17-
.. note::
17+
.. tip::
1818

1919
You can use both the ``ApcClassLoader`` and the ``XcacheClassLoader`` to
2020
:doc:`cache</components/class_loader/cache_class_loader>` a ``ClassLoader``
@@ -66,7 +66,7 @@ register your classes::
6666
'Twig_' => __DIR__.'/vendor/twig/twig/lib',
6767
));
6868

69-
Classes from a sub-namespace or a sub-hierarchy of PEAR classes can be looked
69+
Classes from a sub-namespace or a sub-hierarchy of `PEAR`_ classes can be looked
7070
for in a location list to ease the vendoring of a sub-set of classes for large
7171
projects::
7272

components/class_loader/introduction.rst

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
1+
.. index::
2+
single: Components; Class Loader
3+
14
The Class Loader Component
25
==========================
36

4-
The Class Loader Component loads your project classes automatically.
7+
The Class Loader Component provides tools to load and cache your project
8+
classes automatically.
9+
10+
Usage
11+
-----
512

613
Whenever you use an undefined class, PHP uses the autoloading mechanism to
714
delegate the loading of a file defining the class. Symfony2 provides two
815
autoloaders, which are able to load your classes:
916

10-
* :doc:`A PSR-0 class loader<class_loader>`
11-
12-
* :doc:`Load classes based on class-to-file mapping<map_class_loader>`
17+
* :doc:`A PSR-0 class loader</components/class_loader/class_loader>`
18+
* :doc:`Load classes based on class-to-file mapping</components/class_loader/map_class_loader>`
1319

1420
Additionally, the Symfony Class Loader Component ships with a set of wrapper
1521
classes which can be used to add additional functionality on top of existing
1622
autoloaders:
1723

18-
* :doc:`cache_class_loader`
19-
20-
* :doc:`debug_class_loader`
24+
* :doc:`/components/class_loader/cache_class_loader`
25+
* :doc:`/components/class_loader/debug_class_loader`
2126

2227
Installation
2328
------------

components/class_loader/map_class_loader.rst

+16-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@
44
MapClassLoader
55
==============
66

7-
Additionally to any dynamic class loader (like the :doc:`PSR-0 class loader <class_loader>`)
8-
you can use the :class:`Symfony\\Component\\ClassLoader\\MapClassLoader` to statically
9-
map classes to files. Using it is as easy as passing your mapping to its constructor
10-
when creating an instance of the ``MapClassLoader`` class::
7+
Introduction
8+
------------
9+
10+
Additionally to any dynamic class loader (like the
11+
:doc:`PSR-0 class loader</components/class_loader/class_loader>`) you can use
12+
the :class:`Symfony\\Component\\ClassLoader\\MapClassLoader` to statically map
13+
classes to files. This is useful if you use third-party libraries which don't
14+
follow the `PSR-0`_ standards.
15+
16+
Usage
17+
-----
18+
19+
Using it is as easy as passing your mapping to its constructor when creating
20+
an instance of the ``MapClassLoader`` class::
1121

1222
require_once '/path/to/src/Symfony/Component/ClassLoader/MapClassLoader';
1323
@@ -26,3 +36,5 @@ when creating an instance of the ``MapClassLoader`` class::
2636
stack. If you want to use it as the default autoloader, pass ``true``
2737
when calling the ``register()`` method. Your class loader will then be
2838
prepended on the autoload stack.
39+
40+
.. _PSR-0: http://symfony.com/PSR0

0 commit comments

Comments
 (0)