mirror of
https://github.com/Oreolek/kohana-migrations.git
synced 2024-05-24 11:58:11 +03:00
fixing unproperly handled lack of description
This commit is contained in:
parent
8b38ab7025
commit
b1fa2b7cb0
|
@ -61,9 +61,16 @@ class Minion_Migration_Util {
|
|||
// path from the migrations folder to the migration file
|
||||
$migration['group'] = dirname(substr($file, 11, -strlen(EXT)));
|
||||
|
||||
list($migration['timestamp'], $migration['description'])
|
||||
= explode('_', basename($file, EXT), 2);
|
||||
|
||||
if(strpos(basename($file), "_"))
|
||||
{
|
||||
list($migration['timestamp'], $migration['description'])
|
||||
= explode('_', basename($file, EXT), 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$migration['timestamp'] = basename($file, EXT);
|
||||
$migration['description'] = "";
|
||||
}
|
||||
$migration['id'] = $migration['group'].':'.$migration['timestamp'];
|
||||
|
||||
return $migration;
|
||||
|
@ -79,7 +86,15 @@ class Minion_Migration_Util {
|
|||
public static function get_filename_from_migration(array $migration)
|
||||
{
|
||||
$group = $migration['group'];
|
||||
$migration = $migration['timestamp'].'_'.$migration['description'];
|
||||
|
||||
if(!empty($migration['description']))
|
||||
{
|
||||
$migration = $migration['timestamp'].'_'.$migration['description'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$migration = $migration['timestamp'];
|
||||
}
|
||||
|
||||
$group = ( ! empty($group)) ? (rtrim($group, '/').'/') : '';
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Minion encountered an error while executing migration `<?php echo $migration['id']; ?>` (<?php echo $migration['description'] ?>):
|
||||
Minion encountered an error while executing migration `<?php echo $migration['id']; ?>` <?php echo (!empty($migration['description']) ? '('.$migration['description'].')' : '') ?>):
|
||||
|
||||
<?php echo $error; ?>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?php foreach($groups as $group => $status): ?>
|
||||
* <?php echo $group ?> <?php echo ($status !== NULL ? $status['timestamp'].' ('.$status['description'].')' : 'Not installed'); ?>
|
||||
* <?php echo $group ?> <?php echo ($status !== NULL ? $status['timestamp'].' '.( !empty($status['description']) ? '('.$status['description'].')' : '' ) : 'Not installed'); ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
|
Loading…
Reference in a new issue