| Conditions | 4 |
| Paths | 6 |
| Total Lines | 30 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php defined('SYSPATH') OR die('No direct script access.'); |
||
| 19 | protected function _execute(array $options) |
||
| 20 | { |
||
| 21 | $executed = $this->executed_migrations(); |
||
| 22 | |||
| 23 | $up = array(); |
||
| 24 | $down = array(); |
||
| 25 | |||
| 26 | if (isset($options['version'])) |
||
| 27 | { |
||
| 28 | if (in_array($options['version'], $executed)) |
||
| 29 | { |
||
| 30 | $down[] = $options['version']; |
||
| 31 | } |
||
| 32 | } |
||
| 33 | else |
||
| 34 | { |
||
| 35 | $down = array_slice($executed, 0, $options['steps']); |
||
| 36 | } |
||
| 37 | |||
| 38 | if (isset($options['version'])) |
||
| 39 | { |
||
| 40 | $up[] = $options['version']; |
||
| 41 | } |
||
| 42 | else |
||
| 43 | { |
||
| 44 | $up = array_reverse($down); |
||
| 45 | } |
||
| 46 | |||
| 47 | $this->migrate($up, $down, $options['dry-run'] === NULL); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |