2018-12-31 11:57:32 +00:00
|
|
|
<?php
|
|
|
|
|
|
2019-01-24 05:33:11 +00:00
|
|
|
// array to pass back data
|
|
|
|
|
$data = array();
|
2018-12-31 11:57:32 +00:00
|
|
|
|
2019-01-24 05:33:11 +00:00
|
|
|
// run command on terminal
|
2019-01-25 11:52:59 +00:00
|
|
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
|
|
$command = 'cd ../.. && composer install 2>&1';
|
|
|
|
|
} else {
|
|
|
|
|
$command = 'cd ../.. ; export HOME=/root && export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update; composer install 2>&1';
|
|
|
|
|
}
|
2018-12-31 11:57:32 +00:00
|
|
|
|
2019-01-22 10:43:56 +00:00
|
|
|
$last_line = exec($command, $data['composer'], $data['install']);
|
2018-12-31 11:57:32 +00:00
|
|
|
|
2019-01-24 05:33:11 +00:00
|
|
|
// return a response
|
2018-12-31 11:57:32 +00:00
|
|
|
//return all our data to an AJAX call
|
2019-01-24 05:33:11 +00:00
|
|
|
|
2018-12-31 11:57:32 +00:00
|
|
|
echo json_encode($data);
|