-
Notifications
You must be signed in to change notification settings - Fork 3
/
vendors.php
57 lines (48 loc) · 2.61 KB
/
vendors.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
51
52
53
54
55
56
57
<?php
set_time_limit(0);
if (!is_dir($vendorDir = __DIR__.'/vendor')) {
mkdir($vendorDir, 0777, true);
}
$deps = array(
array('symfony', 'https://github.com/symfony/symfony', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/2.0'),
array('twig', 'https://github.com/fabpot/Twig', 'origin/master'),
array('pagerfanta', 'https://github.com/whiteoctober/Pagerfanta', 'origin/master'),
array('assetic', 'https://github.com/kriswallsmith/assetic', 'origin/master'),
array('molino', 'https://github.com/pablodip/molino', 'origin/master'),
array('mondator', 'https://github.com/mandango/mondator', 'origin/master'),
array('mandango', 'https://github.com/mandango/mandango', 'origin/master'),
array('doctrine-common', 'https://github.com/doctrine/common', 'origin/master'),
array('doctrine-dbal', 'https://github.com/doctrine/dbal', 'origin/master'),
array('doctrine-orm', 'https://github.com/doctrine/doctrine2', 'origin/master'),
array('doctrine-mongodb', 'https://github.com/doctrine/mongodb', 'origin/master'),
array('doctrine-mongodb-odm', 'https://github.com/doctrine/mongodb-odm', 'origin/master'),
array('metadata', 'https://github.com/schmittjoh/metadata', 'origin/master'),
array('pagerfanta-bundle', 'https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle', 'origin/symfony2.0', 'bundles/WhiteOctober/PagerfantaBundle'),
array('assetic-bundle', 'https://github.com/symfony/AsseticBundle', 'origin/master', 'bundles/Symfony/Bundle/AsseticBundle'),
array('mandango-bundle', 'https://github.com/mandango/MandangoBundle', 'origin/master', 'bundles/Mandango/MandangoBundle'),
//array('doctrine-bundle', 'https://github.com/doctrine/DoctrineBundle', 'origin/master', 'bundles/Doctrine/Bundle/DoctrineBundle'),
array('pablodip-module-bundle', 'https://github.com/pablodip/PablodipModuleBundle', 'origin/master', 'bundles/Pablodip/ModuleBundle'),
);
foreach ($deps as $dep) {
if (3 === count($dep)) {
list($name, $url, $rev) = $dep;
$target = null;
} else {
list($name, $url, $rev, $target) = $dep;
}
if (null !== $target) {
$installDir = $vendorDir.'/'.$target;
} else {
$installDir = $vendorDir.'/'.$name;
}
$install = false;
if (!is_dir($installDir)) {
$install = true;
echo "> Installing $name\n";
system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir)));
}
if (!$install) {
echo "> Updating $name\n";
}
system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
}