sarga/public/installer/MigrationRun.php

16 lines
456 B
PHP
Raw Normal View History

2019-06-03 11:02:50 +00:00
<?php
ini_set('max_execution_time', 900);
2021-01-05 01:27:37 +00:00
$phpbin = PHP_BINDIR . '/php';
2019-06-03 11:02:50 +00:00
// array to pass back data
2020-12-21 12:42:26 +00:00
$data = [];
2019-06-03 11:02:50 +00:00
2020-12-21 12:42:26 +00:00
// run command on terminal and asumming that this is as fresh installation
2021-01-05 01:27:37 +00:00
$command = 'cd ../.. && '. $phpbin .' artisan config:cache && '. $phpbin.' artisan migrate:fresh --force';
2020-12-21 12:42:26 +00:00
$data['last_line'] = exec($command, $data['migrate'], $data['results']);
2019-06-03 11:02:50 +00:00
// return a response
2020-12-21 12:42:26 +00:00
// return all our data to an AJAX call
2019-06-03 11:02:50 +00:00
echo json_encode($data);