docs/recipe/contao.md
require 'recipe/contao.php';
Deployer is a free and open source deployment tool written in PHP. It helps you to deploy your Contao application to a server. It is very easy to use and has a lot of features.
Three main features of Deployer are:
Additionally, Deployer has a lot of other features, like:
You can read more about Deployer in Getting Started.
The deploy task of Contao consists of:
The contao recipe is based on the symfony recipe.
Overrides public_path from recipe/provision/website.php.
The public path is the path to be set as DocumentRoot and is defined in the composer.json of the project
but defaults to public from Contao 5.0 on.
This path is relative from the current_path, see recipe/provision/website.php.
$composerConfig = json_decode(file_get_contents('./composer.json'), true, 512, JSON_THROW_ON_ERROR);
return $composerConfig['extra']['public-dir'] ?? 'public';
Overrides bin/console from recipe/symfony.php.
return '{{bin/php}} {{release_or_current_path}}/vendor/bin/contao-console';
$result = run('{{bin/console}} --version');
preg_match_all('/(\d+\.?)+/', $result, $matches);
return $matches[0][0] ?? 'n/a';
Overrides symfony_version from recipe/symfony.php.
$result = run('{{bin/console}} about');
preg_match_all('/(\d+\.?)+/', $result, $matches);
return $matches[0][0] ?? 5.0;
Run Contao migrations.
This task updates the database. A database backup is saved automatically as a default.
To automatically drop the obsolete database structures, you can override the task as follows:
task('contao:migrate', function () {
run('{{bin/php}} {{bin/console}} contao:migrate --with-deletes {{console_options}}');
});
Download the Contao Manager.
Downloads the contao-manager.phar.php into the public path.
Lock the Contao Install Tool.
Locks the Contao install tool which is useful if you don't use it.
Lock the Contao Manager.
Locks the Contao Manager which is useful if you only need the API of the Manager rather than the UI.
Enable maintenance mode.
Disable maintenance mode.
Deploy the project.
This task is group task which contains next tasks: