sarga/public/installer/Composer.php

25 lines
687 B
PHP
Raw Normal View History

<?php
2019-01-24 05:33:11 +00:00
// array to pass back data
$data = array();
2019-03-14 09:04:32 +00:00
$location = str_replace('\\', '/', getcwd());
$currentLocation = explode("/", $location);
array_pop($currentLocation);
array_pop($currentLocation);
$desiredLocation = implode("/", $currentLocation);
$autoLoadFile = $desiredLocation . '/' . 'vendor' . '/' . 'autoload.php';
if (file_exists($autoLoadFile)) {
$data['install'] = 0;
} else {
2019-03-14 09:04:32 +00:00
$data['install'] = 1;
$data['composer'] = 'Composer dependencies is not Installed.Go to root of project, run "composer install" command to install composer dependencies & refresh page again.';
}
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);