Created
August 30, 2011 04:55
-
-
Save ruthlessfish/1180214 to your computer and use it in GitHub Desktop.
Revisions
-
ruthlessfish revised this gist
Aug 30, 2011 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,11 +14,13 @@ public function _remap($method, $args) { $this->load->library(array('cli', 'migration')); // only allow version, latest and current to be called // directly from the shell switch($method) { case 'version' : $args[0] OR $args[0] = $this->config->item('migrations_version'); break; case 'latest' : case 'current' : -
ruthlessfish revised this gist
Aug 30, 2011 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,7 @@ public function _remap($method, $args) { $this->load->library(array('cli', 'migration')); // only allow version, latest and current to be called directly from the shell switch($method) { case 'version' : -
ruthlessfish created this gist
Aug 30, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ <?php /** * Sample Usage: * * $php index.php migrate version 5 * $php index.php migrate latest * $php index.php migrate current * */ class Migrate extends CI_Controller { public function _remap($method, $args) { $this->load->library(array('cli', 'migration')); switch($method) { case 'version' : $args[0] OR $args[0] = $this->config->item('migrations_version'); break; case 'latest' : case 'current' : break; default : $this->cli->write('Command not found.'); exit; break; } if( ! call_user_func_array(array($this->migration, $method), $args)) { $this->cli->write($this->migration->error_string()); exit; } $this->cli->write('Migration Successful', 'green'); } } // end class Migrate /* End of file migrate.php */ /* Location: ./application/controllers/migrate.php */