<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 13:21:47 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/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+10043+AND+labels+%3D+realpath&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+10043+AND+labels+%3D+realpath</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="1" total="1"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DCOM-165] Entities seems not be recognized by AnnotationDriver</title>
                <link>http://www.doctrine-project.org/jira/browse/DCOM-165</link>
                <project id="10043" key="DCOM">Doctrine Common</project>
                        <description>&lt;p&gt;Problem:&lt;br/&gt;
--------&lt;br/&gt;
&quot;$em-&amp;gt;getMetadataFactory()-&amp;gt;getAllMetadata()&quot;&lt;br/&gt;
Will result in an empty array. The entitiy manager is correctly configured and the entities files are loaded (echo&apos;s in the files will be displayed).&lt;/p&gt;


&lt;p&gt;Debug steps:&lt;br/&gt;
------------&lt;br/&gt;
Looking in the code for the problem I created the following debug points first:&lt;/p&gt;

&lt;p&gt;file AnnotationDriver.php method getAllClassNames()&lt;br/&gt;
after the line: &quot;$includedFiles[] = $sourceFile;&quot;&lt;br/&gt;
add: &quot;echo $sourceFile . &apos; is loaded&apos; . PHP_EOL;&quot;&lt;/p&gt;

&lt;p&gt;file AnnotationDriver.php method getAllClassNames()&lt;br/&gt;
after the line: &quot;$sourceFile = $rc-&amp;gt;getFileName();&quot;&lt;br/&gt;
add: &quot;echo $className . &apos; is loaded from: &apos; . $sourceFile . &apos; in the includedFiles array? &apos; . (in_array($sourceFile, $includedFiles) ? &apos;YES&apos; : &apos;not found &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&apos;) . PHP_EOL;&quot;&lt;/p&gt;


&lt;p&gt;the following output will be displayed:&lt;br/&gt;
...&lt;br/&gt;
f:\workspace\nl.markei.posto-2.3\lib\relaties\Contact.php is loaded&lt;br/&gt;
...&lt;br/&gt;
nl\markei\posto\relaties\Contact is loaded from: F:\workspace\nl.markei.posto-2.3\lib\relaties\Contact.php in the includedFiles array? not found &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.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;It seems that Doctrine includes the file from f: but ReflectionClass say it is loaded from F:. The in_array() will fail and Doctrine will not recognized the entity.&lt;/p&gt;

&lt;p&gt;But this is not the full problem. I created a new debug point:&lt;/p&gt;

&lt;p&gt;file AnnotationDriver.php method getAllClassNames()&lt;br/&gt;
after the line: &quot;foreach ($this-&amp;gt;_paths as $path) {&quot;&lt;br/&gt;
add: &quot;echo &apos;path: &apos; . $path . &apos; after realpath: &apos; . realpath($path) . PHP_EOL;&quot;&lt;/p&gt;

&lt;p&gt;This will result in the following output:&lt;br/&gt;
&quot;path: F:\domains\markei.nl\lib\nl.markei.posto\ after realpath: f:\workspace\nl.markei.posto-2.3\lib&quot;&lt;/p&gt;

&lt;p&gt;So the conversion of the F: to f: is done by realpath; its look like &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;A simple fix should be in AnnotationDriver.php / getAllClassNames()&lt;br/&gt;
replace: &quot;$sourceFile = $rc-&amp;gt;getFileName();&quot;&lt;br/&gt;
by: &quot;$sourceFile = realpath($rc-&amp;gt;getFileName());&quot;&lt;/p&gt;

&lt;p&gt;After I did that, the problem still exists. So I add to echo&apos;s (one with realpath and one without at the part of the code). And both echo&apos;s result in a path starting with &quot;F:&quot;.&lt;/p&gt;

&lt;p&gt;So my first reaction was freaky!&lt;/p&gt;

&lt;p&gt;After some frustrating hours I found the problem in the symlink I used.&lt;br/&gt;
&quot;F:\domains\markei.nl\lib\nl.markei.posto&quot; was a symlink to &quot;f:\workspace\nl.markei.posto-2.3\lib&quot; and realpath will not convert the driver char in the target of the symlink for some freaky reason. After changing the symlink target to &quot;F:\workspace....&quot; everything works fine.&lt;/p&gt;


&lt;p&gt;Summary:&lt;br/&gt;
--------&lt;br/&gt;
realpath results are not consistent on Windows. This will resulting in problems under Windows.&lt;/p&gt;


&lt;p&gt;Possible solutions:&lt;br/&gt;
-------------------&lt;br/&gt;
Saying &quot;this is a PHP bug&quot;.&lt;br/&gt;
It is possible that there are more case sensitive problems hidding here on Windows. Maybe it is better to use (for Windows only!) a case insensitive in_array-alternative in AnnotationDriver.php getAllClassNames() (or convert all paths for to lowercase for Windows)&lt;/p&gt;</description>
                <environment>Windows 7 Profesional, Enterprise and Windows Server 2003 and 2008; Common: 2.2.3 DBAL: 2.2.2 ORM: 2.2.3; PHP 5.4.5 and 5.3.5</environment>
            <key id="14007">DCOM-165</key>
            <summary>Entities seems not be recognized by AnnotationDriver</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="maartendekeizer">Maarten de Keizer</reporter>
                        <labels>
                        <label>annotationdriver</label>
                        <label>realpath</label>
                        <label>symlink</label>
                        <label>windows</label>
                    </labels>
                <created>Sun, 2 Sep 2012 20:07:14 +0000</created>
                <updated>Wed, 23 Jan 2013 23:07:12 +0000</updated>
                                    <version>2.2</version>
                <version>2.3</version>
                                                <component>Annotations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19394" author="ocramius" created="Wed, 23 Jan 2013 23:06:56 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=maartendekeizer&quot; class=&quot;user-hover&quot; rel=&quot;maartendekeizer&quot;&gt;Maarten de Keizer&lt;/a&gt; looks like the issue is still there in doctrine/annotations. Are you able to come up with a failing test case?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>