CLI Tool

Continuum CMS is shipped with a command line tool to assist system administrators in performing some of the most commonly used actions on the server, such as clearing the cache, initialising schedule tasks, etc.

The cli.php script is located in the home directory of Continuum CMS.

php cli.php --list               Lists all the available commands.
php cli.php [command] --help     Displays detailed usage for the said command.

cms:clear-cache

Clears the database, symfony and configuration cache for a site.

Arguments
siteurl Site for which the cache needs to be cleared. If no siteURL is given, all sites' cache will be cleared.
php cli.php cms:clear-cache
php cli.php cms:clear-cache galaxy.example.jadu.net

cms:fix-queues

To fix the schedule tasks that may be stuck in the past. This resets the nextRunDate and scheduleTime in the JaduScheduleTasks table of mainsite and galaxies sites.

    php cli.php cms:fix-queues

cms:import-llpg

To import a DTF file into the database. As a pre-requisite, LLPG_DTF_UPLOAD_DIRECTORY constant should be set, llpg file should be made available in the said directory with write permissions.

    php cli.php cms:import-llpg

cms:db-find-and-replace

Find and replace the URLs in the text fields in the database. We suggest running the command with --findOnly prior to making the actual replace.

Arguments
-f, --find=TEXT String to be matched in the database.
-r, --replace=TEXT String to be replaced in the database.
--useRegex Flag to be set if the user intends to find the string using regex.
--findOnly Flag to be set if the user intends to only find the string and not replace.
--site=SITE Site on which the database find and replace needs to be executed.
--preserveTimestamp Flag to be set if the user intends to make changes to database without updating the modification date/time.
php cli.php cms:db-find-and-replace --find "foo" --replace "bar" 
php cli.php cms:db-find-and-replace --find "foo" --replace "bar" --findOnly
php cli.php cms:db-find-and-replace --find "f[\w]+" --replace "bar" --useRegex
php cli.php cms:db-find-and-replace --find "foo" --replace "bar" --preserveTimestamp
php cli.php cms:db-find-and-replace --find "foo" --replace "bar" --site "example.jadu.net"

Calling commands from code

To call commands from code you must use the CommandInvoker. This is available from the Jadu_Service_Container object.

$invoker = Jadu_Service_Container::getInstance()->getCommandInvoker();

// To get an array of commands defined within config
$invoker->getConfigurableCommands();

// To get an array of available commands 
$invoker->getAvailableCommands();

// To run a single command called "myCommand"
$invoker->run('myCommand');

results matching ""

    No results matching ""