/** * {inheridoc} */ public function execute(Cli $console) { $this->CI->load->library('migration'); if (!$this->CI->migration->latest()) { show_error($this->CI->migration->error_string()); } else { $console->out('<green>' . Cli::lang('console_install_done') . '</green>'); } return false; }
/** * {inheritdoc} */ protected function outputArguments($arguments, $type) { if (count($arguments) == 0) { return; } $this->climate->br()->out(sprintf('<yellow>%s</yellow>:', Cli::lang('console_argument_' . $type))); $len = []; foreach ($arguments as $argument) { $len[] = strlen($this->argument($argument)); } foreach ($arguments as $argument) { $arg = $this->argument($argument); $spc = max($len) + 2 - strlen($arg); $str = '<green>' . $arg . '</green>' . str_repeat(' ', $spc); if ($argument->description()) { $str .= $argument->description(); } $this->climate->tab()->out($str); } }
private function print_latest($console) { $console->out('<green>' . Cli::lang('console_migration_label_latest') . '</green>'); return $console->out(sprintf(Cli::lang('console_migration_label_which'), '<green>' . $current . '</green>')); }