59 lines
1.8 KiB
PHP
59 lines
1.8 KiB
PHP
<?php
|
|
|
|
use Ulmus\ConnectionAdapter;
|
|
|
|
putenv('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
|
|
],
|
|
],
|
|
],
|
|
|
|
'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;
|
|
},
|
|
|
|
Lean\ApplicationStrategy\NotFoundDecoratorInterface::class => DI\autowire(Lean\Api\ApplicationStrategy\NotFoundDecorator::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),
|
|
]; |