Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][feature] Use the annotation cache metadata #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

1 participant