protected function _enumerateNewMigrations($type)
{
$mapping = array();
$path = APP . 'Config' . DS . 'Migration' . DS;
if ($type !== 'app') {
$path = CakePlugin::path(Inflector::camelize($type)) . 'Config' . DS . 'Migration' . DS;
}
if (!file_exists($path)) {
return $mapping;
}
$folder = new Folder($path);
foreach ($folder->find('.*?\\.php', true) as $file) {
$parts = explode('_', $file);
$version = array_shift($parts);
$className = implode('_', $parts);
if ($version > 0 && strlen($className) > 0) {
$mapping[(int) $version] = array(substr($file, 0, -4) => Inflector::camelize(substr($className, 0, -4)));
}
}
return $mapping;
}