-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from lando/pirophp84
Pirophp84
- Loading branch information
Showing
16 changed files
with
540 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
vendor | ||
composer.json | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: lando-php83 | ||
events: | ||
post-start: | ||
- defaults: php -i | grep memory_limit | grep -e "-1" | ||
services: | ||
defaults: | ||
type: php:8.4 | ||
composer_version: false | ||
cli: | ||
type: php:8.4 | ||
composer_version: false | ||
via: cli | ||
build_as_root: | ||
- curl -sL https://deb.nodesource.com/setup_14.x | bash - | ||
- apt-get update -y | ||
- apt-get install -y nodejs | ||
cliworker: | ||
type: php:8.4 | ||
composer_version: false | ||
via: cli | ||
command: sleep infinity | ||
custom: | ||
type: php:8.4 | ||
composer_version: "2.5.6" | ||
via: nginx | ||
ssl: true | ||
webroot: web | ||
xdebug: true | ||
config: | ||
php: config/php.ini | ||
overrides: | ||
image: devwithlando/php:8.4-fpm-4 | ||
environment: | ||
DUALBLADE: maxim | ||
OTHER: thing | ||
custom_nginx: | ||
build_as_root: | ||
- mkdir -p /app/test && touch /app/test/managed_build_step | ||
overrides: | ||
environment: | ||
MORE: things | ||
OTHER: stuff | ||
tooling: | ||
php: | ||
service: defaults | ||
node: | ||
service: :host | ||
options: | ||
host: | ||
description: The service to use | ||
default: cli | ||
alias: | ||
- h | ||
|
||
# This is important because it lets lando know to test against the plugin in this repo | ||
# DO NOT REMOVE THIS! | ||
plugins: | ||
"@lando/php": ../.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# PHP 8.4 Example | ||
|
||
This example exists primarily to test the following documentation: | ||
|
||
* [PHP Service](https://docs.lando.dev/config/php.html) | ||
* [Installing Node in a PHP Service](https://docs.lando.dev/guides/installing-node-in-your-lando-php-service.html) | ||
* [Issue #1990](https://github.com/lando/lando/issues/1990) | ||
* [Issue #2192](https://github.com/lando/lando/issues/2192) | ||
|
||
And probably other stuff | ||
|
||
## Start up tests | ||
|
||
Run the following commands to get up and running with this example. | ||
|
||
```bash | ||
# Should start up successfully | ||
lando poweroff | ||
lando start | ||
``` | ||
|
||
## Verification commands | ||
|
||
Run the following commands to validate things are rolling as they should. | ||
|
||
```bash | ||
# Should use 8.4 as the default php version | ||
lando exec defaults -- php -v | grep "PHP 8.4" | ||
|
||
# Should use 10.x as the default postgresql-client version | ||
lando exec defaults -- psql -V | grep "10." | ||
|
||
# Should use apache 2.4 as the default webserver version | ||
lando exec defaults -- apachectl -V | grep "2.4." | ||
|
||
# Should only serve over http by default | ||
lando exec defaults -- curl https://localhost || echo $? | grep 1 | ||
|
||
# Should serve from the app root by default | ||
lando exec defaults -- curl http://localhost | grep "ROOTDIR" | ||
|
||
# Should have a 1G php mem limit on appserver | ||
lando exec defaults -- curl http://localhost | grep "memory_limit" | grep "1G" | ||
|
||
# Should have COMPOSER_MEMORY_LIMIT set to -1 | ||
lando exec defaults -- env | grep "COMPOSER_MEMORY_LIMIT=-1" | ||
|
||
# Should install composer 2.x by default | ||
lando exec defaults -- composer --version --no-ansi | grep "Composer version 2." | ||
|
||
# Should have unlimited memory for php for CLI opts | ||
lando php -i | grep memory_limit | grep -e "-1" | ||
lando exec defaults -- php -i | grep "memory_limit" | grep -e "-1" | ||
|
||
# Should not enable xdebug by default | ||
lando exec defaults -- php -m | grep xdebug || echo $? | grep 1 | ||
|
||
# Should have a PATH_INFO and PATH_TRANSLATED SERVER vars | ||
lando exec custom_nginx -- curl https://localhost | grep SERVER | grep PATH_INFO | ||
lando exec custom_nginx -- curl https://localhost | grep SERVER | grep PATH_TRANSLATED | ||
|
||
# Should use specified php version if given | ||
lando exec custom -- php -v | grep "PHP 8.4" | ||
|
||
# Should install composer 2.5.6 if version number is set | ||
lando exec custom -- composer --version --no-ansi | grep "Composer version 2.5.6" | ||
|
||
# Should serve via nginx if specified | ||
lando exec custom_nginx -- curl http://localhost | grep "WEBDIR" | ||
|
||
# Should serve via https if specified | ||
lando exec custom_nginx -- curl https://localhost | grep "WEBDIR" | ||
|
||
# Should enable xdebug if specified | ||
lando exec custom -- php -m | grep "xdebug" | ||
|
||
# Should not serve port 80 for cli | ||
lando exec cli -- curl http://localhost || echo $? | grep 1 | ||
|
||
# Should install the composer 2.x using the false flag | ||
lando exec cli -- composer --version --no-ansi | grep "Composer version 2." | ||
|
||
# Should use custom php ini if specified | ||
lando exec custom -- php -i | grep memory_limit | grep 514 | ||
lando exec custom -- curl http://custom_nginx | grep html_errors | grep On | grep On | ||
|
||
# Should inherit overrides from its generator | ||
lando exec custom -- env | grep DUALBLADE | grep maxim | ||
lando exec custom_nginx -- env | grep DUALBLADE | grep maxim | ||
|
||
# Should be able to run build steps on lando managed nginx service | ||
# https://github.com/lando/lando/issues/1990 | ||
lando exec custom_nginx -- cat /app/test/managed_build_step | ||
|
||
# Should be able to override lando managed nginx service | ||
# https://github.com/lando/lando/issues/1990 | ||
lando exec custom_nginx -- env | grep OTHER | grep stuff | ||
lando exec custom_nginx -- env | grep MORE | grep things | ||
|
||
# Should set PATH_INFO and PATH_TRANSLATED if appropriate | ||
# https://github.com/lando/lando/issues/2192 | ||
lando exec custom_nginx -- curl http://localhost/path_info.php/a/b.php | grep PATH_INFO | grep "/a/b.php" | ||
lando exec custom_nginx -- curl http://localhost/path_info.php/a/b.php | grep PATH_TRANSLATED | grep "/app/web/a/b.php" | ||
lando exec custom_nginx -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT_NAME | grep "/path_info.php" | ||
lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep PATH_INFO | grep "/a/b.php" | ||
lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep PATH_TRANSLATED | grep "/app/a/b.php" | ||
lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT_NAME | grep "/path_info.php" | ||
|
||
# Should allow cli services to specify a boot up command | ||
lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity | ||
|
||
# Should install the latest composer 2.x by default. | ||
lando exec cliworker -- composer --version --no-ansi | grep "Composer version 2." | ||
|
||
# Should have node14 installed in cli service | ||
lando node -v | grep v14. | ||
``` | ||
|
||
## Destroy tests | ||
|
||
Run the following commands to trash this app like nothing ever happened. | ||
|
||
```bash | ||
# Should be destroyed with success | ||
lando destroy -y | ||
lando poweroff | ||
``` |
Oops, something went wrong.