Commit 205396d4 authored by dj3c1t's avatar dj3c1t

upgrade 1 to 2 : cleanTables

parent f3001e10
......@@ -3,6 +3,9 @@
namespace Dj3c1t\SourceMLBundle\Service;
use Symfony\Component\DependencyInjection\ContainerInterface as Container;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
use Dj3c1t\SourceMLBundle\Entity\Source;
use Dj3c1t\SourceMLBundle\Entity\DerivationSource;
......@@ -50,9 +53,8 @@ class ImportPreviousVersion {
"destination installation: "
.dirname($this->container->get('kernel')->getRootDir())
);
/*
$this->cleanTables();
$this->importUsers();
*/
$this->importLicences();
/*
$this->importAuthors();
......@@ -66,6 +68,28 @@ class ImportPreviousVersion {
}
// ----------------------------------------------------------------------
// clean
//
public function cleanTables() {
$this->log("clean new installation tables");
$application = new Application($this->container->get('kernel'));
$application->setAutoExit(false);
$resultCode = $application->run(
new ArrayInput(
array(
'command' => 'doctrine:fixtures:load',
'--no-interaction' => true,
)
),
new NullOutput()
);
if($resultCode != 0) {
throw new \Exception("Impossible de remplir la base de données");
}
}
// ----------------------------------------------------------------------
// users
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment