dependabot-composer 0.98.15 → 0.98.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edb69ccc5b37b511d71ad19133980ca3f8c6af5a908c58cb960b8550bed8c420
4
- data.tar.gz: 5dfe9f7929c2adca37b7347ce11b654cc6174a3f3ab7113d20b57b3e6af3af1f
3
+ metadata.gz: dd7e8ff47d423afb00e3e7019c0ac804e37deb0d7bd7ffa0f5b5ac97bf614335
4
+ data.tar.gz: 920c9f4ccbc95ffdc1e2a657d87496377e03cfd915ef876a56fa8bbef69b3519
5
5
  SHA512:
6
- metadata.gz: 295596a3cbbba4c9e9754756aeec51a4f526c8eb71255bfc709d94f7e0df29821a5f6b2206fe87b2d7f74f0065a6538cd5486d60f05495b54e0fed21350dd40d
7
- data.tar.gz: e8a76d448d0aa590c929a18922b260e9fd44021ae2a2d7d920563450592e667f82f2e4827e482ce15bc061625e21e4e810cb7d46ae441b520946edd633476fc6
6
+ metadata.gz: 28accfc3dd3d00903a6291b87fc1f0c52a03c46531efab3487855f6e7f1c47720c2182d0ff8a8e4ee0e7b6a5047fd649e277618a481133a811ce20fc3369a893
7
+ data.tar.gz: 6103d756d62f11037be891f68ffa1260fd244ad0e68e46c44c816b28a28195a3fe37c334958388c5afe51100364bfc61a47445761fff391e58b2963ba542bef8
@@ -11,38 +11,34 @@ require __DIR__ . '/../vendor/autoload.php';
11
11
  // and an `args` method, as passed in by UpdateCheckers::Php
12
12
  $request = json_decode(file_get_contents('php://stdin'), true);
13
13
 
14
- // Increase the default memory limit. Calling `composer update` is otherwise
15
- // vulnerable to scenarios where there are unconstrained versions, resulting in
16
- // it checking huge numbers of dependency combinations and causing OOM issues.
17
- // This logic is a duplicate of the logic found in Composer
18
- $memoryInBytes = function ($value) {
19
- $unit = strtolower(substr($value, -1, 1));
20
- $value = (int) $value;
21
- switch ($unit) {
22
- case 'g':
14
+ // Increase the default memory limit the same way Composer does (but clearer)
15
+ if (function_exists('ini_set')) {
16
+ $memoryInBytes = function ($value) {
17
+ $unit = strtolower(substr($value, -1, 1));
18
+ $value = (int) $value;
19
+ if ($unit == 'g') {
20
+ $value *= (1024 * 1024 * 1024);
21
+ } elseif ($unit == 'm') {
22
+ $value *= (1024 * 1024);
23
+ } elseif ($unit == 'k') {
23
24
  $value *= 1024;
24
- // no break (cumulative multiplier)
25
- case 'm':
26
- $value *= 1024;
27
- // no break (cumulative multiplier)
28
- case 'k':
29
- $value *= 1024;
30
- }
25
+ }
31
26
 
32
- return $value;
33
- };
27
+ return $value;
28
+ };
34
29
 
35
- $memoryLimit = trim(ini_get('memory_limit'));
36
- // Increase memory_limit if it is lower than 1900MB
37
- if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1900) {
38
- ini_set('memory_limit', '1900M');
39
- }
30
+ $memoryLimit = trim(ini_get('memory_limit'));
31
+ // Increase memory_limit if it is lower than 1900MB
32
+ if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1900) {
33
+ @ini_set('memory_limit', '1900M');
34
+ }
40
35
 
41
- // Set user defined memory limit
42
- if ($memoryLimit = getenv('COMPOSER_MEMORY_LIMIT')) {
43
- ini_set('memory_limit', $memoryLimit);
36
+ // Set user defined memory limit
37
+ if ($memoryLimit = getenv('COMPOSER_MEMORY_LIMIT')) {
38
+ @ini_set('memory_limit', $memoryLimit);
39
+ }
40
+ unset($memoryInBytes, $memoryLimit);
44
41
  }
45
- unset($memoryInBytes, $memoryLimit);
46
42
 
47
43
  date_default_timezone_set('Europe/London');
48
44
 
@@ -69,11 +69,15 @@ class UpdateChecker
69
69
  ->setRunScripts(false);
70
70
 
71
71
  /*
72
- * If a platform is set we assume people know what they are doing and we respect the setting.
73
- * If no platform is set we ignore it so that the php we run as doesn't interfere
72
+ * If a platform is set we assume people know what they are doing and
73
+ * we respect the setting.
74
+ * If no platform is set we ignore it so that the php we run as doesn't
75
+ * interfere with resolution.
74
76
  */
75
77
  if ($config->get('platform') === []) {
76
78
  $install->setIgnorePlatformRequirements(true);
79
+ } else {
80
+ $install->setIgnorePlatformRequirements(false);
77
81
  }
78
82
 
79
83
  $install->run();
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-composer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.98.15
4
+ version: 0.98.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.98.15
19
+ version: 0.98.16
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.98.15
26
+ version: 0.98.16
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement