- Added Kash interfaces
This commit is contained in:
1 parent
aba9a65a3c
commit
5bebe231c7
12 files changed
+77
-34
No files matched your search
@@ -11,7 +11,8 @@ use Psr\Http\Message\ResponseFactoryInterface,
|
||||
Psr\Http\Message\ResponseInterface,
|
||||
Psr\Http\Message\ServerRequestInterface,
|
||||
Psr\Http\Server\MiddlewareInterface,
|
||||
Psr\Http\Server\RequestHandlerInterface;
|
||||
Psr\Http\Server\RequestHandlerInterface,
|
||||
Psr\SimpleCache\CacheInterface;
|
||||
|
||||
use TheBugs\JavascriptMiddleware;
|
||||
|
||||
@@ -21,6 +22,8 @@ use Tuupola\Middleware\HttpBasicAuthentication;
|
||||
|
||||
use Notes\Route\RouteFetcher;
|
||||
|
||||
use Notes\Breadcrumb\Breadcrumb;
|
||||
|
||||
use Ulmus\User\Lib\Authenticate;
|
||||
|
||||
use Storage\SessionMiddleware;
|
||||
@@ -29,7 +32,7 @@ return [
|
||||
Lean\Routing::class => autowire(Lean\Routing::class),
|
||||
|
||||
RouteFetcher::class => function($c) {
|
||||
$fetcher = new RouteFetcher();
|
||||
$fetcher = new RouteFetcher(null, [], null, $c->get('routes.caching'), getenv('DEBUG'));
|
||||
|
||||
$fetcher->setFolderList(array_map(function($item) {
|
||||
return $item;
|
||||
@@ -38,6 +41,16 @@ return [
|
||||
return $fetcher;
|
||||
},
|
||||
|
||||
Breadcrumb::class => function($c) {
|
||||
$breadcrumb = new Breadcrumb(null, [], null, $c->get('breadcrumbs.caching'), getenv('DEBUG'));
|
||||
|
||||
$breadcrumb->setFolderList(array_map(function($item) {
|
||||
return $item;
|
||||
}, $c->get(Lean\Lean::class)->getRoutable()));
|
||||
|
||||
return $breadcrumb;
|
||||
},
|
||||
|
||||
ApplicationStrategy::class => function($c) {
|
||||
return new class($c->get(Picea\Picea::class)) extends ApplicationStrategy {
|
||||
|
||||
|
||||
@@ -110,4 +110,6 @@ return [
|
||||
|
||||
return "gitless-project";
|
||||
},
|
||||
|
||||
Kash\CacheInvalidator::class => create(Kash\CacheInvalidator::class)->constructor(getenv('CACHE_PATH')."/version.cache", (bool) getenv('DEBUG')),
|
||||
];
|
||||
@@ -4,28 +4,13 @@ use function DI\autowire, DI\create, DI\get;
|
||||
|
||||
use Zend\Diactoros\Response\HtmlResponse;
|
||||
|
||||
use Picea\Picea,
|
||||
Picea\Caching\Cache,
|
||||
Picea\Caching\Opcache,
|
||||
Picea\Compiler,
|
||||
Picea\Compiler\Context,
|
||||
Picea\Compiler\BaseContext,
|
||||
Picea\Extension\LanguageHandler,
|
||||
Picea\Extension\LanguageExtension,
|
||||
Picea\Extension\TitleExtension,
|
||||
Picea\Extension\MoneyExtension,
|
||||
Picea\Extension\UrlExtension,
|
||||
Picea\FileFetcher,
|
||||
Picea\Language\DefaultRegistrations,
|
||||
Picea\Method\Request,
|
||||
Picea\Ui\Method,
|
||||
Picea\Ui\Ui;
|
||||
use Picea\{ Picea, Caching\Cache, Caching\Opcache, Compiler, Compiler\Context, Compiler\BaseContext, FileFetcher, Language\DefaultRegistrations, Method\Request };
|
||||
use Picea\Extension\{ LanguageHandler, LanguageExtension, TitleExtension, MoneyExtension, UrlExtension };
|
||||
use Picea\Ui\{ Method, Ui };
|
||||
|
||||
return [
|
||||
Picea::class => function($c) {
|
||||
return new Picea(function($html) {
|
||||
return new HtmlResponse( $html );
|
||||
}, $c->get(Context::class), $c->get(Cache::class), $c->get(Compiler::class), null, $c->get(FileFetcher::class), null, getenv("DEBUG"));
|
||||
return new Picea($c->get(Context::class), $c->get(Cache::class), $c->get(Compiler::class), null, $c->get(FileFetcher::class), null, getenv("DEBUG"));
|
||||
},
|
||||
|
||||
Context::class => function($c) {
|
||||
@@ -80,7 +65,7 @@ return [
|
||||
|
||||
MoneyExtension::class => autowire(MoneyExtension::class),
|
||||
|
||||
UrlExtension::class => create(UrlExtension::class)->constructor(get(Context::class), getenv("URL_BASE"), get('git.commit')),
|
||||
UrlExtension::class => create(UrlExtension::class)->constructor(getenv("URL_BASE"), get('git.commit')),
|
||||
|
||||
Cache::class => create(Opcache::class)->constructor(getenv("CACHE_PATH"), get(Context::class)),
|
||||
|
||||
|
||||
Reference in new issue
Block a user