mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
26 lines
734 B
PHP
26 lines
734 B
PHP
<?php
|
|
class Migrate extends CI_Controller {
|
|
|
|
public function index() {
|
|
$this->load->library('Migration');
|
|
$this->load->config('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($this->config->item('migration_lockfile'))) {
|
|
sleep(1);
|
|
}
|
|
$result['status'] = 'success';
|
|
$result['version'] = $latest;
|
|
}
|
|
header('Content-Type: application/json');
|
|
echo json_encode($result);
|
|
}
|
|
}
|