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

This commit is contained in:
jekkos committed 2018-11-26 23:52:58 +01:00
1 parent 9f386b003b
commit 3f3e1581ce
2 files changed
+24 -2

No files matched your search

+6 -2
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))
{
+18
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;
}
}