Skip to content
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

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

calvinalkan
Copy link

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.

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.
@calvinalkan calvinalkan changed the title feat: allow absolute path in dump files feat(multi-application): allow absolute path in dump files Aug 16, 2022
@calvinalkan calvinalkan changed the title feat(multi-application): allow absolute path in dump files 2.0:feat(multi-application): allow absolute path in dump files Aug 16, 2022
@@ -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
Copy link
Member

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;
Copy link
Member

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 {
Copy link
Member

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);

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants