|
1 #!/usr/bin/env php |
|
2 <?php |
|
3 |
|
4 /* |
|
5 * This file is part of the Symfony framework. |
|
6 * |
|
7 * (c) Fabien Potencier <fabien@symfony.com> |
|
8 * |
|
9 * For the full copyright and license information, please view the LICENSE |
|
10 * file that was distributed with this source code. |
|
11 */ |
|
12 |
|
13 /* |
|
14 |
|
15 CAUTION: This file installs the dependencies needed to run the Symfony2 test suite. |
|
16 If you want to create a new project, download the Symfony Standard Edition instead: |
|
17 |
|
18 http://symfony.com/download |
|
19 |
|
20 */ |
|
21 |
|
22 if (!is_dir($vendorDir = dirname(__FILE__).'/vendor')) { |
|
23 mkdir($vendorDir, 0777, true); |
|
24 } |
|
25 |
|
26 $deps = array( |
|
27 array('doctrine', 'http://github.com/doctrine/doctrine2.git', '2.1.1'), |
|
28 array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', '2.1.1'), |
|
29 array('doctrine-common', 'http://github.com/doctrine/common.git', '2.1.1'), |
|
30 array('monolog', 'http://github.com/Seldaek/monolog.git', '1.0.1'), |
|
31 array('swiftmailer', 'http://github.com/swiftmailer/swiftmailer.git', 'v4.1.1'), |
|
32 array('twig', 'http://github.com/fabpot/Twig.git', 'v1.1.2'), |
|
33 ); |
|
34 |
|
35 foreach ($deps as $dep) { |
|
36 list($name, $url, $rev) = $dep; |
|
37 |
|
38 echo "> Installing/Updating $name\n"; |
|
39 |
|
40 $installDir = $vendorDir.'/'.$name; |
|
41 if (!is_dir($installDir)) { |
|
42 system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir))); |
|
43 } |
|
44 |
|
45 system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev))); |
|
46 } |