Skip to content

Commit 4221914

Browse files
committed
Fixed sql file missing exception message to make it translatable
1 parent 1aa6f1e commit 4221914

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

system/core/startup.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function autoload($class) {
150150
//convert camelCase to snake_case
151151
$sqlFile = strtolower(preg_replace('/(?<!^)(?<!\/)(?<!\\\)[A-Z]/', '-$0', $sqlFile));
152152
$file = basename($sqlFile);
153-
$pluginName = str_replace([DS . 'plugins' . DS, $file], '', $sqlFile);
153+
$pluginName = str_replace([DS . 'plugins' . DS, DS . $file], '', $sqlFile) . DS;
154154
$pluginName = strtolower(preg_replace('/(?<!^)(?<!\/)(?<!\\\)[A-Z]/', '-$0', $pluginName));
155155
$sqlFile = DIR_PLUGINS . $pluginName . 'sql' . DS . DB_ENGINE . DS . $file . '.sql';
156156
} else {
@@ -173,7 +173,7 @@ function autoload($class) {
173173

174174
if (SQL_CHECK || ! $fileExists) {
175175
if (! file_exists($sqlFile)) {
176-
throw new \Exception("SQL file $sqlFile does not exist for $relativeClass!");
176+
throw new \Exception(sprintf(\Vvveb\__('SQL file %s does not exist for %s!'), $sqlFile, $relativeClass));
177177
}
178178
//if the file has not been generated yet or sql files is changed recompile
179179
if (! $fileExists || ((filemtime($sqlFile) > filemtime($file)))) {

0 commit comments

Comments
 (0)