vendors.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env php
  2. <?php
  3. /*
  4. * This file is part of the Symfony framework.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.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. if (!is_dir($vendorDir = dirname(__FILE__).'/vendor')) {
  12. mkdir($vendorDir, 0777, true);
  13. }
  14. $deps = array(
  15. array('assetic', 'http://github.com/kriswallsmith/assetic.git', 'origin/HEAD'),
  16. array('doctrine', 'http://github.com/doctrine/doctrine2.git', '2.0.5'),
  17. array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', '2.0.5'),
  18. array('doctrine-common', 'http://github.com/doctrine/common.git', 'origin/3.0.x'),
  19. array('monolog', 'http://github.com/Seldaek/monolog.git', 'origin/HEAD'),
  20. array('swiftmailer', 'http://github.com/swiftmailer/swiftmailer.git', 'origin/4.1'),
  21. array('twig', 'http://github.com/fabpot/Twig.git', 'origin/HEAD'),
  22. );
  23. foreach ($deps as $dep) {
  24. list($name, $url, $rev) = $dep;
  25. echo "> Installing/Updating $name\n";
  26. $installDir = $vendorDir.'/'.$name;
  27. if (!is_dir($installDir)) {
  28. system(sprintf('git clone %s %s', $url, $installDir));
  29. }
  30. system(sprintf('cd %s && git fetch origin && git reset --hard %s', $installDir, $rev));
  31. }