From 2c95009aca4de240abe8c1a2803842660952ed3a Mon Sep 17 00:00:00 2001 From: Alec Reynolds Date: Tue, 27 Feb 2024 12:18:06 -0800 Subject: [PATCH 1/4] PHP 8.3 support. Config testing. Correct mysql.cnf name. --- config/default.conf.tpl | 2 ++ config/{mysql.conf => mysql.cnf} | 5 +++-- config/mysql8.cnf | 5 +++-- config/php.ini | 5 +++-- docs/index.md | 2 +- examples/.lando.local.yml | 2 -- examples/.lando.upstream.yml | 2 +- examples/7.1/README.md | 2 +- examples/7.2/README.md | 2 +- examples/7.4/README.md | 2 +- examples/laravel-custom/.lando.yml | 8 +++++++- examples/laravel-custom/README.md | 16 +++++++++++++--- examples/laravel-custom/config/php.ini | 4 ++-- examples/laravel-defaults/README.md | 16 ++++++++++++++++ examples/laravel-init/README.md | 2 +- examples/laravel-mysql8/README.md | 7 ++++++- examples/laravel-nginx/README.md | 4 ++++ 17 files changed, 65 insertions(+), 21 deletions(-) rename config/{mysql.conf => mysql.cnf} (97%) delete mode 100644 examples/.lando.local.yml diff --git a/config/default.conf.tpl b/config/default.conf.tpl index e255d10..c5e0da1 100644 --- a/config/default.conf.tpl +++ b/config/default.conf.tpl @@ -1,3 +1,5 @@ +# LANDOWORDPRESSNGINXCONF + server { listen 80 default_server; diff --git a/config/mysql.conf b/config/mysql.cnf similarity index 97% rename from config/mysql.conf rename to config/mysql.cnf index d85e082..9862c9d 100644 --- a/config/mysql.conf +++ b/config/mysql.cnf @@ -1,6 +1,7 @@ # # The MySQL database server configuration file for Lando # +# LANDOWORDPRESSMYSQLCNF [mysqld] # @@ -71,7 +72,7 @@ max_binlog_size = 100M #innodb_buffer_pool_size = 384M #innodb_additional_mem_pool_size = 20M # Set .._log_file_size to 25 % of buffer pool size -innodb_log_file_size = 100M +innodb_log_file_size = 101M #innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit = 0 #innodb_lock_wait_timeout = 50 @@ -82,7 +83,7 @@ innodb_open_files = 256 innodb_io_capacity = 512 innodb_flush_method = O_DIRECT innodb_thread_concurrency = 8 -innodb_lock_wait_timeout = 120 +innodb_lock_wait_timeout = 121 # # * Security Features # diff --git a/config/mysql8.cnf b/config/mysql8.cnf index de0fd89..44ec72a 100644 --- a/config/mysql8.cnf +++ b/config/mysql8.cnf @@ -1,6 +1,7 @@ # # The MySQL database server configuration file for Lando # +# LANDOWORDPRESSMYSQL8CNF [mysqld] # @@ -49,7 +50,7 @@ read_buffer_size = 2M #server-id = 1 #log_bin = /src/.lando/log/mysql-bin.log expire_logs_days = 10 -max_binlog_size = 100M +max_binlog_size = 101M #binlog_do_db = include_database_name #binlog_ignore_db = include_database_name # @@ -77,7 +78,7 @@ innodb_open_files = 256 innodb_io_capacity = 512 innodb_flush_method = O_DIRECT innodb_thread_concurrency = 8 -innodb_lock_wait_timeout = 120 +innodb_lock_wait_timeout = 127 # # * Security Features # diff --git a/config/php.ini b/config/php.ini index a33dacf..18558ff 100644 --- a/config/php.ini +++ b/config/php.ini @@ -1,5 +1,6 @@ [PHP] +; LANDOWORDPRESSPHPINI ;;;;;;;;;;;;;;; ; PHP Globals ; ;;;;;;;;;;;;;;; @@ -36,8 +37,8 @@ xdebug.mode = ${XDEBUG_MODE} ; Globals expose_php = on -max_execution_time = 90 -max_input_time = 900 +max_execution_time = 91 +max_input_time = 901 max_input_vars = 10000 memory_limit = ${PHP_MEMORY_LIMIT} upload_max_filesize = 100M diff --git a/docs/index.md b/docs/index.md index a77b2f6..50f4a01 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ Lando offers a configurable [recipe](https://docs.lando.dev/core/v3/recipes.html #### 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 web server (`apache` or `nginx`) * Configurable database backend (`mariadb`, `mysql`, or `postgres`) diff --git a/examples/.lando.local.yml b/examples/.lando.local.yml deleted file mode 100644 index 746a5a5..0000000 --- a/examples/.lando.local.yml +++ /dev/null @@ -1,2 +0,0 @@ -plugins: - "@lando/laravel": ./../../../ diff --git a/examples/.lando.upstream.yml b/examples/.lando.upstream.yml index 383d2bc..746a5a5 100644 --- a/examples/.lando.upstream.yml +++ b/examples/.lando.upstream.yml @@ -1,2 +1,2 @@ plugins: - "@lando/laravel": ../../.. + "@lando/laravel": ./../../../ diff --git a/examples/7.1/README.md b/examples/7.1/README.md index 49903f2..251f77d 100644 --- a/examples/7.1/README.md +++ b/examples/7.1/README.md @@ -16,7 +16,7 @@ lando poweroff # Initialize an empty laravel recipe rm -rf laravel && mkdir -p laravel && cd laravel -cp -f ../../.lando.local.yml .lando.local.yml && cat .lando.local.yml +cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml lando init --source cwd --recipe laravel --webroot app/public --name lando-laravel --option cache=redis --option php='7.1' --option composer_version='1-latest' # Should compose create-project a new laravel app diff --git a/examples/7.2/README.md b/examples/7.2/README.md index 863e14a..e33b114 100644 --- a/examples/7.2/README.md +++ b/examples/7.2/README.md @@ -17,7 +17,7 @@ lando poweroff # Initialize an empty laravel recipe rm -rf laravel && mkdir -p laravel && cd laravel lando init --source cwd --recipe laravel --webroot app/public --name lando-laravel --option cache=redis --option php='7.2' --option composer_version='1-latest' -cp -f ../../.lando.local.yml .lando.local.yml && cat .lando.local.yml +cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml # Should compose create-project a new laravel app cd laravel diff --git a/examples/7.4/README.md b/examples/7.4/README.md index 0b0ff16..89d1d41 100644 --- a/examples/7.4/README.md +++ b/examples/7.4/README.md @@ -17,7 +17,7 @@ lando poweroff # Initialize an empty laravel recipe rm -rf laravel && mkdir -p laravel && cd laravel lando init --source cwd --recipe laravel --webroot app/public --name lando-laravel --option cache=redis -cp -f ../../.lando.local.yml .lando.local.yml && cat .lando.local.yml +cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml # Should compose create-project a new laravel app cd laravel diff --git a/examples/laravel-custom/.lando.yml b/examples/laravel-custom/.lando.yml index 51cadb5..70402df 100644 --- a/examples/laravel-custom/.lando.yml +++ b/examples/laravel-custom/.lando.yml @@ -1,7 +1,7 @@ name: laravel-custom recipe: laravel config: - php: '7.4' + php: '8.3' composer_version: '2.0.7' via: nginx:1.17 webroot: bob @@ -13,6 +13,12 @@ config: php: config/php.ini vhosts: config/default.conf +services: + appserver: + overrides: + environment: + PHP_MEMORY_LIMIT: 2G + # do not remove this plugins: "@lando/laravel": ../.. diff --git a/examples/laravel-custom/README.md b/examples/laravel-custom/README.md index 153486f..2d649a3 100644 --- a/examples/laravel-custom/README.md +++ b/examples/laravel-custom/README.md @@ -28,8 +28,8 @@ 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" @@ -37,6 +37,16 @@ lando ssh -s appserver -c "/bin/sh -c 'NO_COLOR=1 composer -V'" | grep "Composer # 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 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 able to connect to the database with the default creds lando mysql laravel -e quit @@ -47,7 +57,7 @@ lando ssh -s cache -c "memcached --version | grep 1.5.12" 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 ``` diff --git a/examples/laravel-custom/config/php.ini b/examples/laravel-custom/config/php.ini index 818a98d..4a8fceb 100644 --- a/examples/laravel-custom/config/php.ini +++ b/examples/laravel-custom/config/php.ini @@ -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 diff --git a/examples/laravel-defaults/README.md b/examples/laravel-defaults/README.md index 14117f2..5e42d69 100644 --- a/examples/laravel-defaults/README.md +++ b/examples/laravel-defaults/README.md @@ -34,12 +34,28 @@ 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 # Should use the default database connection info lando mysql laravel -e quit +# Should use the correct default config files +lando ssh -s appserver -c "cat /usr/local/etc/php/conf.d/zzz-lando-my-custom.ini" | grep "; LANDOWORDPRESSPHPINI" +lando ssh -s appserver -c "curl -L http://localhost/info.php" | grep max_execution_time | grep 91 +lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOWORDPRESSMYSQLCNF" +lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 121 + # Should use composer 2 by default lando ssh -s appserver -c "/bin/sh -c 'NO_COLOR=1 composer -V'" | grep "Composer version 2." ``` diff --git a/examples/laravel-init/README.md b/examples/laravel-init/README.md index da3d34a..5dfcc61 100644 --- a/examples/laravel-init/README.md +++ b/examples/laravel-init/README.md @@ -17,7 +17,7 @@ lando poweroff # Initialize an empty laravel recipe rm -rf laravel && mkdir -p laravel && cd laravel lando init --source cwd --recipe laravel --webroot app/public --name lando-laravel --option cache=redis --option php='8.1' -cp -f ../../.lando.local.yml .lando.local.yml && cat .lando.local.yml +cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml # Should compose create-project a new laravel app cd laravel diff --git a/examples/laravel-mysql8/README.md b/examples/laravel-mysql8/README.md index c67bc96..cc7736b 100644 --- a/examples/laravel-mysql8/README.md +++ b/examples/laravel-mysql8/README.md @@ -17,7 +17,7 @@ lando poweroff # Initialize an empty laravel recipe rm -rf mysql8 && mkdir -p mysql8 && cd mysql8 lando init --source cwd --recipe laravel --webroot app/public --name lando-laravel-mysql8 --option cache=redis --option php='8.1' --option database=mysql:8.0.22 -cp -f ../../.lando.local.yml .lando.local.yml && cat .lando.local.yml +cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml # Should compose create-project a new laravel app cd mysql8 @@ -67,6 +67,11 @@ lando ssh -s cache -c "redis-cli CONFIG GET databases" cd mysql8 lando mysql -ularavel -plaravel laravel -e quit +# Should use the defauly mysql8 config file +cd mysql8 +lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOWORDPRESSMYSQL8CNF" +lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 127 + # Should have artisan available cd mysql8 lando artisan env diff --git a/examples/laravel-nginx/README.md b/examples/laravel-nginx/README.md index 352eb00..0deb87c 100644 --- a/examples/laravel-nginx/README.md +++ b/examples/laravel-nginx/README.md @@ -32,6 +32,10 @@ lando nginx -v 2>&1 | grep "nginx version" | grep "nginx/1.25" # Should use the php version specified by the user eg 7.4 lando php -v | grep "PHP 7.4" + +# Should load the correct default nginx config +lando ssh -s appserver_nginx -c "cat /opt/bitnami/nginx/conf/vhosts/lando.conf" | grep "LANDOWORDPRESSNGINXCONF" +lando ssh -s appserver_nginx -c "cat /opt/bitnami/nginx/conf/vhosts/lando.conf" | grep "WordPress single site rules." ``` Destroy tests From 5a8dd05e9d4522b0b8799a4be103c71352fad38c Mon Sep 17 00:00:00 2001 From: Alec Reynolds Date: Tue, 27 Feb 2024 12:23:04 -0800 Subject: [PATCH 2/4] #45: Make php 8.3 the default. --- builders/laravel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/laravel.js b/builders/laravel.js index 598557e..9f28dca 100644 --- a/builders/laravel.js +++ b/builders/laravel.js @@ -213,7 +213,7 @@ module.exports = { defaultFiles: { php: 'php.ini', }, - php: '7.4', + php: '8.3', services: {appserver: {overrides: {environment: { APP_LOG: 'errorlog', }}}}, From b870a9b794aa7d143f6f35ab65e53b39cd14d214 Mon Sep 17 00:00:00 2001 From: Alec Reynolds Date: Tue, 27 Feb 2024 12:27:56 -0800 Subject: [PATCH 3/4] #45: 8.3 defaults in tests. --- config/default.conf.tpl | 2 +- config/mysql.cnf | 2 +- config/mysql8.cnf | 2 +- config/php.ini | 2 +- examples/laravel-defaults/README.md | 8 ++++---- examples/laravel-init/README.md | 8 ++++---- examples/laravel-mysql8/README.md | 2 +- examples/laravel-nginx/README.md | 3 +-- 8 files changed, 14 insertions(+), 15 deletions(-) diff --git a/config/default.conf.tpl b/config/default.conf.tpl index c5e0da1..a25678e 100644 --- a/config/default.conf.tpl +++ b/config/default.conf.tpl @@ -1,4 +1,4 @@ -# LANDOWORDPRESSNGINXCONF +# LANDOLARAVELNGINXCONF server { diff --git a/config/mysql.cnf b/config/mysql.cnf index 9862c9d..630c5a1 100644 --- a/config/mysql.cnf +++ b/config/mysql.cnf @@ -1,7 +1,7 @@ # # The MySQL database server configuration file for Lando # -# LANDOWORDPRESSMYSQLCNF +# LANDOLARAVELMYSQLCNF [mysqld] # diff --git a/config/mysql8.cnf b/config/mysql8.cnf index 44ec72a..a0ab8a8 100644 --- a/config/mysql8.cnf +++ b/config/mysql8.cnf @@ -1,7 +1,7 @@ # # The MySQL database server configuration file for Lando # -# LANDOWORDPRESSMYSQL8CNF +# LANDOLARAVELMYSQL8CNF [mysqld] # diff --git a/config/php.ini b/config/php.ini index 18558ff..53fa2f2 100644 --- a/config/php.ini +++ b/config/php.ini @@ -1,6 +1,6 @@ [PHP] -; LANDOWORDPRESSPHPINI +; LANDOLARAVELPHPINI ;;;;;;;;;;;;;;; ; PHP Globals ; ;;;;;;;;;;;;;;; diff --git a/examples/laravel-defaults/README.md b/examples/laravel-defaults/README.md index 5e42d69..67f780b 100644 --- a/examples/laravel-defaults/README.md +++ b/examples/laravel-defaults/README.md @@ -24,8 +24,8 @@ Run the following commands to validate things are rolling as they should. # Should serve from app root by default lando ssh -s appserver -c "curl -L localhost" | grep "DEFAULTS" -# Should use 7.4 as the default php version -lando php -v | grep "PHP 7.4" +# Should use 8.3 as the default php version +lando php -v | grep "PHP 8.3" # Should be running apache 2.4 by default lando ssh -s appserver -c "apachectl -V | grep 2.4" @@ -51,9 +51,9 @@ lando php -m | grep xdebug || echo $? | grep 1 lando mysql laravel -e quit # Should use the correct default config files -lando ssh -s appserver -c "cat /usr/local/etc/php/conf.d/zzz-lando-my-custom.ini" | grep "; LANDOWORDPRESSPHPINI" +lando ssh -s appserver -c "cat /usr/local/etc/php/conf.d/zzz-lando-my-custom.ini" | grep "; LANDOLARAVELPHPINI" lando ssh -s appserver -c "curl -L http://localhost/info.php" | grep max_execution_time | grep 91 -lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOWORDPRESSMYSQLCNF" +lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOLARAVELMYSQLCNF" lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 121 # Should use composer 2 by default diff --git a/examples/laravel-init/README.md b/examples/laravel-init/README.md index 5dfcc61..0620f22 100644 --- a/examples/laravel-init/README.md +++ b/examples/laravel-init/README.md @@ -1,4 +1,4 @@ -Laravel PHP 8.1 Example +Laravel Init Example =============== This example exists primarily to test the following documentation: @@ -16,7 +16,7 @@ lando poweroff # Initialize an empty laravel recipe rm -rf laravel && mkdir -p laravel && cd laravel -lando init --source cwd --recipe laravel --webroot app/public --name lando-laravel --option cache=redis --option php='8.1' +lando init --source cwd --recipe laravel --webroot app/public --name lando-laravel --option cache=redis cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml # Should compose create-project a new laravel app @@ -42,9 +42,9 @@ lando ssh -s appserver -c "curl -L localhost" | grep "Laravel" cd laravel lando ssh -s appserver -c 'cd /var/www/.composer && composer show laravel/installer' | grep 'v4.' -# Should use 7.4 as the default php version +# Should use 8.3 as the default php version cd laravel -lando php -v | grep "PHP 8.1" +lando php -v | grep "PHP 8.3" # Should be running apache 2.4 by default cd laravel diff --git a/examples/laravel-mysql8/README.md b/examples/laravel-mysql8/README.md index cc7736b..c729661 100644 --- a/examples/laravel-mysql8/README.md +++ b/examples/laravel-mysql8/README.md @@ -69,7 +69,7 @@ lando mysql -ularavel -plaravel laravel -e quit # Should use the defauly mysql8 config file cd mysql8 -lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOWORDPRESSMYSQL8CNF" +lando ssh -s database -c "cat /opt/bitnami/mysql/conf/my_custom.cnf" | grep "LANDOLARAVELMYSQL8CNF" lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 127 # Should have artisan available diff --git a/examples/laravel-nginx/README.md b/examples/laravel-nginx/README.md index 0deb87c..6cb2d75 100644 --- a/examples/laravel-nginx/README.md +++ b/examples/laravel-nginx/README.md @@ -34,8 +34,7 @@ lando nginx -v 2>&1 | grep "nginx version" | grep "nginx/1.25" lando php -v | grep "PHP 7.4" # Should load the correct default nginx config -lando ssh -s appserver_nginx -c "cat /opt/bitnami/nginx/conf/vhosts/lando.conf" | grep "LANDOWORDPRESSNGINXCONF" -lando ssh -s appserver_nginx -c "cat /opt/bitnami/nginx/conf/vhosts/lando.conf" | grep "WordPress single site rules." +lando ssh -s appserver_nginx -c "cat /opt/bitnami/nginx/conf/vhosts/lando.conf" | grep "LANDOLARAVELNGINXCONF" ``` Destroy tests From 82209b1b9e591bc25de5a2ea0583e7bd2bef9d3f Mon Sep 17 00:00:00 2001 From: Alec Reynolds Date: Tue, 27 Feb 2024 12:31:39 -0800 Subject: [PATCH 4/4] Delete unncessary 7.4 test. --- .github/workflows/pr-laravel-tests.yml | 1 - examples/7.4/.gitignore | 1 - examples/7.4/README.md | 85 -------------------------- 3 files changed, 87 deletions(-) delete mode 100644 examples/7.4/.gitignore delete mode 100644 examples/7.4/README.md diff --git a/.github/workflows/pr-laravel-tests.yml b/.github/workflows/pr-laravel-tests.yml index 2108c27..2c30f5a 100644 --- a/.github/workflows/pr-laravel-tests.yml +++ b/.github/workflows/pr-laravel-tests.yml @@ -27,7 +27,6 @@ jobs: - examples/laravel-nginx - examples/7.1 - examples/7.2 - - examples/7.4 steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/examples/7.4/.gitignore b/examples/7.4/.gitignore deleted file mode 100644 index ff3a751..0000000 --- a/examples/7.4/.gitignore +++ /dev/null @@ -1 +0,0 @@ -laravel diff --git a/examples/7.4/README.md b/examples/7.4/README.md deleted file mode 100644 index 89d1d41..0000000 --- a/examples/7.4/README.md +++ /dev/null @@ -1,85 +0,0 @@ -Laravel PHP 7.4 Example -=============== - -This example exists primarily to test the following documentation: - -* [Laravel Recipe](https://docs.devwithlando.io/tutorials/laravel.html) - -Start up tests --------------- - -Run the following commands to get up and running with this example. - -```bash -# Should poweroff -lando poweroff - -# Initialize an empty laravel recipe -rm -rf laravel && mkdir -p laravel && cd laravel -lando init --source cwd --recipe laravel --webroot app/public --name lando-laravel --option cache=redis -cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml - -# Should compose create-project a new laravel app -cd laravel -lando composer create-project --prefer-dist laravel/laravel app - -# Should start up successfully -cd laravel -lando start -``` - -Verification commands ---------------------- - -Run the following commands to validate things are rolling as they should. - -```bash -# Should return the laravel default page -cd laravel -lando ssh -s appserver -c "curl -L localhost" | grep "Laravel" - -# Should install 4.x version of laravel/installer -cd laravel -lando ssh -s appserver -c 'cd /var/www/.composer && composer show laravel/installer' | grep 'v4.' - -# Should use 7.4 as the default php version -cd laravel -lando php -v | grep "PHP 7.4" - -# Should be running apache 2.4 by default -cd laravel -lando ssh -s appserver -c "apachectl -V | grep 2.4" -lando ssh -s appserver -c "curl -IL localhost" | grep Server | grep 2.4 - -# Should be running mysql 5.7 by default -cd laravel -lando mysql -V | grep 5.7 - -# Should not enable xdebug by default -cd laravel -lando php -m | grep xdebug || echo $? | grep 1 - -# Should have redis running -cd laravel -lando ssh -s cache -c "redis-cli CONFIG GET databases" - -# Should use the default database connection info -cd laravel -lando mysql -ularavel -plaravel laravel -e quit - -# Should have artisan available -cd laravel -lando artisan env -``` - -Destroy tests -------------- - -Run the following commands to trash this app like nothing ever happened. - -```bash -# Should be destroyed with success -cd laravel -lando destroy -y -lando poweroff -```