Skip to content

Instantly share code, notes, and snippets.

@DominicImhof
Created November 18, 2011 16:16
Show Gist options
  • Save DominicImhof/1376911 to your computer and use it in GitHub Desktop.
Save DominicImhof/1376911 to your computer and use it in GitHub Desktop.
CodeIgniter Automigrate
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Automigrate {
private $_ci = null;
public function __construct()
{
$this->_ci =& get_instance();
$this->_ci->config->load('migration');
$enabled = $this->_ci->config->item('migration_enabled');
if($enabled === TRUE) {
$this->_ci->load->library('migration');
$this->_ci->migration->current();
}
}
}
/* End of file automigrate.php */
/* Location: ./application/libraries/automigrate.php */
@DominicImhof
Copy link
Author

Add this class to autoload.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment