Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)
Basculer un projet Drupal 8 existant sous Composer
Voir la documentation : https://www.flocondetoile.fr/blog/basculer-un-projet-drupal-8-existant-sous-composer
Drush doit-être installé.
Ajout des modules
Il est possible de récupérer la liste des modules à installer avec la commande suivante :
drush pml --no-core | grep "Enabled" | awk -F "(" '{print $2}' | awk -F ")" '{print $1}' | xargs -i echo composer require drupal/{}
Il faut ensuite l'adapter.
La commande "require" doit être lancée "relativement" à l'endroit où se trouve composer.phar. Par exemple :
php ../composer.phar require drupal/libraries
Ensuite, il faut ajouter les librairies, le thème et les fichiers locaux.
Ajout des librairies
Pour ajouter les libraries dans la gestion des dépendances, on peut ajouter le plugin composer : Drupal Libraries Installer. Voir la documentation ici : https://packagist.org/packages/balbuf/drupal-libraries-installer. Et https://github.com/composer/installers#custom-install-paths
Les principales commandes :
Ajout de l'installeur :
composer require balbuf/drupal-libraries-installer
Ajouts des librairies dans composer.json.
Par exemple:
"extra": {
"drupal-libraries": {
"flexslider": "https://github.com/woocommerce/FlexSlider/archive/2.6.4.zip",
"chosen": "https://github.com/harvesthq/chosen/releases/download/v1.8.2/chosen_v1.8.2.zip",
"blazy": "https://github.com/dinbror/blazy/archive/master.zip",
"jquery-hoverIntent": "https://github.com/briancherne/jquery-hoverIntent/archive/master.zip",
"cropper": "https://github.com/fengyuanchen/cropper/archive/master.zip",
"colorbox": "https://github.com/jackmoore/colorbox/archive/master.zip",
"jquery.cycle2": "https://github.com/malsup/cycle2/archive/master.zip",
"jquery.cycle": "https://github.com/malsup/cycle/archive/master.zip",
"json2": "https://github.com/douglascrockford/JSON-js/archive/master.zip",
"slick": "https://github.com/kenwheeler/slick/archive/master.zip"
},
"installer-paths": {
[...]
"web/libraries/{$name}": ["type:drupal-library"],
[...]
}