Commands

Contao uses the Console component of Symfony and provides a few commands. To execute these commands locate the console executable in your project and append the subsequently documented commands.

$> php bin/console <command-name>

In the Contao Managed Edition, the path to the console script is vendor/bin/contao-console instead.

By appending the --help argument to any command, a usage guide is printed to the shell.

$> php bin/console contao:user:password --help

Description:
  Changes the password of a Contao back end user.

Usage:
  contao:user:password [options] [--] <username>

Arguments:
  username                 The username of the back end user

Options:
  -p, --password=PASSWORD  The new password
  […]

contao:automator

This command is an interface to the Automator class of Contao. It mainly consists of common tasks around the maintenance of a Contao installation.

$> php bin/console contao:automator [<task>]

The command itself can be executed without providing a task. It will then ask for it. The following tasks are available.

Task Description
purgeSearchTables Clears the search index by deleting the tables tl_search and tl_search_index.
purgeUndoTable Removes the temporarily stored undo entries, which allows for restoring deleted entries.
purgeVersionTable Purges the version table tl_version which holds different versions for rows in tables that have the versioning feature enabled.
purgeSystemLog Deletes entries in the system log.
purgeImageCache Purges the image cache by deleting all processed and resized images in the configurable image.target_dir.
purgeScriptCache Removes processed and/or minified JavaScript files and Stylesheets.
purgePageCache Clears the page cache by removing cached html responses.
purgeSearchCache Clears the search result cache.
purgeInternalCache Clears the internal cache directory in kernel.cache_dir, this includes the Symfony application cache and potentially hits non Contao caches.
purgeTempFolder Purges the complete temporary folder.
purgeRegistrations Purged the unactivated member registrations.
purgeOptInTokens Purged the expired double opt-in tokens.
purgeXmlFiles Removes xml files generated by generateXmlFiles task.
generateSitemap Generates the sitemap.xml files based on the page tree and the settings on the root page.
generateXmlFiles Generates the sitemap.xml files and calls the hook generateXmlFiles for other bundles to use. The ContaoNewsBundle uses it to generate RSS feeds.
generateSymlinks Creates various symlinks to the web directory, for example publicly reachable file directories, the assets directory or system/themes.
generateInternalCache Warms up the internal cache.

Other commands

  • contao:filesync: Synchronises the file system to the database.
  • contao:install: Creates various empty directories which Contao relies on.
  • contao:symlinks: Creates various symlinks to the web directory, for example publicly reachable file directories, the assets directory or system/themes.
  • contao:user:password: Allows for changing a users password on the shell.