Newscoop\Service\Implementation\ThemeServiceLocalFileSystem::loadXML PHP Method

loadXML() protected method

Loads the XML content into SimpleXMLElement.
protected loadXML ( string $path ) : SimpleXMLElement
$path string The path to the XML file, *(not null not empty).
return SimpleXMLElement The XML element, NULL if the XML is not valid.
    protected function loadXML($path)
    {
        if (!isset($this->cacheXMLEmelemt[$path])) {
            try {
                $xml = simplexml_load_file($path);
            } catch (\Exception $e) {
                $xml = FALSE;
            }
            if ($xml === FALSE) {
                $this->getErrorHandler()->error(ThemeErrors::XML_INVALID, $path);
                return NULL;
            }
            $this->cacheXMLEmelemt[$path] = $xml;
        } else {
            $xml = $this->cacheXMLEmelemt[$path];
        }
        return $xml;
    }