propel-bundle/PropelBundle.php

53 lines
1.5 KiB
PHP
Raw Normal View History

2010-10-28 14:41:03 +02:00
<?php
2011-08-30 23:29:49 +02:00
/**
* This file is part of the PropelBundle package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/
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
2011-04-07 10:01:30 +02:00
/**
* PropelBundle
*
* @author William DURAND <william.durand1@gmail.com>
*/
2010-10-28 14:41:03 +02:00
class PropelBundle extends Bundle
{
2011-04-07 10:01:30 +02:00
/**
* {@inheritdoc}
*/
2010-10-28 14:41:03 +02:00
public function boot()
{
require_once $this->container->getParameter('propel.path').'/runtime/lib/Propel.php';
if (0 === strncasecmp(PHP_SAPI, 'cli', 3)) {
set_include_path($this->container->getParameter('kernel.root_dir').'/..'.PATH_SEPARATOR.$this->container->getParameter('propel.phing_path').'/classes'.PATH_SEPARATOR.get_include_path());
2010-10-28 14:41:03 +02:00
}
2011-04-06 18:19:13 +02:00
if (!\Propel::isInit()) {
\Propel::setConfiguration($this->container->get('propel.configuration'));
2011-04-05 21:21:05 +02:00
2011-04-06 18:19:13 +02:00
if ($this->container->getParameter('propel.logging')) {
$this
->container
->get('propel.configuration')
->setParameter('debugpdo.logging.details', array(
'time' => array('enabled' => true),
'mem' => array('enabled' => true),
));
2011-04-06 18:19:13 +02:00
\Propel::setLogger($this->container->get('propel.logger'));
}
2011-04-05 21:21:05 +02:00
2011-04-06 18:19:13 +02:00
\Propel::initialize();
}
2011-01-22 16:15:43 +01:00
}
2010-10-28 14:41:03 +02:00
}