Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix the way Propel is loaded. Propel cannot be instanciated as the me…
…thod only contains static properties and methods.
  • Loading branch information
rande authored and willdurand committed Apr 5, 2011
1 parent 03f97ec commit 0b9da32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/PropelExtension.php
Expand Up @@ -78,7 +78,7 @@ public function load(array $configs, ContainerBuilder $container)
protected function dbalLoad(array $configs, ContainerBuilder $container)
{
if (!$container->hasDefinition('propel')) {
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('propel.xml');
}

Expand Down
4 changes: 3 additions & 1 deletion PropelBundle.php
Expand Up @@ -15,7 +15,9 @@ public function boot()
set_include_path($this->container->getParameter('propel.phing_path').'/classes'.PATH_SEPARATOR.get_include_path());
}

$this->container->get('propel');
\Propel::setConfiguration($this->container->get('propel.configuration'));
\Propel::setLogger($this->container->get('propel.logger'));
\Propel::initialize();
}

/**
Expand Down
11 changes: 0 additions & 11 deletions Resources/config/propel.xml
Expand Up @@ -5,23 +5,12 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="propel.class">Propel</parameter>
<parameter key="propel.configuration.class">PropelConfiguration</parameter>
<parameter key="propel.logger.class">Propel\PropelBundle\Logger\PropelLogger</parameter>
<parameter key="propel.dbal.default_connection">default</parameter>
</parameters>

<services>
<service id="propel" class="%propel.class%">
<call method="setConfiguration">
<argument type="service" id="propel.configuration" />
</call>
<call method="setLogger">
<argument type="service" id="propel.logger" />
</call>
<call method="initialize" />
</service>

<service id="propel.configuration" class="%propel.configuration.class%" />

<service id="propel.logger" class="%propel.logger.class%">
Expand Down

0 comments on commit 0b9da32

Please sign in to comment.