This repository has been archived by the owner on Apr 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Update the chapter extensions for Contao 4 #425
Open
lionel-m
wants to merge
8
commits into
contao:4.2
Choose a base branch
from
lionel-m:update-extension-chapter
base: 4.2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d53f496
Update the chapter extensions for Contao 4
lionel-m 759a2f3
Some improvements according to the last review
lionel-m 1c835f6
Corrections and improvements
lionel-m 24ae224
Add the French translation
lionel-m 7d55931
Correct the target of a URL to the cookbook
lionel-m 06a85b6
Prefer the Wikipedia link for the Symlink
lionel-m 36cfc64
Finish the French translation
lionel-m 6645432
Updated with the latest revisions
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,133 @@ | ||
## Extensions | ||
## Extensions and bundles | ||
|
||
Extensions are an essential part of Contao, because they allow you to add extra | ||
functionality. There are more than 1,400 extensions available in the Contao | ||
Extension Repository, which you can browse directly in the back end. | ||
Communication with the repository server is done via SOAP, so you need to enable | ||
the PHP SOAP extension to use the service (if not enabled by default). | ||
functionality. Contao 4 is based on the Symfony framework and takes advantage of | ||
its functionalities and its terminiology. In Contao 4 you can use classic | ||
extensions from previous Contao versions as well as so called bundles. | ||
|
||
|
||
### Extension catalog | ||
### Finding extensions or bundles | ||
|
||
The "extension catalog" module allows you to browse the extension list and to | ||
install extensions at the push of a button. Use the filter and sorting options | ||
to find a particular extension and click the info icon or extension title to | ||
open the details page and install the module. | ||
Contao has its own [repository][1] where you can find the extensions that are | ||
compatible with Contao 3.x and lower. | ||
|
||
![](images/extension-list.jpg) | ||
The second most commonly used repository is [Packagist][2]. It lists the | ||
extensions and bundles installable through [Composer][3]. | ||
|
||
The details page contains a description of the extension and important | ||
information regarding system requirements, versions and dependencies from other | ||
modules. Click the "Install" button to download and install the extension. | ||
1. [List of Contao 4 bundles][4] in Packagist. | ||
2. [List of Contao 3 extensions][5] in Packagist. | ||
|
||
![](images/extension-details.jpg) | ||
|
||
Contao will automatically download and install the extension and update the | ||
database if necessary. | ||
### Installing a bundle with Composer | ||
|
||
![](images/extension-install.jpg) | ||
A name of a bundle is divided into two parts. The first part is the name of the | ||
vendor (project owner) and the second the bundle name. For example: | ||
`contao/news-bundle`. | ||
|
||
Run the command `composer require vendor/bundleName` in your | ||
command-line interface to start the installation. | ||
|
||
### Extension manager | ||
Contao dependencies (in our case a bundle) are described in a file named | ||
`composer.json` which is located in the root folder of your Contao installation. | ||
During the installation process, Composer updates the `composer.json` file and | ||
determines itself which version of the bundle is best suited to be installed | ||
depending on your version of Contao. | ||
|
||
The "extension manager" module allows you to update and uninstall extensions. It | ||
automatically checks for updates and notifies you if a new version is available. | ||
Many extensions also include links to an online manual and/or forum thread where | ||
you can get support. | ||
Then you must register your bundle in `app/AppKernel.php` so that it can be | ||
taken into account by the system. Add the bundle to the list of registered | ||
bundles: | ||
|
||
![](images/extension-manager.jpg) | ||
```php | ||
<?php | ||
// app/AppKernel.php | ||
|
||
To uninstall an extension, simply click the uninstall icon and follow the | ||
instructions. The extension manager will remove all files and folders and update | ||
the database if necessary. Note that this action cannot be undone and the tables | ||
cannot be restored! | ||
// ... | ||
class AppKernel extends Kernel | ||
{ | ||
public function registerBundles() | ||
{ | ||
$bundles = [ | ||
// ... | ||
|
||
![](images/extension-uninstall.jpg) | ||
new <vendor>\<bundle-name>\<bundle-long-name>(), | ||
]; | ||
|
||
// ... | ||
} | ||
|
||
### Manual installation | ||
// ... | ||
} | ||
``` | ||
|
||
In case the PHP SOAP extension is not available on your server, you can also | ||
install Contao extensions manually. Find the respective module in the [extension | ||
list][1] and download the .zip archive of the latest release. Then unzip the | ||
files and copy them to your local or remote Contao directory. Finally, check the | ||
database with the [Contao install tool][2]. | ||
Finally, check the database with the [Contao install tool][7]. | ||
|
||
With Composer, the cache is cleared automatically. | ||
|
||
|
||
### Installing a Contao extension | ||
|
||
An extension can be installed with Composer or manually. With Composer, the | ||
installation process is the same as a bundle except for the registration in the | ||
`app/AppKernel.php` file where the code is slightly different. | ||
|
||
In the example below, the first parameter `myExtensionName` should be replaced | ||
by the name of your extension: | ||
|
||
```php | ||
<?php | ||
// app/AppKernel.php | ||
|
||
// ... | ||
class AppKernel extends Kernel | ||
{ | ||
public function registerBundles() | ||
{ | ||
$bundles = [ | ||
// ... | ||
|
||
new Contao\CoreBundle\HttpKernel\Bundle\ContaoModuleBundle('myExtensionName', $this->getRootDir()), | ||
]; | ||
|
||
// ... | ||
} | ||
|
||
// ... | ||
} | ||
``` | ||
|
||
|
||
#### Manually | ||
|
||
Almost all extensions for Contao 3 are also compatible with Contao 4. If a | ||
Contao 3 extension is not available on Composer, you can install it manually | ||
and try if it works with Contao 4. Be aware that you must also take care of | ||
installing all dependencies as listed in the Extension Repository. | ||
|
||
Find the extension you want to install in the [Extension Repository][1] and | ||
download the .zip archive of the latest release. Then unzip the files and copy | ||
them to the `system/modules` folder. If the extension has public files, you must | ||
generate a [symbolic link][6] with the command `php app/console contao:symlinks` | ||
in your command-line interface. | ||
|
||
Then you must register your extension in `app/AppKernel.php` so that it can be | ||
taken into account by the system (see the previous chapter). Finally, check the | ||
database with the [Contao install tool][7]. | ||
|
||
When you have made all the installation procedure, you can clear the cache with | ||
the following command: `php app/console cache:clear -e=prod`. | ||
|
||
|
||
## Extension catalog | ||
|
||
Prior to Contao 4, it was possible to install an extension automatically from | ||
the back end. This feature is under development and will be offered in a future | ||
release. | ||
|
||
|
||
[1]: https://contao.org/en/extension-list.html | ||
[2]: ../01-installation/installing-contao.md#the-contao-install-tool | ||
[2]: https://packagist.org | ||
[3]: https://getcomposer.org/doc/00-intro.md#introduction | ||
[4]: https://packagist.org/search/?q=&type=contao-bundle | ||
[5]: https://packagist.org/search/?q=&type=contao-module | ||
[6]: https://en.wikipedia.org/wiki/Symbolic_link | ||
[7]: ../01-installation/installing-contao.md#the-contao-install-tool |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,138 @@ | ||
## Extensions | ||
## Extensions et bundles | ||
|
||
Les extensions sont une partie essentielle de Contao, car ils vous permettent | ||
d'ajouter des fonctionnalités supplémentaires. Il existe plus de 1400 extensions | ||
disponibles dans le référentiel d'extensions de Contao, que vous pouvez parcourir | ||
directement à partir du back office. La communication avec le serveur du | ||
référentiel s'effectue via SOAP, donc vous devez activer l'extension SOAP de PHP | ||
pour utiliser le service (si elle n'est pas activée par défaut). | ||
d'ajouter des fonctionnalités supplémentaires. Contao 4 est basé sur le | ||
framework Symfony et tire profit de ses fonctionnalités et de sa terminologie. | ||
Dans Contao 4, Vous pouvez utiliser des extensions des précédentes versions de | ||
Contao ainsi que les bundles. | ||
|
||
|
||
### Catalogue d'extensions | ||
### Trouver des extensions ou des bundles | ||
|
||
Le module "Catalogue d'extensions" vous permet de parcourir la liste des | ||
extensions et d'installer des extensions par simple pression d'un bouton. | ||
Utilisez les options de filtrage et de tri pour trouver une extension | ||
particulière et cliquez sur l'icône d'information ou le titre de l'extension | ||
pour ouvrir la page de détails et installer le module. | ||
Contao a son propre [référentiel][1] où vous pouvez trouver les extensions qui | ||
sont compatibles avec Contao 3.x et antérieures. | ||
|
||
![](images/liste-extension.jpg) | ||
Le second référentiel le plus couramment utilisé est [Packagist][2]. Il liste | ||
les extensions et bundles qui peuvent être installés par [Composer][3]. | ||
|
||
La page de détails contient une description de l'extension et des informations | ||
importantes concernant les configurations du système requises ainsi que les | ||
versions et les dépendances d'autres modules. Cliquez sur le bouton "Installer" | ||
pour télécharger et installer l'extension. | ||
1. [Liste des bundles de Contao 4][4] dans Packagist. | ||
2. [Liste des extensions de Contao 3][5] dans Packagist. | ||
|
||
![](images/details-extension.jpg) | ||
|
||
Contao téléchargera et installera automatiquement l'extension et mettra à jour | ||
la base de données si nécessaire. | ||
### Installer un bundle avec Composer | ||
|
||
![](images/installer-extension.jpg) | ||
Le nom d'un bundle est divisé en deux parties. La première partie est le nom du | ||
"vendor" (propriétaire du projet) et le second, le nom du bundle. Par exemple : | ||
`contao/news-bundle`. | ||
|
||
Exécutez la commande `composer require vendor/bundleName` dans votre interface | ||
en ligne de commande afin de démarrer l'installation. | ||
|
||
### Gestionnaire d'extensions | ||
Les dépendances de Contao (dans notre cas un bundle) sont décrites dans un | ||
fichier nommé `composer.json` qui est situé dans le dossier racine de votre | ||
installation de Contao. Au cours du processus d'installation, Composer met à | ||
jour le fichier `composer.json` et détermine lui-même quelle version du bundle | ||
est la mieux adaptée pour être installée en fonction de votre version de Contao. | ||
|
||
Le module "Gestionnaire d'extensions" vous permet de mettre à jour et de | ||
désinstaller des extensions. Il vérifie automatiquement les mises à jour et | ||
vous avertit si une nouvelle version est disponible. De nombreuses extensions | ||
incluent également des liens vers un manuel en ligne et/ou un fil de discussion | ||
dans un forum où vous pouvez obtenir de l'aide. | ||
Ensuite, vous devez enregistrer votre bundle dans `app/AppKernel.php` afin | ||
qu'il puisse être pris en compte par le système. Ajoutez le bundle à la liste | ||
des bundles enregistrés : | ||
|
||
![](images/gestionnaire-extension.jpg) | ||
```php | ||
<?php | ||
// app/AppKernel.php | ||
|
||
Pour désinstaller une extension, cliquez simplement sur l'icône de | ||
désinstallation et suivez les instructions. Le gestionnaire d'extensions va | ||
supprimer tous les fichiers et répertoires et mettre à jour la base de données | ||
si nécessaire. Notez que cette action ne peut pas être annulée et les tables ne | ||
peuvent pas être restaurées ! | ||
// ... | ||
class AppKernel extends Kernel | ||
{ | ||
public function registerBundles() | ||
{ | ||
$bundles = [ | ||
// ... | ||
|
||
![](images/desinstaller-extension.jpg) | ||
new <vendor>\<bundle-name>\<bundle-long-name>(), | ||
]; | ||
|
||
// ... | ||
} | ||
|
||
### Installation manuelle | ||
// ... | ||
} | ||
``` | ||
|
||
Dans le cas où l'extension SOAP de PHP n'est pas disponible sur votre serveur, | ||
vous pouvez également installer des extensions de Contao manuellement. Trouvez | ||
le module correspondant dans la [liste des extensions][1] et téléchargez | ||
l'archive .zip de la dernière version. Ensuite, décompressez les fichiers et | ||
copiez-les dans votre répertoire local ou distant de Contao. Enfin, vérifiez | ||
la base de données avec l'[outil d'installation de Contao][2]. | ||
Enfin, vérifiez la base de données avec l'[outil d'installation de Contao][7]. | ||
|
||
Avec Composer, le cache est automatiquement effacé. | ||
|
||
|
||
### Installer une extension de Contao | ||
|
||
Une extension peut être installée avec Composer ou manuellement. Avec Composer, | ||
le processus d'installation est le même que celui d'un bundle à l'exception de | ||
l'enregistrement dans le fichier `app/AppKernel.php` où le code est légèrement | ||
différent. | ||
|
||
Dans l'exemple ci-dessous, le premier paramètre `myExtensionName` doit être | ||
remplacé par le nom de votre extension : | ||
|
||
```php | ||
<?php | ||
// app/AppKernel.php | ||
|
||
// ... | ||
class AppKernel extends Kernel | ||
{ | ||
public function registerBundles() | ||
{ | ||
$bundles = [ | ||
// ... | ||
|
||
new Contao\CoreBundle\HttpKernel\Bundle\ContaoModuleBundle('myExtensionName', $this->getRootDir()), | ||
]; | ||
|
||
// ... | ||
} | ||
|
||
// ... | ||
} | ||
``` | ||
|
||
|
||
#### Manuellement | ||
|
||
Presque toutes les extensions pour Contao 3 sont également compatibles avec | ||
Contao 4. Si une extension de Contao 3 n'est pas disponible avec Composer, vous | ||
pouvez l'installer manuellement et essayer s'il fonctionne avec Contao 4. Soyez | ||
conscient que vous devez aussi prendre soin d'installer toutes les dépendances | ||
comme indiqué dans le référentiel d'extensions. | ||
|
||
Trouver l'extension que vous souhaitez installer dans le | ||
[référentiel d'extensions][1] et télécharger l'archive .zip de la dernière | ||
version. Puis, décompressez les fichiers et copiez-les dans le dossier | ||
`system/modules`. Si l'extension a des fichiers publics, vous devez générer un | ||
[lien symbolique][6] avec la commande `php app/console contao:symlinks` dans | ||
votre interface en ligne de commande. | ||
|
||
Ensuite, vous devez enregistrer votre extension dans `app/AppKernel.php` afin | ||
qu'elle puisse être prise en compte par le système (voir le chapitre précédent). | ||
Enfin, vérifiez la base de données avec l'[outil d'installation de Contao][7]. | ||
|
||
Lorsque vous avez effectué toute la procédure d'installation, vous pouvez | ||
effacer le cache avec la commande suivante : | ||
`php app/console cache:clear -e=prod`. | ||
|
||
|
||
## Catalogue d'extensions | ||
|
||
Avant Contao 4, il était possible d'installer automatiquement une extension à | ||
partir du back office. Cette fonctionnalité est en cours de développement et | ||
sera proposée dans une version ultérieure. | ||
|
||
|
||
[1]: https://contao.org/en/extension-list.html | ||
[2]: ../01-installation/installer-contao.md#loutil-dinstallation-de-contao | ||
[2]: https://packagist.org | ||
[3]: https://getcomposer.org/doc/00-intro.md#introduction | ||
[4]: https://packagist.org/search/?q=&type=contao-bundle | ||
[5]: https://packagist.org/search/?q=&type=contao-module | ||
[6]: https://fr.wikipedia.org/wiki/Lien_symbolique | ||
[7]: ../01-installation/installer-contao.md#loutil-dinstallation-de-contao |
Binary file removed
BIN
-42.9 KB
manual/fr/05-administration-du-systeme/images/desinstaller-extension.jpg
Binary file not shown.
Binary file removed
BIN
-78.9 KB
manual/fr/05-administration-du-systeme/images/details-extension.jpg
Binary file not shown.
Binary file removed
BIN
-21.6 KB
manual/fr/05-administration-du-systeme/images/gestionnaire-extension.jpg
Binary file not shown.
Binary file removed
BIN
-37.1 KB
manual/fr/05-administration-du-systeme/images/installer-extension.jpg
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add an intro like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 1c835f6