Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/tutorial/advanced-composer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Advanced setup for Composer

In this tutorial, you will go beyond the basic Composer setup to include the
full set of WordPress coding standards.

## Prerequisites

You should already have completed the [Getting Started](getting-started.md) tutorial.

## PHP CodeSniffer

The only global package currently needed is PHP CodeSniffer, and the WordPress
coding standards:

```bash
$ composer global require squizlabs/php_codesniffer
```

At this point you should be able to see something like the following output:

```bash
$ phpcs -i
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend
```

## WordPress coding standards

Installing the WordPress code standards should be a process like:

```bash
$ git clone --branch master git@github.com:WordPress/WordPress-Coding-Standards.git ~/code/wpcs
$ phpcs --config-set installed_paths ~/code/wpcs
```

You have done everything correctly if you see the following output:

```bash
$ phpcs -i
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra
```
78 changes: 78 additions & 0 deletions docs/tutorial/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Getting started

In this tutorial, you will set up a local version of our WordPress network.

## Prerequisites

Please ensure you have the following tools set up on your computer. Everything
can be installed via [Homebrew](https://brew.sh/).

### PHP

We currently use the latest release on the 8.0.x branch, using commands such as:

```bash
$ brew install php@8.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

php --version                                                                                                    15:31:19
PHP 8.2.4 (cli) (built: Mar 16 2023 16:25:32) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.4, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.4, Copyright (c), by Zend Technologies

uh... oops

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully that bodes well for when we get around to upgrading PHP versions :-)

```

### Composer

https://getcomposer.org/

```bash
$ brew install composer
```

### Terminus CLI

https://docs.pantheon.io/terminus

There are a few packages with this name - you're looking for this one:

```bash
$ brew install pantheon-systems/external/terminus
```

Authenticating via Terminus is documented at https://docs.pantheon.io/terminus/install#authenticate

Additionally, there are four plugins you'll need:

- [terminus-build-tools-plugin](https://github.com/pantheon-systems/terminus-build-tools-plugin)
- [terminus-composer-plugin](https://github.com/pantheon-systems/terminus-composer-plugin)
- [terminus-secrets-manager-plugin](https://github.com/pantheon-systems/terminus-secrets-manager-plugin)
- [terminus-secrets-plugin](https://github.com/pantheon-systems/terminus-secrets-plugin)

The syntax to install each is typically:

```bash
terminus self:plugin:install plugin-name
```

You have done everything correctly when:

- You see your information with `terminus auth:whoami`
- You see four plugins listed by `terminus self:plugin:list`
- You see at least three entries with `terminus env:list mitlib-wp-network`

### Lando

https://lando.dev/

```bash
$ brew install --cask lando
```

## Set up application

- git clone mitlib-wp-network
- composer install
- lando pull
- lando wp search-replace command
- lando start
- (optional) lando logs -f

Get .env from someone

Set secrets.json values inside Lando (need more words here)

Load https://mitlib-wp-network.lndo.site/ and see the homepage