Merge branch 'propel' of ssh://gitmraynaud:10022/thelia into propel

This commit is contained in:
Manuel Raynaud
2013-01-30 17:30:25 +01:00
4 changed files with 14 additions and 35 deletions

View File

@@ -1,9 +1,5 @@
<?php <?php
if (!isset($env)) {
$env = 'prod';
}
/** /**
* *
* @file * @file
@@ -16,8 +12,7 @@ $loader = require __DIR__ . '/autoload.php';
if(file_exists(THELIA_ROOT . '/local/config/config_db.php')) if (file_exists(THELIA_ROOT . '/local/config/config_db.php')) {
{
require THELIA_ROOT . '/local/config/config_db.php'; require THELIA_ROOT . '/local/config/config_db.php';
} else { } else {
define('THELIA_INSTALL_MODE',true); define('THELIA_INSTALL_MODE',true);

View File

@@ -51,6 +51,9 @@ class Thelia extends Kernel
protected function initPropel() protected function initPropel()
{ {
if (file_exists(THELIA_ROOT . '/local/config/config_db.php') === false) {
return ;
}
Propel::init(THELIA_CONF_DIR . "/config_thelia.php"); Propel::init(THELIA_CONF_DIR . "/config_thelia.php");
if ($this->isDebug()) { if ($this->isDebug()) {
@@ -64,35 +67,16 @@ class Thelia extends Kernel
$con->useDebug(true); $con->useDebug(true);
} }
} }
/** /**
* Initializes the service container.
* *
* @TODO cache container initialization * Load some configuration
* Initialize all plugins
* *
* The cached version of the service container is used when fresh, otherwise the
* container is built.
*/ */
// protected function initializeContainer() public function loadConfiguration(){
// {
// $class = $this->getContainerClass(); }
// $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);
// $fresh = true;
// if (!$cache->isFresh()) {
// $container = $this->buildContainer();
// $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
//
// $fresh = false;
// }
//
// require_once $cache;
//
// $this->container = new $class();
//
// if (!$fresh && $this->container->has('cache_warmer')) {
// $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
// }
//
// }
/** /**
* Gets the cache directory. * Gets the cache directory.

View File

@@ -10,7 +10,7 @@ require __DIR__ . '/../core/bootstrap.php';
$request = Request::createFromGlobals(); $request = Request::createFromGlobals();
$thelia = new Thelia($env, false); $thelia = new Thelia("prod", false);
$response = $thelia->handle($request)->prepare($request)->send(); $response = $thelia->handle($request)->prepare($request)->send();

View File

@@ -19,7 +19,7 @@ if ( false === in_array($request->getClientIp(), $trustIp)) {
//change request to send to a 404 error page //change request to send to a 404 error page
} }
$thelia = new Thelia($env, true); $thelia = new Thelia("dev", true);
$response = $thelia->handle($request)->prepare($request)->send(); $response = $thelia->handle($request)->prepare($request)->send();