Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 - 2024 DotKernel (https://www.dotkernel.com)
Copyright (c) 2020 - 2024 Dotkernel (https://www.dotkernel.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ Documentation is available at: https://docs.dotkernel.org/admin-documentation/
[![Qodana](https://github.com/dotkernel/admin/actions/workflows/qodana_code_quality.yml/badge.svg?branch=5.0)](https://github.com/dotkernel/admin/actions/workflows/qodana_code_quality.yml)
[![PHPStan](https://github.com/dotkernel/admin/actions/workflows/static-analysis.yml/badge.svg?branch=5.0)](https://github.com/dotkernel/admin/actions/workflows/static-analysis.yml)

## Installing DotKernel `admin`
## Installing Dotkernel `admin`

## Tools

DotKernel can be installed through a single command that utilizes [Composer](https://getcomposer.org/). Because of that,
Composer is required to install DotKernel `admin`.
Dotkernel can be installed through a single command that utilizes [Composer](https://getcomposer.org/). Because of that,
Composer is required to install Dotkernel `admin`.

### Composer

Expand All @@ -44,19 +44,19 @@ Installation instructions:
>If you have never used composer before make sure you read
>the [`Composer Basic Usage`](https://getcomposer.org/doc/01-basic-usage.md) section in Composer's documentation

## Choosing an installation path for DotKernel `admin`
## Choosing an installation path for Dotkernel `admin`

Example:

- absolute path `/var/www/dk-admin`
- or relative path `dk-admin` (equivalent with `./dk-admin`)

## Installing DotKernel `admin`
## Installing Dotkernel `admin`

After choosing the path for DotKernel (`dk-admin` will be used for the remainder of this example) it must be installed.
After choosing the path for Dotkernel (`dk-admin` will be used for the remainder of this example) it must be installed.
There are two installation methods.

### I. Installing DotKernel `admin` using composer
### I. Installing Dotkernel `admin` using composer

>please use the below CLI commands in terminal, do NOT use the PhpStorm buttons

Expand All @@ -73,7 +73,7 @@ The setup script prompts for some configuration settings, for example the lines
[1] config/config.php
Make your selection (default is 1):

Simply select `[0] Do not inject`, because DotKernel includes its own configProvider which already contains the prompted
Simply select `[0] Do not inject`, because Dotkernel includes its own configProvider which already contains the prompted
configurations.

If you choose `[1] config/config.php` Laminas's `ConfigProvider` from `session` will be injected.
Expand All @@ -84,7 +84,7 @@ The next question is:

Type `y` here, and hit `enter`

### II. Installing DotKernel `admin` using git clone
### II. Installing Dotkernel `admin` using git clone

This method requires more manual input, but it ensures that the default branch is installed, even if it is not released.
Run the following command:
Expand All @@ -95,7 +95,7 @@ The dependencies have to be installed separately, by running this command

composer install

Just like for `II Installing DotKernel admin using composer` (see above), the setup asks for configuration settings
Just like for `II Installing Dotkernel admin using composer` (see above), the setup asks for configuration settings
regarding injections (type `0` and hit `enter`) and a confirmation to use this setting for other packages (type `y` and
hit `enter`)

Expand Down Expand Up @@ -248,7 +248,7 @@ If you are still getting exceptions or errors regarding some missing services, t

- Open a web browser and visit `http://localhost:8080/`

You should see the `DotKernel admin` login page.
You should see the `Dotkernel admin` login page.

If you ran the migrations you will have an admin user in the database with the following credentials:

Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"authors": [
{
"name": "DotKernel Team",
"name": "Dotkernel Team",
"email": "team@dotkernel.com"
}
],
Expand All @@ -31,7 +31,6 @@
"ext-gettext": "*",
"dotkernel/dot-cache": "^4.0",
"dotkernel/dot-cli": "^3.5.0",
"dotkernel/dot-controller": "^3.4.3",
"dotkernel/dot-data-fixtures": "^1.1.3",
"dotkernel/dot-dependency-injection": "^1.0",
"dotkernel/dot-errorhandler": "^4.0.0",
Expand Down Expand Up @@ -72,6 +71,8 @@
"psr-4": {
"Admin\\App\\": "src/App/src/",
"Admin\\Admin\\": "src/Admin/src/",
"Admin\\Page\\": "src/Page/src/",
"Admin\\Dashboard\\": "src/Dashboard/src/",
"Admin\\Setting\\": "src/Setting/src/"
}
},
Expand All @@ -92,7 +93,6 @@
"development-disable": "laminas-development-mode disable",
"development-enable": "laminas-development-mode enable",
"development-status": "laminas-development-mode status",
"mezzio": "mezzio --ansi",
"check": [
"@cs-check",
"@test",
Expand All @@ -104,7 +104,6 @@
"serve": "php -S 0.0.0.0:8080 -t public/",
"static-analysis": "phpstan analyse --memory-limit 1G",
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
"twig-cs-check": "vendor/bin/twig-cs-fixer lint --config=config/twig-cs-fixer.php",
"twig-cs-fix": "vendor/bin/twig-cs-fixer lint --config=config/twig-cs-fixer.php --fix"
}
Expand Down
5 changes: 5 additions & 0 deletions config/autoload/local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ return [
'name' => $app['name'] ?? '',
'url' => $baseUrl,
],
'routes' => [
'page' => [
'component' => 'components',
],
],
'databases' => $databases,
'doctrine' => [
'connection' => [
Expand Down
24 changes: 10 additions & 14 deletions config/autoload/navigation.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
[
'options' => [
'label' => 'Dashboard',
'uri' => '/',
'route' => [
'route_name' => 'dashboard',
'route_name' => 'app::index-redirect',
],
'icon' => 'c-blue-500 ti-home',
],
Expand All @@ -31,23 +30,26 @@
[
'options' => [
'label' => 'Admins',
'uri' => '/admin/list',
'route' => [
'route_name' => 'admin::admin-list',
],
],
],
[
'options' => [
'label' => 'Logins',
'uri' => '/admin/logins',
'route' => [
'route_name' => 'admin::admin-login-list',
],
],
],
],
],
[
'options' => [
'label' => 'Components',
'uri' => '/page/components',
'route' => [
'route_name' => 'page',
'route_name' => 'page::components',
],
'icon' => 'c-pink-500 ti-palette',
],
Expand All @@ -63,10 +65,7 @@
'options' => [
'label' => 'Profile',
'route' => [
'route_name' => 'admin',
'route_params' => [
'action' => 'account',
],
'route_name' => 'admin::account-edit-form',
],
'icon' => 'ti-user',
],
Expand All @@ -75,10 +74,7 @@
'options' => [
'label' => 'Logout',
'route' => [
'route_name' => 'admin',
'route_params' => [
'action' => 'logout',
],
'route_name' => 'admin::admin-logout',
],
'icon' => 'ti-power-off',
],
Expand Down
2 changes: 2 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
Admin\App\ConfigProvider::class,
Admin\Admin\ConfigProvider::class,
Admin\Setting\ConfigProvider::class,
Admin\Page\ConfigProvider::class,
Admin\Dashboard\ConfigProvider::class,

// Load application config in a pre-defined order in such a way that local settings
// overwrite global settings. (Loaded as first to last):
Expand Down
2 changes: 1 addition & 1 deletion data/doctrine/fixtures/AdminLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function load(ObjectManager $manager): void
$admin = (new Admin())
->setIdentity('admin')
->setPassword(password_hash('dotadmin', PASSWORD_DEFAULT))
->setFirstName('DotKernel')
->setFirstName('Dotkernel')
->setLastName('Admin')
->addRole(
$manager->getRepository(AdminRole::class)->findOneBy(['name' => AdminRole::ROLE_SUPERUSER])
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"keywords": [],
"author": {
"name": "DotKernel Team",
"name": "Dotkernel Team",
"email": "team@dotkernel.com"
},
"license": "ISC",
Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ parameters:
path: src
-
message: '#Call to an undefined method Laminas\\Authentication\\AuthenticationServiceInterface::getAdapter\(\)#'
path: src/Admin/src/Controller/AdminController.php
path: src/Admin/src/Handler/Account/PostAccountLoginHandler.php
-
message: '#Call to an undefined method Laminas\\Authentication\\AuthenticationServiceInterface::getStorage\(\)#'
path: src/Admin/src/Controller/AdminController.php
path: src/Admin/src/Handler/Account/PostAccountLoginHandler.php

2 changes: 1 addition & 1 deletion public/js/table_settings.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 36 additions & 10 deletions src/Admin/src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Admin\Admin;

use Admin\Admin\Adapter\AuthenticationAdapter;
use Admin\Admin\Controller\AdminController;
use Admin\Admin\Delegator\AdminRoleDelegator;
use Admin\Admin\Entity\Admin;
use Admin\Admin\Entity\AdminInterface;
Expand All @@ -14,6 +13,20 @@
use Admin\Admin\Form\AdminForm;
use Admin\Admin\Form\ChangePasswordForm;
use Admin\Admin\Form\LoginForm;
use Admin\Admin\Handler\Account\GetAccountEditFormHandler;
use Admin\Admin\Handler\Account\GetAccountLoginFormHandler;
use Admin\Admin\Handler\Account\GetAccountLogoutHandler;
use Admin\Admin\Handler\Account\PostAccountChangePasswordHandler;
use Admin\Admin\Handler\Account\PostAccountEditHandler;
use Admin\Admin\Handler\Account\PostAccountLoginHandler;
use Admin\Admin\Handler\Admin\GetAdminCreateFormHandler;
use Admin\Admin\Handler\Admin\GetAdminDeleteFormHandler;
use Admin\Admin\Handler\Admin\GetAdminEditFormHandler;
use Admin\Admin\Handler\Admin\GetAdminListHandler;
use Admin\Admin\Handler\Admin\GetAdminLoginListHandler;
use Admin\Admin\Handler\Admin\PostAdminCreateHandler;
use Admin\Admin\Handler\Admin\PostAdminDeleteHandler;
use Admin\Admin\Handler\Admin\PostAdminEditHandler;
use Admin\Admin\Repository\AdminLoginRepository;
use Admin\Admin\Repository\AdminRepository;
use Admin\Admin\Repository\AdminRoleRepository;
Expand Down Expand Up @@ -52,15 +65,28 @@ public function getDependencies(): array
],
],
'factories' => [
AdminController::class => AttributedServiceFactory::class,
AdminService::class => AttributedServiceFactory::class,
AdminRoleService::class => AttributedServiceFactory::class,
AdminRepository::class => AttributedRepositoryFactory::class,
AdminRoleRepository::class => AttributedRepositoryFactory::class,
AdminLoginRepository::class => AttributedRepositoryFactory::class,
AdminForm::class => ElementFactory::class,
AuthenticationService::class => AuthenticationServiceFactory::class,
AuthenticationAdapter::class => AttributedServiceFactory::class,
GetAdminCreateFormHandler::class => AttributedServiceFactory::class,
PostAdminCreateHandler::class => AttributedServiceFactory::class,
GetAdminEditFormHandler::class => AttributedServiceFactory::class,
PostAdminEditHandler::class => AttributedServiceFactory::class,
GetAdminDeleteFormHandler::class => AttributedServiceFactory::class,
PostAdminDeleteHandler::class => AttributedServiceFactory::class,
GetAdminListHandler::class => AttributedServiceFactory::class,
GetAdminLoginListHandler::class => AttributedServiceFactory::class,
GetAccountEditFormHandler::class => AttributedServiceFactory::class,
PostAccountEditHandler::class => AttributedServiceFactory::class,
PostAccountChangePasswordHandler::class => AttributedServiceFactory::class,
GetAccountLoginFormHandler::class => AttributedServiceFactory::class,
PostAccountLoginHandler::class => AttributedServiceFactory::class,
GetAccountLogoutHandler::class => AttributedServiceFactory::class,
AdminService::class => AttributedServiceFactory::class,
AdminRoleService::class => AttributedServiceFactory::class,
AdminRepository::class => AttributedRepositoryFactory::class,
AdminRoleRepository::class => AttributedRepositoryFactory::class,
AdminLoginRepository::class => AttributedRepositoryFactory::class,
AdminForm::class => ElementFactory::class,
AuthenticationService::class => AuthenticationServiceFactory::class,
AuthenticationAdapter::class => AttributedServiceFactory::class,
],
'aliases' => [
AdminInterface::class => Admin::class,
Expand Down
Loading
Loading