- WIP on cleaning of definitions files

This commit is contained in:
Dave Mc Nicoll committed 2024-06-07 00:01:43 +00:00
1 parent 63fde92b68
commit d9f9c053c3
8 files changed
+55 -29

No files matched your search

+8 -12
View File
@@ -37,8 +37,6 @@ class Kernel {
public string $projectPath;
public string $routeDefinitionList = 'routes.list';
public function __construct(string $projectPath)
{
$this->projectPath = $projectPath;
@@ -141,16 +139,15 @@ class Kernel {
protected function serviceContainer() : self
{
$this->container->has(AdapterProxy::class) and $this->container->get(AdapterProxy::class);
$this->container->has('ulmus.caching') and ( Ulmus::$cache = $this->container->get('ulmus.caching') );
$this->container->has(Lean::class) and $this->container->get(Lean::class);
if ($this->container->has(I18n::class)) {
$i18n = $this->container->get(I18n::class);
$i18n->locale($this->locale);
$i18n->initialize(!getenv("DEBUG"));
if ($this->container->has('lean.autoload')) {
foreach($this->container->get('lean.autoload') as $class) {
$this->container->get($class);
}
}
# Must be removed from KERNEL !
$this->container->has('ulmus.caching') and ( Ulmus::$cache = $this->container->get('ulmus.caching') );
return $this;
}
@@ -158,8 +155,7 @@ class Kernel {
{
ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES);
// Router
$routeFactory = $this->container->get($this->routeDefinitionList);
$routeFactory = $this->container->get(Routing\RouteDefinitionInterface::class);
$router = $routeFactory($this->container);
+5
View File
@@ -0,0 +1,5 @@
<?php
namespace Lean\Routing;
interface RouteDefinitionInterface {}