Managing the Drupal 8 web server is one of the very difficult tasks. We recommend using composer for a good management system. It is well known for PHP package management utility to manage library or installation of extension in the web server. To use the Drupal 8 web server, working with Drush and composer is important.
Some used to say that Drupal 8 is accessed only by using CLI administrator but it is possible to bring a solution along with the usage of composer forever.
Step 1: Use the CLI utility or installer.exe to install composer.
To text, sandbox and program developers can use the Wampserver localhost environment by installing composer.
Step 2: Once if you are done with the composer installation, do not stop with the normal configuration. Integration module installation helps to execute both composer and Drush altogether.
If you have already installed Drush no worries start executing below-mentioned command:
This execution will install and download the module of the composer.
The command used to list all the composer available commands:
Start installing the dependencies and parsing composer.json:
Creating the file of composer.json:
Command to download the dependencies and Symfony:
Step 3: As you know before the themes and modules are managed by Drush along with the composer. The high probability of using Drush with the composer is to keep on updating the file called .json.
It takes care of its part like installation of files, download and locating things by executing the below-mentioned command:
If you are converting the modules to composer then it is a must for you to use the application Composerizer. By now, you will get the command list of all composers.
Step 4:
You need to know the data used in the file called composer.json.
Here, you can set the values where it is possible to add the path in composer.json.
Here is the code to add the path of installer in dependency module:
How you can view the composer.json values:
Step 5: Both Drupal and Composer take responsibility to speed your process such as upgrading versions, security patches apply on themes and modules and core updates.
To check the status of installation use below mentioned command:
Start updating the commands such as cache, database and core files:
To get the installation backup process:
Use this command to take zip archive backups:
Whenever you make downloads and version updates kindly take a backup before starting the process.
It is necessary to put your website in the mode of maintenance:
To get your website from maintenance mode use below mentioned code:
Some used to say that Drupal 8 is accessed only by using CLI administrator but it is possible to bring a solution along with the usage of composer forever.
Step 1: Use the CLI utility or installer.exe to install composer.
Code:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Step 2: Once if you are done with the composer installation, do not stop with the normal configuration. Integration module installation helps to execute both composer and Drush altogether.
If you have already installed Drush no worries start executing below-mentioned command:
Code:
drush dl composer-8
drush en composer-8
The command used to list all the composer available commands:
Code:
drush composer
Code:
drush composer install
Code:
drush composer init
Code:
drush composer create-projectsymfony/symfony
Code:
composer require drupal/<modulename>
Code:
composer require 'drupal/<modulename>:<version>'
Step 4:
You need to know the data used in the file called composer.json.
Code:
composer require drupal/<modulename>
Code:
"require": {
"drupal/token": "^1.5"
}
Code:
"extra": {
"installer-paths": {
"core": ["type:drupal-core"],
"libraries/{$name}": ["type:drupal-library"],
"modules/contrib/{$name}": ["type:drupal-module"],
"profiles/contrib/{$name}": ["type:drupal-profile"],
"themes/contrib/{$name}": ["type:drupal-theme"],
"drush/{$name}": ["type:drupal-drush"],
"modules/custom/{$name}": ["type:drupal-custom-module"],
"themes/custom/{$name}": ["type:drupal-custom-theme"]
}
}
Code:
composer require'drupal/token:^1.5'
composer require'drupal/simple_fb_connect:~3.0'
composer require'drupal/ctools:3.0.0-alpha26'
composer require'drupal/token:1.x-dev'
To check the status of installation use below mentioned command:
Code:
composer outdated drupal/*
Code:
composer update drupal/core --with-dependencies
drush updatedb
drush cr
Code:
drush sql-dump
Code:
drush archive-dump
It is necessary to put your website in the mode of maintenance:
Code:
drush sset system.maintenance_mode1
Code:
drush sset system.maintenance_mode0