Environment Initialization
This package ships with a custom Composer command, composer vip
. Thanks to its multiple arguments and flags, it is the single entry point to access numerous features.
Before executing the command, we have to install all dependencies, including the library itself.
Installing dependencies
We can start with a โwebsite projectโ repository having only the composer.json
presented in the previous chapter:
โ ๐ composer.json
After executing composer install
we will end up with a folder structure like the following:
โ ๐ composer.json
โ ๐ composer.lock
โ ๐ vip
โ โ ๐ client-mu-plugins
โ โ โ ๐ my-vip-muplugin
โ โ โ ๐ vendor
โ โ โ ๐ composer
โ โ โ ๐ inpsyde
โ โ โ โ ๐ vip-composer-plugin
โ โ โ ๐ autoload.php
โ โ ๐ config
โ โ ๐ images
โ โ ๐ languages
โ โ ๐ plugins
โ โ โ ๐ my-vip-plugin
โ โ ๐ themes
โ โ โ ๐ my-vip-theme
โ โ ๐ vip-config
The /vip
folder and its content (even if most of its folder are empty, right now) resembles very closely the VIP โskeletonโ, with all the packages placed in the proper place based on their Composer type. This is just the beginning of how the VIP Composer plugins make out life extremely easy.
The real โmagicโ happens when running the composer vip
command.
The vip
command main modes
The composer vip
command provided by this package has several parameters and options, but two are its main scopes:
- **Prepare a local environment for development **
- Deploy to VIP servers
Local development environment
Regarding the local development environment, the package supports two options:
- The VIP local development environment which is based on Lando (thus Docker) plus a series of utilities as scripts to make the containerized system as much as possible similar to the โonlineโ VIP environments.
- A more low-level approach, where this package takes care of the heavy lifting of configuring the environment from an application point of view, and ends up with a
/public
folder which is ready to be uses as the โwebrootโ for whatever system consumers might want to use, which could be container-based, good old XAMPP or MAMP, or anything else that can serve web pages executing PHP and MySQL.
The two approaches are documented separately:
Deployment to VIP servers
The /vip
folder that resembles the structure expected by VIP and documented in the VIP โskeletonโ, is a folder that is generated and so should be git-ignored. (Side note: this package does not create a .gitignore
file, but you need one to exclude /vip
from version control).
However, VIP requires we push to GitHub what we have in that version-control-ignored folder. How can we push to GitHub the content of a folder that is VCS-ignored and whose content is โdisposableโ and created dynamically?
The short answer is: we type composer vip --deploy
in our terminal and let this package handle it. The details of what happens when we do that is documented in the Deployment chapter.
More on the command
The composer vip
command has several options besides the two main usages introduced above. In-depth documentation can be found in the โVIP Commandโ chapter.
Configuration
The composer vip
command outcome can be customized by configuration placed in the projectsโ composer.json
. Learn more about all possible customizations in the โPlugin Configurationโ chapter.
Website configuration
Regardless we execute the composer vip
command to prepare a local environment or to deploy to VIP servers, this package will always deal with website configuration and create some MU plugins.
These files are not part of the โbuildโ process, but are executed and required to run the website. Learn more in the โWebsite Configurationโ chapter.