diff --git a/meta/definitions/language.php b/meta/definitions/language.php index 07afe90..9a7942a 100644 --- a/meta/definitions/language.php +++ b/meta/definitions/language.php @@ -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; diff --git a/meta/definitions/routes.php b/meta/definitions/routes.php index a81c64f..5d0140f 100644 --- a/meta/definitions/routes.php +++ b/meta/definitions/routes.php @@ -15,7 +15,10 @@ use Notes\Breadcrumb\Breadcrumb; use Storage\SessionMiddleware; -use Psr\Http\Message\{ ResponseInterface, ServerRequestInterface }; +use Ulmus\User\Middleware\{ + HeaderAuthenticationMiddleware, + PostRequestAuthenticationMiddleware +}; return [ Lean\Routing::class => autowire(Lean\Routing::class), @@ -65,7 +68,7 @@ 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); @@ -74,4 +77,4 @@ return [ return $router; }; }, -]; +]; \ No newline at end of file diff --git a/skeleton/.env b/skeleton/.env index 7d73d77..85e71b6 100644 --- a/skeleton/.env +++ b/skeleton/.env @@ -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" - -LEAN_RANDOM = "%RAND64%" +#DATABASE_PORT = "" +#DATABASE_HOST = "" +#DATABASE_NAME = "" +#DATABASE_USERNAME = "" +#DATABASE_PASSWORD = "" +#DATABASE_CHARSET = "utf8" +#DATABASE_ADAPTER = "MariaDB" +LEAN_RANDOM = "%RAND64%" \ No newline at end of file diff --git a/skeleton/meta/config.php b/skeleton/meta/config.php index 3ca7a16..a43390b 100644 --- a/skeleton/meta/config.php +++ b/skeleton/meta/config.php @@ -19,7 +19,7 @@ return [ 'ulmus' => [ 'connections' => [ - 'default' => [ + /*'default' => [ 'adapter' => getenv("DATABASE_ADAPTER"), 'host' => getenv("DATABASE_HOST"), 'port' => getenv("DATABASE_PORT"), @@ -29,18 +29,18 @@ 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")), 'pragma_begin' => array_merge( - explode(',', getenv("SQLITE_PRAGMA_BEGIN")), explode(',', getenv('DEBUG') ? getenv("SQLITE_PRAGMA_DEBUG_BEGIN") : "") - ), - 'pragma_close' => array_merge( - explode(',', getenv("SQLITE_PRAGMA_CLOSE")), explode(',', getenv('DEBUG') ? getenv("SQLITE_PRAGMA_DEBUG_CLOSE") : "") - ), + explode(',', getenv("SQLITE_PRAGMA_BEGIN")), explode(',', getenv('DEBUG') ? getenv("SQLITE_PRAGMA_DEBUG_BEGIN") : "") + ), + 'pragma_close' => array_merge( + explode(',', getenv("SQLITE_PRAGMA_CLOSE")), explode(',', getenv('DEBUG') ? getenv("SQLITE_PRAGMA_DEBUG_CLOSE") : "") + ), ], ] ] diff --git a/skeleton/src/Lib/ControllerTrait.php b/skeleton/src/Lib/ControllerTrait.php index f53a8c4..282a53e 100644 --- a/skeleton/src/Lib/ControllerTrait.php +++ b/skeleton/src/Lib/ControllerTrait.php @@ -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,9 +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; } \ No newline at end of file