diff --git a/Command/AbstractPropelCommand.php b/Command/AbstractPropelCommand.php index 18d3e6c..9c4f8b2 100644 --- a/Command/AbstractPropelCommand.php +++ b/Command/AbstractPropelCommand.php @@ -362,8 +362,17 @@ EOT; continue; } - $pos = strpos($line, '='); - $properties[trim(substr($line, 0, $pos))] = trim(substr($line, $pos + 1)); + $pos = strpos($line, '='); + $property = trim(substr($line, 0, $pos)); + $value = trim(substr($line, $pos + 1)); + + if ("true" === $value) { + $value = true; + } else if ("false" === $value) { + $value = false; + } + + $properties[$property] = $value; } return $properties; diff --git a/Command/PropelGeneratorAwareCommand.php b/Command/PropelGeneratorAwareCommand.php index d16cad6..9f0c6a1 100644 --- a/Command/PropelGeneratorAwareCommand.php +++ b/Command/PropelGeneratorAwareCommand.php @@ -42,7 +42,25 @@ abstract class PropelGeneratorAwareCommand extends AbstractPropelCommand protected function getDatabasesFromSchema(\SplFileInfo $file) { $transformer = new \XmlToAppData(null, null, 'UTF-8'); - $transformer->setGeneratorConfig(new \QuickGeneratorConfig()); + $config = new \QuickGeneratorConfig(); + + if (file_exists($propelIni = $this->getContainer()->getParameter('kernel.root_dir') . '/config/propel.ini')) { + foreach ($this->getProperties($propelIni) as $key => $value) { + if (0 === strpos($key, 'propel.')) { + $newKey = substr($key, strlen('propel.')); + + $j = strpos($newKey, '.'); + while (false !== $j) { + $newKey = substr($newKey, 0, $j) . ucfirst(substr($newKey, $j + 1)); + $j = strpos($newKey, '.'); + } + + $config->setBuildProperty($newKey, $value); + } + } + } + + $transformer->setGeneratorConfig($config); return $transformer->parseFile($file->getPathName())->getDatabases(); }