DDC-1247: Implement AnnotationDriver::addExcludePath #1571

Open
opened 2026-01-22 13:18:32 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 4, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user hosiplan:

Hi,
I've been having issues with AnnotationDriver crawling in my directories and loading files.
I have a few classes that require specific libraries loaded, and I don't want the AnnotationDriver to load them.

For example, I have my descendant of PHPUnit_Framework_TestCase in libs and the driver just dies, because PHPUnit is not loaded, and I don't want to load it, to be able to finish the process.

Solution would be add method AnnotationDriver::addExcludePath, whose name speaks for itself :)

Temporarily, I had to extend the AnnotationDriver and overload the crawling process, which is realy annoing, because I had to copy the whole method with all its exceptions and I would have to maintain it, till this will be in Doctrine. Can be viewed here https://github.com/Kdyby/Framework/blob/master/libs/Kdyby/Doctrine/Mapping/Driver/AnnotationDriver.php

Thanks
Filip

Originally created by @doctrinebot on GitHub (Jul 4, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user hosiplan: Hi, I've been having issues with AnnotationDriver crawling in my directories and loading files. I have a few classes that require specific libraries loaded, and I don't want the AnnotationDriver to load them. For example, I have my descendant of PHPUnit_Framework_TestCase in libs and the driver just dies, because PHPUnit is not loaded, and I don't want to load it, to be able to finish the process. Solution would be add method `AnnotationDriver::addExcludePath`, whose name speaks for itself :) Temporarily, I had to extend the AnnotationDriver and overload the crawling process, which is realy annoing, because I had to copy the whole method with all its exceptions and I would have to maintain it, till this will be in Doctrine. Can be viewed here https://github.com/Kdyby/Framework/blob/master/libs/Kdyby/Doctrine/Mapping/Driver/AnnotationDriver.php Thanks Filip
admin added the New Feature label 2026-01-22 13:18:32 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1571