sarga/public/installer/Composer.php

18 lines
485 B
PHP
Raw Normal View History

<?php
2019-01-24 05:33:11 +00:00
// array to pass back data
$data = array();
2019-01-24 05:33:11 +00:00
// run command on terminal
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';
}
2019-01-22 10:43:56 +00:00
$last_line = exec($command, $data['composer'], $data['install']);
2019-01-24 05:33:11 +00:00
// return a response
//return all our data to an AJAX call
2019-01-24 05:33:11 +00:00
echo json_encode($data);