From bca3140e98c45e1624b6e40bdff8886d02758ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Gomez?= Date: Thu, 31 Oct 2013 20:23:48 +0000 Subject: [PATCH] Removed useless buildtime-conf file generation --- Command/AbstractCommand.php | 56 +------------------------------------ 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/Command/AbstractCommand.php b/Command/AbstractCommand.php index 0f769ba..7dd10d8 100644 --- a/Command/AbstractCommand.php +++ b/Command/AbstractCommand.php @@ -75,9 +75,6 @@ abstract class AbstractCommand extends ContainerAwareCommand // build.properties $this->createBuildPropertiesFile($kernel, $this->cacheDir.'/build.properties'); - - // buildtime-conf.xml - $this->createBuildTimeFile($this->cacheDir.'/buildtime-conf.xml'); } protected function getConnections(array $connections) @@ -112,61 +109,10 @@ abstract class AbstractCommand extends ContainerAwareCommand $fs = new Filesystem(); $buildPropertiesFile = $kernel->getRootDir().'/config/propel.ini'; - if ($fs->exists($file)) { + if ($fs->exists($buildPropertiesFile)) { $fs->copy($buildPropertiesFile, $file); } else { $fs->touch($file); } } - - /** - * Create an XML file which represents propel.configuration - * - * @param string $file Should be 'buildtime-conf.xml'. - */ - protected function createBuildTimeFile($file) - { - if (!$this->getContainer()->hasParameter('propel.configuration')) { - throw new \InvalidArgumentException('Could not find Propel configuration.'); - } - - $xml = strtr(<< - - - - -EOT - , array('%default_connection%' => $this->getContainer()->getParameter('propel.dbal.default_connection'))); - - $datasources = $this->getContainer()->getParameter('propel.configuration'); - foreach ($datasources as $name => $datasource) { - $xml .= strtr(<< -%adapter% - -%dsn% -%username% -%password% - - - -EOT - , array( - '%name%' => $name, - '%adapter%' => $datasource['adapter'], - '%dsn%' => $datasource['connection']['dsn'], - '%username%' => $datasource['connection']['user'], - '%password%' => isset($datasource['connection']['password']) ? $datasource['connection']['password'] : '', - )); - } - - $xml .= << - - -EOT; - - file_put_contents($file, $xml); - } }