/vendor/vendors.php

http://github.com/FriendsOfSymfony/FOSFacebookBundle · PHP · 36 lines · 20 code · 7 blank · 9 comment · 2 complexity · bc7c8c741218e275572ce31a350b76c0 MD5 · raw file

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