2010-10-28 14:41:03 +02:00
|
|
|
<?php
|
|
|
|
|
2011-02-14 22:31:28 +01:00
|
|
|
namespace Propel\PropelBundle;
|
2010-10-28 14:41:03 +02:00
|
|
|
|
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
2011-01-22 16:15:43 +01:00
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
2010-10-28 14:41:03 +02:00
|
|
|
|
|
|
|
class PropelBundle extends Bundle
|
|
|
|
{
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
require_once $this->container->getParameter('propel.path').'/runtime/lib/Propel.php';
|
|
|
|
|
|
|
|
if (0 === strncasecmp(PHP_SAPI, 'cli', 3)) {
|
2011-01-30 01:44:27 +01:00
|
|
|
set_include_path($this->container->getParameter('propel.phing_path').'/classes'.PATH_SEPARATOR.get_include_path());
|
2010-10-28 14:41:03 +02:00
|
|
|
}
|
2011-01-25 21:23:03 +01:00
|
|
|
|
2011-04-05 16:01:14 +02:00
|
|
|
\Propel::setConfiguration($this->container->get('propel.configuration'));
|
2011-04-05 21:21:05 +02:00
|
|
|
|
|
|
|
if ($this->container->getParameter('propel.logging')) {
|
|
|
|
\Propel::setLogger($this->container->get('propel.logger'));
|
|
|
|
}
|
|
|
|
|
2011-04-05 16:01:14 +02:00
|
|
|
\Propel::initialize();
|
2011-01-22 16:15:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getNamespace()
|
|
|
|
{
|
|
|
|
return __NAMESPACE__;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getPath()
|
|
|
|
{
|
2011-02-04 16:38:56 +01:00
|
|
|
return __DIR__;
|
2010-10-28 14:41:03 +02:00
|
|
|
}
|
|
|
|
}
|