- Fixed Skeleton and ORM missing namespacing

This commit is contained in:
Dave M. 2024-10-17 17:21:56 +00:00
parent 708af80fa2
commit 0581f378a5
4 changed files with 38 additions and 54 deletions

View File

@ -2,6 +2,10 @@
use Ulmus\Container\AdapterProxy;
use Psr\Container\ContainerInterface;
use Ulmus\ConnectionAdapter;
use function DI\autowire, DI\create, DI\get, DI\add;
return [

View File

@ -6,58 +6,41 @@ use function DI\autowire, DI\create, DI\get;
$dir = getenv("META_PATH") . "/definitions";
return array_merge(
Lean\Lean::autoloadDefinitionsFromComposerExtra(),
[
'%APPKEY%' => [
'picea' => [
'context' => "%ESCAPED_NAMESPACE%\\View",
'asset' => [],
'extensions' => [],
],
'ulmus' => [
'entities' => [ '%ESCAPED_NAMESPACE%\\Entity' => getenv("PROJECT_PATH") . '/src/Entity/' ],
],
'routes' => [
'%ESCAPED_NAMESPACE%\\Controller' => getenv("PROJECT_PATH") . '/src/Controller/',
],
'events' => [
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ getenv("PROJECT_PATH"), 'src', 'Controller', '' ]),
],
'cronard' => [
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ getenv("PROJECT_PATH"), 'src', 'Controller', '' ]),
],
'cli' => [
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ getenv("PROJECT_PATH"), 'src', 'Controller', '' ]),
],
'taxus' => [
[ new Privilege("dev", "Is a developper of this application."), "is_dev" ],
[ new Privilege("admin", "Can manage mostly everything from this application."), "is_admin" ],
[ new Privilege("user", "Is an authenticated user."), "is_user" ],
[ new Privilege("anonymous", "Is an anonymous (unauthenticated) user."), "is_anonymous" ],
]
return [
'%APPKEY%' => [
'picea' => [
'context' => "%ESCAPED_NAMESPACE%\\View",
'asset' => [],
'extensions' => [],
],
'app.middlewares' => [],
'ulmus' => [
'entities' => [ '%ESCAPED_NAMESPACE%\\Entity' => getenv("PROJECT_PATH") . '/src/Entity/' ],
],
'routes' => [
'%ESCAPED_NAMESPACE%\\Controller' => getenv("PROJECT_PATH") . '/src/Controller/',
],
'events' => [
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ getenv("PROJECT_PATH"), 'src', 'Controller', '' ]),
],
'cronard' => [
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ getenv("PROJECT_PATH"), 'src', 'Controller', '' ]),
],
'cli' => [
'%ESCAPED_NAMESPACE%\\Controller' => implode(DIRECTORY_SEPARATOR, [ getenv("PROJECT_PATH"), 'src', 'Controller', '' ]),
],
'taxus' => [
[ new Privilege("dev", "Is a developper of this application."), "is_dev" ],
[ new Privilege("admin", "Can manage mostly everything from this application."), "is_admin" ],
[ new Privilege("user", "Is an authenticated user."), "is_user" ],
[ new Privilege("anonymous", "Is an anonymous (unauthenticated) user."), "is_anonymous" ],
]
],
require("$dir/auth.php"),
require("$dir/storage.php"),
require("$dir/security.php"),
require("$dir/env/" . getenv('APP_ENV') . ".php"),
[
'config' => function () {
return array_merge_recursive(
Lean\Lean::autoloadConfigFromComposerExtra(),
require(getenv("META_PATH")."/config.php")
);
}
]
);
'app.middlewares' => [],
];

View File

@ -19,7 +19,6 @@ return [
AdapterProxy::class => function (ContainerInterface $c) {
return new AdapterProxy(
$c->get('lean:adapter.sqlite'),
$c->get(ConnectionAdapter::class)
);
},

View File

@ -23,8 +23,6 @@ new class(dirname(__DIR__)) extends \Lean\Kernel {
{
$this->errorLogPath = getenv("LOGS_PATH") . DIRECTORY_SEPARATOR. date("Y-m").".log";
$this->definitionFilePaths = Lean::getDefinitionsPathsFromComposer();
return parent::initializeEngine();
}