Download the PHP package dotkernel/admin without Composer

On this page you can find all versions of the php package dotkernel/admin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package admin

admin

DotKernel web starter package suitable for admin applications.

OSS Lifecycle PHP from Packagist (specify version)

GitHub issues GitHub forks GitHub stars GitHub license

Build Static codecov Qodana

SymfonyInsight

Installing DotKernel admin

Tools

DotKernel can be installed through a single command that utilizes Composer. Because of that, Composer is required to install DotKernel admin.

Composer

Installation instructions:

If you have never used composer before make sure you read the Composer Basic Usage section in Composer's documentation

Choosing an installation path for DotKernel admin

Example:

Installing DotKernel admin

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

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

The advantage of using this command is that it runs through the whole installation process. Run the following command:

composer create-project dotkernel/admin -s dev dk

The above command downloads the admin package, then downloads and installs the dependencies.

The setup script prompts for some configuration settings, for example the lines below:

Please select which config file you wish to inject 'Laminas\Diactoros\ConfigProvider' into:
  [0] Do not inject
  [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 configurations.

If you choose [1] config/config.php Laminas's ConfigProvider from session will be injected.

The next question is:

Remember this option for other packages of the same type? (y/N)

Type y here, and hit enter

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:

git clone https://github.com/dotkernel/admin.git .

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 regarding injections (type 0 and hit enter) and a confirmation to use this setting for other packages (type y and hit enter)

Configuration - First Run

Run the migrations and seeds with these commands:

php bin/doctrine-migrations migrate

php bin/doctrine fixtures:execute

Charset recommendation: utf8mb4_general_ci

Manage GeoLite2 database

You can download/update a specific GeoLite2 database, by running the following command:

php bin/cli.php geoip:synchronize -d {DATABASE}

Where {DATABASE} takes one of the following values: asn, city, country.

You can download/update all GeoLite2 databases at once, by running the following command:

php bin/cli.php geoip:synchronize

The output should be similar to the below, displaying per row: database identifier: previous build datetime -> current build datetime.

asn: n/a -> 2021-07-01 02:09:34

city: n/a -> 2021-07-01 02:09:20

country: n/a -> 2021-07-01 02:05:12

Get help for this command by running:

php bin/cli.php help geoip:synchronize

Tip: If you setup the synchronizer command as a cronjob, you can add the -q|--quiet option, and it will output data only if an error has occurred.

NPM Commands

To install dependencies into the node_modules directory run this command.

npm install

If npm install fails, this could be caused by user permissions of npm. Recommendation is to install npm through Node Version Manager.

The watch command compiles the components then watches the files and recompiles when one of them changes.

npm run watch

After all updates are done, this command compiles the assets locally, minifies them and makes them ready for production.

npm run prod

Authorization Guards

The packages responsible for restricting access to certain parts of the application are dot-rbac-guard and dot-rbac. These packages work together to create an infrastructure that is customizable and diversified to manage user access to the platform by specifying the type of role the user has.

The authorization.global.php file provides multiple configurations specifying multiple roles as well as the types of permissions to which these roles have access.

'roles' => [
    'superuser' => [
        'permissions' => [
            'authenticated',
            'edit',
            'delete',
            //etc..
        ]
    ],
    'admin' => [
        'permissions' => [
            'authenticated',
            //etc..
        ]
    ]
]

The authorization-guards.global.php file provides configuration to restrict access to certain actions based on the permissions defined in authorization.global.php so basically we have to add the permissions in the dot-rbac configuration file first to specify the action restriction permissions.

'rules' => [
  [
      'route' => 'account',
      'actions' => [//list of actions to apply , or empty array for all actions
          'unregister',
          'avatar',
          'details',
          'changePassword'
      ],
      'permissions' => ['authenticated']
  ],
  [
      'route' => 'admin',
      'actions' => [
          'deleteAccount'
      ],
       'permissions' => [
          'delete'
          //list of roles to allow
      ]
  ]
]

Testing (Running)

Note: Do not enable dev mode in production

Running command composer serve will do the exact same, but the above is faster.

0.0.0.0 means that the server is open to all incoming connections 127.0.0.1 means that the server can only be accessed locally (localhost only) 8080 the port on which the server is started (the listening port for the server)

NOTE: If you are still getting exceptions or errors regarding some missing services, try running the following command

php bin/clear-config-cache.php

If config-cache.php is present that config will be loaded regardless of the ConfigAggregator::ENABLE_CACHE in config/autoload/mezzio.global.php

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:

NOTE:

Do not change this in local.php.dist as well because this value should remain true on production.


All versions of admin with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2.0 || ~8.3.0
ext-gettext Version *
dotkernel/dot-cache Version ^4.0
dotkernel/dot-cli Version ^3.5.0
dotkernel/dot-controller Version ^3.4.3
dotkernel/dot-data-fixtures Version ^1.1.3
dotkernel/dot-dependency-injection Version ^1.0
dotkernel/dot-errorhandler Version ^4.0.0
dotkernel/dot-flashmessenger Version ^3.4.2
dotkernel/dot-geoip Version ^3.6.0
dotkernel/dot-helpers Version ^3.4.2
dotkernel/dot-mail Version ^4.1.1
dotkernel/dot-navigation Version ^3.4.2
dotkernel/dot-rbac-guard Version ^3.4.2
dotkernel/dot-session Version ^5.6.0
dotkernel/dot-twigrenderer Version 3.4.3
friendsofphp/proxy-manager-lts Version ^1.0.16
laminas/laminas-component-installer Version ^3.4.0
laminas/laminas-config-aggregator Version ^1.14.0
laminas/laminas-i18n Version ^2.26.0
laminas/laminas-math Version ^3.7.0
mezzio/mezzio Version ^3.18.0
mezzio/mezzio-authorization-rbac Version ^1.7.0
mezzio/mezzio-cors Version ^1.11.1
mezzio/mezzio-fastroute Version ^3.11.0
ramsey/uuid-doctrine Version ^2.1.0
roave/psr-container-doctrine Version ^5.2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dotkernel/admin contains the following files

Loading the files please wait ....