Skip to content

Commit

Permalink
Merge branch 'main' into php83_xdebug
Browse files Browse the repository at this point in the history
  • Loading branch information
reynoldsalec committed Feb 15, 2024
2 parents d7c86d9 + ad5f975 commit 9011e82
Show file tree
Hide file tree
Showing 35 changed files with 1,379 additions and 2,984 deletions.
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.temp
.cache
temp
cache
dist
_site
!.vitepress
12 changes: 5 additions & 7 deletions .github/workflows/build-php-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
strategy:
fail-fast: false
matrix:
lando-version:
- 3-dev-slim
include:
- image: php
tag: 8.3-fpm-4
Expand Down Expand Up @@ -71,20 +69,20 @@ jobs:
- name: Set tag suffix
id: pr
if: ${{ github.event_name == 'pull_request' }}
run: echo "tag-suffix=-edge" >> $GITHUB_OUTPUT
run: echo "tag_suffix=-edge" >> "$GITHUB_OUTPUT"
# Build our images.
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push devwithlando/${{ matrix.image }}:${{ matrix.tag }}${{ steps.pr.outputs.TAG_SUFFIX }}
- name: Build and push devwithlando/${{ matrix.image }}:${{ matrix.tag }}${{ steps.pr.outputs.tag_suffix }}
uses: docker/build-push-action@v4
with:
context: ${{ matrix.context }}
platforms: linux/amd64,linux/arm64
push: true
tags: devwithlando/${{ matrix.image }}:${{ matrix.tag }}${{ steps.pr.outputs.TAG_SUFFIX }}
tags: devwithlando/${{ matrix.image }}:${{ matrix.tag }}${{ steps.pr.outputs.tag_suffix }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand All @@ -105,10 +103,10 @@ jobs:
lando-plugin: true
version: dev
sync: false
- name: Setup lando ${{ matrix.lando-version }}
- name: Setup lando 3-dev-slim
uses: lando/setup-lando@v2
with:
lando-version: ${{ matrix.lando-version }}
lando-version: 3-dev-slim
config: |
setup.skipCommonPlugins=true
setup.plugins.@lando/php=/home/runner/work/php/php
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:

jobs:
unit-tests:
docs-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -26,6 +26,6 @@ jobs:

# Run tests
- name: Run linter
run: npm run docs:lint
run: npm run lint
- name: Test build
run: npm run docs:build
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ dist
.nyc_output
coverage/

# Vuepress
# docs
.temp
.cache
_site
docs/.vuepress/.cache
docs/.vuepress/.temp
docs/.vuepress/dist
dist
cache
temp
config.*.timestamp-*-*.*

# YARN
yarn.lock
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.1.0 - [January 29, 2024](https://github.com/lando/php/releases/tag/v1.1.0)
* Add support for PHP 8.3. [#77](https://github.com/lando/php/issues/77)

## v1.0.0 - [December 7, 2023](https://github.com/lando/php/releases/tag/v1.0.0)
* Dialed fully for `lando update`

Expand Down
9 changes: 9 additions & 0 deletions docs/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
"max-len": ["error", {
"code": 12000,
"ignoreComments": true
}],
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": false,
"MethodDefinition": false,
"ClassDeclaration": false,
"ArrowFunctionExpression": false,
"FunctionExpression": false
}
}]
}
}
59 changes: 59 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import {createRequire} from 'module';

import {defineConfig} from '@lando/vitepress-theme-default-plus/config';

const require = createRequire(import.meta.url);

const {name, version} = require('../../package.json');
const landoPlugin = name.replace('@lando/', '');

export default defineConfig({
title: 'Lando Php Plugin',
description: 'The offical Lando plugin for Php.',
landoDocs: 3,
landoPlugin,
version,
head: [
['meta', {name: 'viewport', content: 'width=device-width, initial-scale=1'}],
['link', {rel: 'icon', href: '/php/favicon.ico', size: 'any'}],
['link', {rel: 'icon', href: '/php/favicon.svg', type: 'image/svg+xml'}],
],
themeConfig: {
sidebar: sidebar(),
},
});

function sidebar() {
return [
{
text: 'Introduction',
collapsed: false,
items: [
{text: 'Introduction', link: '/'},
{text: 'Installation', link: '/install'},
{text: 'Configuration', link: '/config'},
{text: 'Extensions', link: '/extensions'},
{text: 'Caveats', link: '/caveats'},
],
},
{
text: 'Contribution',
collapsed: true,
items: [
{text: 'Development', link: '/development'},
{text: 'Team', link: '/team'},
],
},
{
text: 'Help & Support',
collapsed: true,
items: [
{text: 'GitHub', link: 'https://github.com/lando/php/issues/new/choose'},
{text: 'Slack', link: 'https://www.launchpass.com/devwithlando'},
{text: 'Contact Us', link: '/support'},
],
},
{text: 'Guides', link: '/guides', activeMatch: '/guides'},
{text: 'Examples', link: 'https://github.com/lando/php/tree/main/examples'},
];
};
3 changes: 3 additions & 0 deletions docs/.vitepress/theme/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import VPLTheme from '@lando/vitepress-theme-default-plus';

export default VPLTheme;
59 changes: 0 additions & 59 deletions docs/.vuepress/config.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/caveats.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Lando will set the `PATH` hierarchy for this service as follows:
]
```
This is useful to note if you are not using absolute paths in any [tooling routes](https://docs.lando.dev/config/tooling.html) and are getting the unexpected version of a particular utility.
This is useful to note if you are not using absolute paths in any [tooling routes](https://docs.lando.dev/core/v3/tooling.html) and are getting the unexpected version of a particular utility.
38 changes: 13 additions & 25 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ description: Learn how to configure the Lando PHP service.

# Configuration

Here are the configuration options, set to the default values, for this service. If you are unsure about where this goes or what this means, we *highly recommend* scanning the [services documentation](https://docs.lando.dev/config/services.html) to get a good handle on how the magicks work.
Here are the configuration options, set to the default values, for this service. If you are unsure about where this goes or what this means, we *highly recommend* scanning the [services documentation](https://docs.lando.dev/core/v3/lando-service.html) to get a good handle on how the magicks work.

Also note that options, in addition to the [build steps](https://docs.lando.dev/config/services.html#build-steps) and [overrides](https://docs.lando.dev/config/services.html#overrides) that are available to every service, are shown below:
Also note that options, in addition to the [build steps](https://docs.lando.dev/core/v3/lando-service.html#build-steps) and [overrides](https://docs.lando.dev/core/v3/lando-service.html#overrides) that are available to every service, are shown below:

```yaml
services:
Expand All @@ -31,9 +31,9 @@ services:
## Choosing a server (or not)
By default, `php` services will be served by the default version of our [apache](https://docs.lando.dev/config/apache.html) service but you can switch this to either `nginx` or `cli`.
By default, `php` services will be served by the default version of our [apache](https://docs.lando.dev/plugins/apache/) service but you can switch this to either `nginx` or `cli`.

Like with `apache`, `nginx` will use the the default version of our [nginx](https://docs.lando.dev/config/nginx.html) service while `cli` will just spin up a `php` container without a web server. The latter is useful if you just want to work on a CLI utility or lock down what version `composer` runs with.
Like with `apache`, `nginx` will use the the default version of our [nginx](https://docs.lando.dev/plugins/nginx/) service while `cli` will just spin up a `php` container without a web server. The latter is useful if you just want to work on a CLI utility or lock down what version `composer` runs with.

#### With Apache (default)

Expand Down Expand Up @@ -133,21 +133,9 @@ services:

While Lando will handle the server side configuration for you, there is often a considerable amount of pain lurking in the client side configuration. To that end, some helpful info about a few popular clients is shown below:

**ATOM**
**PHPStorm**

An example config for [ATOM's](https://atom.io/) [`php-debug`](https://github.com/gwomacks/php-debug) plugin is shown below:

```json
"php-debug":
{
ServerPort: 9000
PathMaps: [
"/app/www;/Users/pirog/Desktop/work/lando/examples/lando/www"
]
}
```

The first part of a pathmap will be the location of your code in the container. Generally, this should be `/app`. Also note that if your app is in a nested docroot, you will need to append that to the paths. The example above uses an app with a nested webroot called `www`.
[Lando + PhpStorm + Xdebug](https://docs.lando.dev/guides/lando-phpstorm.html)

**VSCODE**

Expand Down Expand Up @@ -205,9 +193,9 @@ composer_version: snapshot
You can also use the `composer` key if you need to require any [global composer dependenices](https://getcomposer.org/doc/03-cli.md#require). This follows the same syntax as your normal [`composer.json`](https://getcomposer.org/doc/01-basic-usage.md#composer-json-project-setup) except written as YAML instead of JSON.

::: tip Use composer.json if you can
While there are some legitimate use cases to globally install a composer dependency, it is almost always preferred to install using your applications normal `composer.json` and then running either `lando composer install` or alternatively setting up a [build step](https://docs.lando.dev/config/services.html#build-steps) that will automatically run before your app starts up.
While there are some legitimate use cases to globally install a composer dependency, it is almost always preferred to install using your applications normal `composer.json` and then running either `lando composer install` or alternatively setting up a [build step](https://docs.lando.dev/core/v3/lando-service.html#build-steps) that will automatically run before your app starts up.

Note that `lando composer` is not provided out of the box by the `php` service and needs to be manually added by configuring your app's [tooling](https://docs.lando.dev/config/tooling.html).
Note that `lando composer` is not provided out of the box by the `php` service and needs to be manually added by configuring your app's [tooling](https://docs.lando.dev/core/v3/tooling.html).
:::

An example of globally installing `phpunit/phpunit` `^6.5` is shown below:
Expand All @@ -220,7 +208,7 @@ services:
phpunit/phpunit: ^6.5
```

An example of using a [build step](https://docs.lando.dev/config/services.html#build-steps) to automatically `composer install` your dependencies before your app starts is shown below:
An example of using a [build step](https://docs.lando.dev/core/v3/lando-service.html#build-steps) to automatically `composer install` your dependencies before your app starts is shown below:

```yaml
services:
Expand All @@ -232,11 +220,11 @@ services:

## Using custom config files

You may need to override our [default php config](https://github.com/lando/php/tree/main/services/php) with your own.
You may need to override our [default php config](https://github.com/lando/php/tree/main/builders) with your own.

If you do this, you must use files that exist inside your application and express them relative to your project root as shown below:

Note that the default files may change based on how you set both `ssl` and `via`. Also note that the `vhosts` and `server` config will be either for `apache` or `nginx` depending on how you set `via`. We *highly recommend* you check out both the [apache](https://docs.lando.dev/apache) and [nginx](https://docs.lando.dev/nginx) if you plan to use a custom `vhosts` or `server` config.
Note that the default files may change based on how you set both `ssl` and `via`. Also note that the `vhosts` and `server` config will be either for `apache` or `nginx` depending on how you set `via`. We *highly recommend* you check out both the [apache](https://docs.lando.dev/plugins/apache/) and [nginx](https://docs.lando.dev/plugins/nginx/) if you plan to use a custom `vhosts` or `server` config.

If you set `via: cli` then, as you might suspect, `vhosts` and/or `server` is not going to do anything.

Expand Down Expand Up @@ -285,7 +273,7 @@ lando php
lando composer
```

Lando tooling is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/config/tooling.html) of its cool features.
Lando tooling is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/core/v3/tooling.html) of its cool features.

## Adding routing

Expand All @@ -298,4 +286,4 @@ proxy:
- something.else.local
```

Lando proxying is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/config/proxy.html) of its cool features.
Lando proxying is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/core/v3/proxy.html) of its cool features.
Loading

0 comments on commit 9011e82

Please sign in to comment.