-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.php
51 lines (41 loc) · 1.25 KB
/
build.php
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
<?php declare(strict_types = 1);
$sources = [
'https://packagist.org/packages/list.json?vendor=contributte&fields[]=abandoned&fields[]=type',
'https://packagist.org/packages/list.json?vendor=nettrine&fields[]=abandoned&fields[]=type',
];
$skipped = [
// TODO
'nettrine/extensions-knplabs',
];
$dependencies = ['php' => '>=8.2'];
foreach ($sources as $source) {
$data = (array) json_decode(file_get_contents($source), true);
foreach ($data['packages'] as $package => $meta) {
// Skip abandoned
if ($meta['abandoned'] !== false) continue;
// Skip other than library
if ($meta['type'] !== 'library') continue;
// Skip skipped
if (in_array($package, $skipped)) continue;
$dependencies[$package] = '*';
}
}
$composer = [
"repositories" => [
["type" => "git", "url" => "https://github.com/holyfork/facebook-graph-sdk"],
],
'require' => $dependencies,
'conflict' => [
'mpdf/psr-http-message-shim' => '^2.0',
],
'minimum-stability' => 'dev',
'prefer-stable' => true,
'config' => [
'sort-packages' => true,
'allow-plugins' => [
'php-http/discovery' => true,
'dealerdirect/phpcodesniffer-composer-installer' => false,
],
],
];
file_put_contents('composer.json', json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n");