Compare commits
61
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
254ea744c3 | ||
|
|
5839041e4c | ||
|
|
c8f4e181be | ||
|
|
5ea4e70988 | ||
|
|
3281713534 | ||
|
|
e3b22335e1 | ||
|
|
6cb5e7bba8 | ||
|
|
e6a41fbfab | ||
|
|
e0f2cbac92 | ||
|
|
e32b092749 | ||
|
|
538e0b9aec | ||
|
|
7bad9a69c9 | ||
|
|
f1570d1c42 | ||
|
|
71b9ca68ec | ||
|
|
020227abfe | ||
|
|
8090e493b5 | ||
|
|
75c480496a | ||
|
|
bbf8566fd2 | ||
|
|
9c5e8c66ff | ||
|
|
50b17ec8b6 | ||
|
|
064d94d32a | ||
|
|
aa15850baa | ||
|
|
c7469af952 | ||
|
|
3a60aaaf56 | ||
|
|
dce553d688 | ||
|
|
1a5d4dd0b2 | ||
|
|
5769f600fe | ||
|
|
7a292fe373 | ||
|
|
79287f28cc | ||
|
|
2a688935cc | ||
|
|
a903153fe2 | ||
|
|
ec59a36afb | ||
|
|
9556a2cba6 | ||
|
|
1c44342bbf | ||
|
|
81e124b144 | ||
|
|
9cd6f10d7e | ||
|
|
a36dbeeef2 | ||
|
|
7ed88ec89f | ||
|
|
c6e9bb6a38 | ||
|
|
e934c1a92c | ||
|
|
baf6fdf952 | ||
|
|
e0da7ae734 | ||
|
|
64f273e65c | ||
|
|
9031236930 | ||
|
|
7ee4b2d8bb | ||
|
|
06c4f46486 | ||
|
|
01d48463b3 | ||
|
|
abe94e498f | ||
|
|
adfd619c5f | ||
|
|
16ee06593c | ||
|
|
5bb5e8ce61 | ||
|
|
fda052d2f3 | ||
|
|
dac7acde87 | ||
|
|
b16b4803c5 | ||
|
|
d54d78ccc5 | ||
|
|
9ff4d6c44d | ||
|
|
a4b02607f3 | ||
|
|
d74c916558 | ||
|
|
ca388e8a52 | ||
|
|
b12fc65ea9 | ||
|
|
4b76a387fe |
No files matched your search
+14
-42
@@ -16,54 +16,26 @@
|
||||
"ext-posix": "*",
|
||||
"ext-xmlreader": "*",
|
||||
"ext-fileinfo": "*",
|
||||
"league/route": "^5.0.0-dev",
|
||||
"laminas/laminas-diactoros": "2.24.x-dev",
|
||||
"laminas/laminas-httphandlerrunner": "2.5.x-dev",
|
||||
"league/route": "^7.0.0-dev",
|
||||
"laminas/laminas-diactoros": "3.9.x-dev",
|
||||
"laminas/laminas-httphandlerrunner": "2.14.x-dev",
|
||||
"vlucas/phpdotenv": "^3.4@dev",
|
||||
"middlewares/whoops": "dev-master",
|
||||
"mcnd/storage": "dev-master",
|
||||
"mcnd/lean-console": "dev-master",
|
||||
"mcnd/ulmus": "dev-master",
|
||||
"mcnd/tell": "dev-master",
|
||||
"mcnd/dump": "dev-master",
|
||||
"mcnd/event": "dev-master",
|
||||
"mcnd/thebugs": "dev-master",
|
||||
"mcnd/taxus": "dev-master",
|
||||
"mcnd/notes": "dev-master",
|
||||
"mcnd/dump": "~1.0.0",
|
||||
"mcnd/storage": "~1.0.0",
|
||||
"mcnd/event": "~1.0.0",
|
||||
"mcnd/tell": "~1.0.0",
|
||||
"mcnd/ulmus": "^1.0 || ^2.0",
|
||||
"mcnd/kash": "~1.0.0",
|
||||
"mcnd/taxus": "1.1.0",
|
||||
"mcnd/notes": "^2.1.1",
|
||||
"mcnd/thebugs": "^1.0.0",
|
||||
"psr/simple-cache": "*"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/event.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/the-bugs.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/storage.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/ulmus.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/notes.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/tell.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/lean-console.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/dump.git"
|
||||
"type": "composer",
|
||||
"url": "https://git.mcnd.ca/api/packages/mcndave/composer"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
|
||||
@@ -3,20 +3,23 @@
|
||||
use Lean\Factory\HttpFactoryInterface;
|
||||
|
||||
use Ulmus\User\{
|
||||
Authorize\CookieAuthentication,
|
||||
Authorize\HeaderAuthentication,
|
||||
Entity,
|
||||
|
||||
Lib\Authenticate,
|
||||
Lib\Authorize,
|
||||
Middleware\AuthenticationMiddleware,
|
||||
Middleware\HeaderAuthenticationMiddleware,
|
||||
Middleware\CookieAuthenticationMiddleware,
|
||||
Middleware\PostRequestAuthenticationMiddleware,
|
||||
Authorize\PostRequestAuthentication
|
||||
};
|
||||
Authorize\PostRequestAuthentication};
|
||||
|
||||
use Storage\{ Cookie, Session };
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Picea\Picea;
|
||||
|
||||
use Storage\{ Cookie, Session };
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
use function DI\{get, autowire, create};
|
||||
|
||||
return [
|
||||
@@ -30,6 +33,10 @@ return [
|
||||
|
||||
HeaderAuthenticationMiddleware::class => create(HeaderAuthenticationMiddleware::class)->constructor(get(HeaderAuthentication::class)),
|
||||
|
||||
CookieAuthentication::class => autowire(CookieAuthentication::class),
|
||||
|
||||
CookieAuthenticationMiddleware::class => create(CookieAuthenticationMiddleware::class)->constructor(get(CookieAuthentication::class), get(Cookie::class)),
|
||||
|
||||
PostRequestAuthentication::class => create(PostRequestAuthentication::class)->constructor("email", "email", "password"),
|
||||
|
||||
PostRequestAuthenticationMiddleware::class => create(PostRequestAuthenticationMiddleware::class)->constructor(get(PostRequestAuthentication::class)),
|
||||
@@ -39,7 +46,6 @@ return [
|
||||
'authorize.error' => function(ContainerInterface $c) {
|
||||
return function(array $errorData) use ($c) {
|
||||
return $c->get(HttpFactoryInterface::class)::createJsonResponse($errorData + [
|
||||
|
||||
'api.error' => "Authorization failed",
|
||||
'api.datetime' => (new \DateTime)->format(\DateTime::ATOM),
|
||||
], 403);
|
||||
@@ -49,6 +55,7 @@ return [
|
||||
'authentication.error' => function($c, Picea $picea) {
|
||||
return function($message) use ($c, $picea) {
|
||||
return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml('lean/error/500', [
|
||||
|
||||
'title' => "Authentication failed",
|
||||
'subtitle' => "",
|
||||
'message' => $message,
|
||||
|
||||
@@ -37,7 +37,7 @@ return [
|
||||
public function execute(Routing $routing, Route $attribute) : void
|
||||
{
|
||||
if (null !== ($name = $attribute->name ?? null)) {
|
||||
$this->extension->registerRoute($name, $attribute->getRoute(), $attribute->class, $attribute->classMethod, (array) ( $attribute->method ?? $attribute->methods ));
|
||||
$this->extension->registerRoute($name, $attribute->getRoute(), $attribute->class, $attribute->classMethod, (array) ( $attribute->method ));
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -52,7 +52,6 @@ return [
|
||||
{
|
||||
$class = $attribute->class;
|
||||
$method = $attribute->classMethod;
|
||||
$object = $container->get($class);
|
||||
|
||||
$request = $request->withAttribute('lean.route', $attribute);
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator, MethodNotAllowedInterface, };
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
|
||||
use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator };
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Laminas\{ Diactoros\ServerRequestFactory, HttpHandlerRunner\Emitter\EmitterInterface, HttpHandlerRunner\Emitter\SapiEmitter };
|
||||
use Lean\Factory\{ HttpFactory, HttpFactoryInterface };
|
||||
use Picea\Picea;
|
||||
use Storage\Cookie,
|
||||
Storage\Session,
|
||||
Storage\SessionMiddleware;
|
||||
|
||||
use function DI\autowire, DI\create, DI\get;
|
||||
use function DI\{ autowire, create, get };
|
||||
|
||||
return [
|
||||
ServerRequestInterface::class => function ($c) {
|
||||
@@ -20,8 +22,28 @@ return [
|
||||
|
||||
EmitterInterface::class => create(SapiEmitter::class),
|
||||
|
||||
ThrowableHandlerInterface::class => autowire(ThrowableHandler::class),
|
||||
NotFoundDecoratorInterface::class => autowire(NotFoundDecorator::class),
|
||||
# MethodNotAllowedInterface::class => autowire(MethodNotAllowedDecorator::class),
|
||||
|
||||
HttpFactoryInterface::class => create(HttpFactory::class),
|
||||
|
||||
Cookie::class => create(Cookie::class)->constructor([
|
||||
'secure' => true,
|
||||
'path' => getenv('URL_BASE') ?: '/',
|
||||
'httponly' => true,
|
||||
'samesite'=> "Lax",
|
||||
], getenv("LEAN_RANDOM")),
|
||||
|
||||
Session::class => create(Session::class)->constructor(get(Cookie::class), [ 'path' => getenv('URL_BASE') ?: '/', ]),
|
||||
|
||||
SessionMiddleware::class => create(SessionMiddleware::class)->constructor(get(Cookie::class), [
|
||||
'name' => "lean_sess_" . substr(md5(getenv("LEAN_RANDOM")), 0, 12),
|
||||
'path' => getenv('URL_BASE') ?: '/',
|
||||
'samesite' => getenv("LEAN_COOKIE_SAMESITE") ?? "Lax",
|
||||
'secure' => (bool) getenv('LEAN_COOKIE_SECURE') ?? false
|
||||
]),
|
||||
|
||||
'error.401' => function(ContainerInterface $c, Picea $picea) {
|
||||
return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/401", []), 401);
|
||||
},
|
||||
@@ -33,7 +55,4 @@ return [
|
||||
'error.500' => function(ContainerInterface $c, Picea $picea) {
|
||||
return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/500", []), 500);
|
||||
},
|
||||
|
||||
ThrowableHandlerInterface::class => autowire(ThrowableHandler::class),
|
||||
NotFoundDecoratorInterface::class => autowire(NotFoundDecorator::class),
|
||||
];
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
use Tell\I18n;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Notes\Tell\LanguageHandler;
|
||||
|
||||
use function DI\autowire, DI\create, DI\get, DI\add;
|
||||
|
||||
|
||||
@@ -68,7 +68,8 @@ return [
|
||||
}
|
||||
}
|
||||
|
||||
$router->addPatternMatcher('email', '[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+');
|
||||
$router->addPatternMatcher('email', '[^@ \t\r\n/]+@[^@ \t\r\n/]+\.[^@ \t\r\n/]+');
|
||||
$router->addPatternMatcher('ids', '\b\d[\d,]*\b');
|
||||
|
||||
$routing = $container->get(Lean\Routing::class);
|
||||
$routing->registerRoute($container, getenv('URL_BASE'));
|
||||
|
||||
@@ -6,9 +6,6 @@ use TheBugs\JavascriptMiddleware;
|
||||
|
||||
use Lean\Lean;
|
||||
|
||||
use Storage\Cookie,
|
||||
Storage\Session,
|
||||
Storage\SessionMiddleware;
|
||||
|
||||
use function DI\autowire, DI\create, DI\get, DI\add;
|
||||
|
||||
@@ -26,7 +23,7 @@ return [
|
||||
],
|
||||
[
|
||||
'path' => implode(DIRECTORY_SEPARATOR, [ $dir, "view", '' ]),
|
||||
'order' => 99,
|
||||
'order' => 1000,
|
||||
],
|
||||
],
|
||||
|
||||
@@ -78,12 +75,6 @@ return [
|
||||
|
||||
JavascriptMiddleware::class => create(JavascriptMiddleware::class),
|
||||
|
||||
Cookie::class => create(Cookie::class)->constructor([ 'secure' => true, 'path' => getenv('URL_BASE') ?: '/', ], getenv("LEAN_RANDOM")),
|
||||
|
||||
Session::class => create(Session::class)->constructor(get(Cookie::class), [ 'path' => getenv('URL_BASE') ?: '/', ]),
|
||||
|
||||
SessionMiddleware::class => create(SessionMiddleware::class)->constructor(get(Cookie::class), [ 'name' => "lean_sess_" . substr(md5(getenv("LEAN_RANDOM")), 0, 12), 'path' => getenv('URL_BASE') ?: '/' ]),
|
||||
|
||||
'git.commit' => function($c) {
|
||||
if ( getenv("DEBUG") ) {
|
||||
return uniqid("debug_");
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
"week": "week"
|
||||
},
|
||||
|
||||
"interval": {
|
||||
"years": "{$years} year(s)",
|
||||
"months": "{$months} month(s)",
|
||||
"days": "{$days} day(s)",
|
||||
"hours": "{$hours} hour(s)",
|
||||
"minutes": "{$minutes} minutes(s)",
|
||||
"seconds": "{$seconds} second(s)"
|
||||
},
|
||||
|
||||
"month": {
|
||||
"list": [
|
||||
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "Décember"
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
"week": "semaine"
|
||||
},
|
||||
|
||||
"interval": {
|
||||
"years": "{$years} années(s)",
|
||||
"months": "{$months} mois",
|
||||
"days": "{$days} jour(s)",
|
||||
"hours": "{$hours} heure(s)",
|
||||
"minutes": "{$minutes} minutes(s)",
|
||||
"seconds": "{$seconds} seconde(s)"
|
||||
},
|
||||
|
||||
"month": {
|
||||
"list": [
|
||||
"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
|
||||
|
||||
+14
-14
@@ -5,7 +5,8 @@ CRON_KEY = dev
|
||||
|
||||
# Route
|
||||
URL_BASE = ""
|
||||
APP_URL = "dev.mcnd.ca"
|
||||
APP_URL = "myapp.ca"
|
||||
ASSET_PATH = "static/"
|
||||
|
||||
# Path
|
||||
CACHE_DIR = "var/cache"
|
||||
@@ -23,19 +24,18 @@ DEFAULT_TIME = "fr.UTF-8"
|
||||
DEFAULT_TIME_FALLBACK = "french.UTF-8"
|
||||
|
||||
# Database
|
||||
#SQLITE_PATH = "var/home.sqlite3"
|
||||
#SQLITE_ADAPTER = "SQLite"
|
||||
#SQLITE_PRAGMA_BEGIN = "foreign_keys=ON,synchronous=NORMAL"
|
||||
#SQLITE_PRAGMA_DEBUG_BEGIN = "journal_mode=WAL"
|
||||
#SQLITE_PRAGMA_CLOSE = "analysis_limit=500,optimize"
|
||||
SQLITE_PATH = "var/myapp.sqlite3"
|
||||
SQLITE_ADAPTER = "SQLite"
|
||||
SQLITE_PRAGMA_BEGIN = "foreign_keys=ON,synchronous=NORMAL"
|
||||
SQLITE_PRAGMA_DEBUG_BEGIN = "journal_mode=WAL"
|
||||
SQLITE_PRAGMA_CLOSE = "analysis_limit=500,optimize"
|
||||
|
||||
DATABASE_PORT = ""
|
||||
DATABASE_HOST = ""
|
||||
DATABASE_NAME = ""
|
||||
DATABASE_USERNAME = ""
|
||||
DATABASE_PASSWORD = ""
|
||||
DATABASE_CHARSET = "utf8"
|
||||
DATABASE_ADAPTER = "MariaDB"
|
||||
#DATABASE_PORT = ""
|
||||
#DATABASE_HOST = ""
|
||||
#DATABASE_NAME = ""
|
||||
#DATABASE_USERNAME = ""
|
||||
#DATABASE_PASSWORD = ""
|
||||
#DATABASE_CHARSET = "utf8"
|
||||
#DATABASE_ADAPTER = "MariaDB"
|
||||
|
||||
LEAN_RANDOM = "%RAND64%"
|
||||
|
||||
File renamed without changes.
@@ -8,26 +8,37 @@
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"php": "^8.4",
|
||||
"ext-apcu": "*",
|
||||
"ext-sodium": "*",
|
||||
"ext-bcmath": "*",
|
||||
"ext-json": "*",
|
||||
"ext-readline": "*",
|
||||
"league/route": "^5.0.0-dev",
|
||||
"laminas/laminas-diactoros": "2.24.x-dev",
|
||||
"laminas/laminas-httphandlerrunner": "2.5.x-dev",
|
||||
"vlucas/phpdotenv": "^3.4@dev",
|
||||
"middlewares/whoops": "dev-master",
|
||||
"ralouphie/getallheaders": "dev-master",
|
||||
"ralouphie/getallheaders": "3.x",
|
||||
"guzzlehttp/guzzle": "7.9.x-dev",
|
||||
"symfony/mailer": "6.3.x-dev",
|
||||
"league/oauth2-client": "dev-master",
|
||||
"php-di/php-di": "dev-master",
|
||||
"league/commonmark": "^2.7@dev",
|
||||
"assets-package/ace": "1.0.0",
|
||||
"mcnd/dump": "dev-master",
|
||||
"mcnd/storage": "dev-master",
|
||||
"mcnd/cli": "dev-master",
|
||||
"mcnd/event": "dev-master",
|
||||
"mcnd/ulmus": "dev-master",
|
||||
"mcnd/ulmus-api": "dev-master",
|
||||
"mcnd/ulmus-user": "dev-master",
|
||||
"mcnd/ulmus": "^1.0 || ^2.0",
|
||||
"mcnd/ulmus-api": "^1.3.0",
|
||||
"mcnd/ulmus-user": "~1.1.2",
|
||||
"mcnd/picea": "dev-master",
|
||||
"mcnd/picea-ui": "dev-master",
|
||||
"mcnd/picea-asset": "dev-master",
|
||||
"mcnd/picea-asset": "~1.0.2",
|
||||
"mcnd/cronard": "dev-master",
|
||||
"mcnd/lean-console": "dev-master",
|
||||
"mcnd/lean-api": "dev-master",
|
||||
"mcnd/lean-console": "~1.3.2",
|
||||
"mcnd/kash": "dev-master",
|
||||
"mcnd/taxus": "dev-master",
|
||||
"mcnd/notes": "dev-master",
|
||||
@@ -35,9 +46,17 @@
|
||||
"mcnd/negundo-client": "dev-master"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "composer",
|
||||
"url": "https://git.mcnd.ca/api/packages/mcndave/composer"
|
||||
},
|
||||
{
|
||||
"type": "composer",
|
||||
"url": "https://git.mcnd.ca/api/packages/assets-package/composer"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/cronard.git"
|
||||
"url": "https://git.mcnd.ca/mcndave/cli.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
@@ -51,6 +70,10 @@
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/lean.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/lean-api.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/lean-console.git"
|
||||
@@ -118,6 +141,10 @@
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/mcndave/negundo-client.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.mcnd.ca/assets-package/ace.git"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
@@ -136,6 +163,7 @@
|
||||
"extra" : {
|
||||
"lean" : {
|
||||
"autoload": {
|
||||
"order": 1000,
|
||||
"definitions" : [
|
||||
"meta/definitions/definitions.php",
|
||||
"meta/definitions/storage.php",
|
||||
|
||||
@@ -10,7 +10,7 @@ return [
|
||||
],
|
||||
|
||||
'keys' => (function() {
|
||||
return explode(',', getenv('KEYS') ?? "") ;
|
||||
return explode(',', getenvonce('KEYS') ?? "") ;
|
||||
})(),
|
||||
|
||||
'meta' => [
|
||||
@@ -19,7 +19,7 @@ return [
|
||||
|
||||
'ulmus' => [
|
||||
'connections' => [
|
||||
'default' => [
|
||||
/*'default' => [
|
||||
'adapter' => getenv("DATABASE_ADAPTER"),
|
||||
'host' => getenv("DATABASE_HOST"),
|
||||
'port' => getenv("DATABASE_PORT"),
|
||||
@@ -29,9 +29,9 @@ return [
|
||||
'settings' => [
|
||||
'charset' => getenv("DATABASE_CHARSET"),
|
||||
],
|
||||
],
|
||||
],*/
|
||||
|
||||
'sqlite' => [
|
||||
'default' => [
|
||||
'adapter' => getenv("SQLITE_ADAPTER"),
|
||||
'path' => getenv('PROJECT_PATH') . DIRECTORY_SEPARATOR . getenv("SQLITE_PATH"),
|
||||
'pragma' => explode(',', getenv("SQLITE_PRAGMA")),
|
||||
|
||||
@@ -43,7 +43,7 @@ return [
|
||||
|
||||
EmailConfiguration::class => function($c) {
|
||||
$email = new EmailConfiguration( EmailConfiguration::AUTH_TYPE_SMTP );
|
||||
$email->smtpHost = getenv('SMTP_HOSTNAME');
|
||||
$email->smtpHost = getenv('SMTP_HOST');
|
||||
$email->smtpPort = getenv('SMTP_PORT');
|
||||
$email->smtpUsername = getenv('SMTP_USERNAME');
|
||||
$email->smtpPassword = getenv('SMTP_PASSWORD');
|
||||
|
||||
@@ -7,6 +7,10 @@ use function DI\{ autowire, add, create, get };
|
||||
$dir = dirname(__DIR__, 2);
|
||||
|
||||
return [
|
||||
\%NAMESPACE%\Factory\FormFactoryInterface::class => autowire(\%NAMESPACE%\Factory\FormFactory::class),
|
||||
\Lean\Api\Factory\MessageFactoryInterface::class => autowire(\%NAMESPACE%\Lib\Message::class),
|
||||
|
||||
|
||||
'%APPKEY%' => [
|
||||
'picea' => [
|
||||
'context' => "%ESCAPED_NAMESPACE%\\View",
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
<?php
|
||||
|
||||
if (! function_exists('getenvonce')) {
|
||||
function getenvonce(string $name) : array|string|false
|
||||
{
|
||||
$value = getenv($name);
|
||||
unset($_ENV[$name], $_SERVER[$name]);
|
||||
putenv($name . "=");
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
return require("env/" . ( getenv('APP_ENV') ?? 'prod' ) . ".php");
|
||||
+1
-1
@@ -13,7 +13,7 @@ use Psr\Http\Server\MiddlewareInterface,
|
||||
|
||||
use function DI\{ create, get, autowire };
|
||||
|
||||
error_reporting(getenv('ERROR_REPORTING') ?: ( E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE ));
|
||||
error_reporting(getenv('ERROR_REPORTING') ?: ( E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_NOTICE ));
|
||||
|
||||
return [
|
||||
/* do nothing in production !*/
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
<?php
|
||||
|
||||
try {
|
||||
require_once(dirname(__DIR__)."/src/Kernel.php");
|
||||
$projectPath = dirname(__DIR__);
|
||||
|
||||
require_once $projectPath . '/vendor/autoload.php';
|
||||
|
||||
new class($projectPath) extends %NAMESPACE%\Kernel {};
|
||||
}
|
||||
catch(\Throwable $t) {
|
||||
echo sprintf("%s in <strong>%s</strong> <pre>%s</pre>", $t->getMessage(), $t->getFile() . ":" . $t->getLine(), $t->getTraceAsString());
|
||||
echo sprintf("%s<hr><small>%s:%d</small><br><pre>%s</pre>", $t->getMessage(), $t->getFile(), $t->getLine(), getenv('DEBUG') ? var_export($t->getTrace(), true) : "");
|
||||
error_log($t->getMessage());
|
||||
header("HTTP/1.1 500 Internal Server Error");
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace %NAMESPACE%\Factory;
|
||||
|
||||
use Lean\Api\Factory\MessageFactoryInterface;
|
||||
use Lean\LanguageHandler;
|
||||
use Picea\Ui\Method\FormContextInterface;
|
||||
use Picea\Ui\Method\FormInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Storage\Session;
|
||||
use Ulmus\Entity\EntityInterface;
|
||||
use Ulmus\User\Entity\UserInterface;
|
||||
use Ulmus\User\Lib\Authenticate;
|
||||
|
||||
class FormFactory implements FormFactoryInterface
|
||||
{
|
||||
/*
|
||||
public function __construct(
|
||||
protected ServerRequestInterface $request,
|
||||
protected Authenticate $authenticate,
|
||||
protected Session $session,
|
||||
protected LanguageHandler $languageHandler,
|
||||
protected MessageFactoryInterface $messageFactory,
|
||||
) {}
|
||||
|
||||
public function save(EntityInterface $entity): FormInterface
|
||||
{
|
||||
return new Form\Save($this->languageHandler, $this->messageFactory, $entity);
|
||||
}
|
||||
|
||||
public function saveContext(? ServerRequestInterface $request = null, ? string $formName = null): FormContextInterface
|
||||
{
|
||||
return new Form\SaveContext($request ?: $this->request, $formName);
|
||||
}
|
||||
|
||||
public function delete(EntityInterface $entity): FormInterface
|
||||
{
|
||||
return new Form\Delete($this->languageHandler, $this->messageFactory, $entity);
|
||||
}
|
||||
|
||||
public function deleteContext(?ServerRequestInterface $request = null, ?string $formName = null): FormContextInterface
|
||||
{
|
||||
return new Lib\FormContext($request, $formName);
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace %NAMESPACE%\Factory;
|
||||
|
||||
use Lean\Api\Factory\MessageFactoryInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Picea\Ui\Method\{ FormInterface, FormContextInterface };
|
||||
use Storage\Session;
|
||||
use Lean\LanguageHandler;
|
||||
use Ulmus\Entity\EntityInterface;
|
||||
use Ulmus\User\Entity\UserInterface;
|
||||
use Ulmus\User\Lib\Authenticate;
|
||||
|
||||
interface FormFactoryInterface
|
||||
{
|
||||
/* public function __construct(ServerRequestInterface $request, Authenticate $authenticate, Session $session, LanguageHandler $languageHandler, MessageFactoryInterface $messageFactory,);
|
||||
|
||||
public function save(EntityInterface $entity): FormInterface;
|
||||
|
||||
public function saveContext(?ServerRequestInterface $request = null, ?string $formName = null): FormContextInterface;
|
||||
|
||||
public function delete(EntityInterface $entity): FormInterface;
|
||||
|
||||
public function deleteContext(?ServerRequestInterface $request = null, ?string $formName = null): FormContextInterface;*/
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace %NAMESPACE%\Lib;
|
||||
|
||||
use Picea\Picea;
|
||||
use Storage\Session;
|
||||
use Mcnd\Event\EventManager;
|
||||
use Notes\{ Attribute\Ignore, Route\Attribute\Object\Route, Security\Attribute\Security };
|
||||
use Ulmus\User\Entity\{ User, UserInterface };
|
||||
|
||||
use %NAMESPACE%\{ Entity, Lib, Form, Factory };
|
||||
|
||||
#[Security(locked: false)]
|
||||
#[Route(base: "/api", method: [ "GET", "POST", "PUT", "PATCH", "DELETE", ])]
|
||||
trait ApiTrait {
|
||||
use \Lean\ControllerTrait, \Lean\Api\LeanApiTrait {
|
||||
\Lean\Api\LeanApiTrait::renderMarkdown insteadof \Lean\ControllerTrait;
|
||||
}
|
||||
|
||||
#[Ignore]
|
||||
public UserInterface $user;
|
||||
|
||||
#[Ignore]
|
||||
protected EventManager $eventManager;
|
||||
|
||||
#[Ignore]
|
||||
protected Factory\FormFactoryInterface $formFactory;
|
||||
}
|
||||
@@ -7,6 +7,7 @@ use Storage\Session;
|
||||
use Ulmus\User\Entity\User;
|
||||
use Notes\Route\Attribute\Object\Route;
|
||||
use Notes\Security\Attribute\Security;
|
||||
use DI\Attribute\Inject;
|
||||
|
||||
use %NAMESPACE%\{ Entity, Lib, Form };
|
||||
|
||||
@@ -18,24 +19,9 @@ use Notes\Attribute\Ignore;use Ulmus\User\Entity\UserInterface;
|
||||
trait ControllerTrait {
|
||||
use \Lean\ControllerTrait;
|
||||
|
||||
#[Ignore]
|
||||
#[Inject]
|
||||
public ? UserInterface $user;
|
||||
|
||||
#[Ignore]
|
||||
#[Inject]
|
||||
protected EventManager $eventManager;
|
||||
|
||||
#[Ignore]
|
||||
public function __construct(Picea $picea, Session $session, UserInterface $user, \Notes\Breadcrumb\Breadcrumb $breadcrumb, EventManager $eventManager) {
|
||||
$this->initializeController($picea, $session, $user, $breadcrumb, $eventManager);
|
||||
}
|
||||
|
||||
#[Ignore]
|
||||
public function initializeController(Picea $picea, Session $session, UserInterface $user, \Notes\Breadcrumb\Breadcrumb $breadcrumb, EventManager $eventManager) {
|
||||
$this->picea = $picea;
|
||||
$this->session = $session;
|
||||
$this->eventManager = $eventManager;
|
||||
$this->breadcrumb = $breadcrumb;
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,9 +2,10 @@
|
||||
|
||||
namespace %NAMESPACE%\Lib;
|
||||
|
||||
use Lean\Api\Factory\MessageFactoryInterface;
|
||||
use Picea\Ui\Method\FormMessage;
|
||||
|
||||
class Message implements FormMessage {
|
||||
class Message implements FormMessage, MessageFactoryInterface {
|
||||
|
||||
const MESSAGE_TYPE = [
|
||||
'success' => [
|
||||
@@ -34,7 +35,7 @@ class Message implements FormMessage {
|
||||
|
||||
public ? string $header = null;
|
||||
|
||||
public function __construct(string $message, string $type = "error", ? string $header = null, ? string $class = null)
|
||||
public function __construct(string $message = "", string $type = "error", ? string $header = null, ? string $class = null)
|
||||
{
|
||||
$this->message = $message;
|
||||
|
||||
@@ -86,18 +87,33 @@ class Message implements FormMessage {
|
||||
return $this->type === "error";
|
||||
}
|
||||
|
||||
public static function generateSuccess(string $message, ? string $header = null, ? string $class = null) : self
|
||||
public static function generateSuccess(string $message, ? string $header = null, ? string $class = null) : MessageFactoryInterface
|
||||
{
|
||||
return new static($message, 'success', $header, $class);
|
||||
}
|
||||
|
||||
public static function generateError(string $message, ? string $header = null, ? string $class = null) : self
|
||||
public static function generateError(string $message, ? string $header = null, ? string $class = null) : MessageFactoryInterface
|
||||
{
|
||||
return new static($message, 'error', $header, $class);
|
||||
}
|
||||
|
||||
public static function generateWarning(string $message, ? string $header = null, ? string $class = null) : self
|
||||
public static function generateWarning(string $message, ? string $header = null, ? string $class = null) : MessageFactoryInterface
|
||||
{
|
||||
return new static($message, 'warning', $header, $class);
|
||||
}
|
||||
|
||||
public static function generateInformation(string $message, ?string $header = null, ?string $class = null): MessageFactoryInterface
|
||||
{
|
||||
return new static($message, 'information', $header, $class);
|
||||
}
|
||||
|
||||
public static function generateDebug(string $message, ?string $header = null, ?string $class = null): MessageFactoryInterface
|
||||
{
|
||||
return new static($message, 'debug', $header, $class);
|
||||
}
|
||||
|
||||
public static function generateTrace(string $message, ?string $header = null, ?string $class = null): MessageFactoryInterface
|
||||
{
|
||||
return new static($message, 'trace', $header, $class);
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
namespace Lean;
|
||||
|
||||
use League\Route\Http\Exception\MethodNotAllowedException;
|
||||
use League\Route\Strategy;
|
||||
use League\Route\Http\Exception\NotFoundException;
|
||||
use Lean\ApplicationStrategy\MethodNotAllowedInterface;
|
||||
use Lean\ApplicationStrategy\NotFoundDecoratorInterface;
|
||||
use Lean\ApplicationStrategy\ThrowableHandlerInterface;
|
||||
use Lean\Factory\HttpFactoryInterface;
|
||||
@@ -30,6 +32,43 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy {
|
||||
public function getThrowableHandler(): MiddlewareInterface
|
||||
{
|
||||
return $this->getContainer()->get(ThrowableHandlerInterface::class);
|
||||
}
|
||||
|
||||
public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface
|
||||
{
|
||||
return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception);
|
||||
}
|
||||
|
||||
/*<<<<<<< HEAD
|
||||
/*=======
|
||||
public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
if (php_sapi_name() !== 'cli' and ! defined('STDIN')) {
|
||||
return $this->throw404($request);
|
||||
}
|
||||
|
||||
return $handler->handle($request);;
|
||||
}
|
||||
|
||||
public function throw404(ServerRequestInterface $request) : ResponseInterface
|
||||
{
|
||||
if ( getenv('DEBUG') && $this->di->has(\Picea\Asset\Asset::class) ) {
|
||||
$params = $request->getServerParams();
|
||||
|
||||
$scpName = basename(explode('?', $params['REQUEST_URI'] ?? "", 2)[0]);
|
||||
list(, $ext) = array_pad(explode('.', $scpName), 2, null);
|
||||
|
||||
if ($ext && in_array($ext, ApplicationStrategy::ASSET_TRIGGER_UPDATE)) {
|
||||
$this->di->get(\Picea\Asset\Asset::class)->launchInstall();
|
||||
}
|
||||
}
|
||||
|
||||
return $this->di->get('error.404');
|
||||
}
|
||||
};
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
>>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Lean\ApplicationStrategy;
|
||||
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
|
||||
interface MethodNotAllowedInterface extends MiddlewareInterface
|
||||
{
|
||||
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class NotFoundDecorator implements NotFoundDecoratorInterface
|
||||
|
||||
public function throw404(ServerRequestInterface $request) : ResponseInterface
|
||||
{
|
||||
return $this->checkAssetTrigger($request) ?: $this->httpFactory->createHtmlResponse($this->picea->renderHtml("lean/error/404", [], $this), 404);
|
||||
return $this->checkAssetTrigger($request) ?: $this->container->get('error.404');
|
||||
}
|
||||
|
||||
protected function checkAssetTrigger(ServerRequestInterface $request) : false|ResponseInterface
|
||||
|
||||
+4
-3
@@ -27,7 +27,8 @@ class Composer
|
||||
$source = static::createPath('vendor', 'mcnd', 'lean', 'skeleton');
|
||||
$dest = static::createPath('skeleton');
|
||||
|
||||
`cp -a $source $dest`;
|
||||
shell_exec("cp -a $source $dest");
|
||||
#`cp -a $source $dest`;
|
||||
|
||||
$iterator = new \RecursiveDirectoryIterator($dest);
|
||||
$iterator->setFlags(\RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
@@ -102,7 +103,7 @@ class Composer
|
||||
throw new \UnexpectedValueException("Composer file 'composer.json' could not be found within your project's root folder.");
|
||||
}
|
||||
|
||||
return $content ??= file_exists($path) ? json_decode(file_get_contents($path), true) : false;
|
||||
return $content ??= file_exists($path) ? json_decode(file_get_contents($path), true, 512, \JSON_THROW_ON_ERROR) : false;
|
||||
}
|
||||
|
||||
protected static function getNamespaceFromAutoload(Event $event) : ? string
|
||||
@@ -125,7 +126,7 @@ class Composer
|
||||
|
||||
$event->getIO()->writeError("Your composer file do not seem to contains a valid psr-4 project pointing to the src folder.");
|
||||
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static function createPath(... $path) : string
|
||||
|
||||
+21
-5
@@ -8,6 +8,8 @@ use Notes\Attribute\Ignore;
|
||||
use Notes\Route\Attribute\Object\Route;
|
||||
use Notes\Security\Attribute\Security;
|
||||
use Picea, Picea\Ui\Method\FormContext;
|
||||
use Picea\Ui\Method\FormContextInterface;
|
||||
use Picea\Ui\Method\FormInterface;
|
||||
use TheBugs\Email\MailerInterface;
|
||||
use Storage\{ Cookie, Session };
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
@@ -20,9 +22,6 @@ use function file_get_contents;
|
||||
#[Route(method: [ "GET", "POST" ])]
|
||||
trait ControllerTrait {
|
||||
|
||||
##[Inject]
|
||||
# public \Notes\Breadcrumb\Breadcrumb $breadcrumb;
|
||||
|
||||
#[Inject]
|
||||
public Session $session;
|
||||
|
||||
@@ -84,6 +83,13 @@ trait ControllerTrait {
|
||||
return HttpFactory::createRedirectResponse($url, $code, $headers);
|
||||
}
|
||||
|
||||
#[Ignore]
|
||||
protected function refresh(int $code = 204, array $headers = []) {
|
||||
return static::renderNothing($code, [
|
||||
'Refresh' => 0
|
||||
] + $headers);
|
||||
}
|
||||
|
||||
#[Ignore]
|
||||
public static function renderNothing(int $code = 204, array $headers = []) : ResponseInterface
|
||||
{
|
||||
@@ -205,6 +211,16 @@ trait ControllerTrait {
|
||||
return $this->picea->compiler->getExtensionFromToken('route')->buildRouteUrl($name, $parameters);
|
||||
}
|
||||
|
||||
#[Ignore]
|
||||
public function form(FormInterface $form, ? FormContextInterface $formContext = null) : Picea\Ui\Method\FormHandler
|
||||
{
|
||||
if (! $this->picea ) {
|
||||
throw new \Exception("A picea object must be provided on class initialization to use this method.");
|
||||
}
|
||||
|
||||
return $this->picea->compiler->getExtensionInstanceOf(Picea\Ui\Method\Form::class)->formClass($form, $formContext);
|
||||
}
|
||||
|
||||
#[Ignore]
|
||||
public function json($data, int $flags = 0) : string
|
||||
{
|
||||
@@ -212,7 +228,7 @@ trait ControllerTrait {
|
||||
}
|
||||
|
||||
#[Ignore]
|
||||
public function pushContext(FormContext $context) : FormContext
|
||||
public function pushContext(FormContextInterface $context) : FormContextInterface
|
||||
{
|
||||
$this->contextList[$context->formName ?? uniqid("context_")] = $context;
|
||||
|
||||
@@ -220,7 +236,7 @@ trait ControllerTrait {
|
||||
}
|
||||
|
||||
#[Ignore]
|
||||
public function context(? string $name = null) : ? FormContext
|
||||
public function context(? string $name = null) : ? FormContextInterface
|
||||
{
|
||||
return $name ? $this->contextList[$name] : array_values($this->contextList)[0] ?? null;
|
||||
}
|
||||
|
||||
@@ -5,13 +5,15 @@ namespace Lean\Factory;
|
||||
use Laminas\Diactoros\Response\{EmptyResponse, HtmlResponse, JsonResponse, RedirectResponse, TextResponse};
|
||||
use Lean\Response\{ DownloadResponse, ImageResponse, FileDownloadResponse, PdfResponse };
|
||||
use Laminas\Diactoros\Response;
|
||||
use Laminas\Diactoros\StreamFactory;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
class HttpFactory implements HttpFactoryInterface
|
||||
{
|
||||
public static function createResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface
|
||||
public static function createResponse(mixed $body = 'php://memory', int $code = 200, array $headers = []) : ResponseInterface
|
||||
{
|
||||
return new Response($url, $code, $headers);
|
||||
return new Response($body, $code, $headers);
|
||||
}
|
||||
|
||||
public static function createRedirectResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface
|
||||
@@ -58,4 +60,9 @@ class HttpFactory implements HttpFactoryInterface
|
||||
{
|
||||
return new FileDownloadResponse($path, $code, $headers);
|
||||
}
|
||||
|
||||
public static function createStream(string $content): StreamInterface
|
||||
{
|
||||
return new StreamFactory()->createStream($content);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Lean\Factory;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
interface HttpFactoryInterface
|
||||
{
|
||||
@@ -16,4 +17,5 @@ interface HttpFactoryInterface
|
||||
public static function createDownloadableResponse(string $data, string $filename, int $code = 200, array $headers = []) : ResponseInterface;
|
||||
public static function createImageResponse(string $data, int $code = 200, array $headers = []) : ResponseInterface;
|
||||
public static function createFileDownloadResponse(string $path, int $code = 200, array $headers = []) : ResponseInterface;
|
||||
public static function createStream(string $content) : StreamInterface;
|
||||
}
|
||||
@@ -40,4 +40,36 @@ class File
|
||||
|
||||
return array_reverse($text);
|
||||
}
|
||||
|
||||
public static function sanitizeFilePath($path) : string
|
||||
{
|
||||
// Remove null bytes
|
||||
$path = str_replace("\0", "", $path);
|
||||
|
||||
$path = str_replace([ "\\", "/" ], DIRECTORY_SEPARATOR, $path);
|
||||
|
||||
$path = preg_replace('#' . DIRECTORY_SEPARATOR . '+#', DIRECTORY_SEPARATOR, $path);
|
||||
|
||||
// Remove . and .. directory traversal attempts
|
||||
$path = preg_replace('#\.{1,2}/#', '', $path);
|
||||
|
||||
$path = trim($path, '/\\');
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
public static function assertFileExists(string $filepath) : void
|
||||
{
|
||||
if (! is_file($filepath)) {
|
||||
throw new \InvalidArgumentException("File does not exist: {$filepath}");
|
||||
}
|
||||
}
|
||||
|
||||
public static function assertFolderExists(string $path) : void
|
||||
{
|
||||
if (! is_dir($path)) {
|
||||
throw new \InvalidArgumentException("Folder does not exist: {$path}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+34
-20
@@ -11,33 +11,34 @@ use League\Route\Strategy\ApplicationStrategy;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
use Tell\I18n;
|
||||
use Ulmus\Container\AdapterProxy;
|
||||
|
||||
use Laminas\Diactoros\ServerRequestFactory,
|
||||
Laminas\HttpHandlerRunner\Emitter\EmitterInterface;
|
||||
|
||||
use Ulmus\Ulmus;
|
||||
|
||||
class Kernel {
|
||||
|
||||
class Kernel
|
||||
{
|
||||
protected Container $container;
|
||||
|
||||
protected string $locale;
|
||||
|
||||
public array $paths = [];
|
||||
|
||||
public int $errorReporting = E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE;
|
||||
public int $errorReportingDev = -1 & ~E_USER_DEPRECATED & ~E_DEPRECATED ;
|
||||
|
||||
public int $errorReportingProd = E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED /*& ~E_NOTICE*/;
|
||||
|
||||
public array $definitionFilePaths;
|
||||
|
||||
public string $errorLogPath;
|
||||
|
||||
public string $projectPath;
|
||||
public function __construct(
|
||||
public string $projectPath
|
||||
) {
|
||||
# Still not sure about adding a folder check each call just to add a basic project setup error ...
|
||||
# File::assertFolderExists($this->projectPath);
|
||||
|
||||
public function __construct(string $projectPath)
|
||||
{
|
||||
$this->projectPath = $projectPath;
|
||||
define('IS_CLI', php_sapi_name() === 'cli' OR defined('STDIN'));
|
||||
|
||||
$this->setEnvironment();
|
||||
$this->initializeEngine();
|
||||
@@ -46,13 +47,14 @@ class Kernel {
|
||||
$this->handleRequest();
|
||||
}
|
||||
|
||||
public static function putenv($var, $value)
|
||||
public static function putenv($var, $value) : void
|
||||
{
|
||||
putenv("$var=$value");
|
||||
$_ENV[$var] = $value;
|
||||
}
|
||||
|
||||
protected function setEnvironment() {
|
||||
protected function setEnvironment() : void
|
||||
{
|
||||
static::putenv('PROJECT_PATH', $this->projectPath);
|
||||
|
||||
// Environment vars (accessible from \DI\env(), getenv(), $_ENV and $_SERVER)
|
||||
@@ -60,6 +62,11 @@ class Kernel {
|
||||
|
||||
// Override using headers
|
||||
if (($keys = getenv('KEYS')) && ($auth = $_SERVER["HTTP_X_DEV_AUTH"] ?? null) && in_array($auth, explode(',', $keys))) {
|
||||
unset($_SERVER["HTTP_X_DEV_AUTH"]);
|
||||
|
||||
unset($_ENV['KEYS'], $_SERVER['KEYS']);
|
||||
putenv("KEYS=");
|
||||
|
||||
foreach(['APP_ENV', 'DEBUG',] as $env) {
|
||||
if (null !== $value = $_SERVER["HTTP_X_$env"] ?? null) {
|
||||
static::putenv($env, $value);
|
||||
@@ -73,10 +80,12 @@ class Kernel {
|
||||
$path = getenv("PROJECT_PATH") . DIRECTORY_SEPARATOR . getenv($envkey);
|
||||
|
||||
if (getenv('DEBUG') && ! file_exists($path)) {
|
||||
if (false === mkdir($path, 0755, true)) {
|
||||
if (false === @mkdir($path, 0755, true)) {
|
||||
if (! IS_CLI) {
|
||||
throw new \Exception(sprintf("Folder '%s' could not be created", $path));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static::putenv($name, realpath($path));
|
||||
}
|
||||
@@ -95,11 +104,16 @@ class Kernel {
|
||||
\Locale::setDefault($this->locale);
|
||||
}
|
||||
|
||||
ini_set("log_errors", "1");
|
||||
ini_set("error_log", $this->errorLogPath);
|
||||
ini_set('display_errors', getenv("DEBUG") ? 'on' : 'on');
|
||||
ini_set("error_log", $this->errorLogPath ?? getenv("LOGS_PATH") . DIRECTORY_SEPARATOR. date("Y-m").".log");
|
||||
ini_set("log_errors", true);
|
||||
ini_set('display_errors', getenv("DEBUG") ? 'on' : 'off');
|
||||
|
||||
error_reporting($this->errorReporting);
|
||||
if (getenv("DEBUG")) {
|
||||
error_reporting(getenv('ERROR_REPORTING_DEV') ?: $this->errorReportingDev);
|
||||
}
|
||||
else {
|
||||
error_reporting(getenv('ERROR_REPORTING_PROD') ?: $this->errorReportingProd);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -112,7 +126,8 @@ class Kernel {
|
||||
|
||||
if (getenv("APP_ENV") === "prod") {
|
||||
if (getenv("CACHE_PATH")) {
|
||||
# check if ACPU is there first, $containerBuilder->enableDefinitionCache();
|
||||
# check if ACPU is there first,
|
||||
# $containerBuilder->enableDefinitionCache(); # Do not work .. ?
|
||||
|
||||
$containerBuilder->enableCompilation(getenv("CACHE_PATH") . "/di/");
|
||||
# No proxies yet... $containerBuilder->writeProxiesToFile(true, getenv("CACHE_PATH") . "/di/");
|
||||
@@ -157,7 +172,6 @@ class Kernel {
|
||||
|
||||
# Must be removed from KERNEL !
|
||||
$this->container->has('ulmus.caching') and (Ulmus::$cache = $this->container->get('ulmus.caching'));
|
||||
# $this->container->has(AdapterProxy::class) and ( $ )
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -180,4 +194,4 @@ class Kernel {
|
||||
|
||||
return $this;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -244,4 +244,15 @@ class Lean
|
||||
|
||||
return call_user_func($func);
|
||||
}
|
||||
|
||||
public static function path(...$parts) : string
|
||||
{
|
||||
return implode(DIRECTORY_SEPARATOR, $parts);
|
||||
}
|
||||
|
||||
|
||||
public static function rawPath(...$parts) : string
|
||||
{
|
||||
return implode(DIRECTORY_SEPARATOR, $parts);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,6 @@ class FileDownloadResponse extends Response
|
||||
else {
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$mime = finfo_file($finfo, $filepath);
|
||||
finfo_close($finfo);
|
||||
}
|
||||
|
||||
parent::__construct(
|
||||
|
||||
@@ -44,6 +44,11 @@ class Routing {
|
||||
|
||||
$container->set(ServerRequestInterface::class, $request);
|
||||
|
||||
# Decoding arguments received from the router
|
||||
foreach($arguments as &$arg) {
|
||||
$arg = urldecode($arg);
|
||||
}
|
||||
|
||||
return $this->response ?? $object->$method($request, $arguments);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{% arguments array $contextList %}
|
||||
|
||||
{% if $contextList %}
|
||||
<div class="message-wrapper">{% php
|
||||
foreach($contextList as $name => $context) {
|
||||
foreach($context->formContextMessages ?? [] as $message) {
|
||||
echo $message->render();
|
||||
}
|
||||
}
|
||||
%}</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,23 @@
|
||||
{% arguments \DateInterval $interval %}
|
||||
|
||||
{% if $interval->y %}
|
||||
{% lang "lean.date.interval.years", [ 'years' => $interval->y ] %},
|
||||
{% endif %}
|
||||
|
||||
{% if $interval->m %}
|
||||
{% lang "lean.date.interval.months", [ 'months' => $interval->m ] %},
|
||||
{% endif %}
|
||||
|
||||
{% if $interval->d %}
|
||||
{% lang "lean.date.interval.days", [ 'days' => $interval->d ] %},
|
||||
{% endif %}
|
||||
|
||||
{% if $interval->h %}
|
||||
{% lang "lean.date.interval.hours", [ 'hours' => $interval->h ] %},
|
||||
{% endif %}
|
||||
|
||||
{% if $interval->i %}
|
||||
{% lang "lean.date.interval.minutes", [ 'minutes' => $interval->i ] %}
|
||||
{% else %}
|
||||
{% lang "lean.date.interval.seconds", [ 'seconds' => $interval->s ] %}
|
||||
{% endif %}
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="title">{% _ "title" %}</div>
|
||||
<div class="subtitle">{% _ "subtitle" %}</div>
|
||||
<div class="content">{% _ "message" %}</div>
|
||||
<u><a href="#" onclick="history.back()">{% _ "back" %}</a></u>
|
||||
<u><a href="{% url %}">{% _ "back" %}</a></u>
|
||||
</div>
|
||||
{% endsection %}
|
||||
|
||||
@@ -22,5 +22,5 @@
|
||||
{% section "head.css" %}
|
||||
.title {font-size:2rem}
|
||||
.subtitle {font-size:1.25rem; padding-top: 1rem;}
|
||||
.content {padding-top:1rem}
|
||||
.content {background: #f7f7f7;padding: 7px;color: #8c3c3c;max-height:300px;overflow-y:auto}
|
||||
{% endsection %}
|
||||
@@ -18,9 +18,3 @@
|
||||
{% view "lean/picto/undraw_lost" %}
|
||||
</div>
|
||||
{% endsection %}
|
||||
|
||||
{% section "head.css" %}
|
||||
.title {font-size:2rem}
|
||||
.subtitle {font-size:1.25rem; padding-top: 1rem;}
|
||||
.content {padding-top:1rem}
|
||||
{% endsection %}
|
||||
@@ -18,9 +18,3 @@
|
||||
{% view "lean/picto/undraw_error" %}
|
||||
</div>
|
||||
{% endsection %}
|
||||
|
||||
{% section "head.css" %}
|
||||
.title {font-size:2rem}
|
||||
.subtitle {font-size:1.25rem; padding-top: 1rem;}
|
||||
.content {background: #f7f7f7;padding: 7px;color: #8c3c3c;max-height:300px;overflow-y:auto}
|
||||
{% endsection %}
|
||||
@@ -2,6 +2,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="Content-Type" content="text/html; ">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>{{ title() }}</title>
|
||||
@@ -10,14 +11,14 @@
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
|
||||
|
||||
<style>
|
||||
body {background:#272822}
|
||||
body {background:#272822;min-height:100vh;}
|
||||
#main-content {min-height: 100vh;width: 100vw;align-items:center;justify-content: center;}
|
||||
#wrapper-content {max-width:960px; max-height:65vh;flex-direction:row-reverse; margin:0 10vw}
|
||||
#wrapper-content .content-right {background:#efefef;padding:5vh 2vw;align-items:center;display:flex;justify-content:center; width:100%;border-radius:6px 0 0 6px}
|
||||
#wrapper-content .content-left {background:#ffffff;padding:5vh 2vw;border-radius:0 6px 6px 0;display:flex;align-items:center;justify-content: center}
|
||||
|
||||
.form-user-login {width:80%;}
|
||||
.picto-login svg {max-width:100%;}
|
||||
.picto-login svg {max-width:100%;width:100%;max-height:33vh}
|
||||
|
||||
{% section "head.css" %}{% endsection %}
|
||||
</style>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<svg id="a63b68c9-40cd-4f97-89ed-e7d494eb42f9" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="742.41705" height="712.57302" viewBox="0 0 742.41705 712.57302"><path id="aa38b2e7-2ea9-4025-adcf-83f87c0cfc4a" data-name="Path 968" d="M853.60644,262.60547h-3.9v-106.977a61.915,61.915,0,0,0-61.915-61.915h-226.65a61.915,61.915,0,0,0-61.916,61.914v586.884a61.915,61.915,0,0,0,61.915,61.915h226.648a61.915,61.915,0,0,0,61.915-61.915v-403.758h3.9Z" transform="translate(-228.79147 -93.71349)" fill="#3f3d56"/><path id="f27259c2-0089-4137-bfd8-cb22dff914f1" data-name="Path 969" d="M837.00647,151.48149v595.175a46.959,46.959,0,0,1-46.942,46.952h-231.3a46.966,46.966,0,0,1-46.973-46.952v-595.175a46.965,46.965,0,0,1,46.971-46.951h28.058a22.329,22.329,0,0,0,20.656,30.74h131.868a22.329,22.329,0,0,0,20.656-30.74h30.055a46.959,46.959,0,0,1,46.951,46.942Z" transform="translate(-228.79147 -93.71349)" fill="#fff"/><circle id="fc31cc31-f989-45cc-bd1e-521a0ee1871b" data-name="Ellipse 18" cx="445.56497" cy="200.129" r="96.565" fill="#6c63ff"/><path id="a573942c-3bf3-4c43-b474-689725a927f7" data-name="Path 39" d="M779.67245,494.30947h-205.537a3.81,3.81,0,0,1-3.806-3.806V439.51949a3.811,3.811,0,0,1,3.806-3.806h205.537a3.811,3.811,0,0,1,3.806,3.806v50.985a3.811,3.811,0,0,1-3.806,3.806Zm-205.537-57.074a2.286,2.286,0,0,0-2.284,2.284v50.985a2.286,2.286,0,0,0,2.284,2.284h205.537a2.286,2.286,0,0,0,2.284-2.284v-50.985a2.286,2.286,0,0,0-2.284-2.284Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="fb5feb1e-1fe2-48fa-806d-0a2b51d12b49" data-name="Path 40" d="M637.69945,454.07448a2.66449,2.66449,0,0,0,0,5.329h125.605a2.665,2.665,0,0,0,.2041-5.32611q-.0585-.00221-.11713-.0019h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="bcb9932f-0864-4b7e-b0ed-f7254bb9b8bf" data-name="Path 41" d="M637.69945,470.05846a2.66449,2.66449,0,0,0,0,5.329h125.605a2.665,2.665,0,0,0,.2041-5.32611q-.0585-.00219-.11713-.00189h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="f88e2a8b-becc-4da9-bd36-af011daaaaf2" data-name="Path 42" d="M779.67245,579.28947h-205.537a3.81,3.81,0,0,1-3.806-3.806V524.49949a3.811,3.811,0,0,1,3.806-3.806h205.537a3.811,3.811,0,0,1,3.806,3.806v50.985A3.811,3.811,0,0,1,779.67245,579.28947Zm-205.537-57.074a2.286,2.286,0,0,0-2.284,2.284v50.985a2.286,2.286,0,0,0,2.284,2.284h205.537a2.286,2.286,0,0,0,2.284-2.284v-50.985a2.286,2.286,0,0,0-2.284-2.284Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="e192d34f-2ccc-4f79-b47a-46430e4d87f6" data-name="Path 43" d="M637.69945,539.33047a2.66449,2.66449,0,0,0,0,5.329h125.605a2.665,2.665,0,0,0,.087-5.328h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="b230677c-48cc-4ee6-87d6-a753204ffe47" data-name="Path 44" d="M637.69945,555.3185a2.66449,2.66449,0,0,0,0,5.329h125.605a2.665,2.665,0,0,0,.087-5.328h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="b88a2a79-0ae3-4fd9-9894-02e0db9a2271" data-name="Path 39-2" d="M779.67245,664.54748h-205.537a3.81,3.81,0,0,1-3.806-3.806V609.7575a3.811,3.811,0,0,1,3.806-3.806h205.537a3.811,3.811,0,0,1,3.806,3.806v50.985a3.811,3.811,0,0,1-3.806,3.806Zm-205.537-57.074a2.286,2.286,0,0,0-2.284,2.284v50.985a2.286,2.286,0,0,0,2.284,2.284h205.537a2.286,2.286,0,0,0,2.284-2.284v-50.985a2.286,2.286,0,0,0-2.284-2.284Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="aa2394a9-8b56-4a12-a2cd-a583e6ea12eb" data-name="Path 40-2" d="M637.69945,624.59148a2.66449,2.66449,0,1,0,0,5.329h125.605a2.665,2.665,0,0,0,.2041-5.32611q-.0585-.00219-.11713-.00189h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="bc352cb2-8959-4b51-bd18-df6817a9a47e" data-name="Path 41-2" d="M637.69945,640.57846a2.66449,2.66449,0,0,0,0,5.329h125.605a2.665,2.665,0,0,0,.2041-5.32611q-.0585-.0022-.11713-.00189h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="b30ee82f-5b3a-4aa4-9db7-ead828191937" data-name="Path 970" d="M969.27042,806.28651h-738.541c-1.071,0-1.938-.468-1.938-1.045s.868-1.045,1.938-1.045H969.27054c1.06994,0,1.938.468,1.938,1.045S970.34146,806.28651,969.27042,806.28651Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><g id="f24cf2fd-107c-4150-a0f1-6f6b12d88bf3" data-name="Group 58"><path id="a2b576eb-bb95-4480-aa60-cd8aa023fe61" data-name="Path 438" d="M937.99248,765.52151a19.4741,19.4741,0,0,1-18.806-3.313c-6.587-5.528-8.652-14.636-10.332-23.07l-4.97-24.945,10.405,7.165c7.483,5.152,15.134,10.47,20.316,17.933s7.443,17.651,3.28,25.726" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="fe1c5433-44e0-47a6-8430-329cbd7c4dea" data-name="Path 439" d="M936.38547,797.45852c1.31-9.542,2.657-19.206,1.738-28.849-.816-8.565-3.429-16.93-8.749-23.789a39.57365,39.57365,0,0,0-10.153-9.2c-1.015-.641-1.95.968-.939,1.606a37.62192,37.62192,0,0,1,14.881,17.956c3.24,8.241,3.76,17.224,3.2,25.977-.338,5.294-1.053,10.553-1.774,15.805a.964.964,0,0,0,.6Line truncated
|
||||
<svg width="742" height="712" id="a63b68c9-40cd-4f97-89ed-e7d494eb42f9" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.41705 712.57302"><path id="aa38b2e7-2ea9-4025-adcf-83f87c0cfc4a" data-name="Path 968" d="M853.60644,262.60547h-3.9v-106.977a61.915,61.915,0,0,0-61.915-61.915h-226.65a61.915,61.915,0,0,0-61.916,61.914v586.884a61.915,61.915,0,0,0,61.915,61.915h226.648a61.915,61.915,0,0,0,61.915-61.915v-403.758h3.9Z" transform="translate(-228.79147 -93.71349)" fill="#3f3d56"/><path id="f27259c2-0089-4137-bfd8-cb22dff914f1" data-name="Path 969" d="M837.00647,151.48149v595.175a46.959,46.959,0,0,1-46.942,46.952h-231.3a46.966,46.966,0,0,1-46.973-46.952v-595.175a46.965,46.965,0,0,1,46.971-46.951h28.058a22.329,22.329,0,0,0,20.656,30.74h131.868a22.329,22.329,0,0,0,20.656-30.74h30.055a46.959,46.959,0,0,1,46.951,46.942Z" transform="translate(-228.79147 -93.71349)" fill="#fff"/><circle id="fc31cc31-f989-45cc-bd1e-521a0ee1871b" data-name="Ellipse 18" cx="445.56497" cy="200.129" r="96.565" fill="#6c63ff"/><path id="a573942c-3bf3-4c43-b474-689725a927f7" data-name="Path 39" d="M779.67245,494.30947h-205.537a3.81,3.81,0,0,1-3.806-3.806V439.51949a3.811,3.811,0,0,1,3.806-3.806h205.537a3.811,3.811,0,0,1,3.806,3.806v50.985a3.811,3.811,0,0,1-3.806,3.806Zm-205.537-57.074a2.286,2.286,0,0,0-2.284,2.284v50.985a2.286,2.286,0,0,0,2.284,2.284h205.537a2.286,2.286,0,0,0,2.284-2.284v-50.985a2.286,2.286,0,0,0-2.284-2.284Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="fb5feb1e-1fe2-48fa-806d-0a2b51d12b49" data-name="Path 40" d="M637.69945,454.07448a2.66449,2.66449,0,0,0,0,5.329h125.605a2.665,2.665,0,0,0,.2041-5.32611q-.0585-.00221-.11713-.0019h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="bcb9932f-0864-4b7e-b0ed-f7254bb9b8bf" data-name="Path 41" d="M637.69945,470.05846a2.66449,2.66449,0,0,0,0,5.329h125.605a2.665,2.665,0,0,0,.2041-5.32611q-.0585-.00219-.11713-.00189h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="f88e2a8b-becc-4da9-bd36-af011daaaaf2" data-name="Path 42" d="M779.67245,579.28947h-205.537a3.81,3.81,0,0,1-3.806-3.806V524.49949a3.811,3.811,0,0,1,3.806-3.806h205.537a3.811,3.811,0,0,1,3.806,3.806v50.985A3.811,3.811,0,0,1,779.67245,579.28947Zm-205.537-57.074a2.286,2.286,0,0,0-2.284,2.284v50.985a2.286,2.286,0,0,0,2.284,2.284h205.537a2.286,2.286,0,0,0,2.284-2.284v-50.985a2.286,2.286,0,0,0-2.284-2.284Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="e192d34f-2ccc-4f79-b47a-46430e4d87f6" data-name="Path 43" d="M637.69945,539.33047a2.66449,2.66449,0,0,0,0,5.329h125.605a2.665,2.665,0,0,0,.087-5.328h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="b230677c-48cc-4ee6-87d6-a753204ffe47" data-name="Path 44" d="M637.69945,555.3185a2.66449,2.66449,0,0,0,0,5.329h125.605a2.665,2.665,0,0,0,.087-5.328h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="b88a2a79-0ae3-4fd9-9894-02e0db9a2271" data-name="Path 39-2" d="M779.67245,664.54748h-205.537a3.81,3.81,0,0,1-3.806-3.806V609.7575a3.811,3.811,0,0,1,3.806-3.806h205.537a3.811,3.811,0,0,1,3.806,3.806v50.985a3.811,3.811,0,0,1-3.806,3.806Zm-205.537-57.074a2.286,2.286,0,0,0-2.284,2.284v50.985a2.286,2.286,0,0,0,2.284,2.284h205.537a2.286,2.286,0,0,0,2.284-2.284v-50.985a2.286,2.286,0,0,0-2.284-2.284Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="aa2394a9-8b56-4a12-a2cd-a583e6ea12eb" data-name="Path 40-2" d="M637.69945,624.59148a2.66449,2.66449,0,1,0,0,5.329h125.605a2.665,2.665,0,0,0,.2041-5.32611q-.0585-.00219-.11713-.00189h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="bc352cb2-8959-4b51-bd18-df6817a9a47e" data-name="Path 41-2" d="M637.69945,640.57846a2.66449,2.66449,0,0,0,0,5.329h125.605a2.665,2.665,0,0,0,.2041-5.32611q-.0585-.0022-.11713-.00189h-125.692Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="b30ee82f-5b3a-4aa4-9db7-ead828191937" data-name="Path 970" d="M969.27042,806.28651h-738.541c-1.071,0-1.938-.468-1.938-1.045s.868-1.045,1.938-1.045H969.27054c1.06994,0,1.938.468,1.938,1.045S970.34146,806.28651,969.27042,806.28651Z" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><g id="f24cf2fd-107c-4150-a0f1-6f6b12d88bf3" data-name="Group 58"><path id="a2b576eb-bb95-4480-aa60-cd8aa023fe61" data-name="Path 438" d="M937.99248,765.52151a19.4741,19.4741,0,0,1-18.806-3.313c-6.587-5.528-8.652-14.636-10.332-23.07l-4.97-24.945,10.405,7.165c7.483,5.152,15.134,10.47,20.316,17.933s7.443,17.651,3.28,25.726" transform="translate(-228.79147 -93.71349)" fill="#e6e6e6"/><path id="fe1c5433-44e0-47a6-8430-329cbd7c4dea" data-name="Path 439" d="M936.38547,797.45852c1.31-9.542,2.657-19.206,1.738-28.849-.816-8.565-3.429-16.93-8.749-23.789a39.57365,39.57365,0,0,0-10.153-9.2c-1.015-.641-1.95.968-.939,1.606a37.62192,37.62192,0,0,1,14.881,17.956c3.24,8.241,3.76,17.224,3.2,25.977-.338,5.294-1.053,10.553-1.774,15.805a.964.964,0,0,0,.65,1.144.936.Line truncated
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@@ -22,7 +22,7 @@
|
||||
{% slot "week.heading", $day, $month, $year %}
|
||||
<div class="day-box">
|
||||
{# Random calendar date that starts on a sunday #}
|
||||
{{ substr(( new Date("2019-12-$day") )->formatLocale("%A"), 0, 3) }}
|
||||
{{ new Date("2019-12-$day")->formatLocaleIntl(\IntlDateFormatter::SHORT, \IntlDateFormatter::NONE, 'EEE') }}
|
||||
</div>
|
||||
{% endslot %}
|
||||
{% endforeach %}
|
||||
|
||||
@@ -5,14 +5,4 @@
|
||||
if ($context && ! in_array($context, $messageList)) {
|
||||
$messageList[] = $context;
|
||||
}
|
||||
%}
|
||||
|
||||
{% if $messageList %}
|
||||
<div class="message-wrapper">{% php
|
||||
foreach($messageList as $name => $context) {
|
||||
foreach($context->messages ?? [] as $message) {
|
||||
echo $message->render();
|
||||
}
|
||||
}
|
||||
%}</div>
|
||||
{% endif %}
|
||||
%}{% block "lean/block/message", $messageList %}{% endblock %}
|
||||
Reference in new issue
Block a user