/vendor/vendors.php
PHP | 36 lines | 20 code | 7 blank | 9 comment | 2 complexity | bc7c8c741218e275572ce31a350b76c0 MD5 | raw file
1#!/usr/bin/env php 2<?php 3 4/* 5 * This file is part of the FOSFacebookBundle package. 6 * 7 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/> 8 * 9 * For the full copyright and license information, please view the LICENSE 10 * file that was distributed with this source code. 11 */ 12set_time_limit(0); 13 14if (isset($argv[1])) { 15 $_SERVER['SYMFONY_VERSION'] = $argv[1]; 16} 17 18$vendorDir = __DIR__; 19$deps = array( 20 array('symfony', 'http://github.com/symfony/symfony', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'), 21 array('facebook', 'git://github.com/facebook/php-sdk.git', 'origin/master'), 22 array('twig', 'http://github.com/fabpot/Twig', 'origin/master'), 23); 24 25foreach ($deps as $dep) { 26 list($name, $url, $rev) = $dep; 27 28 echo "> Installing/Updating $name\n"; 29 30 $installDir = $vendorDir.'/'.$name; 31 if (!is_dir($installDir)) { 32 system(sprintf('git clone -q %s %s', escapeshellarg($url), escapeshellarg($installDir))); 33 } 34 35 system(sprintf('cd %s && git fetch -q origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev))); 36}