2021-04-26 12:34:45 +03:00
|
|
|
#!/usr/bin/env php
|
|
|
|
|
<?php
|
2021-03-15 14:36:53 +02:00
|
|
|
|
2021-04-26 12:34:45 +03:00
|
|
|
setlocale(LC_ALL, ['en_GB.utf8', 'en_GB']);
|
|
|
|
|
date_default_timezone_set('America/Denver');
|
|
|
|
|
chdir(__DIR__ . '/..');
|
2021-03-15 14:36:53 +02:00
|
|
|
|
2021-04-26 14:03:21 +03:00
|
|
|
echo "# Running composer install for build script\n";
|
2021-04-27 11:01:12 +03:00
|
|
|
composer_install('bin/builder', false);
|
2021-03-15 14:36:53 +02:00
|
|
|
|
2021-04-26 12:34:45 +03:00
|
|
|
chdir('platforms');
|
2021-03-15 14:36:53 +02:00
|
|
|
|
2021-04-26 12:34:45 +03:00
|
|
|
echo "# Running composer install for Grav\n";
|
2021-04-26 14:03:21 +03:00
|
|
|
composer_install('grav/gantry5', true);
|
2021-09-16 13:46:18 +03:00
|
|
|
composer_install('grav/gantry5/compat', false);
|
2021-03-15 14:36:53 +02:00
|
|
|
|
2021-04-26 12:34:45 +03:00
|
|
|
echo "# Running composer install for Joomla\n";
|
2021-04-26 14:03:21 +03:00
|
|
|
composer_install('joomla/lib_gantry5', true);
|
|
|
|
|
composer_install('joomla/plg_system_gantry5_debugbar', false);
|
2021-05-13 15:26:04 +03:00
|
|
|
composer_install('joomla/lib_gantry5/compat', false);
|
2021-04-19 13:56:26 +03:00
|
|
|
|
2021-04-26 12:34:45 +03:00
|
|
|
echo "# Running composer install for WP\n";
|
2021-04-26 14:03:21 +03:00
|
|
|
composer_install('wordpress/gantry5', true);
|
|
|
|
|
composer_install('wordpress/gantry5_debugbar', false);
|
2021-05-13 15:26:04 +03:00
|
|
|
composer_install('wordpress/gantry5/compat', false);
|
2021-04-26 12:34:45 +03:00
|
|
|
|
2021-04-26 14:03:21 +03:00
|
|
|
function composer_install($folder, $link)
|
|
|
|
|
{
|
|
|
|
|
chdir($folder);
|
|
|
|
|
if ($link && !file_exists('src')) {
|
|
|
|
|
symlink('../../../src', 'src');
|
|
|
|
|
}
|
|
|
|
|
if (false === exec('composer install --no-dev --no-progress', $output, $result) || $result) {
|
|
|
|
|
echo implode("\n", $output);
|
|
|
|
|
throw new \RuntimeException('Failed to run composer install in ' . $folder);
|
|
|
|
|
}
|
|
|
|
|
chdir(preg_replace('|[^/]+|', '..', $folder));
|
2021-04-26 12:34:45 +03:00
|
|
|
}
|