Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions docs/recipe/contao.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,31 @@ return '{{bin/php}} {{release_or_current_path}}/vendor/bin/contao-console';


```php title="Default value"
return run('{{bin/console}} contao:version');
$result = run('{{bin/console}} --version');
preg_match_all('/(\d+\.?)+/', $result, $matches);
return $matches[0][0] ?? 'n/a';
```


### symfony_version
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L39)

Overrides [symfony_version](/docs/recipe/symfony.md#symfony_version) from `recipe/symfony.php`.



```php title="Default value"
$result = run('{{bin/console}} about');
preg_match_all('/(\d+\.?)+/', $result, $matches);
return $matches[0][0] ?? 5.0;
```



## Tasks

### contao:migrate
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L47)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L55)

Run Contao migrations.

Expand All @@ -108,47 +124,47 @@ task('contao:migrate', function () {


### contao:manager:download
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L53)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L61)

Download the Contao Manager.

Downloads the `contao-manager.phar.php` into the public path.


### contao:install:lock
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L59)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L67)

Lock the Contao Install Tool.

Locks the Contao install tool which is useful if you don't use it.


### contao:manager:lock
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L65)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L73)

Lock the Contao Manager.

Locks the Contao Manager which is useful if you only need the API of the Manager rather than the UI.


### contao:maintenance:enable
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L71)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L79)

Enable maintenance mode.




### contao:maintenance:disable
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L86)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L94)

Disable maintenance mode.




### deploy
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L98)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/contao.php#L106)

Deploy the project.

Expand Down
10 changes: 9 additions & 1 deletion recipe/contao.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@
});

set('contao_version', function () {
return run('{{bin/console}} contao:version');
$result = run('{{bin/console}} --version');
preg_match_all('/(\d+\.?)+/', $result, $matches);
return $matches[0][0] ?? 'n/a';
});

set('symfony_version', function () {
$result = run('{{bin/console}} about');
preg_match_all('/(\d+\.?)+/', $result, $matches);
return $matches[0][0] ?? 5.0;
});

// This task updates the database. A database backup is saved automatically as a default.
Expand Down