#!/usr/bin/env php array_merge( isset($package['require']) ? $package['require'] : array(), array($package['name'] => $moduleBranchComposer . '#' . $moduleRevision,) ), // Always include DBs, allow module specific version dependencies though 'require-dev' => array_merge( array('silverstripe/postgresql' => '*','silverstripe/sqlite3' => '*'), isset($package['require-dev']) ? $package['require-dev'] : array() ), 'minimum-stability' => 'dev' ); // Override module dependencies in order to test with specific core branch. // This might be older than the latest permitted version based on the module definition. // Its up to the module author to declare compatible CORE_RELEASE values in the .travis.yml. if(isset($packageNew['require']['silverstripe/framework'])) { $packageNew['require']['silverstripe/framework'] = $coreBranchComposer; } if(isset($packageNew['require']['silverstripe/cms'])) { $packageNew['require']['silverstripe/cms'] = $coreBranchComposer; } $composer = json_encode($packageNew); echo "Generated composer file:\n"; echo "$composer\n\n"; echo "Cloning installer@$coreBranch...\n"; `git clone --depth=100 --quiet -b $coreBranch git://github.com/silverstripe/silverstripe-installer.git $target`; echo "Setting up project...\n"; `cp $dir/_config.php $target/mysite`; echo "Replacing composer file...\n"; unlink("$target/composer.json"); file_put_contents("$target/composer.json", $composer); echo "Running composer...\n"; passthru("composer install --prefer-dist --dev -d $target");