WARNING: You are browsing the documentation for Symfony 2.2 which is not maintained anymore. Consider upgrading your projects to Symfony 4.1.

The ClassLoader Component

2.2 version
Unmaintained

The ClassLoader Component

The ClassLoader component provides tools to autoload your classes and cache their locations for performance.

Usage

Whenever you reference a class that has not been required or included yet, PHP uses the autoloading mechanism to delegate the loading of a file defining the class. Symfony2 provides two autoloaders, which are able to load your classes:

Additionally, the Symfony ClassLoader component ships with a set of wrapper classes which can be used to add additional functionality on top of existing autoloaders:

Installation

You can install the component in 2 different ways:

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.