@lando/php
Advanced tools
+73
-14
@@ -8,2 +8,25 @@ 'use strict'; | ||
| const addBuildStep = require('./../utils/add-build-step'); | ||
| /** | ||
| * Get the appropriate Composer version based on the PHP version. | ||
| * @param {semver} phpSemver - The PHP semantic version. | ||
| * @return {string|boolean} - The Composer version or false if we cannot parse the version. | ||
| */ | ||
| const getDefaultComposerVersion = phpSemver => { | ||
| // Don't set a default composer version if we cannot | ||
| // parse the version such as with `custom`. | ||
| if (!phpSemver) return false; | ||
| if (semver.lt(phpSemver, '5.3.2')) { | ||
| // Use Composer 1 for PHP < 5.3.2 | ||
| return '1'; | ||
| } else if (semver.lt(phpSemver, '7.3.0')) { | ||
| // Use Composer 2.2 LTS for PHP < 7.3 | ||
| return '2.2'; | ||
| } else { | ||
| // Use Composer 2 for PHP >= 7.3 | ||
| return '2'; | ||
| } | ||
| }; | ||
| /* | ||
@@ -34,9 +57,21 @@ * Helper to get nginx config | ||
| 'discover_client_host=1', | ||
| 'log=/tmp/xdebug.log', | ||
| 'remote_enable=true', | ||
| 'log=/tmp/xdebug.log', | ||
| 'remote_enable=true', | ||
| `remote_host=${host}`, | ||
| ].join(' ')); | ||
| /* | ||
| * Helper to build a package string | ||
| /** | ||
| * Helper function to build a package string by combining package name and version | ||
| * | ||
| * @param {string} pkg - The package name | ||
| * @param {string} version - The package version | ||
| * @return {string} The formatted package string, either "pkg:version" or just "pkg" if version is empty | ||
| * | ||
| * @example | ||
| * // Returns "php:7.4" | ||
| * pkger('php', '7.4'); | ||
| * | ||
| * @example | ||
| * // Returns "mysql" | ||
| * pkger('mysql', ''); | ||
| */ | ||
@@ -113,3 +148,3 @@ const pkger = (pkg, version) => (!_.isEmpty(version)) ? `${pkg}:${version}` : pkg; | ||
| command: ['sh -c \'a2enmod rewrite && apache2-foreground\''], | ||
| composer_version: '2.2.22', | ||
| composer_version: true, | ||
| phpServer: 'apache', | ||
@@ -143,3 +178,11 @@ defaultFiles: { | ||
| constructor(id, options = {}, factory) { | ||
| const debug = _.get(options, '_app._lando').log.debug; | ||
| // Merge the user config onto the default options | ||
| options = parseConfig(_.merge({}, config, options)); | ||
| // Get the semver of the PHP version, NULL if we cannot parse it | ||
| const phpSemver = semver.coerce(options.version); | ||
| phpSemver && debug('Parsed PHP semantic version: %s', phpSemver); | ||
| // Mount our default php config | ||
@@ -149,3 +192,3 @@ options.volumes.push(`${options.confDest}/${options.defaultFiles._php}:${options.remoteFiles._php}`); | ||
| // Shift on the docker entrypoint if this is a more recent version | ||
| if (options.version !== 'custom' && semver.gt(semver.coerce(options.version), '5.5.0')) { | ||
| if (phpSemver && semver.gt(phpSemver, '5.5.0')) { | ||
| options.command.unshift('docker-php-entrypoint'); | ||
@@ -176,3 +219,22 @@ } | ||
| // Add our composer things to run step | ||
| // Determine the appropriate composer version to install if not specified | ||
| if (options.composer_version === true || options.composer_version === '') { | ||
| options.composer_version = getDefaultComposerVersion(phpSemver); | ||
| } else if (typeof options.composer_version === 'number') { | ||
| options.composer_version = options.composer_version.toString(); | ||
| } | ||
| const usingComposer1 = options.composer_version && semver.satisfies(options.composer_version, '1.x'); | ||
| // Add prestissimo as a global package for Composer 1.x performance improvements. Requires PHP >= 5.3 | ||
| if (usingComposer1 && phpSemver && semver.gte(phpSemver, '5.3.0')) { | ||
| options.composer = options.composer || {}; | ||
| options.composer = {'hirak/prestissimo': '*', ...options.composer}; | ||
| } | ||
| // Add build step to enable xdebug | ||
| if (options.xdebug) { | ||
| addBuildStep(['docker-php-ext-enable xdebug'], options._app, options.name, 'build_as_root_internal'); | ||
| } | ||
| // Add build step to install our Composer global packages | ||
| if (!_.isEmpty(options.composer)) { | ||
@@ -184,11 +246,8 @@ const commands = | ||
| // Add activate steps for xdebug | ||
| if (options.xdebug) { | ||
| addBuildStep(['docker-php-ext-enable xdebug'], options._app, options.name, 'build_as_root_internal'); | ||
| } | ||
| // Install the desired composer version | ||
| // Install the desired composer version as the first `build_internal` build step | ||
| if (options.composer_version) { | ||
| debug('Installing composer version %s', options.composer_version); | ||
| const commands = [`/helpers/install-composer.sh ${options.composer_version}`]; | ||
| addBuildStep(commands, options._app, options.name, 'build_internal', true); | ||
| const firstStep = true; | ||
| addBuildStep(commands, options._app, options.name, 'build_internal', firstStep); | ||
| } | ||
@@ -195,0 +254,0 @@ |
+12
-0
| ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) | ||
| ## v1.7.0 - [January 8, 2025](https://github.com/lando/php/releases/tag/v1.7.0) | ||
| * Added logic to allow default `composer` version to be set based on PHP version. | ||
| * Added `2.2` and `2.2-latest` shorthand options to install the latest stable 2.2 LTS version of `composer`. | ||
| * Set default `composer` version to `2-latest` | ||
| * Set default `composer` version to `2.2-latest` for PHP 5.3-7.2 | ||
| * Set default `composer` version to `1-latest` for PHP <= 5.2 | ||
| * Removed `composer` installation from images to prefer installing during app build | ||
| * Fixed bug causing `composer` 2.2.x to be installed when `composer_version` was set to a single digit version such as `1` | ||
| * Fixed mismatched `libsqlite3-dev` and `libsqlite3-0` versions in PHP 8.3 and 8.4 images | ||
| * Fixed regression causing ImageMagick `convert` to not be available in images with `imagick` extension enabled | ||
| ## v1.6.4 - [December 14, 2024](https://github.com/lando/php/releases/tag/v1.6.4) | ||
@@ -4,0 +16,0 @@ |
@@ -75,7 +75,3 @@ # docker build -t devwithlando/php:5.6-apache-5 . | ||
| pcntl \ | ||
| && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
| && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \ | ||
| && php -r "unlink('composer-setup.php');" \ | ||
| && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
| && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \ | ||
| && apt-get -y clean \ | ||
@@ -82,0 +78,0 @@ && apt-get -y autoclean \ |
@@ -75,8 +75,3 @@ # docker build -t devwithlando/php:5.6-fpm-5 . | ||
| pcntl \ | ||
| # Install composer | ||
| && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
| && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \ | ||
| && php -r "unlink('composer-setup.php');" \ | ||
| && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
| && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \ | ||
| && apt-get -y clean \ | ||
@@ -83,0 +78,0 @@ && apt-get -y autoclean \ |
@@ -75,7 +75,3 @@ # docker build -t devwithlando/php:7.0-apache-5 . | ||
| pcntl \ | ||
| && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
| && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \ | ||
| && php -r "unlink('composer-setup.php');" \ | ||
| && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
| && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \ | ||
| && apt-get -y clean \ | ||
@@ -82,0 +78,0 @@ && apt-get -y autoclean \ |
@@ -75,7 +75,3 @@ # docker build -t devwithlando/php:7.0-fpm-5 . | ||
| pcntl \ | ||
| && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
| && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \ | ||
| && php -r "unlink('composer-setup.php');" \ | ||
| && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
| && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \ | ||
| && apt-get -y clean \ | ||
@@ -82,0 +78,0 @@ && apt-get -y autoclean \ |
@@ -78,7 +78,3 @@ # docker build -t devwithlando/php:7.1-apache-5 . | ||
| pcntl \ | ||
| && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
| && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \ | ||
| && php -r "unlink('composer-setup.php');" \ | ||
| && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
| && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \ | ||
| && apt-get -y clean \ | ||
@@ -85,0 +81,0 @@ && apt-get -y autoclean \ |
@@ -78,7 +78,3 @@ # docker build -t devwithlando/php:7.1-fpm-5 . | ||
| pcntl \ | ||
| && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
| && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \ | ||
| && php -r "unlink('composer-setup.php');" \ | ||
| && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
| && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \ | ||
| && apt-get -y clean \ | ||
@@ -85,0 +81,0 @@ && apt-get -y autoclean \ |
@@ -76,7 +76,3 @@ # docker build -t devwithlando/php:7.2-apache-5 . | ||
| pcntl \ | ||
| && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
| && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \ | ||
| && php -r "unlink('composer-setup.php');" \ | ||
| && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
| && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \ | ||
| && apt-get -y clean \ | ||
@@ -83,0 +79,0 @@ && apt-get -y autoclean \ |
@@ -76,7 +76,3 @@ # docker build -t devwithlando/php:7.2-fpm-5 . | ||
| pcntl \ | ||
| && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
| && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \ | ||
| && php -r "unlink('composer-setup.php');" \ | ||
| && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
| && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \ | ||
| && apt-get -y clean \ | ||
@@ -83,0 +79,0 @@ && apt-get -y autoclean \ |
@@ -72,5 +72,2 @@ # docker build -t devwithlando/php:7.3-apache-5 . | ||
| pcntl \ | ||
| && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
| && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.2.12 \ | ||
| && php -r "unlink('composer-setup.php');" \ | ||
| && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
@@ -77,0 +74,0 @@ && apt-get -y clean \ |
@@ -72,5 +72,2 @@ # docker build -t devwithlando/php:7.3-fpm-5 . | ||
| pcntl \ | ||
| && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
| && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.2.12 \ | ||
| && php -r "unlink('composer-setup.php');" \ | ||
| && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
@@ -77,0 +74,0 @@ && apt-get -y clean \ |
@@ -19,2 +19,3 @@ # docker build -t devwithlando/php:7.4-apache-5 . | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| libonig-dev \ | ||
@@ -63,4 +64,2 @@ mariadb-client \ | ||
| RUN install-php-extensions @composer-2.2.12 | ||
| RUN \ | ||
@@ -67,0 +66,0 @@ chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ |
@@ -19,2 +19,3 @@ # docker build -t devwithlando/php:7.4-fpm-5 . | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| libonig-dev \ | ||
@@ -63,4 +64,2 @@ mariadb-client \ | ||
| RUN install-php-extensions @composer-2.2.12 | ||
| RUN \ | ||
@@ -67,0 +66,0 @@ chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ |
@@ -19,2 +19,3 @@ # docker build -t devwithlando/php:8.0-apache-5 . | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| libonig-dev \ | ||
@@ -63,4 +64,2 @@ mariadb-client \ | ||
| RUN install-php-extensions @composer-2 | ||
| RUN \ | ||
@@ -67,0 +66,0 @@ chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ |
@@ -19,2 +19,3 @@ # docker build -t devwithlando/php:8.0-fpm-5 . | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| libonig-dev \ | ||
@@ -63,4 +64,2 @@ mariadb-client \ | ||
| RUN install-php-extensions @composer-2 | ||
| RUN \ | ||
@@ -67,0 +66,0 @@ chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ |
@@ -20,2 +20,3 @@ # docker build -t devwithlando/php:8.1-apache-5 . | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| mariadb-client \ | ||
@@ -61,4 +62,2 @@ openssl \ | ||
| RUN install-php-extensions @composer-2 | ||
| RUN \ | ||
@@ -65,0 +64,0 @@ chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ |
@@ -20,2 +20,3 @@ # docker build -t devwithlando/php:8.1-fpm-5 . | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| mariadb-client \ | ||
@@ -61,4 +62,2 @@ openssl \ | ||
| RUN install-php-extensions @composer-2 | ||
| RUN \ | ||
@@ -65,0 +64,0 @@ chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ |
@@ -20,2 +20,3 @@ # docker build -t devwithlando/php:8.2-apache-5 . | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| mariadb-client \ | ||
@@ -61,4 +62,2 @@ openssl \ | ||
| RUN install-php-extensions @composer-2 | ||
| RUN \ | ||
@@ -65,0 +64,0 @@ chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ |
@@ -20,2 +20,3 @@ # docker build -t devwithlando/php:8.2-fpm-5 . | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| mariadb-client \ | ||
@@ -61,4 +62,2 @@ openssl \ | ||
| RUN install-php-extensions @composer-2 | ||
| RUN \ | ||
@@ -65,0 +64,0 @@ chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ |
@@ -15,3 +15,10 @@ # docker build -t devwithlando/php:8.3-apache-5 . | ||
| # Drupal 11 requires sqlite3 3.45+ | ||
| ARG SQLITE_VERSION=3.45.1 | ||
| RUN \ | ||
| curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-dev.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-dev_${SQLITE_VERSION}-1_${TARGETARCH}.deb" | ||
| RUN \ | ||
| mkdir -p /usr/share/man/man1 /usr/share/man/man7 \ | ||
@@ -23,3 +30,3 @@ && apt -y update && apt-get install -y \ | ||
| gnupg2 \ | ||
| openssl \ | ||
| imagemagick \ | ||
| postgresql-client-15 \ | ||
@@ -30,3 +37,6 @@ pv \ | ||
| unzip \ | ||
| wget | ||
| wget \ | ||
| /tmp/sqlite3.deb \ | ||
| /tmp/libsqlite3-0.deb \ | ||
| /tmp/libsqlite3-dev.deb | ||
@@ -64,12 +74,3 @@ RUN \ | ||
| RUN install-php-extensions @composer-2 | ||
| # Drupal 11 requires sqlite3 3.45+ | ||
| ARG SQLITE_VERSION=3.45.1 | ||
| RUN \ | ||
| curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && dpkg -i /tmp/sqlite3.deb /tmp/libsqlite3-0.deb | ||
| RUN \ | ||
| chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
@@ -76,0 +77,0 @@ && apt-get -y clean \ |
@@ -15,3 +15,10 @@ # docker build -t devwithlando/php:8.3-fpm-5 . | ||
| # Drupal 11 requires sqlite3 3.45+ | ||
| ARG SQLITE_VERSION=3.45.1 | ||
| RUN \ | ||
| curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-dev.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-dev_${SQLITE_VERSION}-1_${TARGETARCH}.deb" | ||
| RUN \ | ||
| mkdir -p /usr/share/man/man1 /usr/share/man/man7 \ | ||
@@ -23,4 +30,4 @@ && apt -y update && apt-get install -y \ | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| mariadb-client \ | ||
| openssl \ | ||
| postgresql-client-15 \ | ||
@@ -31,3 +38,6 @@ pv \ | ||
| unzip \ | ||
| wget | ||
| wget \ | ||
| /tmp/sqlite3.deb \ | ||
| /tmp/libsqlite3-0.deb \ | ||
| /tmp/libsqlite3-dev.deb | ||
@@ -65,12 +75,3 @@ RUN \ | ||
| RUN install-php-extensions @composer-2 | ||
| # Drupal 11 requires sqlite3 3.45+ | ||
| ARG SQLITE_VERSION=3.45.1 | ||
| RUN \ | ||
| curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && dpkg -i /tmp/sqlite3.deb /tmp/libsqlite3-0.deb | ||
| RUN \ | ||
| chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
@@ -77,0 +78,0 @@ && apt-get -y clean \ |
@@ -15,3 +15,10 @@ # docker build -t devwithlando/php:8.4-apache-5 . | ||
| # Drupal 11 requires sqlite3 3.45+ | ||
| ARG SQLITE_VERSION=3.45.1 | ||
| RUN \ | ||
| curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-dev.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-dev_${SQLITE_VERSION}-1_${TARGETARCH}.deb" | ||
| RUN \ | ||
| mkdir -p /usr/share/man/man1 /usr/share/man/man7 \ | ||
@@ -23,5 +30,5 @@ && apt -y update && apt-get install -y \ | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| mariadb-client \ | ||
| mariadb-client-compat \ | ||
| openssl \ | ||
| postgresql-client-15 \ | ||
@@ -32,3 +39,6 @@ pv \ | ||
| unzip \ | ||
| wget | ||
| wget \ | ||
| /tmp/sqlite3.deb \ | ||
| /tmp/libsqlite3-0.deb \ | ||
| /tmp/libsqlite3-dev.deb | ||
@@ -66,12 +76,3 @@ RUN \ | ||
| RUN install-php-extensions @composer-2 | ||
| # Drupal 11 requires sqlite3 3.45+ | ||
| ARG SQLITE_VERSION=3.45.1 | ||
| RUN \ | ||
| curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && dpkg -i /tmp/sqlite3.deb /tmp/libsqlite3-0.deb | ||
| RUN \ | ||
| chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
@@ -78,0 +79,0 @@ && apt-get -y clean \ |
@@ -15,3 +15,10 @@ # docker build -t devwithlando/php:8.4-fpm-5 . | ||
| # Drupal 11 requires sqlite3 3.45+ | ||
| ARG SQLITE_VERSION=3.45.1 | ||
| RUN \ | ||
| curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-dev.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-dev_${SQLITE_VERSION}-1_${TARGETARCH}.deb" | ||
| RUN \ | ||
| mkdir -p /usr/share/man/man1 /usr/share/man/man7 \ | ||
@@ -24,5 +31,5 @@ && apt -y update && apt-get install -y \ | ||
| gnupg2 \ | ||
| imagemagick \ | ||
| mariadb-client \ | ||
| mariadb-client-compat \ | ||
| openssl \ | ||
| postgresql-client-15 \ | ||
@@ -33,3 +40,6 @@ pv \ | ||
| unzip \ | ||
| wget | ||
| wget \ | ||
| /tmp/sqlite3.deb \ | ||
| /tmp/libsqlite3-0.deb \ | ||
| /tmp/libsqlite3-dev.deb | ||
@@ -67,12 +77,3 @@ RUN \ | ||
| RUN install-php-extensions @composer-2 | ||
| # Drupal 11 requires sqlite3 3.45+ | ||
| ARG SQLITE_VERSION=3.45.1 | ||
| RUN \ | ||
| curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \ | ||
| && dpkg -i /tmp/sqlite3.deb /tmp/libsqlite3-0.deb | ||
| RUN \ | ||
| chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \ | ||
@@ -79,0 +80,0 @@ && apt-get -y clean \ |
+5
-5
| { | ||
| "name": "@lando/php", | ||
| "description": "A Lando plugin that provides a tight integration with PHP.", | ||
| "version": "1.6.4", | ||
| "version": "1.7.0", | ||
| "author": "Mike Pirog @pirog", | ||
@@ -69,7 +69,7 @@ "license": "GPL-3.0", | ||
| "dist": { | ||
| "integrity": "sha512-5WhDKDmSxTN7C2vMR/qzw8c0HpekQDz0Q9+JngTf9DQySz8g4PLuoGdPeBBxKWWvZR++vMOFYHBlO1da6Q7XJA==", | ||
| "shasum": "16cef0ada1a9a4694a08b0c193db05e6d762cdde", | ||
| "filename": "lando-php-1.6.4.tgz", | ||
| "unpackedSize": 3125868 | ||
| "integrity": "sha512-SMAjegMZXUtiSQOHdsdbjnrIFRX9DkO6/7gWlEs5q+KRXXzjfHPhwMtddd5225jbGSnDlKQUWKBlHaDWHRDaAA==", | ||
| "shasum": "222014d582a6d1377d0da500571651149cb1e048", | ||
| "filename": "lando-php-1.7.0.tgz", | ||
| "unpackedSize": 3128242 | ||
| } | ||
| } |
@@ -19,2 +19,6 @@ #!/bin/sh | ||
| php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2 | ||
| elif [ "$VERSION" = '2.2' ]; then | ||
| php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2.2 | ||
| elif [ "$VERSION" = '2.2-latest' ]; then | ||
| php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2.2 | ||
| elif [ "$VERSION" = 'preview' ]; then | ||
@@ -21,0 +25,0 @@ php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --preview |
@@ -6,5 +6,19 @@ 'use strict'; | ||
| /* | ||
| * Helper to get global deps | ||
| * @TODO: this looks pretty testable? should services have libs? | ||
| /** | ||
| * Helper function to add build steps to a service's configuration | ||
| * | ||
| * @param {string|string[]} steps - The build step(s) to add | ||
| * @param {Object} app - The Lando app object | ||
| * @param {string} name - The name of the service | ||
| * @param {string} [step='build_internal'] - The build step type to modify | ||
| * @param {boolean} [front=false] - Whether to add steps to front of array | ||
| * @return {void} - Modifies app config object directly | ||
| * | ||
| * @example | ||
| * // Add a build step to the end | ||
| * addBuildStep('npm install', app, 'web'); | ||
| * | ||
| * @example | ||
| * // Add multiple build steps to the front | ||
| * addBuildStep(['composer install', 'npm install'], app, 'web', 'build_internal', true); | ||
| */ | ||
@@ -11,0 +25,0 @@ module.exports = (steps, app, name, step = 'build_internal', front = false) => { |
@@ -6,5 +6,21 @@ 'use strict'; | ||
| /* | ||
| * Helper to get global deps | ||
| * @TODO: this looks pretty testable? should services have libs? | ||
| /** | ||
| * Helper function to generate installation commands for dependencies | ||
| * | ||
| * @param {Object} deps - Dependencies object with package names as keys and versions as values | ||
| * @param {Function} pkger - Function that generates package installation command | ||
| * @param {string[]} [prefix=[]] - Command prefix to prepend to each installation command | ||
| * @return {string[]} Array of formatted installation commands | ||
| * | ||
| * @example | ||
| * // Generate npm install commands | ||
| * const deps = { 'lodash': '^4.0.0', 'express': '4.17.1' }; | ||
| * const npmInstall = (pkg, version) => ['npm', 'install', `${pkg}@${version}`]; | ||
| * getInstallCommands(deps, npmInstall); | ||
| * // Returns: ['npm install lodash@^4.0.0', 'npm install express@4.17.1'] | ||
| * | ||
| * @example | ||
| * // Generate commands with prefix | ||
| * getInstallCommands(deps, npmInstall, ['sudo', '-E']); | ||
| * // Returns: ['sudo -E npm install lodash@^4.0.0', 'sudo -E npm install express@4.17.1'] | ||
| */ | ||
@@ -11,0 +27,0 @@ module.exports = (deps, pkger, prefix = []) => _(deps) |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
3128501
0.08%84318
0.1%