예제 #1
0
 public function getConnection()
 {
     if (!preg_match('/^\\//', $this->dataDir)) {
         // resolve relative path to data dir
         $this->dataDir = Application::resolveRelativePath($this->dataDir);
     }
     return array('driver' => 'pdo_sqlite', 'path' => sprintf('%s/%s', $this->dataDir, $this->filename));
 }
예제 #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('');
     $output->write("Creating Portunus DB ... ");
     Application::createDb($this->getContainer());
     $output->writeln('<info>DONE</info>');
     $output->writeln('');
 }
예제 #3
0
 public function setUp()
 {
     if ($this->freshDb) {
         return;
     }
     $this->getContainer()->setParameter('doctrine.db.filename', 'portunus_test.sqlite');
     $dataDir = $this->getContainer()->getParameter('doctrine.db.data_dir');
     $dbFile = $this->getContainer()->getParameter('doctrine.db.filename');
     $dataDir = Application::resolveRelativePath($dataDir);
     $dbFile = sprintf('%s/%s', $dataDir, $dbFile);
     if (file_exists($dbFile)) {
         unlink($dbFile);
     }
     $this->getContainer()->get('portunus.application')->createDb($this->getContainer());
     $this->freshDb = true;
 }
예제 #4
0
파일: Composer.php 프로젝트: garyr/portunus
 /**
  * Post install event handler
  *
  * @param Event $event
  * @throws \Exception
  */
 public static function postInstall(Event $event)
 {
     self::writeConfigXml($event);
     Application::createDb();
 }