vendors.php 857 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env php
  2. <?php
  3. set_time_limit(0);
  4. $vendorDir = __DIR__.'/../../vendor';
  5. if (!is_dir($vendorDir)) {
  6. mkdir($vendorDir);
  7. }
  8. $deps = array(
  9. array('symfony', 'git://github.com/symfony/symfony.git', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'),
  10. array('knpmenu', 'git://github.com/KnpLabs/KnpMenu.git', 'origin/master'),
  11. array('twig', 'git://github.com/fabpot/Twig.git', '1.3.0'),
  12. );
  13. foreach ($deps as $dep) {
  14. list($name, $url, $rev) = $dep;
  15. echo "> Installing/Updating $name\n";
  16. $installDir = $vendorDir.'/'.$name;
  17. if (!is_dir($installDir)) {
  18. system(sprintf('git clone --quiet %s %s', escapeshellarg($url), escapeshellarg($installDir)));
  19. }
  20. system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
  21. }