Skip to content

Commit

Permalink
updated files
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiu committed Jul 11, 2022
1 parent 257d979 commit 6409c4f
Show file tree
Hide file tree
Showing 23 changed files with 262 additions and 123 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Dotkernel web starter package suitable for admin applications.
[![GitHub license](https://img.shields.io/github/license/dotkernel/admin)](https://github.com/dotkernel/admin/blob/3.0/LICENSE.md)


![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/3.0.x-dev)
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/4.0.0)


# Installing DotKernel `admin`
Expand All @@ -23,6 +23,7 @@ Dotkernel web starter package suitable for admin applications.
- [Installing the `admin` Composer package](#installing-the-admin-composer-package)
- [Installing DotKernel admin](#installing-dotkernel-admin)
- [Configuration - First Run](#configuration---first-run)
- [Manage GeoLite2 database](#manage-geolite2-database)
- [Testing (Running)](#testing-running)

## Tools
Expand Down
58 changes: 29 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,46 +43,46 @@
}
},
"require": {
"php": "^7.4",
"php": "~7.4.0 || ~8.0.0 || ~8.1.0",
"ext-gettext": "*",
"dotkernel/dot-annotated-services": "^3.1",
"dotkernel/dot-cli": "^3.2",
"dotkernel/dot-controller": "^3.1",
"dotkernel/dot-errorhandler": "^3.1",
"dotkernel/dot-flashmessenger": "^3.1",
"dotkernel/dot-form": "^4.0",
"dotkernel/dot-annotated-services": "^3.2.1",
"dotkernel/dot-cli": "^3.2.0",
"dotkernel/dot-controller": "^3.2.1",
"dotkernel/dot-errorhandler": "^3.2.0",
"dotkernel/dot-flashmessenger": "^3.2.0",
"dotkernel/dot-form": "^4.0.1",
"dotkernel/dot-geoip": "^3.3.1",
"dotkernel/dot-helpers": "^3.1",
"dotkernel/dot-mail": "^3.2",
"dotkernel/dot-navigation": "^3.1",
"dotkernel/dot-rbac-guard": "^3.1",
"dotkernel/dot-session": "^4.2",
"dotkernel/dot-twigrenderer": "^3.1",
"dotkernel/dot-user-agent-sniffer": "^3.0.2",
"laminas/laminas-component-installer": "^2.6",
"laminas/laminas-config-aggregator": "^1.7",
"laminas/laminas-i18n": "^2.13",
"laminas/laminas-math": "^3.5",
"mezzio/mezzio": "^3.10",
"mezzio/mezzio-authorization-rbac": "^1.3",
"mezzio/mezzio-cors": "^1.3",
"mezzio/mezzio-fastroute": "^3.5",
"ramsey/uuid-doctrine": "^1.8",
"roave/psr-container-doctrine": "^2.2",
"robmorgan/phinx": "^0.12"
"dotkernel/dot-helpers": "^3.2.0",
"dotkernel/dot-mail": "^3.3.0",
"dotkernel/dot-navigation": "^3.2.0",
"dotkernel/dot-rbac-guard": "^3.2.1",
"dotkernel/dot-session": "^4.3.0",
"dotkernel/dot-twigrenderer": "^3.2.1",
"dotkernel/dot-user-agent-sniffer": "^3.1.1",
"laminas/laminas-component-installer": "^2.8.0",
"laminas/laminas-config-aggregator": "^1.7.0",
"laminas/laminas-i18n": "^2.15.0",
"laminas/laminas-math": "^3.5.0",
"mezzio/mezzio": "^3.11.0",
"mezzio/mezzio-authorization-rbac": "^1.3.0",
"mezzio/mezzio-cors": "^1.3.0",
"mezzio/mezzio-fastroute": "^3.5.0",
"ramsey/uuid-doctrine": "^1.8.1",
"roave/psr-container-doctrine": "^3.5.0",
"robmorgan/phinx": "^0.12.11"
},
"require-dev": {
"laminas/laminas-development-mode": "^3.6",
"mezzio/mezzio-tooling": "^1.4",
"phpunit/phpunit": "^7.5",
"mezzio/mezzio-tooling": "^2.5",
"phpunit/phpunit": "^9.5.21",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "^3.6",
"squizlabs/php_codesniffer": "^3.7",
"filp/whoops": "^2.14"
},
"autoload": {
"psr-4": {
"Frontend\\App\\": "src/App/src/",
"Frontend\\User\\": "src/User/src/"
"Frontend\\Admin\\": "src/Admin/src/"
}
},
"autoload-dev": {
Expand Down
5 changes: 4 additions & 1 deletion config/autoload/app.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

declare(strict_types=1);

$baseUrl = 'http://localhost:8080';

$app = [
'name' => 'DotKernel Admin V3'
'name' => 'DotKernel Admin V4',
'url' => $baseUrl
];

return [
Expand Down
4 changes: 2 additions & 2 deletions config/autoload/authentication.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

use Frontend\User\Entity\Admin;
use Frontend\Admin\Entity\Admin;

return [
'doctrine' => [
Expand All @@ -12,7 +12,7 @@
'identity_class' => Admin::class,
'identity_property' => 'identity',
'credential_property' => 'password',
'credential_callable' => 'Frontend\User\Doctrine\UserAuthentication::verifyCredential',
'credential_callable' => 'Frontend\Admin\Doctrine\AdminAuthentication::verifyCredential',
'messages' => [
'success' => 'Authenticated successfully.',
'not_found' => 'Identity not found.',
Expand Down
5 changes: 0 additions & 5 deletions config/autoload/authorization-guards.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
'type' => 'ControllerPermission',
'options' => [
'rules' => [
[
'route' => 'user',
'actions' => [],
'permissions' => ['authenticated']
],
[
'route' => 'admin',
'actions' => ['login'],
Expand Down
2 changes: 1 addition & 1 deletion config/autoload/doctrine.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

use Doctrine\Common\Cache\PhpFileCache;
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType;
Expand Down
31 changes: 17 additions & 14 deletions config/autoload/navigation.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,25 @@
[
'options' => [
'label' => 'Manage admins',
'route' => [
'route_name' => 'admin',
'route_params' => ['action' => 'manage']
],
'route' => '',
'icon' => 'fas fa-user-circle',
]
],
[
'options' => [
'label' => 'Manage users',
'route' => [
'route_name' => 'user',
'route_params' => ['action' => 'manage']
],
'icon' => 'fas fa-user',
],
'pages' => [
[
'options' => [
'label' => 'Admins',
'uri' => '/admin/manage',
'icon' => 'fas fa-user-circle',
],
],
[
'options' => [
'label' => 'Logins',
'uri' => '/admin/logins',
'icon' => 'fas fa-sign-in-alt',
],
]
]
],
[
'options' => [
Expand Down
5 changes: 2 additions & 3 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Laminas\ConfigAggregator\ArrayProvider;
use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\ConfigAggregator\PhpFileProvider;
use Laminas\ZendFrameworkBridge\ConfigPostProcessor;

// To enable or disable caching, set the `ConfigAggregator::ENABLE_CACHE` boolean in
// `config/autoload/local.php`.
Expand Down Expand Up @@ -51,7 +50,7 @@ class_exists(\Mezzio\Swoole\ConfigProvider::class)

// Default App module config
\Frontend\App\ConfigProvider::class,
\Frontend\User\ConfigProvider::class,
\Frontend\Admin\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 All @@ -63,6 +62,6 @@ class_exists(\Mezzio\Swoole\ConfigProvider::class)

// Load development config if it exists
new PhpFileProvider(realpath(__DIR__) . '/development.config.php'),
], $cacheConfig['config_cache_path'], [ConfigPostProcessor::class]);
], $cacheConfig['config_cache_path']);

return $aggregator->getMergedConfig();
1 change: 0 additions & 1 deletion config/pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
// - route-based validation
// - etc.

$app->pipe(TranslatorMiddleware::class);
$app->pipe(AuthMiddleware::class);
$app->pipe(ForbiddenHandler::class);
$app->pipe(RbacGuardMiddleware::class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Phinx\Migration\AbstractMigration;
use Frontend\User\Entity\Admin;
use Frontend\Admin\Entity\Admin;

class DefaultAdminSchema extends AbstractMigration
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;
use Frontend\User\Entity\AdminLogin;
use Frontend\Admin\Entity\AdminLogin;

/**
* ClassLogAdminLogins
Expand Down
2 changes: 1 addition & 1 deletion data/database/seeds/AdminSeeder.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Data\Database\Seeds;

use Frontend\User\Entity\Admin;
use Frontend\Admin\Entity\Admin;
use Phinx\Seed\AbstractSeed;
use Ramsey\Uuid\Codec\OrderedTimeCodec;
use Ramsey\Uuid\Uuid;
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Frontend\User;
namespace Frontend\Admin;

use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Dot\AnnotatedServices\Factory\AnnotatedServiceFactory;
Expand Down
Loading

0 comments on commit 6409c4f

Please sign in to comment.