1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-migrations.git synced 2024-06-16 15:01:08 +03:00

Fix classname bug in db:generate when an empty location is used. fixes #3

This commit is contained in:
Matt Button 2011-01-07 15:02:19 +00:00
parent b36b2131aa
commit 64fec1190b

View file

@ -84,7 +84,16 @@ class Minion_Task_Db_Generate extends Minion_Task
$class = ucwords(str_replace('/', ' ', $location));
return 'Migration_'.preg_replace('~[^a-zA-Z0-9]+~', '_', $class.'_'.$time);
// If location is empty then we want to avoid double underscore in the
// class name
if( ! empty($class))
{
$class .= '_';
}
$class .= $time;
return 'Migration_'.preg_replace('~[^a-zA-Z0-9]+~', '_', $class);
}
/**