Skip to content

Commit

Permalink
Update DoctrineCommand.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lucchese committed Apr 11, 2016
1 parent f069b13 commit bcacb83
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Command/DoctrineCommand.php
Expand Up @@ -32,8 +32,9 @@ public static function configureMigrations(ContainerInterface $container, Config
{
if (!$configuration->getMigrationsDirectory()) {
$dir = $container->getParameter('doctrine_migrations.dir_name');
if (!file_exists($dir)) {
mkdir($dir, 0777, true);
if (!@mkdir($dir, 0777, true) && !is_dir($dir)) {
$error = error_get_last();
throw new \ErrorException($error['message']);
}
$configuration->setMigrationsDirectory($dir);
} else {
Expand All @@ -45,8 +46,9 @@ public static function configureMigrations(ContainerInterface $container, Config
$dir = str_replace('%'.$pathPlaceholder.'%', $container->getParameter($pathPlaceholder), $dir);
}
}
if (!file_exists($dir)) {
mkdir($dir, 0777, true);
if (!@mkdir($dir, 0777, true) && !is_dir($dir)) {
$error = error_get_last();
throw new \ErrorException($error['message']);
}
$configuration->setMigrationsDirectory($dir);
}
Expand Down

1 comment on commit bcacb83

@Ravetracer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this patch produces an error in our project when the DoctrineMigrations directory already exists under the kernel root dir. Maybe "is_dir()" should be checked before calling mkdir().

bildschirmfoto 2016-05-09 um 17 16 23

Please sign in to comment.