2011-05-23 15:01:21 +01:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the Symfony framework.
|
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2011-05-24 16:27:37 +01:00
|
|
|
/*
|
|
|
|
|
|
|
|
CAUTION: This file installs the dependencies needed to run the Symfony2 test suite.
|
|
|
|
If you want to create a new project, download the Symfony Standard Edition instead:
|
|
|
|
|
|
|
|
http://symfony.com/download
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2011-09-28 07:30:05 +01:00
|
|
|
set_time_limit(0);
|
|
|
|
|
2011-05-23 15:01:21 +01:00
|
|
|
if (!is_dir($vendorDir = dirname(__FILE__).'/vendor')) {
|
|
|
|
mkdir($vendorDir, 0777, true);
|
|
|
|
}
|
|
|
|
|
2011-11-16 02:41:56 +00:00
|
|
|
// optional transport change
|
|
|
|
$transport = false;
|
|
|
|
if (isset($argv[1]) && in_array($argv[1], array('--transport=http', '--transport=https', '--transport=git'))) {
|
|
|
|
$transport = preg_replace('/^--transport=(.*)$/', '$1', $argv[1]);
|
|
|
|
}
|
|
|
|
|
2011-05-23 15:01:21 +01:00
|
|
|
$deps = array(
|
2011-10-11 18:26:57 +01:00
|
|
|
array('doctrine', 'http://github.com/doctrine/doctrine2.git', 'origin/master'),
|
2011-10-15 02:39:29 +01:00
|
|
|
array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', 'origin/master'),
|
2011-10-11 18:24:58 +01:00
|
|
|
array('doctrine-common', 'http://github.com/doctrine/common.git', 'origin/master'),
|
2011-10-27 05:56:14 +01:00
|
|
|
array('monolog', 'http://github.com/Seldaek/monolog.git', '1.0.2'),
|
2011-10-24 16:11:00 +01:00
|
|
|
array('swiftmailer', 'http://github.com/swiftmailer/swiftmailer.git', 'origin/master'),
|
2011-10-16 10:18:01 +01:00
|
|
|
array('twig', 'http://github.com/fabpot/Twig.git', 'origin/master'),
|
2011-05-23 15:01:21 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
foreach ($deps as $dep) {
|
|
|
|
list($name, $url, $rev) = $dep;
|
2011-11-16 02:41:56 +00:00
|
|
|
|
|
|
|
if ($transport) {
|
|
|
|
$url = preg_replace('/^(http:|https:|git:)(.*)/', $transport . ':$2', $url);
|
|
|
|
}
|
2011-05-23 15:01:21 +01:00
|
|
|
|
|
|
|
$installDir = $vendorDir.'/'.$name;
|
2011-09-02 08:22:14 +01:00
|
|
|
$install = false;
|
2011-05-23 15:01:21 +01:00
|
|
|
if (!is_dir($installDir)) {
|
2011-09-02 08:22:14 +01:00
|
|
|
$install = true;
|
|
|
|
echo "> Installing $name\n";
|
|
|
|
|
2011-06-10 16:57:54 +01:00
|
|
|
system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir)));
|
2011-05-23 15:01:21 +01:00
|
|
|
}
|
|
|
|
|
2011-09-02 08:22:14 +01:00
|
|
|
if (!$install) {
|
|
|
|
echo "> Updating $name\n";
|
|
|
|
}
|
|
|
|
|
2011-06-10 16:57:54 +01:00
|
|
|
system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
|
2011-05-23 15:01:21 +01:00
|
|
|
}
|