/**
* Retrieves a list of available migration scripts for one namespace
*/
public function findNamespaceMigrations(string
$namespace): array
{ $migrations =
[];
$locator = Services::
locator(true
);
if (!
empty($this->path
)) { helper('filesystem'
);
$dir =
rtrim($this->path, DIRECTORY_SEPARATOR
) . '/';
$files =
get_filenames($dir, true, false, false
);
} else { $files =
$locator->
listNamespaceFiles($namespace, '/Database/Migrations/'
);
} foreach ($files as $file) { $file =
empty($this->path
) ?
$file :
$this->path .
str_replace($this->path, '',
$file);
if ($migration =
$this->
migrationFromFile($file,
$namespace)) { $migrations[] =
$migration;
} }