Composer is required to install Dotkernel api. You can install Composer from the official site.
First, 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.
composer installThe automatic setup script performs these tasks:
- Installs the packages listed in the
composer.jsonfile and their dependencies into thevendorfolder. - Creates the
composer.lockfile that locks all dependencies to exact versions (you can still runcomposer updateto replace them with newer versions, if available). - Configures PHP CodeSniffer, a utility to detect code style errors in PHP code.
- Generate and save the OAuth2 keys in the
data/oauthfolder. - Creates the initial
config/autoloadconfiguration files:- config/autoload/local.php
- config/autoload/local.test.php
- config/autoload/mail.global.php
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-enableThe confirmation message should read:
You are now in development mode.If you ever need to disable the development mode, run:
composer development-disableThis command displays the development mode status:
composer development-statusYou should see the message Development mode is ENABLED or Development mode is DISABLED.