WCMS Lando setup
This repository contains all you will need to get up and running with Lando and the WCMS 3.x.
Setup the Dev environment with Lando
Requirements
- Lando (https://lando.dev/)
- Git (https://git-scm.com/downloads)
- Docker (https://www.docker.com/products/docker-desktop), though Lando installs the version it needs if it's missing
(There may be others that I am currently missing...)
Setup
Clone repo (https://git.uwaterloo.ca/mnshantz/wcms-lando.git)
Go into the wcms-lando directory.
cd wcms-lando
Since you don't need to commit back to the Lando
repo we can remove that ability.
git remote remove origin
Now we can start Lando
.
lando start
We can then run the WCMS rebuild script within Lando
, this runs ./rebuild.sh
, you will be presented with prompts. In most cases the defaults are fine.
lando wcms-rebuild
I've created a database to get things started, you can import it using this command.
lando db-import wcms/wcms-lando.sql.gz
Finally, we clear caches within our sites folder so things are tickety-boo!
lando wcms-cr
Go to your site URL (which should be located at https://wcms.lndo.site/) Otherwise run
lando info
To get the URL for your site. You should see the WCMS site with the correct header and footer. Login is:
- username: wcmsadmin
- password: 12345
To run gulp watch on the Gesso folder:
lando wcms-gulp
If you need to get rid of your Lando instance:
lando destroy -y
Also, remember you need to clean up (remove) any files that were created as part
of the lando start
command, or you can just delete and re-clone the folder.
Using xdebug with Lando and PHPStorm
Note This assumes you already have Lando and PHPstorm installed, and that you have downloaded and installed the required Xdebug plugin for your web browser of choice.
Running xdebug in Lando can cause a performance hit. To enable or disable xdebug you need to change run
lando xdebug-on
or
lando xdebug-off
The default state is currently off.
Once you have you site (re)built, start PHPStorm.
-
Going to Preferences -> Languages & Frameworks -> PHP and make sure that the PHP language level matches the .lando.yml file, currently (May 2020) set to PHP 7.3.
-
Make sure that you have your Project opened in PHPStorm.
-
Add a breakpoint in your desired module.
-
Open your browser and go to the URL of the lando site, if you are using the defaults it should be https://wcms.lndo.site
-
Make sure you've installed the Xdebug plugin for your browser and enable debugging on your lando site.
-
Refresh the page in your browser. The first time you run this you will need to accept the connection in PHPStorm.
-
You should then see the output in the debugging window in PHPStorm.