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

Unified Approach (5.4 vs. 5.5) for Finding Version #13

Open
astorm opened this issue Jun 23, 2014 · 1 comment
Open

Unified Approach (5.4 vs. 5.5) for Finding Version #13

astorm opened this issue Jun 23, 2014 · 1 comment

Comments

@astorm
Copy link
Owner

astorm commented Jun 23, 2014

According to this pull request, something's changed in PHP 5.5's XML handling. Come up with a unified/single-code-path approach for finding the the module version in both PHP 5.4 and PH 5.5.

@yireo
Copy link
Contributor

yireo commented Jun 23, 2014

I've created a small test-script that shows you (well at least me) what's wrong:

<?php
$xmlString = <<<EOF
<config>
    <modules>
        <Mage_Test>
            <version>test</version>
        </Mage_Test>
    </modules>
</config>
EOF;

$xml = simplexml_load_string($xmlString);
$test = (array)$xml->xpath('//modules');
print_r($test); // Should print array with version "test" present

$test = $xml->xpath('//Mage_Test');
print_r($test); // Should print array with version "test" present

$test = $xml->xpath('//version');
print_r($test); // Preduces empty array in my case

Fetching //version gives wrong output. If I add in another level, the //version works again (but ofcourse this is pointless in Magento):

<version><span>test</span></version>

So it looks to me like it has nothing to do with the number of levels, but simply with the fact that if the element you're trying to match (version) is the last node without children, it is not found.

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

No branches or pull requests

1 participant