elektronika_bagisto/public/installer/MigrationRun.php

16 lines
456 B
PHP
Raw Normal View History

2021-11-30 05:09:18 +00:00
<?php
ini_set('max_execution_time', 900);
$phpbin = PHP_BINDIR . '/php';
// array to pass back data
$data = [];
// run command on terminal and asumming that this is as fresh installation
$command = 'cd ../.. && '. $phpbin .' artisan config:cache && '. $phpbin.' artisan migrate:fresh --force';
$data['last_line'] = exec($command, $data['migrate'], $data['results']);
// return a response
// return all our data to an AJAX call
echo json_encode($data);