Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Nov 28, 2012
1 parent 539f34e commit e1d6c46
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions system/libraries/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,6 @@ public function version($target_version)
$this->_error_string = sprintf($this->lang->line('migration_class_doesnt_exist'), $class);
return FALSE;
}
elseif ( ! is_callable(array($class, $method)))
{
$this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);
return FALSE;
}

$previous = $number;

Expand All @@ -247,8 +242,15 @@ public function version($target_version)
($method === 'down' && $number <= $current_version && $number > $target_version)
)
{
$instance = new $class();
if ( ! is_callable(array($instance, $method)))
{
$this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);
return FALSE;
}

log_message('debug', 'Migrating '.$method.' from version '.$current_version.' to version '.$number);
call_user_func(array(new $class, $method));
call_user_func(array($instance, $method));
$current_version = $number;
$this->_update_version($current_version);
}
Expand Down

0 comments on commit e1d6c46

Please sign in to comment.