Console commands
This page is for application creators who run and add command line tools. bin/php/console is one entry point for
every script of Exponential: kernel scripts, shell scripts, extension scripts and cronjob parts
(Exponential Console).
Contents
- Finding commands
- Command names
- Your extension's commands
- Options and exit codes
- Commands you will use daily
Finding commands
php bin/php/console # every command
php bin/php/console list ext:expdemo # one namespace
php bin/php/console --versionCommand names
| Namespace | Runs | Example |
|---|---|---|
exp:<name> | bin/php/<name>.php | exp:ezcache |
shell:<name> | bin/shell/<name>.sh | |
bin:<name> | bin/<name>.sh or .php | |
ext:<ext>:<name> | extension/<ext>/bin/php/<name>.php or bin/<name>.sh | ext:expqueue:status |
ext:<ext>:sh:<name> | extension/<ext>/bin/shell/<name>.sh | |
cron:<part> | a cronjob part | cron:frequent |
Without a namespace the console tries exp:, shell:, then bin:.
Your extension's commands
Put the script in extension/expdemo/bin/php/report.php; the console finds it as ext:expdemo:report, no
registration needed. Give it a @description tag in its docblock so list describes it. Write the logic as a class
(CLI scripts with eZScript).
Options and exit codes
- Everything after the command name goes to the script unchanged;
--quiet,--versionand--helpalone belong to the console. - Scripts refuse to run as root unless
--allow-root-useris given; run them as the web server's user. - The script's exit code is returned unchanged: 0 for success, anything else for failure, so commands work in CI and shell pipelines. Make your commands follow that.
Commands you will use daily
| Command | Does |
|---|---|
exp:ezpgenerateautoloads -e | regenerate extension autoloads |
exp:ezcache --clear-tag=ini | clear caches by tag or id |
exp:cache status | every cache layer, PASS or FAIL |
exp:ini get/set/where | read and change settings (exp:ini) |
exp:velocity deploy | autoloads, caches, PHP reload, Velocity restart, in order |
exp:velocity status, restart, cache clear | the application server |
exp:help check, exp:help search | the help's link check and search |
exp:benchmark | measure the site |
exp:maintenance on/off | maintenance mode |
cron:<part> | run a cronjob part |
The generated pages of every command, with their options, are in the examples (doc/eng-us/examples/commands/).
Related pages
- CLI scripts with eZScript
- Command pattern
- Cache console
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.