@scandipwa/magento-scripts 1.12.0 → 1.12.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.
Files changed (47) hide show
  1. package/.eslintrc +0 -0
  2. package/LICENSE +0 -0
  3. package/lib/config/php-config.js +0 -0
  4. package/lib/config/phpbrew.js +12 -0
  5. package/lib/config/save-config.js +0 -0
  6. package/lib/config/templates/cma-config.template.js +0 -0
  7. package/lib/config/templates/magentorc.template +0 -0
  8. package/lib/config/templates/php-fpm.template.conf +0 -0
  9. package/lib/tasks/cache/index.js +0 -0
  10. package/lib/tasks/cli/index.js +0 -0
  11. package/lib/tasks/execute/index.js +0 -0
  12. package/lib/tasks/magento/index.js +0 -0
  13. package/lib/tasks/magento/setup-magento/adjust-magento-configuration.js +0 -0
  14. package/lib/tasks/magento/setup-magento/configure-elasticsearch.js +0 -0
  15. package/lib/tasks/magento/setup-magento/create-admin.js +0 -0
  16. package/lib/tasks/magento/setup-magento/delete-admin-users.js +0 -0
  17. package/lib/tasks/magento/setup-magento/flush-redis-config.js +0 -0
  18. package/lib/tasks/magento/setup-magento/increase-admin-session-lifetime.js +0 -0
  19. package/lib/tasks/magento/setup-magento/set-base-url.js +0 -0
  20. package/lib/tasks/magento/setup-magento/set-deployment-mode.js +0 -0
  21. package/lib/tasks/magento/setup-magento/set-url-rewrite.js +0 -0
  22. package/lib/tasks/magento/setup-magento/waiting-for-redis.js +0 -0
  23. package/lib/tasks/mysql/index.js +0 -0
  24. package/lib/tasks/php/configure.js +28 -3
  25. package/lib/tasks/php/update-phpbrew.js +0 -0
  26. package/lib/tasks/php-fpm/index.js +0 -0
  27. package/lib/tasks/requirements/dependency/arch.js +0 -0
  28. package/lib/tasks/requirements/dependency/centos.js +0 -0
  29. package/lib/tasks/requirements/dependency/fedora.js +0 -0
  30. package/lib/tasks/requirements/dependency/index.js +0 -0
  31. package/lib/tasks/requirements/dependency/mac.js +0 -0
  32. package/lib/tasks/requirements/dependency/ubuntu.js +0 -0
  33. package/lib/util/clean-object.js +0 -0
  34. package/lib/util/download-file.js +0 -0
  35. package/lib/util/ip.js +0 -0
  36. package/lib/util/match-filesystem.js +0 -0
  37. package/lib/util/move-file.js +0 -0
  38. package/lib/util/path-exists-sync.js +0 -0
  39. package/lib/util/portscanner.js +0 -0
  40. package/lib/util/run-composer.js +0 -0
  41. package/lib/util/run-magento.js +0 -0
  42. package/lib/util/run-php.js +0 -0
  43. package/lib/util/set-config.js +0 -0
  44. package/lib/util/sleep.js +0 -0
  45. package/lib/util/wait-for-it.js +0 -0
  46. package/lib/util/wait-for-logs.js +0 -0
  47. package/package.json +2 -2
package/.eslintrc CHANGED
File without changes
package/LICENSE CHANGED
File without changes
File without changes
@@ -0,0 +1,12 @@
1
+ const os = require('os');
2
+ const path = require('path');
3
+
4
+ const homePath = process.env.PHPBREW_HOME || os.homedir();
5
+ const phpbrewConfig = {
6
+ homePath,
7
+ buildPath: path.join(homePath, 'build'),
8
+ phpPath: path.join(homePath, 'php'),
9
+ bashrcPath: path.join(homePath, 'bashrc')
10
+ };
11
+
12
+ module.exports = phpbrewConfig;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,11 +1,12 @@
1
1
  /* eslint-disable max-len */
2
2
  const path = require('path');
3
- const os = require('os');
4
3
  const fs = require('fs');
5
4
  const { execAsyncSpawn } = require('../../util/exec-async-command');
5
+ const pathExists = require('../../util/path-exists');
6
6
  const enableExtension = require('./extensions/enable');
7
7
  const installExtension = require('./extensions/install');
8
8
  const disableExtension = require('./extensions/disable');
9
+ const phpbrewConfig = require('../../config/phpbrew');
9
10
 
10
11
  /**
11
12
  * Get enabled extensions list with versions
@@ -28,13 +29,36 @@ const getEnabledExtensions = async ({ php }) => {
28
29
  .reduce((acc, [name, version]) => ({ ...acc, [name]: version }), {});
29
30
  };
30
31
 
32
+ /**
33
+ * Get disabled extensions list
34
+ * @param {import('../../../typings/context').ListrContext['config']} param0
35
+ * @returns {Promise<string[]>}
36
+ */
37
+ const getDisabledExtensions = async ({ php }) => {
38
+ const extensionsIniDirectory = path.join(phpbrewConfig.phpPath, `php-${php.version}`, 'var', 'db');
39
+
40
+ if (!await pathExists(extensionsIniDirectory)) {
41
+ return [];
42
+ }
43
+
44
+ const extensionIniList = await fs.promises.readdir(
45
+ extensionsIniDirectory,
46
+ {
47
+ encoding: 'utf-8',
48
+ withFileTypes: true
49
+ }
50
+ );
51
+
52
+ return extensionIniList.filter((f) => f.isFile() && f.name.endsWith('.disabled')).map((f) => f.name.replace('.disabled', ''));
53
+ };
54
+
31
55
  /**
32
56
  * Get installed extensions
33
57
  * @param {import('../../../typings/context').ListrContext['config']} param0
34
58
  * @returns {Promise<string[]>}
35
59
  */
36
60
  const getInstalledExtensions = async ({ php }) => {
37
- const extensionDirectory = path.join(os.homedir(), '.phpbrew', 'build', `php-${php.version}`, 'ext');
61
+ const extensionDirectory = path.join(phpbrewConfig.buildPath, `php-${php.version}`, 'ext');
38
62
 
39
63
  const availableExtensions = await fs.promises.readdir(extensionDirectory, {
40
64
  encoding: 'utf-8'
@@ -52,6 +76,7 @@ const configure = () => ({
52
76
  const { php, php: { disabledExtensions = [] } } = config;
53
77
  const enabledExtensions = await getEnabledExtensions(config);
54
78
  const installedExtensions = await getInstalledExtensions(config);
79
+ const disabledExtensionsInPHP = await getDisabledExtensions(config);
55
80
 
56
81
  if (!debug && enabledExtensions.xdebug && !disabledExtensions.includes('xdebug')) {
57
82
  disabledExtensions.push('xdebug');
@@ -86,7 +111,7 @@ const configure = () => ({
86
111
 
87
112
  if (missingExtensions.length > 0) {
88
113
  missingExtensions.forEach(([extensionName, extensionOptions]) => {
89
- if (installedExtensions.includes(extensionName)) {
114
+ if (installedExtensions.includes(extensionName) && disabledExtensionsInPHP.includes(extensionName)) {
90
115
  extensionTasks.push(enableExtension(extensionName, extensionOptions));
91
116
  } else {
92
117
  extensionTasks.push(installExtension(extensionName, extensionOptions));
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/util/ip.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/util/sleep.js CHANGED
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Scripts and configuration used by CMA.",
4
4
  "homepage": "https://docs.create-magento-app.com/",
5
5
  "repository": "github:scandipwa/create-magento-app",
6
- "version": "1.12.0",
6
+ "version": "1.12.1",
7
7
  "main": "./index.js",
8
8
  "types": "./typings/index.d.ts",
9
9
  "license": "OSL-3.0",
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "24e277b08147a61ac53ae974895135d27668a9ca"
45
+ "gitHead": "079d0a72e1abeaaa3b529406c328ce2aa0d224d7"
46
46
  }