mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
25 lines
687 B
PHP
25 lines
687 B
PHP
<?php
|
|
class Migrate extends CI_Controller {
|
|
|
|
public function index() {
|
|
$this->load->library('Migration');
|
|
|
|
$result = array();
|
|
$latest = $this->migration->latest();
|
|
|
|
if (!$latest) {
|
|
show_error($this->migration->error_string());
|
|
log_message('error', 'Migration failed');
|
|
$result['status'] = 'error';
|
|
} else {
|
|
while (file_exists(APPPATH . 'cache/.migration_running')) {
|
|
sleep(1);
|
|
}
|
|
$result['status'] = 'success';
|
|
$result['version'] = $latest;
|
|
}
|
|
header('Content-Type: application/json');
|
|
echo json_encode($result);
|
|
}
|
|
}
|