|
|
| (5 dazwischenliegende Versionen von einem anderen Benutzer werden nicht angezeigt) |
| Zeile 1: |
Zeile 1: |
| =Allgemeines= | | =Allgemeines= |
| | |
| Drupal Module installieren: | | Drupal Module installieren: |
| <code>composer require 'drupal/ctools:^3.4'</code> | | <code>composer require 'drupal/ctools:^3.4'</code> |
| Module einschalten mit Drush | | Module einschalten mit Drush |
| <code>drush em -y ctools</code> | | <code>drush en -y ctools</code> |
| =Composer Patch installieren= | | == Module mit Patch auf inkompatibler Drupal Version installieren == |
| * Composer Patch installieren
| | <code>composer req mglaman/composer-drupal-lenient</code> |
| **<code>composer require cweagans/composer-patches</code>
| | <code>composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/node_view_permissions"]' </code> |
| **<code>composer config extra.enable-patching true</code>
| |
| * in '''EXTRA''' folgenden Code einfügen:
| |
| | |
| | |
| "enable-patching": true,
| |
| "patches": {
| |
| "drupal/entity_reference_revisions": {
| |
| "Translate References": "https://www.drupal.org/files/issues/2019-10-07/3024588-11-entity_reference_revisions-invalid-translation-lang.patch"
| |
| }
| |
| }
| |
| | |
| | |
| * <code>composer update --with-all-dependencies</code>
| |
| | |
| = Composer - The PHP dependency manager =
| |
| | |
| The Drupal community is changing to use Composer to install and update Drupal. Drush has no idea about dependencies as it is not a dependency manager.
| |
| | |
| == Install the Drupal 8 Lightning distribution with Composer ==
| |
| | |
| <code>composer create-project acquia/lightning-project:^8.1.0 '''MYPROJECT''' --no-interaction</code>
| |
| Where '''MYPROJECT''' is the name of the project folder. Inside the project folder will be the webroot folder called '''docroot'''. This is the folder to server with the web server.
| |
| | |
| ie. To install a project called '''meos''' on the '''dev01''' server, first go to <code>/var/www</code> then run:
| |
| <code>composer create-project acquia/lightning-project:^8.1.0 '''meos''' --no-interaction</code>
| |
| | |
| For more information about the Lightning Distribution see its [https://www.drupal.org/project/lightning Drupal.org project page] or [https://github.com/acquia/lightning-project Github page].
| |
| | |
| == Update Composer Managed Drupal Site (core, modules, themes, and libraries) ==
| |
| To update your Drupal site that is managed with Composer, first in a terminal go to the project directory (Not the same as the webroot directory. It is one directory below it). Then run:
| |
| <code>composer update</code>
| |
| Then run
| |
| <code>drush updatedb</code>
| |
|
| |
|
| '''Note:''' For sites that use the Drupal 8 version of the Lightning distribution(or other distributions too), do not use `drush pm-update` or `drush up` to update Lightning! Lightning includes specific, vetted, pre-tested versions of modules, and occasionally patches for those modules (and Drupal core). Drush's updater totally disregards all of that and '''may therefore break your site'''.
| | composer, lenient, Drupal 10, Patch, inkompatibel, modul |
|
| |
|
| == Composer Configuration == | | == Composer Configuration == |
| List configuration from the composer.json file in the current folder. | | List configuration from the composer.json file in the current folder. |
| <code>composer config --list</code> | | <code>composer config --list</code> |
|
| |
| === Modifying Repositories ===
| |
| The '''composer config''' command also supports making changes to the repositories section by using it the following way:
| |
|
| |
| <code>composer config repositories.foo vcs https://github.com/foo/bar</code>
| |
|
| |
| If your repository requires more configuration options, you can instead pass its JSON representation :
| |
|
| |
| <code>composer config repositories.foo '{"type": "vcs", "url": "http://svn.example.org/my-project/", "trunk-path": "master"}'</code>
| |
|
| |
| More info on [https://getcomposer.org/doc/03-cli.md#config '''composer config''' commands].
| |
|
| |
| More info on [https://getcomposer.org/doc/04-schema.md#repositories '''composer config repositories''' commands].
| |
| == Creating your very own Composer Package ==
| |
| ([http://knpuniversity.com/screencast/question-answer-day/create-composer-package Info from KNP University])
| |
| # Put your Composer package project in a git repository (example repository https://github.com/weaverryan/derp-dangerzone used in examples)
| |
| # Give your Library a composer.json File
| |
| Add a '''composer.json''' file in the library itself. This is really easy. Created a new '''composer.json''' file at the root of the git project. Composer will look at your branches and tags to get the version and source keys.
| |
|
| |
| In other words, create a composer.json file in your git repository root that looks similar to this:
| |
|
| |
| {
| |
| "name": "'''weaverryan/derp-dangerzone'''",
| |
| "autoload": {
| |
| "psr-0" : {
| |
| "'''Weaverryan\\DangerZone'''" : "src"
| |
| }
| |
| }
| |
| }
| |
|
| |
| Where '''weaverryan/derp-dangerzone''' is the name of the git repository and
| |
| where '''Weaverryan\\DangerZone''' is the [https://getcomposer.org/doc/04-schema.md#psr-0 PSR-0 namespace]. This namespace is directly related to the folders in the '''src''' folder containing your project.
| |
|
| |
| To add this repository to your composer project you can run:
| |
|
| |
| <code>composer config repositories.'''zeberli''' vcs https://github.com/weaverryan/derp-dangerzone</code>
| |
| Where '''zeberli''' in a unique key identifying this repository in the composer.json file and the URL is the address of the git repository containing your project.
| |
Allgemeines
Drupal Module installieren:
composer require 'drupal/ctools:^3.4'
Module einschalten mit Drush
drush en -y ctools
Module mit Patch auf inkompatibler Drupal Version installieren
composer req mglaman/composer-drupal-lenient
composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/node_view_permissions"]'
composer, lenient, Drupal 10, Patch, inkompatibel, modul
Composer Configuration
List configuration from the composer.json file in the current folder.
composer config --list