* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShop\PrestaShop\Core\Localization\Pack\Loader; use ErrorException; use SimpleXMLElement; /** * Class AbstractLocalizationPackLoader is abstract localization pack loader that implements XML loading from file. */ abstract class AbstractLocalizationPackLoader implements LocalizationPackLoaderInterface { /** * Loads XML from local or remote file. * * @param string $file * * @return SimpleXMLElement|null */ protected function loadXml($file) { try { $xml = simplexml_load_file($file); } catch (ErrorException $e) { return null; } return false === $xml ? null : $xml; } }