Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
2442cfa8
Commit
2442cfa8
authored
Sep 01, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Refined ClassLoader API class documentation to be more clear and descriptive.
parent
7c359905
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
+29
-7
ClassLoader.php
lib/Doctrine/Common/ClassLoader.php
+29
-7
No files found.
lib/Doctrine/Common/ClassLoader.php
View file @
2442cfa8
...
@@ -24,18 +24,40 @@ namespace Doctrine\Common;
...
@@ -24,18 +24,40 @@ namespace Doctrine\Common;
/**
/**
* A class loader used to load class files on demand.
* A class loader used to load class files on demand.
*
*
* Usage recommendation:
* IMPORTANT:
*
* This class loader is NOT meant to be put into a "chain" of autoloaders.
* It is not meant to load only Doctrine class file. It is a one-classloader-for-all-classes
* solution. It may not be useable with frameworks that do not follow basic pear/zend
* conventions where the namespace+class name reflects the physical location of the source
* file. This is not a bug. This class loader is, however, compatible with the
* old namespace separator '_' (underscore), so any classes using that convention
* instead of the 5.3 builtin namespaces can be loaded as well.
*
* The only way to put this classloader into an autoloader chain is to use
* setCheckFileExists(true) which is not recommended.
*
* Here is the recommended usage:
* 1) Use only 1 class loader instance.
* 1) Use only 1 class loader instance.
* 2) Set the base paths to your class libraries (including Doctrine's) through
* 2) Reduce the include_path to only the path to the PEAR packages.
* 2) Set the base paths to any non-pear class libraries through
* $classLoader->setBasePath($prefix, $basePath);
* $classLoader->setBasePath($prefix, $basePath);
* Example:
* $classLoader->setBasePath('Doctrine', '/usr/local/phplibs/doctrine/lib');
* Then, when trying to load the class Doctrine\ORM\EntityManager, for example
* the classloader will look for /usr/local/phplibs/doctrine/lib/Doctrine/ORM/EntityManager.php
*
* 3) DO NOT setCheckFileExists(true). Doing so is expensive in terms of performance.
* 3) DO NOT setCheckFileExists(true). Doing so is expensive in terms of performance.
* 4) Use an opcode-cache (i.e. APC) (STRONGLY RECOMMENDED).
* 4) Use an opcode-cache (i.e. APC) (STRONGLY RECOMMENDED).
*
*
* The "prefix" is the part of a class name before the very first namespace separator
* character. If the class is named "Foo_Bar_Baz" then the prefix is "Foo".
*
* If no base path is configured for a certain class prefix, the classloader relies on
* the include_path. That's why classes of any pear packages can be loaded without
* registering their base paths. However, since a long include_path has a negative effect
* on performance it is recommended to have only the path to the pear packages in the
* include_path.
*
* For any other class libraries you always have the choice between registering the base
* path on the classloader or putting the base path into the include_path. The former
* should be preferred but the latter is fine also.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @since 2.0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment