-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvendors.php
36 lines (30 loc) · 1.26 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
<?php
/*
* Copyright Cameron Manderson (c) 2011 All rights reserved.
* Date: 29/08/11
* @author camm ([email protected])
*/
if (!is_dir($vendorDir = dirname(__FILE__).'/vendor')) {
mkdir($vendorDir, 0777, true);
}
$deps = array(
array('symfony', 'http://github.com/symfony/symfony.git', 'v2.0.0'),
array('doctrine', 'http://github.com/doctrine/doctrine2.git', '2.1.0'),
array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', '2.1.0'),
array('doctrine-common', 'http://github.com/doctrine/common.git', '2.1.0'),
array('doctrine-extensions', 'https://github.com/l3pp4rd/DoctrineExtensions.git'),
array('doctrine-fixtures', 'http://github.com/doctrine/data-fixtures.git'),
);
foreach ($deps as $dep) {
list($name, $url, $rev) = $dep;
echo "> Installing/Updating $name\n";
$installDir = $vendorDir.'/'.$name;
if (!is_dir($installDir)) {
system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir)));
}
if ($rev) {
system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
} else {
system(sprintf('cd %s && git fetch origin', escapeshellarg($installDir), escapeshellarg($rev)));
}
}