forked from Sylius/Sylius
-
Notifications
You must be signed in to change notification settings - Fork 0
/
require-symfony-version
executable file
·74 lines (68 loc) · 1.88 KB
/
require-symfony-version
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env php
<?php
$packages = [
'symfony/asset',
'symfony/browser-kit',
'symfony/cache',
'symfony/config',
'symfony/console',
'symfony/css-selector',
'symfony/debug',
'symfony/debug-bundle',
'symfony/dependency-injection',
'symfony/doctrine-bridge',
'symfony/dom-crawler',
'symfony/event-dispatcher',
'symfony/expression-language',
'symfony/filesystem',
'symfony/finder',
'symfony/form',
'symfony/framework-bundle',
'symfony/http-foundation',
'symfony/http-kernel',
'symfony/inflector',
'symfony/intl',
'symfony/ldap',
'symfony/lock',
'symfony/messenger',
'symfony/monolog-bridge',
'symfony/options-resolver',
'symfony/process',
'symfony/property-access',
'symfony/property-info',
'symfony/proxy-manager-bridge',
'symfony/routing',
'symfony/security',
'symfony/security-bundle',
'symfony/security-core',
'symfony/security-csrf',
'symfony/security-guard',
'symfony/security-http',
'symfony/serializer',
'symfony/stopwatch',
'symfony/symfony',
'symfony/templating',
'symfony/translation',
'symfony/twig-bridge',
'symfony/twig-bundle',
'symfony/validator',
'symfony/var-dumper',
'symfony/web-link',
'symfony/web-profiler-bundle',
'symfony/web-server-bundle',
'symfony/workflow',
];
$path = $argv[1];
$version = $argv[2];
$contents = json_decode(file_get_contents($path), true);
foreach ($contents['require'] ?? [] as $key => $value) {
if (in_array($key, $packages, true)) {
$contents['require'][$key] = $version;
}
}
foreach ($contents['require-dev'] ?? [] as $key => $value) {
if (in_array($key, $packages, true)) {
$contents['require-dev'][$key] = $version;
}
}
file_put_contents($path, json_encode($contents, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));