use sqlite database for install process

This commit is contained in:
Manuel Raynaud
2013-09-16 20:42:18 +02:00
parent 63472b9f80
commit eeb9a0f9eb
2 changed files with 24 additions and 15 deletions

View File

@@ -69,10 +69,16 @@ class Thelia extends Kernel
protected function initPropel()
{
if (file_exists(THELIA_ROOT . '/local/config/database.yml') === false) {
return ;
}
if (defined('THELIA_INSTALL_MODE') === true) {
$serviceContainer = Propel::getServiceContainer();
$serviceContainer->setAdapterClass('thelia', 'sqlite');
$manager = new ConnectionManagerSingle();
$manager->setConfiguration(array(
"classname" => "\Propel\Runtime\Connection\PropelPDO",
"dsn" => "sqlite:".THELIA_ROOT . "/install/thelia.sqlite"
));
$serviceContainer->setConnectionManager('thelia', $manager);
} else {
$definePropel = new DefinePropel(new DatabaseConfiguration(),
Yaml::parse(THELIA_ROOT . '/local/config/database.yml'));
$serviceContainer = Propel::getServiceContainer();
@@ -88,6 +94,9 @@ class Thelia extends Kernel
}
}
}
/**
* dispatch an event when application is boot
*/

BIN
install/thelia.sqlite Normal file

Binary file not shown.