Skip to content

Commit fce0e7a

Browse files
committed
Merge pull request #159 from lucchese/patch-1
Update DoctrineCommand.php
2 parents f069b13 + bcacb83 commit fce0e7a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Command/DoctrineCommand.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public static function configureMigrations(ContainerInterface $container, Config
3232
{
3333
if (!$configuration->getMigrationsDirectory()) {
3434
$dir = $container->getParameter('doctrine_migrations.dir_name');
35-
if (!file_exists($dir)) {
36-
mkdir($dir, 0777, true);
35+
if (!@mkdir($dir, 0777, true) && !is_dir($dir)) {
36+
$error = error_get_last();
37+
throw new \ErrorException($error['message']);
3738
}
3839
$configuration->setMigrationsDirectory($dir);
3940
} else {
@@ -45,8 +46,9 @@ public static function configureMigrations(ContainerInterface $container, Config
4546
$dir = str_replace('%'.$pathPlaceholder.'%', $container->getParameter($pathPlaceholder), $dir);
4647
}
4748
}
48-
if (!file_exists($dir)) {
49-
mkdir($dir, 0777, true);
49+
if (!@mkdir($dir, 0777, true) && !is_dir($dir)) {
50+
$error = error_get_last();
51+
throw new \ErrorException($error['message']);
5052
}
5153
$configuration->setMigrationsDirectory($dir);
5254
}

0 commit comments

Comments
 (0)