- Work done on the kinda-micro-framework to allow smoother deployment

This commit is contained in:
mcndave committed 2022-11-29 19:53:41 +00:00
1 parent f719246624
commit aba9a65a3c
14 files changed
+357 -12

No files matched your search

+7 -6
View File
@@ -8,23 +8,24 @@ return [
Tell\I18n::class => create( Tell\I18n::class ) ->constructor(
get(Tell\Reader\JsonReader::class),
get(Tell\Reader\PhpReader::class),
getenv("DEBUG") ? create(Tell\PrintMissingKey::class) : get('tell.fallback')
get('tell.fallback') /* getenv("DEBUG") ? create(Tell\PrintMissingKey::class) : get('tell.fallback') */
),
'tell.fallback' => function($c) {
$tell = new Tell\I18n( $c->get(Tell\Reader\PhpReader::class) );
$tell->locale = "en_US";
$i18n = new Tell\I18n( $c->get(Tell\Reader\JsonReader::class), $c->get(Tell\Reader\PhpReader::class), new Tell\PrintMissingKey() );
$i18n->locale(getenv('DEFAULT_LOCAL_FALLBACK') ?: "en_US");
$i18n->initialize(true);
return $tell;
return $i18n;
},
# TODO -- accept folders from Lean Apps
Tell\Reader\PhpReader::class => function($c) {
return new Tell\Reader\PhpReader($c->get(Lean\Lean::class)->getI18n('php'), true);
return new Tell\Reader\PhpReader($c->get(Lean\Lean::class)->getI18n('php'), false);
},
Tell\Reader\JsonReader::class => function($c) {
return new Tell\Reader\JsonReader($c->get(Lean\Lean::class)->getI18n('json'), true);
return new Tell\Reader\JsonReader($c->get(Lean\Lean::class)->getI18n('json'), true, \JSON_PRETTY_PRINT);
},
LanguageHandler::class => autowire(LanguageHandler::class),
-22
View File
@@ -1,22 +0,0 @@
<?php
use function DI\autowire, DI\create, DI\get;
use Storage\Session;
use Taxus\{ Privilege, Taxus, PermissionGrantInterface, DefaultPermissionGrant };
use Psr\Http\Message\ServerRequestInterface;
return [
Taxus::class => function ($c) {
return ( new Taxus( $c->get(PermissionGrantInterface::class) ) )->add(
[ 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" ],
);
},
PermissionGrantInterface::class => create(DefaultPermissionGrant::class)->constructor(get(ServerRequestInterface::class), get(Session::class)),
];
+1 -1
View File
@@ -28,7 +28,7 @@ return [
'order' => 10,
],
[
'path' => getenv("PROJECT_PATH") . "/vendor/mcnd/lean/view/",
'path' => getenv("PROJECT_PATH") . implode(DIRECTORY_SEPARATOR, [ "", "vendor", "mcnd" , "lean" , "view" ]),
'order' => 99,
],
],