Skip to content

Commit

Permalink
Updated @lando/php and added config testing. (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
reynoldsalec authored Feb 27, 2024
1 parent 363cdd6 commit a8143f8
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 14 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## v1.2.0 - [February 27, 2024](https://github.com/lando/lamp/releases/tag/v1.2.0)

### New Features

* Added support for `php:8.3`
* Added support for `php:8.2`

### Internal

* Updated to `@lando/php@1.2.0`
* Added config testing.

## v1.1.0 - [February 20, 2024](https://github.com/lando/lamp/releases/tag/v1.1.0)

* Included ability to specify `database: mssql` in the `config` section to maintain backwards compatibility. [@lando/mssql#31](https://github.com/lando/mssql/issues/31)
Expand Down
2 changes: 1 addition & 1 deletion builders/lamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ module.exports = {
name: 'lamp',
parent: '_recipe',
config: {
confSrc: __dirname,
confSrc: path.resolve(__dirname, '..', 'config'),
database: 'mysql',
defaultFiles: {
},
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Note that this recipe is for a generic LAMP stack. Definitely check out Lando's

#### Features of this plugin:

* Configurable `php` version from `5.3` all the way to `8.1`
* Configurable `php` version from `5.3` all the way to `8.3`
* Configurable `webroot`
* Configurable `apache` web server
* Configurable database backend (`mariadb`, `mysql`, or `postgres`)
Expand Down
8 changes: 7 additions & 1 deletion examples/lamp-custom/.lando.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: lamp-custom
recipe: lamp
config:
php: '7.4'
php: '8.3'
composer_version: '2.0.7'
via: nginx:1.17
webroot: bob
Expand All @@ -12,6 +12,12 @@ config:
php: config/php.ini
vhosts: config/default.conf

services:
appserver:
overrides:
environment:
PHP_MEMORY_LIMIT: 2G

# do not remove this
plugins:
"@lando/lamp": ../..
Expand Down
16 changes: 13 additions & 3 deletions examples/lamp-custom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,22 @@ lando ssh -s appserver -c "curl -L appserver_nginx" | grep "HI BOB"
lando ssh -s appserver_nginx -c "nginx -v" 2>&1 | grep "nginx version" | grep "nginx/1.17"
lando ssh -s appserver -c "curl -IL appserver_nginx" | grep Server | grep nginx

# Should use php 7.4
lando php -v | grep "PHP 7.4"
# Should use php 8.3
lando php -v | grep "PHP 8.3"

# Should use composer 2.0.7
lando ssh -s appserver -c "/bin/sh -c 'NO_COLOR=1 composer -V'" | grep "Composer version 2.0.7"

# Should have COMPOSER_MEMORY_LIMIT set to -1
lando ssh -s appserver -c "env" | grep "COMPOSER_MEMORY_LIMIT=-1"

# Should allow environment variable PHP_MEMORY_LIMIT to work if used in config file
lando ssh -s appserver -c "curl -L appserver_nginx/info.php" | grep memory_limit | grep 2G

# Should have unlimited memory for php for CLI opts
lando php -i | grep memory_limit | grep -e "-1"
lando ssh -s appserver -c "php -i" | grep "memory_limit" | grep -e "-1"

# Should be running mysql 5.7 by default
lando mysql -V | grep 5.7

Expand All @@ -44,7 +54,7 @@ lando mysql lamp -e quit
lando php -m | grep Xdebug

# Should be using custom config files
lando ssh -s appserver -c "curl -L appserver_nginx/info.php" | grep memory_limit | grep 513M
lando ssh -s appserver -c "curl -L appserver_nginx/info.php" | grep max_execution_time | grep 92
lando ssh -s appserver_nginx -c "cat /opt/bitnami/nginx/conf/vhosts/lando.conf" | grep server_name | grep pirog
lando mysql -u root -e "show variables;" | grep thread_cache_size | grep 12
```
Expand Down
4 changes: 2 additions & 2 deletions examples/lamp-custom/config/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ xdebug.mode = ${XDEBUG_MODE}

; Globals
expose_php = on
max_execution_time = 90
max_execution_time = 92
max_input_time = 900
max_input_vars = 10000
memory_limit = 513M
memory_limit = ${PHP_MEMORY_LIMIT}
upload_max_filesize = 100M
post_max_size = 100M
error_reporting = E_ALL & ~E_DEPRECATED
Expand Down
10 changes: 10 additions & 0 deletions examples/lamp-defaults/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ lando ssh -s appserver -c "curl -IL localhost" | grep Server | grep 2.4
# Should be running mysql 5.7 by default
lando mysql -V | grep 5.7

# Should have COMPOSER_MEMORY_LIMIT set to -1
lando ssh -s appserver -c "env" | grep "COMPOSER_MEMORY_LIMIT=-1"

# Should have a 1G php mem limit on appserver
lando ssh -s appserver -c "curl http://localhost/info.php" | grep "memory_limit" | grep "1G"

# Should have unlimited memory for php for CLI opts
lando php -i | grep memory_limit | grep -e "-1"
lando ssh -s appserver -c "php -i" | grep "memory_limit" | grep -e "-1"

# Should not enable xdebug by default
lando php -m | grep xdebug || echo $? | grep 1

Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@lando/mssql": "^1.0.0",
"@lando/mysql": "^1.0.0",
"@lando/nginx": "^1.0.0",
"@lando/php": "^1.0.0",
"@lando/php": "^1.2.0",
"@lando/postgres": "^1.0.0",
"lodash": "^4.17.21"
},
Expand Down

0 comments on commit a8143f8

Please sign in to comment.