<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu Jun 20 09:37:24 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DDC-1247/DDC-1247.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DDC-1247] Implement AnnotationDriver::addExcludePath</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1247</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi, &lt;br/&gt;
I&apos;ve been having issues with AnnotationDriver crawling in my directories and loading files. &lt;br/&gt;
I have a few classes that require specific libraries loaded, and I don&apos;t want the AnnotationDriver to load them. &lt;/p&gt;

&lt;p&gt;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&apos;t want to load it, to be able to finish the process.&lt;/p&gt;

&lt;p&gt;Solution would be add method &lt;tt&gt;AnnotationDriver::addExcludePath&lt;/tt&gt;, whose name speaks for itself &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;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 &lt;a href=&quot;https://github.com/Kdyby/Framework/blob/master/libs/Kdyby/Doctrine/Mapping/Driver/AnnotationDriver.php&quot; class=&quot;external-link&quot;&gt;https://github.com/Kdyby/Framework/blob/master/libs/Kdyby/Doctrine/Mapping/Driver/AnnotationDriver.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
Filip&lt;/p&gt;</description>
                <environment></environment>
            <key id="12784">DDC-1247</key>
            <summary>Implement AnnotationDriver::addExcludePath</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="hosiplan">Filip Proch&#225;zka</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jul 2011 09:26:49 +0000</created>
                <updated>Wed, 19 Sep 2012 16:10:00 +0000</updated>
                                    <version>Git Master</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="17875" author="juzna" created="Fri, 20 Apr 2012 12:33:23 +0000"  >&lt;p&gt;This behavior really messes with my projects, as it automatically loads all php files. Not just those with classes, but also simple scripts, which can do horrible stuff (e.g. I&apos;ve got scripts to make changes in the source code!)&lt;/p&gt;

&lt;p&gt;Annotations should be read without executing the scripts, e.g. by TokenReflection library: &lt;a href=&quot;https://github.com/Andrewsville/PHP-Token-Reflection&quot; class=&quot;external-link&quot;&gt;https://github.com/Andrewsville/PHP-Token-Reflection&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18546" author="vrtak-cz" created="Mon, 27 Aug 2012 17:05:46 +0000"  >&lt;p&gt;pull &lt;a href=&quot;https://github.com/doctrine/common/pull/176&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/176&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18683" author="stof" created="Wed, 19 Sep 2012 11:13:23 +0000"  >&lt;p&gt;@Jan Tokenizing the file was the way annotations were handled in 2.0. Doctrine 2.1 switched to using Reflection to read annotation because it is faster.&lt;/p&gt;

&lt;p&gt;@Filip I&apos;m wondering why you would have PHPUnit testcases in a path storing entities.&lt;/p&gt;</comment>
                    <comment id="18684" author="hosiplan" created="Wed, 19 Sep 2012 13:39:24 +0000"  >&lt;p&gt;@stof&lt;/p&gt;

&lt;p&gt;&amp;gt; Tokenizing the file was the way annotations were handled in 2.0. Doctrine 2.1 switched to using Reflection to read annotation because it is faster.&lt;/p&gt;

&lt;p&gt;And it is obviousely the wrong one. There is no argument, that could beat the fact, that the result can and should be cached, as it does already. Correct behaviour is much more valuable than few miliseconds on first run.&lt;/p&gt;

&lt;p&gt;&amp;gt; I&apos;m wondering why you would have PHPUnit testcases in a path storing entities.&lt;/p&gt;

&lt;p&gt;I don&apos;t. They are base classes for the actual tests. I agree they might (or should) be somewhere else, but the fact, that they should not be executed, when readed, stays.&lt;/p&gt;</comment>
                    <comment id="18685" author="stof" created="Wed, 19 Sep 2012 16:10:00 +0000"  >&lt;p&gt;@Filip The AnnotationReader is not loading any file. It simply expects a ReflectionClass.&lt;br/&gt;
And for the performances, we are talking about running several times faster here (I don&apos;t have the benchmark results anymore but you could search in the merged PRs on Doctrine Common)&lt;/p&gt;

&lt;p&gt;The ORM AnnotationDriver expects a path in which it should look for annotated classes, to be able to implement getAllClasses() (as it cannot expect all classes to be already loaded). And btw, the behavior was the same in 2.0 when the reader was using tokenization.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>