diff --git a/.lando.yml b/.lando.yml index c3ac687..6030f5d 100644 --- a/.lando.yml +++ b/.lando.yml @@ -2,15 +2,18 @@ name: bee recipe: backdrop keys: false config: - php: 8.3 + php: 8.4 webroot: backdrop - database: mysql + database: mysql:8.0 # Set Xdebug off by default. We use the tooling below to turn it on as needed. xdebug: false # Need to disable bee so can use the version in the repo. bee: false services: appserver: + # Allow scanner to fail faster; http paths often fail locally. + scanner: + retry: 5 config: php: .lando/php.ini build_as_root: @@ -42,8 +45,12 @@ services: database: healthcheck: mysql --defaults-extra-file=/app/.lando/mysql.cnf --silent --execute "SHOW DATABASES;" multisite: - type: php:8.3 + type: php:8.4 webroot: multisite + ssl: true + # Allow scanner to fail faster; http paths often fail locally. + scanner: + retry: 5 events: pre-rebuild: # Run clean-up tasks. diff --git a/.lando/setup.sh b/.lando/setup.sh index b1c6b98..7afbc18 100755 --- a/.lando/setup.sh +++ b/.lando/setup.sh @@ -22,10 +22,11 @@ set_up() { cd /app # Create databases. - mysql -h database -u root -e "CREATE DATABASE IF NOT EXISTS backdrop; GRANT ALL PRIVILEGES ON backdrop.* TO 'backdrop'@'%' IDENTIFIED by 'backdrop';" - mysql -h database -u root -e "CREATE DATABASE multi_one; GRANT ALL PRIVILEGES ON multi_one.* TO 'backdrop'@'%' IDENTIFIED by 'backdrop';" - mysql -h database -u root -e "CREATE DATABASE multi_two; GRANT ALL PRIVILEGES ON multi_two.* TO 'backdrop'@'%' IDENTIFIED by 'backdrop';" - mysql -h database -u root -e "CREATE DATABASE install_test; GRANT ALL PRIVILEGES ON install_test.* TO 'backdrop'@'%' IDENTIFIED by 'backdrop';" + mysql -h database -u root -e "CREATE USER IF NOT EXISTS 'backdrop'@'%' IDENTIFIED BY 'backdrop';" + mysql -h database -u root -e "CREATE DATABASE IF NOT EXISTS backdrop; GRANT ALL PRIVILEGES ON backdrop.* TO 'backdrop'@'%';" + mysql -h database -u root -e "CREATE DATABASE IF NOT EXISTS multi_one; GRANT ALL PRIVILEGES ON multi_one.* TO 'backdrop'@'%';" + mysql -h database -u root -e "CREATE DATABASE IF NOT EXISTS multi_two; GRANT ALL PRIVILEGES ON multi_two.* TO 'backdrop'@'%';" + mysql -h database -u root -e "CREATE DATABASE IF NOT EXISTS install_test; GRANT ALL PRIVILEGES ON install_test.* TO 'backdrop'@'%';" mysql -h database -u root -e "FLUSH PRIVILEGES;" # Configure Backdrop installation. diff --git a/CHANGELOG.md b/CHANGELOG.md index f55b820..65bbffd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project follows the which is based on the major version of Backdrop CMS with a semantic version system for each contributed module, theme and layout. -## [Unreleased] - 2026-02-18 +## [Unreleased] - 2026-02-23 ### Added - An option for the `db-import` command to allow import from newer MariaDB @@ -18,6 +18,7 @@ database or client does not support it. - The ability to download specified releases or branches of modules, themes, layout templates or Backdrop itself. - Command to convert database to UTF8MB4. +- Support for PHP 8.4 - Defensive coding to prevent warnings if a module or theme exists in the `system` table but not in the file system. diff --git a/README.md b/README.md index 51e5cd9..eb72e3b 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,14 @@ database operations (i.e. `db-export`, `db-import`, `db-drop`, `sql` but NOT ### PHP ![Static Badge](https://img.shields.io/badge/php%20compatibility-555555?logo=php&logoColor=white&style=flat-square) +![Static Badge](https://img.shields.io/badge/8.4-blue?style=flat-square) ![Static Badge](https://img.shields.io/badge/8.3-blue?style=flat-square) ![Static Badge](https://img.shields.io/badge/8.2-blue?style=flat-square) ![Static Badge](https://img.shields.io/badge/8.1-blue?style=flat-square) ![Static Badge](https://img.shields.io/badge/8.0-blue?style=flat-square) ![Static Badge](https://img.shields.io/badge/7.4-blue?style=flat-square) -- Bee is tested and works from `7.4` up to `8.3`. +- Bee is tested and works from `7.4` up to `8.4`. ## Installation diff --git a/bee.php b/bee.php index a1150c5..d646f64 100755 --- a/bee.php +++ b/bee.php @@ -54,7 +54,7 @@ */ function bee_error_handler($error_level, $message, $filename, $line, ?array $context = NULL) { require_once __DIR__ . '/includes/errors.inc'; - _bee_error_handler_real($error_level, $message, $filename, $line, $context); + _bee_error_handler_real($error_level, $message, $filename, $line); } /** diff --git a/commands/db.bee.inc b/commands/db.bee.inc index 13938fe..4ecc9d6 100644 --- a/commands/db.bee.inc +++ b/commands/db.bee.inc @@ -422,7 +422,7 @@ function db_bee_mysql_options(array $db_info, $include_db = TRUE) { // Create an array for the connection string and filename. $options = array(); - $options['connection'] = "--defaults-file=$temp_filename "; + $options['connection'] = "--defaults-extra-file=$temp_filename "; $options['connection'] .= ($include_db) ? rawurldecode($db_info['database']) : ''; $options['filename'] = $temp_filename; diff --git a/includes/errors.inc b/includes/errors.inc index fc43f75..bceffc4 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -194,6 +194,7 @@ function _bee_get_last_caller(array $backtrace) { * * @ingroup bee_logging_severity_levels * @see backdrop_error_levels() + * @see https://github.com/backdrop/backdrop/commit/f823b3a49ffb2e6b280650583fe8d0ccae6796f5#diff-8fb28e6d2a966106560c58c335bc3f025c9e385e1497030a49b47c2638518b83 */ function _bee_error_levels() { $types = array( @@ -213,5 +214,11 @@ function _bee_error_levels() { E_USER_DEPRECATED => array('User deprecated function', BEE_WATCHDOG_DEBUG), ); + // E_STRICT was removed from PHP 8.4 and higher, but still exists in older + // versions. + if (version_compare(PHP_VERSION, '8.4.0') < 0) { + $types[E_STRICT] = array('Strict warning', BEE_WATCHDOG_DEBUG); + } + return $types; } diff --git a/tests/multisite/MultisiteInstallCommandsTest.php b/tests/multisite/MultisiteInstallCommandsTest.php index 0cc0d9c..7475bd2 100644 --- a/tests/multisite/MultisiteInstallCommandsTest.php +++ b/tests/multisite/MultisiteInstallCommandsTest.php @@ -33,9 +33,8 @@ public function test_install_command_works() { $this->assertRegExp('/Database host +database/', (string) $output_after); // Cleanup the install. + exec('bee --site=install_test db-drop -y'); exec('rm -r sites/install_test/files'); exec('cp settings.php sites/install_test'); - exec("mysql -h $bee_test_db_host -u root -e 'DROP DATABASE $bee_test_multisite_install_test_db_name; CREATE DATABASE $bee_test_multisite_install_test_db_name; GRANT ALL PRIVILEGES ON $bee_test_multisite_install_test_db_name.* TO \"backdrop\"@\"%\" IDENTIFIED by \"backdrop\";'"); } - }