public static function AnnotationRegistry::loadAnnotationClass in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php \Doctrine\Common\Annotations\AnnotationRegistry::loadAnnotationClass()
Autoloads an annotation class silently.
Parameters
string $class:
Return value
boolean
1 call to AnnotationRegistry::loadAnnotationClass()
- DocParser::classExists in vendor/doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ DocParser.php 
- Attempts to check if a class exists or not. This never goes through the PHP autoloading mechanism but uses the {@link AnnotationRegistry} to load classes.
File
- vendor/doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ AnnotationRegistry.php, line 123 
Class
- AnnotationRegistry
- AnnotationRegistry.
Namespace
Doctrine\Common\AnnotationsCode
public static function loadAnnotationClass($class) {
  foreach (self::$autoloadNamespaces as $namespace => $dirs) {
    if (strpos($class, $namespace) === 0) {
      $file = str_replace("\\", DIRECTORY_SEPARATOR, $class) . ".php";
      if ($dirs === null) {
        if ($path = stream_resolve_include_path($file)) {
          require $path;
          return true;
        }
      }
      else {
        foreach ((array) $dirs as $dir) {
          if (is_file($dir . DIRECTORY_SEPARATOR . $file)) {
            require $dir . DIRECTORY_SEPARATOR . $file;
            return true;
          }
        }
      }
    }
  }
  foreach (self::$loaders as $loader) {
    if (call_user_func($loader, $class) === true) {
      return true;
    }
  }
  return false;
}