vendors.php 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. /*
  12. CAUTION: This file installs the dependencies needed to run the Symfony2 test suite.
  13. If you want to create a new project, download the Symfony Standard Edition instead:
  14. http://symfony.com/download
  15. */
  16. if (!is_dir($vendorDir = dirname(__FILE__).'/vendor')) {
  17. mkdir($vendorDir, 0777, true);
  18. }
  19. $deps = array(
  20. array('doctrine', 'http://github.com/doctrine/doctrine2.git', '2.1.1'),
  21. array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', '2.1.1'),
  22. array('doctrine-common', 'http://github.com/doctrine/common.git', '2.1.1'),
  23. array('monolog', 'http://github.com/Seldaek/monolog.git', '1.0.1'),
  24. array('swiftmailer', 'http://github.com/swiftmailer/swiftmailer.git', 'v4.1.1'),
  25. array('twig', 'http://github.com/fabpot/Twig.git', 'v1.1.2'),
  26. );
  27. foreach ($deps as $dep) {
  28. list($name, $url, $rev) = $dep;
  29. echo "> Installing/Updating $name\n";
  30. $installDir = $vendorDir.'/'.$name;
  31. if (!is_dir($installDir)) {
  32. system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir)));
  33. }
  34. system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
  35. }