Lines Matching defs:class
16 * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
30 * In this example, if you try to use a class in the Symfony\Component
32 * the autoloader will first look for the class under the component/
36 * This class is loosely based on the Symfony UniversalClassLoader.
43 class ClassLoader
313 * Turns on searching the include path for class files.
337 * that have not been registered with the class map.
349 * Should class lookup fail if not found in the current class map?
418 * Loads the given class or interface.
420 * @param string $class The name of the class
423 public function loadClass($class)
425 if ($file = $this->findFile($class)) {
436 * Finds the path to the file where the class is defined.
438 * @param string $class The name of the class
442 public function findFile($class)
444 // class map lookup
445 if (isset($this->classMap[$class])) {
446 return $this->classMap[$class];
448 if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
452 $file = apcu_fetch($this->apcuPrefix.$class, $hit);
458 $file = $this->findFileWithExtension($class, '.php');
462 $file = $this->findFileWithExtension($class, '.hh');
466 apcu_add($this->apcuPrefix.$class, $file);
470 // Remember that this class does not exist.
471 $this->missingClasses[$class] = true;
488 * @param string $class
492 private function findFileWithExtension($class, $ext)
495 $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
497 $first = $class[0];
499 $subPath = $class;
522 if (false !== $pos = strrpos($class, '\\')) {
523 // namespaced class name
527 // PEAR-like class name
528 $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
533 if (0 === strpos($class, $prefix)) {