diff --git a/skeleton/meta/config.php b/skeleton/meta/config.php index 99fbb40..2e40b90 100644 --- a/skeleton/meta/config.php +++ b/skeleton/meta/config.php @@ -30,6 +30,12 @@ return [ 'charset' => getenv("DATABASE_CHARSET"), ], ], + + #'sqlite' => [ + # 'adapter' => getenv("SQLITE_ADAPTER"), + # 'path' => getenv('PROJECT_PATH') . DIRECTORY_SEPARATOR . getenv("SQLITE_PATH"), + # 'pragma' => explode(',', getenv("SQLITE_PRAGMA")), + #], ] ] ]; diff --git a/skeleton/meta/definitions/auth.php b/skeleton/meta/definitions/auth.php index 9405214..7e37832 100644 --- a/skeleton/meta/definitions/auth.php +++ b/skeleton/meta/definitions/auth.php @@ -63,6 +63,4 @@ return [ return $email; }, - - PermissionGrantInterface::class => create(%NAMESPACE%\PrivilegeGrantAccess::class)->constructor(get(ServerRequestInterface::class), get(Session::class)), ]; diff --git a/skeleton/meta/definitions/security.php b/skeleton/meta/definitions/security.php index 1cc4c09..892ac27 100644 --- a/skeleton/meta/definitions/security.php +++ b/skeleton/meta/definitions/security.php @@ -18,5 +18,5 @@ return [ ); }, - PermissionGrantInterface::class => create(DefaultPermissionGrant::class)->constructor(get(ServerRequestInterface::class), get(Session::class)), + PermissionGrantInterface::class => create(%NAMESPACE%\PrivilegeGrantAccess::class)->constructor(get(ServerRequestInterface::class), get(Session::class)), ]; diff --git a/skeleton/meta/definitions/storage.php b/skeleton/meta/definitions/storage.php index 4fefaf2..8b485dc 100644 --- a/skeleton/meta/definitions/storage.php +++ b/skeleton/meta/definitions/storage.php @@ -14,8 +14,6 @@ return [ $adapter = new ConnectionAdapter('default', $c->get('config')['ulmus'], true); $adapter->resolveConfiguration(); - $adapter->connect(); - return $adapter; }, diff --git a/skeleton/src/Controller/Home.php b/skeleton/src/Controller/Home.php index 73f6fbf..33d575f 100644 --- a/skeleton/src/Controller/Home.php +++ b/skeleton/src/Controller/Home.php @@ -4,11 +4,12 @@ namespace %NAMESPACE%\Controller; use Psr\Http\Message\{ServerRequestInterface, ResponseInterface }; +use Notes\Route\Attribute\Method\Route; + use %NAMESPACE%\{ Lib, Entity, Form, }; use function %NAMESPACE%\View\{ _, lang, url, route, form }; -#[Language("%APPKEY%.home")] class Home { use Lib\ControllerTrait; diff --git a/skeleton/src/Entity/User.php b/skeleton/src/Entity/User.php index 1ef3fb6..dac9dc5 100644 --- a/skeleton/src/Entity/User.php +++ b/skeleton/src/Entity/User.php @@ -3,7 +3,7 @@ namespace %NAMESPACE%\Entity; use Ulmus\Entity\Field\Datetime; -use Ulmus\{Attribute\Obj\Table; +use Ulmus\{Attribute\Obj\Table}; use %NAMESPACE%\Lib; diff --git a/skeleton/src/Lib/ControllerTrait.php b/skeleton/src/Lib/ControllerTrait.php index 21e6d1f..5fd2679 100644 --- a/skeleton/src/Lib/ControllerTrait.php +++ b/skeleton/src/Lib/ControllerTrait.php @@ -8,7 +8,8 @@ use Ulmus\User\Entity\User; use Ulmus\User\Lib\Authenticate; use Notes\Route\Attribute\Object\Route; use Notes\Security\Attribute\Security; -use %NAMESPACE%\Entity; + +use %NAMESPACE%\{ Entity, Lib, Form }; use Mcnd\Event\EventManager; diff --git a/skeleton/src/Middleware/Authentication.php b/skeleton/src/Middleware/Authentication.php index c939356..c4cc124 100644 --- a/skeleton/src/Middleware/Authentication.php +++ b/skeleton/src/Middleware/Authentication.php @@ -2,11 +2,8 @@ namespace %NAMESPACE%\Middleware; -use Psr\Http\Server\MiddlewareInterface; -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Server\RequestHandlerInterface; -use Psr\Http\Message\ResponseInterface; - +use Psr\Http\Server\{ RequestHandlerInterface, MiddlewareInterface }; +use Psr\Http\Message\{ ResponseInterface, ServerRequestInterface }; use Storage\Session; class Authentication implements MiddlewareInterface { @@ -23,9 +20,6 @@ class Authentication implements MiddlewareInterface { $this->session = $session; } - #[param ServerRequestInterface $request] - #[param RequestHandlerInterface $handler] - #[return ResponseInterface] public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface { $user = $this->session->get( $this->sessionUserVariable() ); @@ -37,8 +31,6 @@ class Authentication implements MiddlewareInterface { return $handler->handle($request); } - #[param string|null sessionUserVariable] - #[return mixed] public function sessionUserVariable(?string $set = null) : string { return $set !== null ? $this->sessionUserVariable = $set : $this->sessionUserVariable; diff --git a/skeleton/view/base/layout/default.phtml b/skeleton/view/base/layout/default.phtml index ebfa87e..b0f654e 100644 --- a/skeleton/view/base/layout/default.phtml +++ b/skeleton/view/base/layout/default.phtml @@ -5,7 +5,6 @@ {% section "head.title" %}{{ title() }} — {{ lang('application_name') }}{% endsection %} - {% endsection %} diff --git a/skeleton/view/home.phtml b/skeleton/view/home.phtml index 1d7e5c9..e2a7c93 100644 --- a/skeleton/view/home.phtml +++ b/skeleton/view/home.phtml @@ -6,4 +6,8 @@
Hello World :) !
+ +
+ Accéder à la console LEAN +
{% endsection %} \ No newline at end of file