We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3956469 + 26ef6d2 commit 5d2af1eCopy full SHA for 5d2af1e
src/Symfony/Component/Config/Util/XmlUtils.php
@@ -37,9 +37,14 @@ private function __construct()
37
* @return \DOMDocument
38
*
39
* @throws \InvalidArgumentException When loading of XML file returns error
40
+ * @throws \RuntimeException When DOM extension is missing
41
*/
42
public static function loadFile($file, $schemaOrCallable = null)
43
{
44
+ if (!extension_loaded('dom')) {
45
+ throw new \RuntimeException('Extension DOM is required.');
46
+ }
47
+
48
$content = @file_get_contents($file);
49
if ('' === trim($content)) {
50
throw new \InvalidArgumentException(sprintf('File %s does not contain valid XML, it is empty.', $file));
0 commit comments