This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/vendors.php
Fabien Potencier 885bb33791 merged 2.0
2011-09-28 16:08:31 +02:00

55 lines
1.5 KiB
PHP
Executable File

#!/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.
*/
/*
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
*/
set_time_limit(0);
if (!is_dir($vendorDir = dirname(__FILE__).'/vendor')) {
mkdir($vendorDir, 0777, true);
}
$deps = array(
array('doctrine', 'http://github.com/doctrine/doctrine2.git', 'origin/2.1.x'),
array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', 'origin/2.1.x'),
array('doctrine-common', 'http://github.com/doctrine/common.git', 'origin/2.1.x'),
array('monolog', 'http://github.com/Seldaek/monolog.git', '1.0.1'),
array('swiftmailer', 'http://github.com/swiftmailer/swiftmailer.git', 'v4.1.2'),
array('twig', 'http://github.com/fabpot/Twig.git', 'v1.2.0'),
);
foreach ($deps as $dep) {
list($name, $url, $rev) = $dep;
$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)));
}