@lando/php 1.6.4 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})
2
2
 
3
+ ## v1.7.1 - [January 15, 2025](https://github.com/lando/php/releases/tag/v1.7.1)
4
+
5
+ * Improved the `php` service builder to mount a unique scripts directory per service to prevent version conflicts.
6
+
7
+ ## v1.7.0 - [January 8, 2025](https://github.com/lando/php/releases/tag/v1.7.0)
8
+
9
+ * Added logic to allow default `composer` version to be set based on PHP version.
10
+ * Added `2.2` and `2.2-latest` shorthand options to install the latest stable 2.2 LTS version of `composer`.
11
+ * Set default `composer` version to `2-latest`
12
+ * Set default `composer` version to `2.2-latest` for PHP 5.3-7.2
13
+ * Set default `composer` version to `1-latest` for PHP <= 5.2
14
+ * Removed `composer` installation from images to prefer installing during app build
15
+ * Fixed bug causing `composer` 2.2.x to be installed when `composer_version` was set to a single digit version such as `1`
16
+ * Fixed mismatched `libsqlite3-dev` and `libsqlite3-0` versions in PHP 8.3 and 8.4 images
17
+ * Fixed regression causing ImageMagick `convert` to not be available in images with `imagick` extension enabled
18
+
3
19
  ## v1.6.4 - [December 14, 2024](https://github.com/lando/php/releases/tag/v1.6.4)
4
20
 
5
21
  * Fixed issue causing `xdebug` extension to not be disabled by default in PHP 8.3 and 8.4 images.
package/builders/php.js CHANGED
@@ -5,6 +5,29 @@ const _ = require('lodash');
5
5
  const path = require('path');
6
6
  const semver = require('semver');
7
7
  const addBuildStep = require('./../utils/add-build-step');
8
+
9
+ /**
10
+ * Get the appropriate Composer version based on the PHP version.
11
+ * @param {semver} phpSemver - The PHP semantic version.
12
+ * @return {string|boolean} - The Composer version or false if we cannot parse the version.
13
+ */
14
+ const getDefaultComposerVersion = phpSemver => {
15
+ // Don't set a default composer version if we cannot
16
+ // parse the version such as with `custom`.
17
+ if (!phpSemver) return false;
18
+
19
+ if (semver.lt(phpSemver, '5.3.2')) {
20
+ // Use Composer 1 for PHP < 5.3.2
21
+ return '1';
22
+ } else if (semver.lt(phpSemver, '7.3.0')) {
23
+ // Use Composer 2.2 LTS for PHP < 7.3
24
+ return '2.2';
25
+ } else {
26
+ // Use Composer 2 for PHP >= 7.3
27
+ return '2';
28
+ }
29
+ };
30
+
8
31
  /*
9
32
  * Helper to get nginx config
10
33
  */
@@ -30,13 +53,25 @@ const nginxConfig = options => ({
30
53
  const xdebugConfig = host => ([
31
54
  `client_host=${host}`,
32
55
  'discover_client_host=1',
33
- 'log=/tmp/xdebug.log',
34
- 'remote_enable=true',
56
+ 'log=/tmp/xdebug.log',
57
+ 'remote_enable=true',
35
58
  `remote_host=${host}`,
36
59
  ].join(' '));
37
60
 
38
- /*
39
- * Helper to build a package string
61
+ /**
62
+ * Helper function to build a package string by combining package name and version
63
+ *
64
+ * @param {string} pkg - The package name
65
+ * @param {string} version - The package version
66
+ * @return {string} The formatted package string, either "pkg:version" or just "pkg" if version is empty
67
+ *
68
+ * @example
69
+ * // Returns "php:7.4"
70
+ * pkger('php', '7.4');
71
+ *
72
+ * @example
73
+ * // Returns "mysql"
74
+ * pkger('mysql', '');
40
75
  */
41
76
  const pkger = (pkg, version) => (!_.isEmpty(version)) ? `${pkg}:${version}` : pkg;
42
77
 
@@ -108,7 +143,7 @@ module.exports = {
108
143
  ],
109
144
  confSrc: path.resolve(__dirname, '..', 'config'),
110
145
  command: ['sh -c \'a2enmod rewrite && apache2-foreground\''],
111
- composer_version: '2.2.22',
146
+ composer_version: true,
112
147
  phpServer: 'apache',
113
148
  defaultFiles: {
114
149
  _php: 'php.ini',
@@ -126,6 +161,7 @@ module.exports = {
126
161
  php: '/usr/local/etc/php/conf.d/zzz-lando-my-custom.ini',
127
162
  pool: '/usr/local/etc/php-fpm.d/zz-lando.conf',
128
163
  },
164
+ scriptsDir: path.resolve(__dirname, '..', 'scripts'),
129
165
  sources: [],
130
166
  suffix: '5',
131
167
  ssl: false,
@@ -137,12 +173,20 @@ module.exports = {
137
173
  parent: '_appserver',
138
174
  builder: (parent, config) => class LandoPhp extends parent {
139
175
  constructor(id, options = {}, factory) {
176
+ const debug = _.get(options, '_app._lando').log.debug;
177
+
178
+ // Merge the user config onto the default options
140
179
  options = parseConfig(_.merge({}, config, options));
180
+
181
+ // Get the semver of the PHP version, NULL if we cannot parse it
182
+ const phpSemver = semver.coerce(options.version);
183
+ phpSemver && debug('Parsed PHP semantic version: %s', phpSemver);
184
+
141
185
  // Mount our default php config
142
186
  options.volumes.push(`${options.confDest}/${options.defaultFiles._php}:${options.remoteFiles._php}`);
143
187
  options.volumes.push(`${options.confDest}/${options.defaultFiles.pool}:${options.remoteFiles.pool}`);
144
188
  // Shift on the docker entrypoint if this is a more recent version
145
- if (options.version !== 'custom' && semver.gt(semver.coerce(options.version), '5.5.0')) {
189
+ if (phpSemver && semver.gt(phpSemver, '5.5.0')) {
146
190
  options.command.unshift('docker-php-entrypoint');
147
191
  }
148
192
 
@@ -168,22 +212,38 @@ module.exports = {
168
212
  };
169
213
  options.info = {via: options.via};
170
214
 
171
- // Add our composer things to run step
172
- if (!_.isEmpty(options.composer)) {
173
- const commands =
174
- require('../utils/get-install-commands')(options.composer, pkger, ['composer', 'global', 'require', '-n']);
175
- addBuildStep(commands, options._app, options.name, 'build_internal');
215
+ // Determine the appropriate composer version to install if not specified
216
+ if (options.composer_version === true || options.composer_version === '') {
217
+ options.composer_version = getDefaultComposerVersion(phpSemver);
218
+ } else if (typeof options.composer_version === 'number') {
219
+ options.composer_version = options.composer_version.toString();
176
220
  }
221
+ const usingComposer1 = options.composer_version && semver.satisfies(options.composer_version, '1.x');
177
222
 
178
- // Add activate steps for xdebug
223
+ // Add prestissimo as a global package for Composer 1.x performance improvements. Requires PHP >= 5.3
224
+ if (usingComposer1 && phpSemver && semver.gte(phpSemver, '5.3.0')) {
225
+ options.composer = options.composer || {};
226
+ options.composer = {'hirak/prestissimo': '*', ...options.composer};
227
+ }
228
+
229
+ // Add build step to enable xdebug
179
230
  if (options.xdebug) {
180
231
  addBuildStep(['docker-php-ext-enable xdebug'], options._app, options.name, 'build_as_root_internal');
181
232
  }
182
233
 
183
- // Install the desired composer version
234
+ // Add build step to install our Composer global packages
235
+ if (!_.isEmpty(options.composer)) {
236
+ const commands =
237
+ require('../utils/get-install-commands')(options.composer, pkger, ['composer', 'global', 'require', '-n']);
238
+ addBuildStep(commands, options._app, options.name, 'build_internal');
239
+ }
240
+
241
+ // Install the desired composer version as the first `build_internal` build step
184
242
  if (options.composer_version) {
185
- const commands = [`/helpers/install-composer.sh ${options.composer_version}`];
186
- addBuildStep(commands, options._app, options.name, 'build_internal', true);
243
+ debug('Installing composer version %s', options.composer_version);
244
+ const commands = [`/etc/lando/service/helpers/install-composer.sh ${options.composer_version}`];
245
+ const firstStep = true;
246
+ addBuildStep(commands, options._app, options.name, 'build_internal', firstStep);
187
247
  }
188
248
 
189
249
  // Add in nginx if we need to
@@ -72,11 +72,7 @@ RUN \
72
72
  intl \
73
73
  gettext \
74
74
  pcntl \
75
- && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
76
- && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \
77
- && php -r "unlink('composer-setup.php');" \
78
75
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
79
- && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \
80
76
  && apt-get -y clean \
81
77
  && apt-get -y autoclean \
82
78
  && apt-get -y autoremove \
@@ -72,12 +72,7 @@ RUN \
72
72
  intl \
73
73
  gettext \
74
74
  pcntl \
75
- # Install composer
76
- && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
77
- && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \
78
- && php -r "unlink('composer-setup.php');" \
79
75
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
80
- && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \
81
76
  && apt-get -y clean \
82
77
  && apt-get -y autoclean \
83
78
  && apt-get -y autoremove \
@@ -72,11 +72,7 @@ RUN \
72
72
  intl \
73
73
  gettext \
74
74
  pcntl \
75
- && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
76
- && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \
77
- && php -r "unlink('composer-setup.php');" \
78
75
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
79
- && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \
80
76
  && apt-get -y clean \
81
77
  && apt-get -y autoclean \
82
78
  && apt-get -y autoremove \
@@ -72,11 +72,7 @@ RUN \
72
72
  intl \
73
73
  gettext \
74
74
  pcntl \
75
- && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
76
- && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \
77
- && php -r "unlink('composer-setup.php');" \
78
75
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
79
- && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \
80
76
  && apt-get -y clean \
81
77
  && apt-get -y autoclean \
82
78
  && apt-get -y autoremove \
@@ -75,11 +75,7 @@ RUN \
75
75
  intl \
76
76
  gettext \
77
77
  pcntl \
78
- && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
79
- && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \
80
- && php -r "unlink('composer-setup.php');" \
81
78
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
82
- && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \
83
79
  && apt-get -y clean \
84
80
  && apt-get -y autoclean \
85
81
  && apt-get -y autoremove \
@@ -75,11 +75,7 @@ RUN \
75
75
  intl \
76
76
  gettext \
77
77
  pcntl \
78
- && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
79
- && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \
80
- && php -r "unlink('composer-setup.php');" \
81
78
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
82
- && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \
83
79
  && apt-get -y clean \
84
80
  && apt-get -y autoclean \
85
81
  && apt-get -y autoremove \
@@ -73,11 +73,7 @@ RUN \
73
73
  intl \
74
74
  gettext \
75
75
  pcntl \
76
- && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
77
- && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \
78
- && php -r "unlink('composer-setup.php');" \
79
76
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
80
- && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \
81
77
  && apt-get -y clean \
82
78
  && apt-get -y autoclean \
83
79
  && apt-get -y autoremove \
@@ -73,11 +73,7 @@ RUN \
73
73
  intl \
74
74
  gettext \
75
75
  pcntl \
76
- && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
77
- && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.1 \
78
- && php -r "unlink('composer-setup.php');" \
79
76
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
80
- && su -c "composer global require -n hirak/prestissimo" -s /bin/sh www-data \
81
77
  && apt-get -y clean \
82
78
  && apt-get -y autoclean \
83
79
  && apt-get -y autoremove \
@@ -69,9 +69,6 @@ RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
69
69
  intl \
70
70
  gettext \
71
71
  pcntl \
72
- && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
73
- && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.2.12 \
74
- && php -r "unlink('composer-setup.php');" \
75
72
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
76
73
  && apt-get -y clean \
77
74
  && apt-get -y autoclean \
@@ -69,9 +69,6 @@ RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
69
69
  intl \
70
70
  gettext \
71
71
  pcntl \
72
- && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
73
- && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.2.12 \
74
- && php -r "unlink('composer-setup.php');" \
75
72
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
76
73
  && apt-get -y clean \
77
74
  && apt-get -y autoclean \
@@ -16,6 +16,7 @@ RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
16
16
  exiftool \
17
17
  git-core \
18
18
  gnupg2 \
19
+ imagemagick \
19
20
  libonig-dev \
20
21
  mariadb-client \
21
22
  openssl \
@@ -59,8 +60,6 @@ RUN \
59
60
  RUN install-php-extensions xdebug \
60
61
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
61
62
 
62
- RUN install-php-extensions @composer-2.2.12
63
-
64
63
  RUN \
65
64
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
66
65
  && apt-get -y clean \
@@ -16,6 +16,7 @@ RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
16
16
  exiftool \
17
17
  git-core \
18
18
  gnupg2 \
19
+ imagemagick \
19
20
  libonig-dev \
20
21
  mariadb-client \
21
22
  openssl \
@@ -59,8 +60,6 @@ RUN \
59
60
  RUN install-php-extensions xdebug \
60
61
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
61
62
 
62
- RUN install-php-extensions @composer-2.2.12
63
-
64
63
  RUN \
65
64
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
66
65
  && apt-get -y clean \
@@ -16,6 +16,7 @@ RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
16
16
  exiftool \
17
17
  git-core \
18
18
  gnupg2 \
19
+ imagemagick \
19
20
  libonig-dev \
20
21
  mariadb-client \
21
22
  openssl \
@@ -59,8 +60,6 @@ RUN \
59
60
  RUN install-php-extensions xdebug \
60
61
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
61
62
 
62
- RUN install-php-extensions @composer-2
63
-
64
63
  RUN \
65
64
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
66
65
  && apt-get -y clean \
@@ -16,6 +16,7 @@ RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
16
16
  exiftool \
17
17
  git-core \
18
18
  gnupg2 \
19
+ imagemagick \
19
20
  libonig-dev \
20
21
  mariadb-client \
21
22
  openssl \
@@ -59,8 +60,6 @@ RUN \
59
60
  RUN install-php-extensions xdebug \
60
61
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
61
62
 
62
- RUN install-php-extensions @composer-2
63
-
64
63
  RUN \
65
64
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
66
65
  && apt-get -y clean \
@@ -17,6 +17,7 @@ RUN \
17
17
  exiftool \
18
18
  git-core \
19
19
  gnupg2 \
20
+ imagemagick \
20
21
  mariadb-client \
21
22
  openssl \
22
23
  postgresql-client-15 \
@@ -57,8 +58,6 @@ RUN \
57
58
  RUN install-php-extensions xdebug \
58
59
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
59
60
 
60
- RUN install-php-extensions @composer-2
61
-
62
61
  RUN \
63
62
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
64
63
  && apt-get -y clean \
@@ -17,6 +17,7 @@ RUN \
17
17
  exiftool \
18
18
  git-core \
19
19
  gnupg2 \
20
+ imagemagick \
20
21
  mariadb-client \
21
22
  openssl \
22
23
  postgresql-client-15 \
@@ -57,8 +58,6 @@ RUN \
57
58
  RUN install-php-extensions xdebug \
58
59
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
59
60
 
60
- RUN install-php-extensions @composer-2
61
-
62
61
  RUN \
63
62
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
64
63
  && apt-get -y clean \
@@ -17,6 +17,7 @@ RUN \
17
17
  exiftool \
18
18
  git-core \
19
19
  gnupg2 \
20
+ imagemagick \
20
21
  mariadb-client \
21
22
  openssl \
22
23
  postgresql-client-15 \
@@ -57,8 +58,6 @@ RUN \
57
58
  RUN install-php-extensions xdebug \
58
59
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
59
60
 
60
- RUN install-php-extensions @composer-2
61
-
62
61
  RUN \
63
62
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
64
63
  && apt-get -y clean \
@@ -17,6 +17,7 @@ RUN \
17
17
  exiftool \
18
18
  git-core \
19
19
  gnupg2 \
20
+ imagemagick \
20
21
  mariadb-client \
21
22
  openssl \
22
23
  postgresql-client-15 \
@@ -57,8 +58,6 @@ RUN \
57
58
  RUN install-php-extensions xdebug \
58
59
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
59
60
 
60
- RUN install-php-extensions @composer-2
61
-
62
61
  RUN \
63
62
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
64
63
  && apt-get -y clean \
@@ -12,6 +12,13 @@ RUN \
12
12
  && curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp' \
13
13
  && echo "deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mirror.mariadb.org/repo/10.11/debian bookworm main" > /etc/apt/sources.list.d/mariadb.list
14
14
 
15
+ # Drupal 11 requires sqlite3 3.45+
16
+ ARG SQLITE_VERSION=3.45.1
17
+ RUN \
18
+ curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
19
+ && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
20
+ && curl -Lo /tmp/libsqlite3-dev.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-dev_${SQLITE_VERSION}-1_${TARGETARCH}.deb"
21
+
15
22
  RUN \
16
23
  mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
17
24
  && apt -y update && apt-get install -y \
@@ -19,13 +26,16 @@ RUN \
19
26
  exiftool \
20
27
  git-core \
21
28
  gnupg2 \
22
- openssl \
29
+ imagemagick \
23
30
  postgresql-client-15 \
24
31
  pv \
25
32
  rsync \
26
33
  ssh \
27
34
  unzip \
28
- wget
35
+ wget \
36
+ /tmp/sqlite3.deb \
37
+ /tmp/libsqlite3-0.deb \
38
+ /tmp/libsqlite3-dev.deb
29
39
 
30
40
  RUN \
31
41
  install-php-extensions @fix_letsencrypt \
@@ -58,15 +68,6 @@ RUN \
58
68
  RUN install-php-extensions xdebug \
59
69
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
60
70
 
61
- RUN install-php-extensions @composer-2
62
-
63
- # Drupal 11 requires sqlite3 3.45+
64
- ARG SQLITE_VERSION=3.45.1
65
- RUN \
66
- curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
67
- && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
68
- && dpkg -i /tmp/sqlite3.deb /tmp/libsqlite3-0.deb
69
-
70
71
  RUN \
71
72
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
72
73
  && apt-get -y clean \
@@ -12,6 +12,13 @@ RUN \
12
12
  && curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp' \
13
13
  && echo "deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mirror.mariadb.org/repo/10.11/debian bookworm main" > /etc/apt/sources.list.d/mariadb.list
14
14
 
15
+ # Drupal 11 requires sqlite3 3.45+
16
+ ARG SQLITE_VERSION=3.45.1
17
+ RUN \
18
+ curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
19
+ && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
20
+ && curl -Lo /tmp/libsqlite3-dev.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-dev_${SQLITE_VERSION}-1_${TARGETARCH}.deb"
21
+
15
22
  RUN \
16
23
  mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
17
24
  && apt -y update && apt-get install -y \
@@ -19,14 +26,17 @@ RUN \
19
26
  exiftool \
20
27
  git-core \
21
28
  gnupg2 \
29
+ imagemagick \
22
30
  mariadb-client \
23
- openssl \
24
31
  postgresql-client-15 \
25
32
  pv \
26
33
  rsync \
27
34
  ssh \
28
35
  unzip \
29
- wget
36
+ wget \
37
+ /tmp/sqlite3.deb \
38
+ /tmp/libsqlite3-0.deb \
39
+ /tmp/libsqlite3-dev.deb
30
40
 
31
41
  RUN \
32
42
  install-php-extensions @fix_letsencrypt \
@@ -59,15 +69,6 @@ RUN \
59
69
  RUN install-php-extensions xdebug \
60
70
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
61
71
 
62
- RUN install-php-extensions @composer-2
63
-
64
- # Drupal 11 requires sqlite3 3.45+
65
- ARG SQLITE_VERSION=3.45.1
66
- RUN \
67
- curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
68
- && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
69
- && dpkg -i /tmp/sqlite3.deb /tmp/libsqlite3-0.deb
70
-
71
72
  RUN \
72
73
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
73
74
  && apt-get -y clean \
@@ -12,6 +12,13 @@ RUN \
12
12
  && curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp' \
13
13
  && echo "deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mirror.mariadb.org/repo/11.4/debian bookworm main" > /etc/apt/sources.list.d/mariadb.list
14
14
 
15
+ # Drupal 11 requires sqlite3 3.45+
16
+ ARG SQLITE_VERSION=3.45.1
17
+ RUN \
18
+ curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
19
+ && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
20
+ && curl -Lo /tmp/libsqlite3-dev.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-dev_${SQLITE_VERSION}-1_${TARGETARCH}.deb"
21
+
15
22
  RUN \
16
23
  mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
17
24
  && apt -y update && apt-get install -y \
@@ -19,15 +26,18 @@ RUN \
19
26
  exiftool \
20
27
  git-core \
21
28
  gnupg2 \
29
+ imagemagick \
22
30
  mariadb-client \
23
31
  mariadb-client-compat \
24
- openssl \
25
32
  postgresql-client-15 \
26
33
  pv \
27
34
  rsync \
28
35
  ssh \
29
36
  unzip \
30
- wget
37
+ wget \
38
+ /tmp/sqlite3.deb \
39
+ /tmp/libsqlite3-0.deb \
40
+ /tmp/libsqlite3-dev.deb
31
41
 
32
42
  RUN \
33
43
  install-php-extensions @fix_letsencrypt \
@@ -60,15 +70,6 @@ RUN \
60
70
  RUN install-php-extensions xdebug \
61
71
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
62
72
 
63
- RUN install-php-extensions @composer-2
64
-
65
- # Drupal 11 requires sqlite3 3.45+
66
- ARG SQLITE_VERSION=3.45.1
67
- RUN \
68
- curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
69
- && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
70
- && dpkg -i /tmp/sqlite3.deb /tmp/libsqlite3-0.deb
71
-
72
73
  RUN \
73
74
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
74
75
  && apt-get -y clean \
@@ -12,6 +12,13 @@ RUN \
12
12
  && curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp' \
13
13
  && echo "deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mirror.mariadb.org/repo/11.4/debian bookworm main" > /etc/apt/sources.list.d/mariadb.list
14
14
 
15
+ # Drupal 11 requires sqlite3 3.45+
16
+ ARG SQLITE_VERSION=3.45.1
17
+ RUN \
18
+ curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
19
+ && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
20
+ && curl -Lo /tmp/libsqlite3-dev.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-dev_${SQLITE_VERSION}-1_${TARGETARCH}.deb"
21
+
15
22
  RUN \
16
23
  mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
17
24
  && apt -y update && apt-get install -y \
@@ -20,15 +27,18 @@ RUN \
20
27
  exiftool \
21
28
  git-core \
22
29
  gnupg2 \
30
+ imagemagick \
23
31
  mariadb-client \
24
32
  mariadb-client-compat \
25
- openssl \
26
33
  postgresql-client-15 \
27
34
  pv \
28
35
  rsync \
29
36
  ssh \
30
37
  unzip \
31
- wget
38
+ wget \
39
+ /tmp/sqlite3.deb \
40
+ /tmp/libsqlite3-0.deb \
41
+ /tmp/libsqlite3-dev.deb
32
42
 
33
43
  RUN \
34
44
  install-php-extensions @fix_letsencrypt \
@@ -61,15 +71,6 @@ RUN \
61
71
  RUN install-php-extensions xdebug \
62
72
  && rm -f /usr/local/etc/php/conf.d/*xdebug.ini
63
73
 
64
- RUN install-php-extensions @composer-2
65
-
66
- # Drupal 11 requires sqlite3 3.45+
67
- ARG SQLITE_VERSION=3.45.1
68
- RUN \
69
- curl -Lo /tmp/sqlite3.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
70
- && curl -Lo /tmp/libsqlite3-0.deb "https://snapshot.debian.org/archive/debian/20240506T211830Z/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETARCH}.deb" \
71
- && dpkg -i /tmp/sqlite3.deb /tmp/libsqlite3-0.deb
72
-
73
74
  RUN \
74
75
  chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
75
76
  && apt-get -y clean \
package/netlify.toml CHANGED
@@ -10,7 +10,7 @@
10
10
  [[context.deploy-preview.plugins]]
11
11
  package = "netlify-plugin-checklinks"
12
12
  [context.deploy-preview.plugins.inputs]
13
- todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com", "/v/" ]
13
+ todoPatterns = [ "load", "CHANGELOG.html", "/v/", "x.com", "twitter.com", "www.php.net" ]
14
14
  skipPatterns = [ ".rss", ".gif", ".jpg" ]
15
15
  checkExternal = true
16
16
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lando/php",
3
3
  "description": "A Lando plugin that provides a tight integration with PHP.",
4
- "version": "1.6.4",
4
+ "version": "1.7.1",
5
5
  "author": "Mike Pirog @pirog",
6
6
  "license": "GPL-3.0",
7
7
  "repository": "lando/php",
@@ -66,9 +66,9 @@
66
66
  "semver"
67
67
  ],
68
68
  "dist": {
69
- "integrity": "sha512-5WhDKDmSxTN7C2vMR/qzw8c0HpekQDz0Q9+JngTf9DQySz8g4PLuoGdPeBBxKWWvZR++vMOFYHBlO1da6Q7XJA==",
70
- "shasum": "16cef0ada1a9a4694a08b0c193db05e6d762cdde",
71
- "filename": "lando-php-1.6.4.tgz",
72
- "unpackedSize": 3125868
69
+ "integrity": "sha512-GF7bMuFPLQoPPb1ODyJ2aCLbASR6PLmM9TLJy+5v+2xViS6elMJLe20D51SsFB4K8vzo4o6PIO7WboE5PRn8cg==",
70
+ "shasum": "3e52a825d6d81d9117e9ce6243e28a1d16c43fea",
71
+ "filename": "lando-php-1.7.1.tgz",
72
+ "unpackedSize": 3128531
73
73
  }
74
74
  }
@@ -16,6 +16,10 @@ elif [ "$VERSION" = '2-latest' ]; then
16
16
  php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2
17
17
  elif [ "$VERSION" = '2' ]; then
18
18
  php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2
19
+ elif [ "$VERSION" = '2.2' ]; then
20
+ php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2.2
21
+ elif [ "$VERSION" = '2.2-latest' ]; then
22
+ php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2.2
19
23
  elif [ "$VERSION" = 'preview' ]; then
20
24
  php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --preview
21
25
  elif [ "$VERSION" = 'snapshot' ]; then
@@ -3,9 +3,23 @@
3
3
  // Modules
4
4
  const _ = require('lodash');
5
5
 
6
- /*
7
- * Helper to get global deps
8
- * @TODO: this looks pretty testable? should services have libs?
6
+ /**
7
+ * Helper function to add build steps to a service's configuration
8
+ *
9
+ * @param {string|string[]} steps - The build step(s) to add
10
+ * @param {Object} app - The Lando app object
11
+ * @param {string} name - The name of the service
12
+ * @param {string} [step='build_internal'] - The build step type to modify
13
+ * @param {boolean} [front=false] - Whether to add steps to front of array
14
+ * @return {void} - Modifies app config object directly
15
+ *
16
+ * @example
17
+ * // Add a build step to the end
18
+ * addBuildStep('npm install', app, 'web');
19
+ *
20
+ * @example
21
+ * // Add multiple build steps to the front
22
+ * addBuildStep(['composer install', 'npm install'], app, 'web', 'build_internal', true);
9
23
  */
10
24
  module.exports = (steps, app, name, step = 'build_internal', front = false) => {
11
25
  const current = _.get(app, `config.services.${name}.${step}`, []);
@@ -3,9 +3,25 @@
3
3
  // Modules
4
4
  const _ = require('lodash');
5
5
 
6
- /*
7
- * Helper to get global deps
8
- * @TODO: this looks pretty testable? should services have libs?
6
+ /**
7
+ * Helper function to generate installation commands for dependencies
8
+ *
9
+ * @param {Object} deps - Dependencies object with package names as keys and versions as values
10
+ * @param {Function} pkger - Function that generates package installation command
11
+ * @param {string[]} [prefix=[]] - Command prefix to prepend to each installation command
12
+ * @return {string[]} Array of formatted installation commands
13
+ *
14
+ * @example
15
+ * // Generate npm install commands
16
+ * const deps = { 'lodash': '^4.0.0', 'express': '4.17.1' };
17
+ * const npmInstall = (pkg, version) => ['npm', 'install', `${pkg}@${version}`];
18
+ * getInstallCommands(deps, npmInstall);
19
+ * // Returns: ['npm install lodash@^4.0.0', 'npm install express@4.17.1']
20
+ *
21
+ * @example
22
+ * // Generate commands with prefix
23
+ * getInstallCommands(deps, npmInstall, ['sudo', '-E']);
24
+ * // Returns: ['sudo -E npm install lodash@^4.0.0', 'sudo -E npm install express@4.17.1']
9
25
  */
10
26
  module.exports = (deps, pkger, prefix = []) => _(deps)
11
27
  .map((version, pkg) => _.flatten([prefix, pkger(pkg, version)]))