Skip to content

Commit

Permalink
Dev: Throw exception if config.xml cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed May 6, 2021
1 parent 9a259ca commit 2e20711
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions application/models/QuestionTheme.php
Expand Up @@ -888,6 +888,9 @@ public static function convertLS3toLS4($sXMLDirectoryPath)
}

$sQuestionConfigFilePath = App()->getConfig('rootdir') . DIRECTORY_SEPARATOR . $sConfigPath;
if (!file_exists($sQuestionConfigFilePath)) {
throw new Exception('Found no config.xml file at ' . $sQuestionConfigFilePath);
}
$sQuestionConfigFile = file_get_contents($sQuestionConfigFilePath); // @see: Now that entity loader is disabled, we can't use simplexml_load_file; so we must read the file with file_get_contents and convert it as a string

if (!$sQuestionConfigFile) {
Expand Down

0 comments on commit 2e20711

Please sign in to comment.