Extend request timeout if migration needs to be done (#2241)

This commit is contained in:
jekkos
2018-11-26 23:50:25 +01:00
parent 9f386b003b
commit 3f3e1581ce
2 changed files with 24 additions and 2 deletions

View File

@@ -41,9 +41,13 @@ class Login extends CI_Controller
return FALSE;
}
// trigger any required upgrade before starting the application
$this->load->library('migration');
$this->migration->latest();
if (!$this->migration->is_latest())
{
set_time_limit(1200);
// trigger any required upgrade before starting the application
$this->migration->latest();
}
if(!$this->Employee->login($username, $password))
{

View File

@@ -0,0 +1,18 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Migration extends CI_Migration {
public function is_latest()
{
$migrations = $this->find_migrations();
$last_migration = basename(end($migrations));
$last_version = $this->_get_migration_number($last_migration);
$current_version = $this->_get_version();
return $last_version == $current_version;
}
}