-
Notifications
You must be signed in to change notification settings - Fork 33
PHP Shell
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 totara-aliases.sh
file that has a few helpers to get you started. They are:
-
install
- installs a fresh instance of Totara -
upgrade
- upgrades an existing site -
cron
- runs cron -
purge
- purges the site caches -
installunit
- initialises PHPUnit -
unit
- runs PHPUnit -
installbehat
- runs a helper script for installing Behat -
behat
- runs a helper script for running Behat -
behatlogs
- outputs the behat error logs from the last run -
createcourse
- creates a course -
createuser
- 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.
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.
Copyright (c) 2023 Totara Learning Solutions Limited
- Node.js and Grunt
- PHPUnit
- Behat
- Cron
- Machine Learning
- Mailcatcher (for viewing emails)
- Shell Customisations
- Ngrok (for making your site publicly accessible)
-
PHPStorm Integration
- Performance improvements
- Automated testing integration
- XDebug setup
- Database tools