- Lean's API WIP on forms and ApiRenderer
This commit is contained in:
1 parent
3ce356e1f2
commit
4d7053a9cb
30 files changed
+1003
-56
No files matched your search
+20
-1
@@ -1,9 +1,28 @@
|
||||
<?php
|
||||
|
||||
$path = dirname(__DIR__, 1);
|
||||
|
||||
return [
|
||||
'lean' => [
|
||||
'autoload' => [
|
||||
'lean.api',
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
'ulmus' => [
|
||||
'connections' => [
|
||||
'lean.api' => [
|
||||
'adapter' => getenv("LEAN_API_ADAPTER") ?: "SQLite",
|
||||
'path' => getenv('PROJECT_PATH') . DIRECTORY_SEPARATOR . ( getenv("LEAN_API_PATH") ?: "var/lean-api.sqlite3" ),
|
||||
'pragma_begin' => array_merge(
|
||||
explode(',', getenv("LEAN_API_PRAGMA_BEGIN") ?: "foreign_keys=ON,synchronous=NORMAL"),
|
||||
explode(',', getenv('DEBUG') ? getenv("LEAN_API_PRAGMA_DEBUG_BEGIN") : "journal_mode=WAL")
|
||||
),
|
||||
'pragma_close' => array_merge(
|
||||
explode(',', getenv("LEAN_API_PRAGMA_CLOSE") ?: "analysis_limit=500,optimize"),
|
||||
explode(',', getenv('DEBUG') ? getenv("LEAN_API_PRAGMA_DEBUG_CLOSE") : "")
|
||||
),
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
$path = dirname(__DIR__, 2);
|
||||
use Ulmus\ConnectionAdapter;
|
||||
|
||||
putenv('LEAN_API_PROJECT_PATH=' . $path = dirname(__DIR__, 2));
|
||||
|
||||
return [
|
||||
'lean.api' => [
|
||||
@@ -22,6 +24,13 @@ return [
|
||||
],
|
||||
],
|
||||
|
||||
'ulmus' => [
|
||||
'entities' => [ 'Lean\\Api\\Entity' => implode(DIRECTORY_SEPARATOR, [ $path, 'src', 'Entity', '' ]) ],
|
||||
'adapters' => [
|
||||
DI\get('lean.api:storage'),
|
||||
]
|
||||
],
|
||||
|
||||
'tell' => [
|
||||
'json' => [
|
||||
[
|
||||
@@ -31,10 +40,19 @@ return [
|
||||
]
|
||||
],
|
||||
|
||||
/*'routes' => [
|
||||
'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\Api\Factory\MessageFactoryInterface::class => DI\autowire(\Lean\Api\Lib\Message::class),
|
||||
\League\Route\Strategy\ApplicationStrategy::class => DI\autowire(\Lean\Api\ApplicationStrategy::class),
|
||||
\Lean\Api\Factory\DebugFormFactoryInterface::class => DI\autowire(\Lean\Api\Factory\DebugFormFactory::class),
|
||||
];
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
use Ulmus\ConnectionAdapter,
|
||||
Ulmus\Container\AdapterProxy;
|
||||
|
||||
use Storage\Session;
|
||||
|
||||
use function DI\autowire, DI\create, DI\get;
|
||||
|
||||
return [
|
||||
'lean.api:storage' => function($c) {
|
||||
$adapter = new ConnectionAdapter('lean.api', $c->get('config')['ulmus'], false);
|
||||
$adapter->resolveConfiguration();
|
||||
|
||||
return $adapter;
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,21 @@
|
||||
# LEAN API
|
||||
|
||||
## Debug tooling to help development within Lean's API
|
||||
|
||||
[Documentation](../) / Debug API queries
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
### Routes
|
||||
|
||||
{route:descriptor}
|
||||
|
||||
{request:debugger}
|
||||
|
||||
### Forms / actions
|
||||
|
||||
{form:descriptor}
|
||||
|
||||
### Entities
|
||||
|
||||
{entity:descriptor}
|
||||
@@ -0,0 +1,21 @@
|
||||
# LEAN API
|
||||
|
||||
## Debug tooling to help development within Lean's API
|
||||
|
||||
[Lean API](../../debug) / Debug API queries
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
### Routes
|
||||
|
||||
{route:descriptor}
|
||||
|
||||
{request:debugger}
|
||||
|
||||
### Forms / actions
|
||||
|
||||
{form:descriptor}
|
||||
|
||||
### Entities
|
||||
|
||||
{entity:descriptor}
|
||||
@@ -0,0 +1,7 @@
|
||||
# Lean API
|
||||
|
||||
## Lean's API internal debug API
|
||||
|
||||
### Routes disponibles
|
||||
|
||||
- [Debug / Errors](./debug/errors/documentation)
|
||||
@@ -12,11 +12,11 @@
|
||||
},
|
||||
"form": {
|
||||
"error": {
|
||||
"entity": "Une propriété $entity est nécessaire dans ce form"
|
||||
"entity": "Une propriété $entity est nécessaire pour envoyer ce formulaire."
|
||||
},
|
||||
"save": {
|
||||
"error": {
|
||||
"save": "Une erreur est survenue en tenant de sauvegarder les données",
|
||||
"entity": "Une erreur est survenue en tenant de sauvegarder les données pour l'entité {$entity}.",
|
||||
"pdo": "Une erreur est survenue : '{$error}'"
|
||||
},
|
||||
"success": {
|
||||
|
||||
Reference in new issue
Block a user