From fb92a60245e1aea2d7aa2b0086441173a48affb9 Mon Sep 17 00:00:00 2001 From: bidi Date: Mon, 21 Sep 2026 15:31:24 +0300 Subject: [PATCH] fixed inconsistencies with dotkernel/admin repo Signed-off-by: bidi --- docs/book/v7/how-to/authorization.md | 52 +++++++++++-------- docs/book/v7/how-to/dependency-injection.md | 6 +-- docs/book/v7/introduction/file-structure.md | 6 +-- docs/book/v7/introduction/packages.md | 42 +++++++++------ .../v7/introduction/server-requirements.md | 4 +- .../create-book-module-via-dot-maker.md | 2 +- 6 files changed, 63 insertions(+), 49 deletions(-) diff --git a/docs/book/v7/how-to/authorization.md b/docs/book/v7/how-to/authorization.md index dd898b2..f02dd13 100644 --- a/docs/book/v7/how-to/authorization.md +++ b/docs/book/v7/how-to/authorization.md @@ -13,22 +13,28 @@ The `authorization.global.php` file provides multiple configurations specifying ```php //example of a flat RBAC model that specifies two types of roles as well as their permission - 'roles' => [ - 'admin' => [ - 'permissions' => [ - 'authenticated', - 'edit', - 'delete', - //etc.. - ] +'dot_authorization' => [ + 'role_provider' => [ + 'options' => [ + 'roles' => [ + 'admin' => [ + 'permissions' => [ + 'authenticated', + 'edit', + 'delete', + //etc.. + ] + ], + 'user' => [ + 'permissions' => [ + 'authenticated', + //etc.. + ] + ] + ], ], - 'user' => [ - 'permissions' => [ - 'authenticated', - //etc.. - ] - ] - ] + ], +] ``` The `authorization-guards.global.php` file defines which permissions are required to access specific route handlers. @@ -37,14 +43,14 @@ These permissions must first be declared in the `authorization.global.php` (dot- ```php // Example configuration granting access to route handlers based on permissions. 'rules' => [ - 'admin::admin-login-form' => [], - 'admin::admin-login' => [], - 'admin::admin-create-form' => ['authenticated'], - 'admin::admin-create' => ['authenticated'], - 'admin::admin-delete-form' => ['authenticated'], - 'admin::admin-delete' => ['authenticated'], - 'admin::admin-edit-form' => ['authenticated'], - 'admin::admin-edit' => ['authenticated'], + 'admin::login-admin-form' => ['unauthenticated'], + 'admin::login-admin' => ['unauthenticated'], + 'admin::create-admin-form' => ['authenticated'], + 'admin::create-admin' => ['authenticated'], + 'admin::delete-admin-form' => ['authenticated'], + 'admin::delete-admin' => ['authenticated'], + 'admin::edit-admin-form' => ['authenticated'], + 'admin::edit-admin' => ['authenticated'], ] ``` diff --git a/docs/book/v7/how-to/dependency-injection.md b/docs/book/v7/how-to/dependency-injection.md index 30ebb55..b35790b 100644 --- a/docs/book/v7/how-to/dependency-injection.md +++ b/docs/book/v7/how-to/dependency-injection.md @@ -20,12 +20,12 @@ Dotkernel Admin comes out of the box with the [dot-dependency-injection](https:/ `dot-dependency-injection` determines the dependencies by looking at the `#[Inject]` attribute, added to the constructor of a class. Each dependency is specified as a separate parameter of the `#[Inject]` attribute. -For our example we will inject `RouterInterface` and `AuthenticationServiceInterface` dependencies into `GetAccountLogoutHandler`. +For our example we will inject `RouterInterface` and `AuthenticationServiceInterface` dependencies into `GetLogoutAccountHandler`. ```php use Dot\DependencyInjection\Attribute\Inject; -class GetAccountLogoutHandler implements RequestHandlerInterface +class GetLogoutAccountHandler implements RequestHandlerInterface { #[Inject( RouterInterface::class, @@ -48,7 +48,7 @@ public function getDependencies(): array { return [ 'factories' => [ - GetAccountLogoutHandler::class => AttributedServiceFactory::class, + GetLogoutAccountHandler::class => AttributedServiceFactory::class, ], ]; } diff --git a/docs/book/v7/introduction/file-structure.md b/docs/book/v7/introduction/file-structure.md index aa43150..fc9f7f4 100644 --- a/docs/book/v7/introduction/file-structure.md +++ b/docs/book/v7/introduction/file-structure.md @@ -35,15 +35,14 @@ This folder contains all application-related config files: * `config.php` - Registers ConfigProviders for installing packages * `container.php` - Main service container that provides access to all registered services * `development.config.php.dist` - Activates debug mode; gets symlinked as `development.config.php` when enabling development mode -* `migrations.php` - Configuration for database migration, like migration file location and table to save the migration log * `pipeline.php` - Contains a list of middlewares, in the order of their execution +* `routes.php` - Registers the application's routes * `twig-cs-fixer.php` - Configuration file for Twig code style checker/fixer ### `config/autoload` folder This folder contains all service-related local and global config files: -* `app.global.php` - Configures basic app variables * `authentication.global.php` - Defines the Admin identity * `authorization.global.php` - Configures permissions for user roles * `authorization-guards.global.php` - Configures access per route for user roles @@ -52,6 +51,7 @@ This folder contains all service-related local and global config files: * `dependencies.global.php` - Config file to set global dependencies that should be accessible by all modules * `development.local.php.dist` - Gets symlinked as `development.local.php` when enabling development mode; activates error handlers * `error-handling.global.php` - Configures and activates error logs +* `geoip.global.php` - Configures the GeoLite2 synchronizer command * `local.php.dist` - Local config file where you can overwrite application name and URL * `local.test.php.dist` - Local configuration for functional tests * `mail.global.php` - Mail configuration; e.g. sendmail vs smtp, message configuration, mail logging @@ -85,7 +85,7 @@ This folder contains all publicly available assets and serves as the entry point * `uploads` - a folder that normally contains admin avatar images * `.htaccess` - server configuration file used by Apache web server; it enables the URL rewrite functionality * `index.php` - the application's main entry point -* `robots.txt.dist` - a sample robots.txt file that allows/denies bot access to certain areas of your application; activate it by duplicating the file as `robots.txt` and comment out the lines that don't match your environment +* `robots.txt` - controls bot access to certain areas of your application; ships ready to use, edit the lines that don't match your environment ## `src` folder diff --git a/docs/book/v7/introduction/packages.md b/docs/book/v7/introduction/packages.md index 454f255..76754e1 100644 --- a/docs/book/v7/introduction/packages.md +++ b/docs/book/v7/introduction/packages.md @@ -4,18 +4,16 @@ This page lists the main Composer packages Dotkernel Admin depends on, covering Doctrine, Dotkernel, Laminas and Mezzio components. -## Details +## Direct Dependencies -* `doctrine/dbal`:`^4.4` - Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management. -* `doctrine/orm`:`^3.6` - Object-Relational-Mapper for PHP -* `dotkernel/dot-authorization`:`^3.8` - Authorization base package defining interfaces for authorization services to be used with Dotkernel applications * `dotkernel/dot-cache`:`^4.4` - Cache component extending symfony-cache * `dotkernel/dot-cli`:`^3.10` - Component for creating console applications based on laminas-cli -* `dotkernel/dot-controller`:`^3.6` - Provides base classes for action based controllers similar to Laminas controller component * `dotkernel/dot-data-fixtures`:`^1.5` - Provides a CLI interface for listing & executing doctrine data fixtures * `dotkernel/dot-dependency-injection`:`^1.3` - Dependency injection component using class attributes * `dotkernel/dot-errorhandler`:`^4.0` - Logging Error Handler for Middleware Applications * `dotkernel/dot-flashmessenger`:`^3.7` - Provides session messages between redirects +* `dotkernel/dot-geoip`:`^3.10.1` - Synchronizes and manages GeoLite2 databases +* `dotkernel/dot-helpers`:`^3.9.0` - Helper utilities used across Dotkernel applications * `dotkernel/dot-mail`:`^5.1` - Mail component based on laminas-mail * `dotkernel/dot-navigation`:`^3.6` - Allows you to easily define and parse menus inside templates, configuration based approach * `dotkernel/dot-rbac-guard`:`^3.7` - Defines authorization guards that authorize users for accessing certain parts of an application based on various criteria @@ -23,24 +21,34 @@ This page lists the main Composer packages Dotkernel Admin depends on, covering * `dotkernel/dot-session`"`^5.8` - Dotkernel session component extending and customizing laminas-session * `dotkernel/dot-twigrenderer`:`^3.7` - Dotkernel component providing twig extensions and customizations * `friendsofphp/proxy-manager-lts`:`^1.0` - Fork of ocramius/proxy-manager -* `laminas/laminas-authentication`:`^2.19` - API for authentication and includes concrete authentication adapters for common use case scenarios * `laminas/laminas-component-installer`:`^3.7` - Composer plugin for injecting modules and configuration providers into application configuration * `laminas/laminas-config-aggregator`:`^1.19` - Lightweight library for collecting and merging configuration from different sources -* `laminas/laminas-form`:`^3.24` - Bridge between your domain models and the View Layer -* `laminas/laminas-hydrator`:`^4.18` - Serialize objects to arrays, and vice versa -* `laminas/laminas-inputfilter`:`^2.35` - Normalize and validate input sets from the web, APIs, the CLI, and more, including files -* `laminas/laminas-servicemanager`:`^3.24` - Factory-Driven Dependency Injection Container -* `laminas/laminas-stdlib`:`^3.21` - SPL extensions, array utilities, error handlers, and more -* `mezzio/mezzio`:`^3.27` - PSR-15 Middleware Microframework -* `mezzio/mezzio-authentication-oauth2`:`^2.14` - OAuth2 (server) authentication middleware for Mezzio and PSR-15 applications +* `mezzio/mezzio`:`^3.26.0` - PSR-15 Middleware Microframework +* `mezzio/mezzio-authentication-oauth2`:`^3.0.1` - OAuth2 (server) authentication middleware for Mezzio and PSR-15 applications * `mezzio/mezzio-authorization-rbac`:`^1.10` - mezzio authorization rbac adapter for laminas/laminas-permissions-rbac -* `mezzio/mezzio-cors`:`^1.16` - CORS component for Mezzio and other PSR-15 middleware runners +* `mezzio/mezzio-cors`:`^1.15.0` - CORS component for Mezzio and other PSR-15 middleware runners * `mezzio/mezzio-fastroute`:`^3.14` - FastRoute integration for Mezzio -* `mezzio/mezzio-helpers`:`^5.20` - Helper/Utility classes for Mezzio * `ramsey/uuid`:`^4.9` - A PHP library for generating and working with universally unique identifiers (UUIDs) * `ramsey/uuid-doctrine`:`^2.1` - Use ramsey/uuid as a Doctrine field type -* `roave/psr-container-doctrine`:`^6.1` - Doctrine Factories for PSR-11 Containers -* `symfony/filesystem`:`^8.0` - Provides basic utilities for the filesystem +* `roave/psr-container-doctrine`:`^5.2.2 || ^6.0.0` - Doctrine Factories for PSR-11 Containers +* `symfony/var-exporter`:`^6.4 || ^7.4` - Exports a PHP value to a string of PHP code + +## Transitive Dependencies + +These packages are not required directly in `composer.json`, but are pulled in by the packages above and used throughout Dotkernel Admin. +Versions below are the ones actually resolved by Composer, not a direct version constraint. + +* `doctrine/dbal`:`4.4.3` - Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management. +* `doctrine/orm`:`3.6.3` - Object-Relational-Mapper for PHP +* `dotkernel/dot-authorization`:`3.8.1` - Authorization base package defining interfaces for authorization services to be used with Dotkernel applications +* `dotkernel/dot-controller`:`3.6.0` - Provides base classes for action based controllers similar to Laminas controller component +* `laminas/laminas-authentication`:`2.19.0` - API for authentication and includes concrete authentication adapters for common use case scenarios +* `laminas/laminas-form`:`3.24.2` - Bridge between your domain models and the View Layer +* `laminas/laminas-hydrator`:`4.18.0` - Serialize objects to arrays, and vice versa +* `laminas/laminas-inputfilter`:`2.35.0` - Normalize and validate input sets from the web, APIs, the CLI, and more, including files +* `laminas/laminas-servicemanager`:`3.24.0` - Factory-Driven Dependency Injection Container +* `laminas/laminas-stdlib`:`3.21.0` - SPL extensions, array utilities, error handlers, and more +* `mezzio/mezzio-helpers`:`5.20.0` - Helper/Utility classes for Mezzio ## FAQ diff --git a/docs/book/v7/introduction/server-requirements.md b/docs/book/v7/introduction/server-requirements.md index 90e9e59..328ccab 100644 --- a/docs/book/v7/introduction/server-requirements.md +++ b/docs/book/v7/introduction/server-requirements.md @@ -21,7 +21,7 @@ For production, we highly recommend a *nix based system. You need to convert the provided Apache related `.htaccess` file into Nginx configuration instructions. -## PHP >= 8.2 +## PHP >= 8.3 Both mod_php and FCGI (FPM) are supported. @@ -55,7 +55,7 @@ Both mod_php and FCGI (FPM) are supported. **Q: What is the minimum required PHP version?** -A: PHP 8.2 or above, supported through either mod_php or FCGI (FPM). +A: PHP 8.3 or above, supported through either mod_php or FCGI (FPM). **Q: Which databases are supported?** diff --git a/docs/book/v7/tutorials/create-book-module-via-dot-maker.md b/docs/book/v7/tutorials/create-book-module-via-dot-maker.md index 5a294fd..81f3125 100644 --- a/docs/book/v7/tutorials/create-book-module-via-dot-maker.md +++ b/docs/book/v7/tutorials/create-book-module-via-dot-maker.md @@ -955,7 +955,7 @@ php ./vendor/bin/doctrine-migrations migrate ## Update the authorization file We need to configure access to the newly created endpoints. -Open `config/autoload/authorization-guards.global.php` and append the below routes to the `guards.options.rules` key: +Open `config/autoload/authorization-guards.global.php` and append the below routes to the `dot_authorization.guards_provider.options.guards[0].options.rules` key: ```php 'book::create-book-form' => ['authenticated'],