In this step you will:
Composer is required to install Dotkernel
api. You can install Composer from the official site.Before you begin, make sure that you have navigated your command prompt to the folder where you copied the files in the previous step.
Run this command in the command prompt.
Use the CLI to ensure interactivity for proper configuration. In some IDEs, Composer may not be able to prompt for configuration settings.
composer install
The automatic setup script performs these tasks:
composer.json file and their dependencies into the vendor folder.composer.lock file that locks all dependencies to exact versions (you can still run composer update to replace them with newer versions, if available and installable without conflicts).data/oauth folder../bin/generate-oauth2-keys.php.config/autoload configuration files../bin/composer-post-install-script.php.The post install commands are run automatically on every
composer installandcomposer update. The scripts check if the files exist to prevent overwriting them.
You should see this text below, along with a long list of packages to be installed instead of the [...].
In this example there are 146 packages, though the number can change in future updates.
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 146 installs, 0 updates, 0 removals
[...]
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 146 installs, 0 updates, 0 removals
[...]
The setup script may prompt for some configuration settings, for example, the lines below. If you don't see them, you can skip to the next section.
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):
Type 0 to select [0] Do not inject.
If you choose
1, an extraConfigProviderwill be injected, which may return an error for packages you add in the future. Choosing0prevents duplicate ConfigProvider registrations, as Dotkernel already includes its own.
The next question is:
Remember this option for other packages of the same type? (y/N)
Type y here, and hit enter to complete this stage.
Normally, a new project starts in development mode to prevent caching certain files in the data/cache folder.
Enable development mode by running:
composer development-enable
The confirmation message should read:
You are now in development mode.
If you ever need to disable the development mode, run:
composer development-disable
This command displays the development mode status:
composer development-status
You should see the message Development mode is ENABLED or Development mode is DISABLED.