fixed usage of LIBXML_COMPACT as it is not always available
This commit is contained in:
parent
9e438128fa
commit
17af13813a
@ -209,7 +209,7 @@ class XmlFileLoader extends FileLoader
|
||||
{
|
||||
$dom = new \DOMDocument();
|
||||
libxml_use_internal_errors(true);
|
||||
if (!$dom->load($file, LIBXML_COMPACT)) {
|
||||
if (!$dom->load($file, defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0)) {
|
||||
throw new \InvalidArgumentException(implode("\n", $this->getXmlErrors()));
|
||||
}
|
||||
$dom->validateOnParse = true;
|
||||
|
@ -152,7 +152,7 @@ class XmlFileLoader extends FileLoader
|
||||
{
|
||||
$dom = new \DOMDocument();
|
||||
libxml_use_internal_errors(true);
|
||||
if (!$dom->load($file, LIBXML_COMPACT)) {
|
||||
if (!$dom->load($file, defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0)) {
|
||||
throw new \InvalidArgumentException(implode("\n", $this->getXmlErrors()));
|
||||
}
|
||||
$dom->validateOnParse = true;
|
||||
|
@ -52,7 +52,7 @@ class XliffFileLoader implements LoaderInterface
|
||||
{
|
||||
$dom = new \DOMDocument();
|
||||
$current = libxml_use_internal_errors(true);
|
||||
if (!@$dom->load($file, LIBXML_COMPACT)) {
|
||||
if (!@$dom->load($file, defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0)) {
|
||||
throw new \RuntimeException(implode("\n", $this->getXmlErrors()));
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ class XmlFileLoader extends FileLoader
|
||||
{
|
||||
$dom = new \DOMDocument();
|
||||
libxml_use_internal_errors(true);
|
||||
if (!$dom->load($file, LIBXML_COMPACT)) {
|
||||
if (!$dom->load($file, defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0)) {
|
||||
throw new MappingException(implode("\n", $this->getXmlErrors()));
|
||||
}
|
||||
if (!$dom->schemaValidate(__DIR__.'/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd')) {
|
||||
|
Reference in New Issue
Block a user