lean-api/meta/definitions/software.php
Dave M 9b360c4010 - Added a new ArrayCollection
- Changed Action attribute and transformed it into an abstract class
2026-07-14 14:44:30 +00:00

71 lines
2.4 KiB
PHP

<?php
use Ulmus\ConnectionAdapter;
use function DI\{ get, env };
define('LEAN_API_PROJECT_PATH', $path = dirname(__DIR__, 2));
return [
'lean.api' => [
'picea' => [
'context' => Lean\Api\View::class,
'view' => [
[
'path' => implode(DIRECTORY_SEPARATOR, [ $path , "view", '' ]),
'order' => 99,
],
],
'asset' => [
[
'path' => implode(DIRECTORY_SEPARATOR, [ $path, "asset", '' ]),
'order' => 10
],
],
],
'cli' => [
'Lean\\Api\\Cli' => implode(DIRECTORY_SEPARATOR, [ $path, "src", "Cli", "" ]),
],
'ulmus' => [
'entities' => [ 'Lean\\Api\\Entity' => implode(DIRECTORY_SEPARATOR, [ $path, 'src', 'Entity', '' ]) ],
'adapters' => [
DI\get('lean.api:storage'),
]
],
'tell' => [
'json' => [
[
'path' => implode(DIRECTORY_SEPARATOR, [ $path, "meta", "i18n", "" ]),
'order' => 99,
],
]
],
'routes' => [
'Lean\\Api\\Controller' => implode(DIRECTORY_SEPARATOR, [ $path, "src", "Controller", "" ]),
],
],
'lean.api:storage' => function($c) {
$adapter = new ConnectionAdapter('lean.api', $c->get('config')['ulmus'], false);
$adapter->resolveConfiguration();
return $adapter;
},
'app.middlewares' => \DI\add([
Lean\Api\Middleware\CORS::class,
]),
Lean\Api\Lib\RenderCORS::class => DI\create(Lean\Api\Lib\RenderCORS::class)->constructor(get(\Psr\Http\Message\ServerRequestInterface::class), env('LEAN_API_CORS_ORIGIN', '*')),
Lean\ApplicationStrategy\NotFoundDecoratorInterface::class => DI\autowire(Lean\Api\ApplicationStrategy\NotFoundDecorator::class),
Lean\ApplicationStrategy\MethodNotAllowedInterface::class => DI\autowire(Lean\Api\ApplicationStrategy\MethodNotAllowedDecorator::class),
Lean\Api\Factory\MessageFactoryInterface::class => DI\autowire(Lean\Api\Lib\Message::class),
Lean\Api\Factory\DebugFormFactoryInterface::class => DI\autowire(Lean\Api\Factory\DebugFormFactory::class),
# League\Route\Strategy\ApplicationStrategy::class => DI\autowire(Lean\Api\ApplicationStrategy::class),
];