-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.0:feat(multi-application): allow absolute path in dump files #38
base: 2.x
Are you sure you want to change the base?
Conversation
This is highly useful in multi-application setups where dump files may not be inside the project directory but in a shared fixture directory. The current alternative is to symlink each file into the project dir.
@@ -532,18 +532,24 @@ private function readSql($databaseKey = null, $databaseConfig = null): void | |||
* @return bool|null|string|string[] | |||
* @throws ModuleConfigException | |||
*/ | |||
private function readSqlFile(string $filePath): ?string | |||
private function readSqlFile(string $configPath): ?string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was it necessary to rename parameter?
if(file_exists($configPath)) { | ||
$dumpFile = $configPath; | ||
}elseif (file_exists(Configuration::projectDir().$configPath)){ | ||
$dumpFile = Configuration::projectDir().$configPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check Configuration::projectDir() . $configPath
first for better backwards compatibility.
$dumpFile = $configPath; | ||
}elseif (file_exists(Configuration::projectDir().$configPath)){ | ||
$dumpFile = Configuration::projectDir().$configPath; | ||
}else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting. Please put space after if
and before elseif
and else
keywords.
Please put spaces on both sides of concatenation operator.
); | ||
} | ||
|
||
$sql = file_get_contents(Configuration::projectDir() . $filePath); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And delete spaces in empty line.
This is highly useful in multi-application setups
where dump files may not be inside the project
directory but in a shared fixture directory.
The current alternative is to symlink each file into the project dir.