PHP Shell - totara/totara-docker-dev GitHub Wiki
Aliases
The shell
folder lets you add custom aliases and functions to your php containers.
Any file with the .sh
extension will be sourced into your php container whenever you bash/sh into it.
This is useful for when you need to run complex commands often during development, such as initialising tests.
By default, there is a default-aliases.sh
file that has a few helpers to get you started. They are:
install
- installs a fresh instance of Totaraupgrade
- upgrades an existing sitecron
- runs cronpurge
- purges the site cachesinstallunit
- initialises PHPUnitunit
- runs PHPUnitinstallbehat
- runs a helper script for installing Behatbehat
- runs a helper script for running Behatbehatlogs
- outputs the behat error logs from the last runcreatecourse
- creates a coursecreateuser
- create user(s)config_var
- extract a$CFG
variable from the site config.php. For example, you can gocd $(config_var dataroot)
, which will take you to the dataroot folder.
Feel free to add your own .sh
/.bash
files into the shell
directory.
Note that the aliases listed above must be run inside the PHP docker containers at the root of your Totara site directory.
Oh My Zsh
For the PHP containers, the Oh My Zsh extention is used on top of zsh.
Oh My Zsh is highly configurable - see shell/.zshrc
for the current configuration and check out the ohmyzsh and powerline10k docs for more ideas on what is possible.