In the code of the online store there is a fragment:
if (!file_exists($xml_file) || !$xml = @simplexml_load_file($xml_file)) { $this->errors[] = "cannot load"; return false; } if (!$xml['version'] || !$xml['name']) { $this->errors[] = "version and name required"; return false; } Example of XML being processed:
<?xml version="1.0" encoding="UTF-8" ?> <theme> <version value="1.4"> <ccc available="true" /> <guest_checkout available="true" /> <one_page_checkout available="true" /> <store_locator available="true" /> </version> <name value="Sound Theme" /> </theme> The problem is that the condition (!$xml['version'] || !$xml['name']) returns false, despite the fact that there are version and name elements in xml. I tried to contact them in the style of $xml->{'version'} - everything works. It can not be that in such a large product incorrectly written code to work with XML. Maybe access to elements through the syntax [] works with a certain version of PHP? I have version 5.3.13. I ask you to suggest what the problem may be and how to fix it without changing the source code of the online store.
$xml['version']is working with an array, and your$xmlis an object . Do you understand the difference between them? - u_mulder