Installing and updating using composer

Posted under » PHP » Drupal » CakePHP updated on 27 Sep 2022

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. To install. Some software that uses composer are symfony, cakephp, PHPMmailer and guzzle among others.

This is somewhat similar to the Python's pip.

In Ubuntu, all you need to do is sudo apt-get install composer. In this doesn't work... try the official documents from composer.

The following are drupal use cases.

$ composer create-project drupal/recommended-project:10.0.2 "install-dir"

You can update your software too eg.

$ composer update "drupal/core-*" --with-all-dependencies

sometimes you may not use composer to update drupal. You can do it manually. You mainly need to update the `vendor' and `core' directory. Occasionally you need to update the database also.

If you wish to update to a particular version

$ composer require drupal/core-recommended:10.0.2 drupal/core-composer-scaffold:10.0.2 drupal/core-project-message:10.0.2 --update-with-all-dependencies

If you wish to update drupal theme.

$  composer require 'drupal/bootstrap:^3.28'

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS data