]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Command/InstallCommand.php
Many corrections material theme
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Command / InstallCommand.php
index bba2607d05ae6c5ffd80585dbe268d2d97ffd98f..491c67f9fc99533c7e49ec7cd12cc6a7a883adea 100644 (file)
@@ -225,7 +225,7 @@ class InstallCommand extends ContainerAwareCommand
     }
 
     /**
-     * Run a command
+     * Run a command.
      *
      * @param string $command
      * @param array  $parameters Parameters to this command (usually 'force' => true)
@@ -266,9 +266,9 @@ class InstallCommand extends ContainerAwareCommand
     }
 
     /**
-     * Check if the database already exists
+     * Check if the database already exists.
      *
-     * @return boolean
+     * @return bool
      */
     private function isDatabasePresent()
     {
@@ -299,14 +299,15 @@ class InstallCommand extends ContainerAwareCommand
     }
 
     /**
-     * Check if the schema is already created
+     * Check if the schema is already created.
+     * If we found at least oen table, it means the schema exists.
      *
-     * @return boolean
+     * @return bool
      */
     private function isSchemaPresent()
     {
         $schemaManager = $this->getContainer()->get('doctrine')->getManager()->getConnection()->getSchemaManager();
 
-        return $schemaManager->tablesExist(array('entry'));
+        return count($schemaManager->listTableNames()) > 0 ? true : false;
     }
 }