propel-bundle/vendor/install_vendors.php
2012-01-12 17:42:34 +01:00

28 lines
1 KiB
PHP
Executable file

#!/usr/bin/env php
<?php
set_time_limit(0);
$vendorDir = __DIR__;
$deps = array(
array('symfony', 'http://github.com/symfony/symfony', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'),
array('propel', 'http://github.com/propelorm/Propel', isset($_SERVER['PROPEL_VERSION']) ? $_SERVER['PROPEL_VERSION'] : 'origin/master'),
array('phing', 'http://github.com/Xosofox/phing.git', 'origin/master'),
array('Sensio/Bundle/FrameworkExtraBundle', 'http://github.com/sensio/SensioFrameworkExtraBundle.git', 'origin/master'),
);
foreach ($deps as $dep) {
list($name, $url, $rev) = $dep;
echo "> Installing/Updating $name\n";
$installDir = $vendorDir.'/'.$name;
if (!is_dir($installDir)) {
system(sprintf('git clone -q %s %s', escapeshellarg($url), escapeshellarg($installDir)));
}
system(sprintf('cd %s && git fetch -q origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
}
system(sprintf('cd %s && php vendors.php', escapeshellarg($vendorDir.'/symfony')));