merged branch gajdaw/2_1_component_classloader_cs (PR #4073)
Commits
-------
bc8855e
[2.1][Component][ClassLoader] cs
Discussion
----------
[2.1][Component][ClassLoader] cs
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
---------------------------------------------------------------------------
by fabpot at 2012-04-23T06:18:26Z
Can you please remove the changes you have already made in the other PR as I merge 2.0 into master regularly. Then, you will need to squash you commits to avoid any conflict when merging will occur. Thanks.
---------------------------------------------------------------------------
by gajdaw at 2012-04-23T06:50:58Z
I hope that's it.
This commit is contained in:
commit
918769ded9
@ -48,7 +48,7 @@ class ApcClassLoader
|
|||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param string $prefix A prefix to create a namespace in APC
|
* @param string $prefix A prefix to create a namespace in APC
|
||||||
* @param object $classFinder
|
* @param object $classFinder An object that implements findFile() method.
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@ -88,6 +88,7 @@ class ApcClassLoader
|
|||||||
* Loads the given class or interface.
|
* Loads the given class or interface.
|
||||||
*
|
*
|
||||||
* @param string $class The name of the class
|
* @param string $class The name of the class
|
||||||
|
*
|
||||||
* @return Boolean|null True, if loaded
|
* @return Boolean|null True, if loaded
|
||||||
*/
|
*/
|
||||||
public function loadClass($class)
|
public function loadClass($class)
|
||||||
|
@ -25,7 +25,7 @@ namespace Symfony\Component\ClassLoader;
|
|||||||
* // activate the autoloader
|
* // activate the autoloader
|
||||||
* $loader->register();
|
* $loader->register();
|
||||||
*
|
*
|
||||||
* // to enable searching the include path (eg. for PEAR packages)
|
* // to enable searching the include path (e.g. for PEAR packages)
|
||||||
* $loader->setUseIncludePath(true);
|
* $loader->setUseIncludePath(true);
|
||||||
*
|
*
|
||||||
* In this example, if you try to use a class in the Symfony\Component
|
* In this example, if you try to use a class in the Symfony\Component
|
||||||
@ -43,16 +43,31 @@ class ClassLoader
|
|||||||
private $fallbackDirs = array();
|
private $fallbackDirs = array();
|
||||||
private $useIncludePath = false;
|
private $useIncludePath = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns prefixes.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getPrefixes()
|
public function getPrefixes()
|
||||||
{
|
{
|
||||||
return $this->prefixes;
|
return $this->prefixes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns fallback directories.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getFallbackDirs()
|
public function getFallbackDirs()
|
||||||
{
|
{
|
||||||
return $this->fallbackDirs;
|
return $this->fallbackDirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds prefixes.
|
||||||
|
*
|
||||||
|
* @param array $prefixes Prefixes to add
|
||||||
|
*/
|
||||||
public function addPrefixes(array $prefixes)
|
public function addPrefixes(array $prefixes)
|
||||||
{
|
{
|
||||||
foreach ($prefixes as $prefix => $path) {
|
foreach ($prefixes as $prefix => $path) {
|
||||||
@ -128,6 +143,7 @@ class ClassLoader
|
|||||||
* Loads the given class or interface.
|
* Loads the given class or interface.
|
||||||
*
|
*
|
||||||
* @param string $class The name of the class
|
* @param string $class The name of the class
|
||||||
|
*
|
||||||
* @return Boolean|null True, if loaded
|
* @return Boolean|null True, if loaded
|
||||||
*/
|
*/
|
||||||
public function loadClass($class)
|
public function loadClass($class)
|
||||||
|
@ -73,6 +73,7 @@ class DebugClassLoader
|
|||||||
* Loads the given class or interface.
|
* Loads the given class or interface.
|
||||||
*
|
*
|
||||||
* @param string $class The name of the class
|
* @param string $class The name of the class
|
||||||
|
*
|
||||||
* @return Boolean|null True, if loaded
|
* @return Boolean|null True, if loaded
|
||||||
*/
|
*/
|
||||||
public function loadClass($class)
|
public function loadClass($class)
|
||||||
|
@ -42,7 +42,7 @@ namespace Symfony\Component\ClassLoader;
|
|||||||
* ));
|
* ));
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* // to enable searching the include path (eg. for PEAR packages)
|
* // to enable searching the include path (e.g. for PEAR packages)
|
||||||
* $loader->useIncludePath(true);
|
* $loader->useIncludePath(true);
|
||||||
*
|
*
|
||||||
* // activate the autoloader
|
* // activate the autoloader
|
||||||
|
@ -49,7 +49,7 @@ class XcacheClassLoader
|
|||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param string $prefix A prefix to create a namespace in Xcache
|
* @param string $prefix A prefix to create a namespace in Xcache
|
||||||
* @param object $classFinder
|
* @param object $classFinder An object that implements findFile() method.
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@ -89,12 +89,14 @@ class XcacheClassLoader
|
|||||||
* Loads the given class or interface.
|
* Loads the given class or interface.
|
||||||
*
|
*
|
||||||
* @param string $class The name of the class
|
* @param string $class The name of the class
|
||||||
|
*
|
||||||
* @return Boolean|null True, if loaded
|
* @return Boolean|null True, if loaded
|
||||||
*/
|
*/
|
||||||
public function loadClass($class)
|
public function loadClass($class)
|
||||||
{
|
{
|
||||||
if ($file = $this->findFile($class)) {
|
if ($file = $this->findFile($class)) {
|
||||||
require $file;
|
require $file;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user