- A lot of fixes done on this for a test project.
This commit is contained in:
1 parent
52e55f2bba
commit
09b3e47c19
11 files changed
+78
-21
No files matched your search
@@ -68,7 +68,7 @@ return [
|
||||
};
|
||||
},
|
||||
|
||||
'routes.middlewares' => [ "errorHandler", "dump", SessionMiddleware::class, CronardMiddleware::class, HttpBasicAuthentication::class, JavascriptMiddleware::class ],
|
||||
'routes.middlewares' => [ "dump", "errorHandler", SessionMiddleware::class, CronardMiddleware::class, HttpBasicAuthentication::class, JavascriptMiddleware::class ],
|
||||
|
||||
'routes.list' => function($c) {
|
||||
return function (ContainerInterface $container) {
|
||||
|
||||
@@ -29,6 +29,8 @@ return [
|
||||
'order' => 99,
|
||||
],
|
||||
],
|
||||
|
||||
'extensions' => [],
|
||||
],
|
||||
|
||||
'ulmus' => [],
|
||||
@@ -60,7 +62,7 @@ return [
|
||||
Lean::class => autowire(Lean::class),
|
||||
|
||||
CronardMiddleware::class => function($c) {
|
||||
$cronardMiddleware = new CronardMiddleware(getenv('CRON_KEY'), function() : ResponseInterface {
|
||||
$cronardMiddleware = new CronardMiddleware($c, getenv('CRON_KEY'), function() : ResponseInterface {
|
||||
return new TextResponse(sprintf("%s - cron task begin...", date('Y-m-d H:i:s')));
|
||||
});
|
||||
|
||||
@@ -82,11 +84,13 @@ return [
|
||||
|
||||
$gitdir = getenv("PROJECT_PATH") . DIRECTORY_SEPARATOR . ".git" . DIRECTORY_SEPARATOR;
|
||||
|
||||
if ( false !== ( $currentBranch = file_get_contents( $gitdir . "HEAD") ) ) {
|
||||
$file = explode(": ", $currentBranch)[1];
|
||||
$path = $gitdir . str_replace("/", DIRECTORY_SEPARATOR, trim($file, " \t\n\r"));
|
||||
if ( file_exists($gitdir . "HEAD") ) {
|
||||
if (false !== ($currentBranch = file_get_contents($gitdir . "HEAD"))) {
|
||||
$file = explode(": ", $currentBranch)[1];
|
||||
$path = $gitdir . str_replace("/", DIRECTORY_SEPARATOR, trim($file, " \t\n\r"));
|
||||
|
||||
return trim(file_get_contents( $path ), " \t\n\r");
|
||||
return trim(file_get_contents($path), " \t\n\r");
|
||||
}
|
||||
}
|
||||
|
||||
return "gitless-project";
|
||||
|
||||
@@ -32,14 +32,14 @@ return [
|
||||
},
|
||||
|
||||
Compiler::class => function($c) {
|
||||
return new Compiler(new class(null, [
|
||||
return new Compiler(new class(array_merge([
|
||||
$c->get(LanguageExtension::class),
|
||||
$c->get(TitleExtension::class),
|
||||
$c->get(UrlExtension::class),
|
||||
$c->get(Method\Form::class),
|
||||
$c->get(Method\Pagination::class),
|
||||
$c->get(Request::class),
|
||||
]) extends DefaultRegistrations {
|
||||
], array_map(fn($class) => $c->get($class), $c->get(Lean\Lean::class)->getPiceaExtensions() ))) extends DefaultRegistrations {
|
||||
|
||||
public function registerAll(Compiler $compiler) : void
|
||||
{
|
||||
@@ -56,7 +56,7 @@ return [
|
||||
|
||||
Method\Pagination::class => autowire(Method\Pagination::class),
|
||||
|
||||
LanguageExtension::class => create(LanguageExtension::class)->constructor(get(Context::class), get(LanguageHandler::class)),
|
||||
LanguageExtension::class => create(LanguageExtension::class)->constructor(get(LanguageHandler::class)),
|
||||
|
||||
LanguageHandler::class => function($c) {
|
||||
return new class( $c->get(Tell\I18n::class) ) implements LanguageHandler {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"pagination": {
|
||||
"next": "Next >",
|
||||
"previous": "< Previous",
|
||||
"next": ">",
|
||||
"previous": "<",
|
||||
"shown": "elements shown"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"pagination": {
|
||||
"next": ">",
|
||||
"previous": "<",
|
||||
"shown": "éléments affichés"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user