[2.1][Component][ClassLoader] cs

This commit is contained in:
Włodzimierz Gajda 2012-04-23 07:25:09 +02:00
parent 6c714095fa
commit bc8855e46a
6 changed files with 29 additions and 9 deletions

View File

@ -48,7 +48,7 @@ class ApcClassLoader
* Constructor.
*
* @param string $prefix A prefix to create a namespace in APC
* @param object $classFinder
* @param object $classFinder An object that implements findFile() method.
*
* @api
*/
@ -88,6 +88,7 @@ class ApcClassLoader
* Loads the given class or interface.
*
* @param string $class The name of the class
*
* @return Boolean|null True, if loaded
*/
public function loadClass($class)

View File

@ -25,7 +25,7 @@ namespace Symfony\Component\ClassLoader;
* // activate the autoloader
* $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);
*
* In this example, if you try to use a class in the Symfony\Component
@ -43,16 +43,31 @@ class ClassLoader
private $fallbackDirs = array();
private $useIncludePath = false;
/**
* Returns prefixes.
*
* @return array
*/
public function getPrefixes()
{
return $this->prefixes;
}
/**
* Returns fallback directories.
*
* @return array
*/
public function getFallbackDirs()
{
return $this->fallbackDirs;
}
/**
* Adds prefixes.
*
* @param array $prefixes Prefixes to add
*/
public function addPrefixes(array $prefixes)
{
foreach ($prefixes as $prefix => $path) {
@ -128,6 +143,7 @@ class ClassLoader
* Loads the given class or interface.
*
* @param string $class The name of the class
*
* @return Boolean|null True, if loaded
*/
public function loadClass($class)

View File

@ -73,6 +73,7 @@ class DebugClassLoader
* Loads the given class or interface.
*
* @param string $class The name of the class
*
* @return Boolean|null True, if loaded
*/
public function loadClass($class)

View File

@ -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);
*
* // activate the autoloader

View File

@ -49,7 +49,7 @@ class XcacheClassLoader
* Constructor.
*
* @param string $prefix A prefix to create a namespace in Xcache
* @param object $classFinder
* @param object $classFinder An object that implements findFile() method.
*
* @api
*/
@ -89,12 +89,14 @@ class XcacheClassLoader
* Loads the given class or interface.
*
* @param string $class The name of the class
*
* @return Boolean|null True, if loaded
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
require $file;
return true;
}
}