Skip to content

Conversation

@liuggio
Copy link

@liuggio liuggio commented Jul 3, 2015

in production is useful to let the user configure an annotation cache

$cache = new ApcCache(); //or whatever

AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');

        if ($useSimpleAnnotationReader) {
            // Register the ORM Annotations in the AnnotationRegistry
            $reader = new SimpleAnnotationReader();
            $reader->addNamespace('Doctrine\ORM\Mapping');
            $cachedReader = new CachedReader($reader, $cache);

            return new AnnotationDriver($cachedReader, (array) $paths);
        }

        return new AnnotationDriver(
            new CachedReader(new AnnotationReader(), $cache),
            (array) $paths
        );

Is WIP because it should be improved:

  • SimpleAnnotation support
  • Better doc

@liuggio liuggio changed the title [feature] Use the annotation cache metadata [WIP][feature] Use the annotation cache metadata Jul 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant