| Conditions | 3 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php defined('SYSPATH') OR die('No direct script access.'); |
||
| 24 | protected function _execute(array $options) |
||
| 25 | { |
||
| 26 | $db = $this->db_params($options['database']); |
||
| 27 | |||
| 28 | $file = $options['file'] ? $options['file'] : Kohana::$config->load("migrations.path").DIRECTORY_SEPARATOR.'schema.sql'; |
||
| 29 | |||
| 30 | $command = strtr("mysqldump -u:username :password -h :hostname --skip-comments --add-drop-database --add-drop-table --no-data :database | sed 's/ AUTO_INCREMENT=[0-9]*\b//' > :file ", array( |
||
| 31 | ':username' => $db['username'], |
||
| 32 | ':password' => $db['password'] ? '-p'.$db['password'] : '', |
||
| 33 | ':database' => $db['database'], |
||
| 34 | ':hostname' => $db['hostname'], |
||
| 35 | ':file' => $file |
||
| 36 | )); |
||
| 37 | |||
| 38 | Minion_CLI::write(Minion_CLI::color('Saving structure of database "'.$db['database'].'" to '.Debug::path($file), 'green')); |
||
| 39 | |||
| 40 | system($command); |
||
| 41 | } |
||
| 42 | |||
| 44 |