-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for PHP 8.3. * Use the LTS release of Composer. * Update documentation. * Set the correct name for the PHP 8.3 example Lando file. * There is no stable PECL package of xdebug yet that is compatible with PHP 8.3. * Test that we can install the latest version of Composer. * Use the latest version of the Redis extension. * Remove erroneous favicon file. --------- Co-authored-by: Alec Reynolds <[email protected]>
- Loading branch information
1 parent
6abf2ef
commit 82e83e2
Showing
30 changed files
with
928 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ jobs: | |
- '8.0' | ||
- '8.1' | ||
- '8.2' | ||
- '8.3' | ||
lando-version: | ||
- 3-dev-slim | ||
os: | ||
|
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
Empty file.
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.3 | ||
composer_version: false | ||
cli: | ||
type: php:8.3 | ||
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.3 | ||
composer_version: false | ||
via: cli | ||
command: sleep infinity | ||
custom: | ||
type: php:8.3 | ||
composer_version: "2.5.6" | ||
via: nginx | ||
ssl: true | ||
webroot: web | ||
xdebug: true | ||
config: | ||
php: config/php.ini | ||
overrides: | ||
image: devwithlando/php:8.3-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,131 @@ | ||
PHP 8.3 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.3 as the default php version | ||
lando ssh -s defaults -c "php -v" | grep "PHP 8.3" | ||
|
||
# Should use 10.x as the default postgresql-client version | ||
lando ssh -s defaults -c "psql -V" | grep "10." | ||
|
||
# Should use apache 2.4 as the default webserver version | ||
lando ssh -s defaults -c "apachectl -V" | grep "2.4." | ||
|
||
# Should only serve over http by default | ||
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1 | ||
|
||
# Should serve from the app root by default | ||
lando ssh -s defaults -c "curl http://localhost" | grep "ROOTDIR" | ||
|
||
# Should have a 1G php mem limit on appserver | ||
lando ssh -s defaults -c "curl http://localhost" | grep "memory_limit" | grep "1G" | ||
|
||
# Should have COMPOSER_MEMORY_LIMIT set to -1 | ||
lando ssh -s defaults -c "env" | grep "COMPOSER_MEMORY_LIMIT=-1" | ||
|
||
# Should install composer 2.x by default | ||
lando ssh -s defaults -c "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 ssh -s defaults -c "php -i" | grep "memory_limit" | grep -e "-1" | ||
|
||
# Should not enable xdebug by default | ||
lando ssh -s defaults -c "php -m | grep xdebug" || echo $? | grep 1 | ||
|
||
# Should have a PATH_INFO and PATH_TRANSLATED SERVER vars | ||
lando ssh -s custom_nginx -c "curl https://localhost" | grep SERVER | grep PATH_INFO | ||
lando ssh -s custom_nginx -c "curl https://localhost" | grep SERVER | grep PATH_TRANSLATED | ||
|
||
# Should use specified php version if given | ||
lando ssh -s custom -c "php -v" | grep "PHP 8.3" | ||
|
||
# Should install composer 2.5.6 if version number is set | ||
lando ssh -s custom -c "composer --version --no-ansi" | grep "Composer version 2.5.6" | ||
|
||
# Should serve via nginx if specified | ||
lando ssh -s custom_nginx -c "curl http://localhost" | grep "WEBDIR" | ||
|
||
# Should serve via https if specified | ||
lando ssh -s custom_nginx -c "curl https://localhost" | grep "WEBDIR" | ||
|
||
# Should enable xdebug if specified | ||
lando ssh -s custom -c "php -m" | grep "xdebug" | ||
|
||
# Should not serve port 80 for cli | ||
lando ssh -s cli -c "curl http://localhost" || echo $? | grep 1 | ||
|
||
# Should install the composer 2.x using the false flag | ||
lando ssh -s cli -c "composer --version --no-ansi" | grep "Composer version 2." | ||
|
||
# Should use custom php ini if specified | ||
lando ssh -s custom -c "php -i | grep memory_limit | grep 514" | ||
lando ssh -s custom -c "curl http://custom_nginx" | grep html_errors | grep On | grep On | ||
|
||
# Should inherit overrides from its generator | ||
lando ssh -s custom -c "env | grep DUALBLADE | grep maxim" | ||
lando ssh -s custom_nginx -c "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 ssh -s custom_nginx -c "cat /app/test/managed_build_step" | ||
|
||
# Should be able to override lando managed nginx service | ||
# https://github.com/lando/lando/issues/1990 | ||
lando ssh -s custom_nginx -c "env | grep OTHER | grep stuff" | ||
lando ssh -s custom_nginx -c "env | grep MORE | grep things" | ||
|
||
# Should set PATH_INFO and PATH_TRANSLATED if appropriate | ||
# https://github.com/lando/lando/issues/2192 | ||
lando ssh -s custom_nginx -c "curl http://localhost/path_info.php/a/b.php" | grep PATH_INFO | grep "/a/b.php" | ||
lando ssh -s custom_nginx -c "curl http://localhost/path_info.php/a/b.php" | grep PATH_TRANSLATED | grep "/app/web/a/b.php" | ||
lando ssh -s custom_nginx -c "curl http://localhost/path_info.php/a/b.php" | grep SCRIPT_NAME | grep "/path_info.php" | ||
lando ssh -s defaults -c "curl http://localhost/path_info.php/a/b.php" | grep PATH_INFO | grep "/a/b.php" | ||
lando ssh -s defaults -c "curl http://localhost/path_info.php/a/b.php" | grep PATH_TRANSLATED | grep "/app/a/b.php" | ||
lando ssh -s defaults -c "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 ssh -s cliworker -c "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.