début d'écriture de la classe principale Thelia

Elle hérite de Symfony\Component\HttpKernel\Kernel (/!\ aux interfaces)
mise en place d'un conteneur d'injection de dépendance à
modifier/compléter (voir comment gérer le chargement)
This commit is contained in:
Manuel Raynaud
2012-10-05 17:44:35 +02:00
parent 56446d0aa3
commit 47ccf66db5
5 changed files with 94 additions and 12 deletions

View File

@@ -17,5 +17,7 @@ use Symfony\Component\DependencyInjection\Reference;
$loader = require __DIR__ . '/autoload.php';
define('THELIA_ROOT', __DIR__ .'/../');
?>

View File

@@ -2,11 +2,69 @@
namespace Thelia\Core;
/**
* Root class of Thelia
*
*
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class Thelia extends Kernel{
class Thelia extends Kernel {
const version = '0.0.1';
protected function initializeContainer(){
if(false === $container = require THELIA_ROOT . '/local/config/container.php'){
/**
* @todo redirect to installation process
*
*/
}
$this->container = $container;
$this->container->set('kernel', $this);
}
/**
*
* @return \Symfony\Component\DependencyInjection\ContainerBuilder
*/
public function getContainer(){
return $this->container;
}
/**
* return available bundle
*
* Part of Symfony\Component\HttpKernel\KernelInterface
*
*/
public function registerBundles() {
}
/**
* Loads the container configuration
*
* part of Symfony\Component\HttpKernel\KernelInterface
*
* @param LoaderInterface $loader A LoaderInterface instance
*
* @api
*/
public function registerContainerConfiguration(LoaderInterface $loader){
}
}