We are proud to release a new major version of the Platform.sh CLI. We got some great feedback from you and there are some major changes to the way the CLI works… so you should pay attention …
This post will help you with updating your CLI installation, and it will explain some of the major changes.
Updating
You can update with the command: platform self-update
(but do read this first).
New file structure
The Platform.sh CLI version 3.0.0 includes a major change to the way it structures your files.
Previously the CLI always needed your project to have all its code inside a repository
subdirectory, and it kept its own data one level up, in files such as .platform-project
, builds
, and a www
symlink. Example structure with the CLI version 2.x.x:
$ ls -A1 my-project
.platform-project
builds
repository
www
$ ls -A1 my-project/repository
.git
.platform
.platform.app.yaml
# and your project's files
This worked well, but it was always a little bit confusing for new users, and it works differently from many other CLI tools. It also means the CLI could not recognise a project from a plain repository (fetched via git clone
) - now it can.
So, the CLI version 3 has changed the file structure. It runs directly inside your project’s repository.
Example structure with the CLI version 3.x.x:
$ ls -A1 my-project
.git
.platform
.platform.app.yaml
_www
# and your project's files
For each project, the CLI will prompt you to ‘migrate’ to the new file structure. You can do this by accepting the prompt, or you can manually run the command: platform legacy-migrate
. A backup of your project will be created to ensure you do not lose any data.
New web root location.
The CLI version 3 has a different location for the local “web root” symlink: it has changed from www
to _www
. This is to avoid conflicts with files in your repository.
The web root will only exist if you run the command: platform build
You may need to update your local web server configuration: just change www
to _www
.
New metadata location.
The CLI version 3 keeps its own metadata about your project inside a folder named .platform/local/
. This is automatically excluded from Git.
New PHP requirement
Because of new dependencies, version 3 requires PHP version 5.5.9 as a minimum. It is tested with PHP 5.5, 5.6, 7.0, and HHVM.