From d6d99be87f95af30622693c4671f061b0e4bf8cd Mon Sep 17 00:00:00 2001 From: Thomas Schaaf Date: Sat, 13 Feb 2016 18:10:46 +0100 Subject: [PATCH 1/2] Fix model_paths --- Command/FixturesLoadCommand.php | 2 +- DataFixtures/AbstractDataHandler.php | 4 ++-- DependencyInjection/Configuration.php | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Command/FixturesLoadCommand.php b/Command/FixturesLoadCommand.php index 9e4ec1b..fddb934 100644 --- a/Command/FixturesLoadCommand.php +++ b/Command/FixturesLoadCommand.php @@ -168,7 +168,7 @@ EOT return -1; } - $connectionName = $input->getOption('connection'); + $connectionName = $input->getOption('connection') ?: $this->getDefaultConnection(); if ('yml' === $type) { $loader = $this->getContainer()->get('propel.loader.yaml'); diff --git a/DataFixtures/AbstractDataHandler.php b/DataFixtures/AbstractDataHandler.php index 025cb12..36697e0 100644 --- a/DataFixtures/AbstractDataHandler.php +++ b/DataFixtures/AbstractDataHandler.php @@ -146,8 +146,8 @@ abstract class AbstractDataHandler { $searchPath = array(); - if (!empty($this->datasources[$connectionName]['connection']['model_paths'])) { - $modelPaths = $this->datasources[$connectionName]['connection']['model_paths']; + if (!empty($this->datasources['database']['connections'][$connectionName]['model_paths'])) { + $modelPaths = $this->datasources['database']['connections'][$connectionName]['model_paths']; foreach ($modelPaths as $modelPath) { $searchPath[] = $this->getRootDir() . '/../' . $modelPath; } diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 88ecb22..0d89dd2 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -158,6 +158,10 @@ class Configuration extends PropelConfiguration ->booleanNode('ATTR_EMULATE_PREPARES')->defaultFalse()->end() ->end() ->end() + ->arrayNode('model_paths') + ->defaultValue(['src', 'vendor']) + ->prototype('scalar')->end() + ->end() ->arrayNode('settings') ->fixXmlConfig('query', 'queries') ->children() From c57aa6ee3134dbdd11a277b8502833d000010b1d Mon Sep 17 00:00:00 2001 From: Thomas Schaaf Date: Sat, 13 Feb 2016 18:16:31 +0100 Subject: [PATCH 2/2] Fix xml model_path --- DependencyInjection/Configuration.php | 1 + 1 file changed, 1 insertion(+) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 0d89dd2..82b4ebb 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -122,6 +122,7 @@ class Configuration extends PropelConfiguration ->useAttributeAsKey('id') ->prototype('array') ->fixXmlConfig('slave') + ->fixXmlConfig('model_path') ->children() ->scalarNode('classname')->defaultValue($this->debug ? '\Propel\Runtime\Connection\DebugPDO' : '\Propel\Runtime\Connection\ConnectionWrapper')->end() ->scalarNode('adapter')