@scandipwa/magento-scripts 1.13.5-alpha.0 → 1.14.1-alpha.0

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.
Files changed (33) hide show
  1. package/lib/commands/start.js +23 -12
  2. package/lib/config/templates/php-fpm.template.conf +1 -0
  3. package/lib/config/versions/magento-2.3.0.js +3 -1
  4. package/lib/config/versions/magento-2.3.1.js +3 -1
  5. package/lib/config/versions/magento-2.3.2-p2.js +3 -1
  6. package/lib/config/versions/magento-2.3.2.js +3 -1
  7. package/lib/config/versions/magento-2.3.3-p1.js +3 -1
  8. package/lib/config/versions/magento-2.3.3.js +3 -1
  9. package/lib/config/versions/magento-2.3.4-p2.js +3 -1
  10. package/lib/config/versions/magento-2.3.4.js +3 -1
  11. package/lib/config/versions/magento-2.3.5-p1.js +3 -1
  12. package/lib/config/versions/magento-2.3.5-p2.js +3 -1
  13. package/lib/config/versions/magento-2.3.5.js +3 -1
  14. package/lib/config/versions/magento-2.3.6-p1.js +3 -1
  15. package/lib/config/versions/magento-2.3.6.js +3 -1
  16. package/lib/config/versions/magento-2.3.7-p2.js +47 -0
  17. package/lib/config/versions/magento-2.3.7-p3.js +47 -0
  18. package/lib/config/versions/magento-2.4.3-p2.js +51 -0
  19. package/lib/config/versions/magento-2.4.4.js +51 -0
  20. package/lib/tasks/composer/index.js +1 -1
  21. package/lib/tasks/docker/containers.js +16 -4
  22. package/lib/tasks/magento/setup-magento/set-base-url.js +2 -1
  23. package/lib/tasks/php/compile-options.js +4 -3
  24. package/lib/tasks/php/compile.js +1 -1
  25. package/lib/tasks/php/index.js +22 -8
  26. package/lib/tasks/requirements/composer.js +211 -19
  27. package/lib/tasks/requirements/docker/index.js +12 -1
  28. package/lib/tasks/requirements/docker/permissions.js +58 -0
  29. package/lib/tasks/requirements/index.js +1 -2
  30. package/lib/tasks/status/index.js +24 -9
  31. package/lib/util/instance-metadata.js +74 -0
  32. package/package.json +12 -2
  33. package/readme.md +54 -124
@@ -9,9 +9,12 @@ const systeminformation = require('systeminformation');
9
9
  const { getCSAThemes } = require('../util/CSA-theme');
10
10
  const shouldUseYarn = require('@scandipwa/scandipwa-dev-utils/should-use-yarn');
11
11
  const ConsoleBlock = require('../util/console-block');
12
+ const { getInstanceMetadata } = require('../util/instance-metadata');
12
13
 
13
14
  const cmaGaTrackingId = 'UA-127741417-7';
14
15
 
16
+ googleAnalytics.setGaTrackingId(cmaGaTrackingId);
17
+
15
18
  /**
16
19
  * @param {import('yargs')} yargs
17
20
  */
@@ -64,6 +67,9 @@ module.exports = (yargs) => {
64
67
  default: false
65
68
  }),
66
69
  async (args = {}) => {
70
+ /**
71
+ * @type {Listr<import('../../typings/context').ListrContext>}
72
+ */
67
73
  const tasks = new Listr(
68
74
  start(), {
69
75
  exitOnError: true,
@@ -75,7 +81,7 @@ module.exports = (yargs) => {
75
81
  }
76
82
  }
77
83
  );
78
- const timeStamp = Date.now() / 1000;
84
+ const timeStamp = Date.now();
79
85
 
80
86
  if (args.debug) {
81
87
  logger.warn('You are running in debug mode. Magento setup will be slow.');
@@ -90,20 +96,27 @@ module.exports = (yargs) => {
90
96
  const ctx = await tasks.run();
91
97
 
92
98
  const {
93
- ports,
94
- config: { magentoConfiguration, overridenConfiguration: { host, ssl } },
95
99
  systemConfiguration: { analytics }
96
100
  } = ctx;
97
101
 
98
- const webLocation = `${ssl.enabled ? 'https' : 'http'}://${host}${ssl.enabled || ports.app === 80 ? '' : `:${ports.app}`}/`;
102
+ const instanceMetadata = getInstanceMetadata(ctx);
99
103
 
100
104
  const block = new ConsoleBlock();
101
105
  block
102
106
  .addHeader('Magento 2')
103
- .addEmptyLine()
104
- .addLine(`Web location: ${logger.style.link(webLocation)}`)
105
- .addLine(`Magento Admin panel location: ${logger.style.link(`${webLocation}${magentoConfiguration.adminuri}`)}`)
106
- .addLine(`Magento Admin panel credentials: ${logger.style.misc(magentoConfiguration.user)} - ${logger.style.misc(magentoConfiguration.password)}`);
107
+ .addEmptyLine();
108
+
109
+ block.addLine(logger.style.misc('Frontend'));
110
+ instanceMetadata.frontend.forEach(({ title, text }) => {
111
+ block.addLine(` ${title}: ${text}`);
112
+ });
113
+
114
+ block.addEmptyLine();
115
+
116
+ block.addLine(logger.style.misc('Admin'));
117
+ instanceMetadata.admin.forEach(({ title, text }) => {
118
+ block.addLine(` ${title}: ${text}`);
119
+ });
107
120
 
108
121
  const themes = await getCSAThemes();
109
122
  if (themes.length > 0) {
@@ -143,10 +156,8 @@ module.exports = (yargs) => {
143
156
  }
144
157
 
145
158
  try {
146
- googleAnalytics.setGaTrackingId(cmaGaTrackingId);
147
-
148
159
  if (!process.isFirstStart) {
149
- await googleAnalytics.trackTiming('CMA start time', Date.now() / 1000 - timeStamp);
160
+ await googleAnalytics.trackTiming('CMA start time', Date.now() - timeStamp);
150
161
  googleAnalytics.printAboutAnalytics();
151
162
  process.exit(0);
152
163
  }
@@ -160,7 +171,7 @@ module.exports = (yargs) => {
160
171
  const paramInfo = `Platform: ${platform} ${kernel}, CPU model: ${manufacturer} ${brand}, RAM amount: ${totalRam}MB`;
161
172
 
162
173
  await googleAnalytics.trackEvent('Params', paramInfo, 0, 'OS');
163
- await googleAnalytics.trackTiming('CMA first start time', Date.now() / 1000 - timeStamp);
174
+ await googleAnalytics.trackTiming('CMA first start time', Date.now() - timeStamp);
164
175
  googleAnalytics.printAboutAnalytics();
165
176
  } catch (e) {
166
177
  await googleAnalytics.trackError(e.message || e);
@@ -18,3 +18,4 @@ pm.process_idle_timeout = 10s
18
18
  pm.status_path = /fpmstatus
19
19
  listen = 127.0.0.1:<%= it.ports.fpm %>
20
20
 
21
+ env[PATH] = $PATH
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.2.33',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.2.33',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.2.33',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.2.33',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.3.28',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.3.28',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.3.28',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.3.28',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.3.28',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.3.28',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.3.28',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.3.28',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
8
8
  version: '7.3.28',
9
9
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
10
  extensions: {
11
- gd: {},
11
+ gd: {
12
+ macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
13
+ },
12
14
  intl: {},
13
15
  zlib: {},
14
16
  openssl: {},
@@ -0,0 +1,47 @@
1
+ const path = require('path');
2
+ const { defaultMagentoConfig } = require('../magento-config');
3
+
4
+ module.exports = ({ templateDir } = {}) => ({
5
+ magentoVersion: '2.3.7-p2',
6
+ configuration: {
7
+ php: {
8
+ version: '7.4.27',
9
+ configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
+ extensions: {
11
+ gd: {},
12
+ intl: {},
13
+ zlib: {},
14
+ openssl: {},
15
+ sockets: {},
16
+ SimpleXML: {},
17
+ xdebug: {
18
+ version: '3.1.2'
19
+ }
20
+ }
21
+ },
22
+ nginx: {
23
+ version: '1.18.0',
24
+ configTemplate: path.join(templateDir || '', 'nginx.template.conf')
25
+ },
26
+ redis: {
27
+ version: '6'
28
+ },
29
+ mysql: {
30
+ version: '5.7'
31
+ },
32
+ mariadb: {
33
+ version: '10.2'
34
+ },
35
+ elasticsearch: {
36
+ version: '7.9.3'
37
+ },
38
+ composer: {
39
+ version: '2'
40
+ }
41
+ },
42
+ magento: defaultMagentoConfig,
43
+ host: 'localhost',
44
+ ssl: {
45
+ enabled: false
46
+ }
47
+ });
@@ -0,0 +1,47 @@
1
+ const path = require('path');
2
+ const { defaultMagentoConfig } = require('../magento-config');
3
+
4
+ module.exports = ({ templateDir } = {}) => ({
5
+ magentoVersion: '2.3.7-p3',
6
+ configuration: {
7
+ php: {
8
+ version: '7.4.27',
9
+ configTemplate: path.join(templateDir || '', 'php.template.ini'),
10
+ extensions: {
11
+ gd: {},
12
+ intl: {},
13
+ zlib: {},
14
+ openssl: {},
15
+ sockets: {},
16
+ SimpleXML: {},
17
+ xdebug: {
18
+ version: '3.1.2'
19
+ }
20
+ }
21
+ },
22
+ nginx: {
23
+ version: '1.18.0',
24
+ configTemplate: path.join(templateDir || '', 'nginx.template.conf')
25
+ },
26
+ redis: {
27
+ version: '6'
28
+ },
29
+ mysql: {
30
+ version: '5.7'
31
+ },
32
+ mariadb: {
33
+ version: '10.2'
34
+ },
35
+ elasticsearch: {
36
+ version: '7.9.3'
37
+ },
38
+ composer: {
39
+ version: '2'
40
+ }
41
+ },
42
+ magento: defaultMagentoConfig,
43
+ host: 'localhost',
44
+ ssl: {
45
+ enabled: false
46
+ }
47
+ });
@@ -0,0 +1,51 @@
1
+ const path = require('path');
2
+ const { defaultMagentoConfig } = require('../magento-config');
3
+ const { libsodium } = require('../php/extensions');
4
+
5
+ module.exports = ({ templateDir } = {}) => ({
6
+ magentoVersion: '2.4.3-p2',
7
+ isDefault: true,
8
+ configuration: {
9
+ php: {
10
+ version: '7.4.27',
11
+ configTemplate: path.join(templateDir || '', 'php.template.ini'),
12
+ extensions: {
13
+ gd: {},
14
+ intl: {},
15
+ zlib: {},
16
+ openssl: {},
17
+ sockets: {},
18
+ SimpleXML: {},
19
+ libsodium,
20
+ fileinfo: {},
21
+ xdebug: {
22
+ version: '3.1.2'
23
+ }
24
+ }
25
+ },
26
+ nginx: {
27
+ version: '1.18.0',
28
+ configTemplate: path.join(templateDir || '', 'nginx.template.conf')
29
+ },
30
+ redis: {
31
+ version: '6.0'
32
+ },
33
+ mysql: {
34
+ version: '8.0'
35
+ },
36
+ mariadb: {
37
+ version: '10.4'
38
+ },
39
+ elasticsearch: {
40
+ version: '7.12.1'
41
+ },
42
+ composer: {
43
+ version: '2'
44
+ }
45
+ },
46
+ magento: defaultMagentoConfig,
47
+ host: 'localhost',
48
+ ssl: {
49
+ enabled: false
50
+ }
51
+ });
@@ -0,0 +1,51 @@
1
+ const path = require('path');
2
+ const { defaultMagentoConfig } = require('../magento-config');
3
+ const { libsodium } = require('../php/extensions');
4
+
5
+ module.exports = ({ templateDir } = {}) => ({
6
+ magentoVersion: '2.4.4',
7
+ isDefault: true,
8
+ configuration: {
9
+ php: {
10
+ version: '8.1.4',
11
+ configTemplate: path.join(templateDir || '', 'php.template.ini'),
12
+ extensions: {
13
+ gd: {},
14
+ intl: {},
15
+ zlib: {},
16
+ openssl: {},
17
+ sockets: {},
18
+ SimpleXML: {},
19
+ libsodium,
20
+ fileinfo: {},
21
+ xdebug: {
22
+ version: '3.1.4'
23
+ }
24
+ }
25
+ },
26
+ nginx: {
27
+ version: '1.18.0',
28
+ configTemplate: path.join(templateDir || '', 'nginx.template.conf')
29
+ },
30
+ redis: {
31
+ version: '6.0'
32
+ },
33
+ mysql: {
34
+ version: '8.0'
35
+ },
36
+ mariadb: {
37
+ version: '10.4'
38
+ },
39
+ elasticsearch: {
40
+ version: '7.16.3'
41
+ },
42
+ composer: {
43
+ version: '2'
44
+ }
45
+ },
46
+ magento: defaultMagentoConfig,
47
+ host: 'localhost',
48
+ ssl: {
49
+ enabled: false
50
+ }
51
+ });
@@ -17,7 +17,7 @@ const getComposerVersion = async ({ composer, php }) => {
17
17
 
18
18
  const composerVersion = safeRegexExtract({
19
19
  string: composerVersionOutput,
20
- regex: /Composer version ([\d.]+)/i,
20
+ regex: /composer.+(\d+\.\d+\.\d+)/i,
21
21
  onNoMatch: () => {
22
22
  throw new Error(`
23
23
  No composer version found in composer version output!\n\n${composerVersionOutput}
@@ -1,8 +1,22 @@
1
+ /* eslint-disable max-len */
1
2
  const { execAsyncSpawn } = require('../../util/exec-async-command');
2
3
 
4
+ /**
5
+ * @param {Object} options
6
+ * @param {number[]} [options.ports] Publish or expose port [docs](https://docs.docker.com/engine/reference/commandline/run/#publish-or-expose-port--p---expose)
7
+ * @param {number[]} [options.mounts] Add bind mounts or volumes using the --mount flag [docs](https://docs.docker.com/engine/reference/commandline/run/#add-bind-mounts-or-volumes-using-the---mount-flag)
8
+ * @param {number[]} [options.mountVolumes] Mount volume [docs](https://docs.docker.com/engine/reference/commandline/run/#mount-volume--v---read-only)
9
+ * @param {Record<string, string>} [options.env] Set environment variables [docs](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file)
10
+ * @param {string} [options.image]
11
+ * @param {string} [options.restart] Restart policies [docs](https://docs.docker.com/engine/reference/commandline/run/#restart-policies---restart)
12
+ * @param {string} [options.name] Container name
13
+ * @param {string} [options.entrypoint] Container entrypoint
14
+ * @param {string} [options.command] Container command
15
+ * @param {Record<"cmd" | "interval" | "retries" | "start-period" | "timeout", string>} [options.healthCheck] Container heathcheck properties
16
+ * @param {string[]} [options.securityOptions] Security options [docs](https://docs.docker.com/engine/reference/commandline/run/#optional-security-options---security-opt)
17
+ */
3
18
  const run = (options) => {
4
19
  const {
5
- expose = [],
6
20
  ports = [],
7
21
  mounts = [],
8
22
  mountVolumes = [],
@@ -19,7 +33,6 @@ const run = (options) => {
19
33
 
20
34
  const restartArg = restart && `--restart ${ restart }`;
21
35
  const networkArg = network && `--network ${ network }`;
22
- const exposeArgs = expose.map((port) => `--expose ${ port }`).join(' ');
23
36
  const portsArgs = ports.map((port) => `-p ${ port }`).join(' ');
24
37
  const mountsArgs = mounts.map((mount) => `--mount ${ mount }`).join(' ');
25
38
  const mountVolumesArgs = mountVolumes.map((mount) => `-v ${mount}`).join(' ');
@@ -36,7 +49,6 @@ const run = (options) => {
36
49
  nameArg,
37
50
  networkArg,
38
51
  restartArg,
39
- exposeArgs,
40
52
  portsArgs,
41
53
  mountsArgs,
42
54
  mountVolumesArgs,
@@ -139,7 +151,7 @@ const stopContainers = () => ({
139
151
 
140
152
  const getContainerStatus = async (containerName) => {
141
153
  try {
142
- return JSON.parse(await execAsyncSpawn(`docker inspect --format='{{json .State.Health}}' ${containerName}`));
154
+ return JSON.parse(await execAsyncSpawn(`docker inspect --format='{{json .State}}' ${containerName}`));
143
155
  } catch {
144
156
  return null;
145
157
  }
@@ -11,8 +11,9 @@ module.exports = () => ({
11
11
  config: { overridenConfiguration: { host, ssl } },
12
12
  mysqlConnection
13
13
  } = ctx;
14
+ const isNgrok = host.endsWith('ngrok.io');
14
15
  const enableSecureFrontend = ssl.enabled ? '1' : '0';
15
- const location = `${host}${ ports.app !== 80 ? `:${ports.app}` : '' }/`;
16
+ const location = `${host}${ !isNgrok && ports.app !== 80 ? `:${ports.app}` : '' }/`;
16
17
  const secureLocation = `${host}/`; // SSL will work only on port 443, so you cannot run multiple projects with SSL at the same time.
17
18
  const httpUrl = `http://${location}`;
18
19
  const httpsUrl = `https://${secureLocation}`;
@@ -44,7 +44,7 @@ const compileOptions = {
44
44
  '+bz2="$(brew --prefix bzip2)"',
45
45
  '+bcmath',
46
46
  '+ctype',
47
- '+curl=$(brew --prefix curl-openssl)',
47
+ '+curl=$(brew --prefix curl)',
48
48
  '+intl=$(brew --prefix icu4c)',
49
49
  '+dom',
50
50
  '+filter',
@@ -70,11 +70,12 @@ const compileOptions = {
70
70
  ],
71
71
  env: {
72
72
  // eslint-disable-next-line max-len
73
- PKG_CONFIG_PATH: '$PKG_CONFIG_PATH:$(brew --prefix libxml2)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix openssl@1.1)/lib/pkgconfig:$(brew --prefix curl-openssl@1.1)/lib/pkgconfig:$(brew --prefix zlib)/lib/pkgconfig',
73
+ PKG_CONFIG_PATH: '$PKG_CONFIG_PATH:$(brew --prefix libxml2)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix openssl@1.1)/lib/pkgconfig:$(brew --prefix curl)/lib/pkgconfig:$(brew --prefix zlib)/lib/pkgconfig',
74
74
  CPATH: '$CPATH:$(brew --prefix openssl@1.1)/include',
75
75
  CXX: 'g++ -DTRUE=1 -DFALSE=0',
76
76
  CC: 'gcc -DTRUE=1 -DFALSE=0',
77
- LDFLAGS: '$(brew --prefix openssl@1.1)/lib/libssl.dylib $(brew --prefix openssl@1.1)/lib/libcrypto.dylib'
77
+ LDFLAGS: '$(brew --prefix openssl@1.1)/lib/libssl.dylib $(brew --prefix openssl@1.1)/lib/libcrypto.dylib',
78
+ CFLAGS: '-Wno-implicit-function-declaration' // https://github.com/phpbrew/phpbrew/issues/1222
78
79
  }
79
80
  }
80
81
  };
@@ -16,7 +16,7 @@ const compile = () => ({
16
16
  platformCompileOptions.extraOptions.push('--with-libdir=lib64');
17
17
  }
18
18
  }
19
- const commandEnv = Object.entries(platformCompileOptions.env || {}).map(([key, value]) => `${key}="${value}"`).join(' && ');
19
+ const commandEnv = Object.entries(platformCompileOptions.env || {}).map(([key, value]) => `export ${key}="${value}"`).join(' && ');
20
20
  const phpCompileCommand = `${commandEnv ? `${commandEnv} && ` : ''} \
21
21
  phpbrew install -j ${platformCompileOptions.cpuCount} ${php.version} ${platformCompileOptions.variants.join(' ')} \
22
22
  -- ${platformCompileOptions.extraOptions.join(' ')}`;
@@ -1,4 +1,5 @@
1
1
  const fs = require('fs');
2
+ const path = require('path');
2
3
  const logger = require('@scandipwa/scandipwa-dev-utils/logger');
3
4
  const pathExists = require('../../util/path-exists');
4
5
  const compile = require('./compile');
@@ -24,15 +25,28 @@ const installPhp = () => ({
24
25
  task.title = `Installing PHP ${php.version}`;
25
26
 
26
27
  try {
27
- const hasPHPVersion = (
28
- await fs.promises.readdir(phpbrewConfig.phpPath, {
29
- encoding: 'utf-8',
30
- withFileTypes: true
31
- })
32
- )
33
- .some((f) => f.isDirectory() && f.name === `php-${php.version}`);
28
+ const hasPHPVersionDirectory = (
29
+ await Promise.all(
30
+ (
31
+ await fs.promises.readdir(phpbrewConfig.phpPath, {
32
+ encoding: 'utf-8',
33
+ withFileTypes: true
34
+ })
35
+ ).map(async (f) => {
36
+ if (!f.isDirectory()) {
37
+ return false;
38
+ }
34
39
 
35
- if (hasPHPVersion && !recompilePhp) {
40
+ if (f.name !== `php-${php.version}`) {
41
+ return false;
42
+ }
43
+
44
+ return pathExists(path.join(phpbrewConfig.phpPath, f.name, 'bin', 'php'));
45
+ })
46
+ ))
47
+ .includes(true);
48
+
49
+ if (hasPHPVersionDirectory && !recompilePhp) {
36
50
  task.skip();
37
51
  // eslint-disable-next-line consistent-return
38
52
  return;