vendors.php 942 B

1234567891011121314151617181920212223242526272829
  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/2.0'),
  10. array('knpmenu', 'git://github.com/KnpLabs/KnpMenu.git', 'origin/master'),
  11. array('twig', 'git://github.com/fabpot/Twig.git', '1.6.1'),
  12. array('exporter', 'git://github.com/sonata-project/exporter.git', 'origin/master'),
  13. );
  14. foreach ($deps as $dep) {
  15. list($name, $url, $rev) = $dep;
  16. echo "> Installing/Updating $name\n";
  17. $installDir = $vendorDir.'/'.$name;
  18. if (!is_dir($installDir)) {
  19. system(sprintf('git clone --quiet %s %s', escapeshellarg($url), escapeshellarg($installDir)));
  20. }
  21. system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
  22. }