- Work done on DatabaseMigration part and separation from Lean main package too.
This commit is contained in:
1 parent
923b2be49e
commit
f6fadd715e
5 files changed
+69
-26
No files matched your search
@@ -17,10 +17,11 @@ class DatabaseMigrations
|
||||
{
|
||||
$this->entities = [];
|
||||
|
||||
foreach($this->folderList as $folder => $namespace) {
|
||||
foreach($this->folderList as $namespace => $folder) {
|
||||
foreach(static::files($folder) as $file) {
|
||||
$name = $file->getBasename(".".$file->getExtension());
|
||||
$entity = rtrim($namespace, "\\") . "\\{$name}";
|
||||
$name = $file->getBasename("." . $file->getExtension());
|
||||
$subNs = substr($file->getPath(), strlen($folder));
|
||||
$entity = rtrim($namespace, "\\") . ( $subNs ? "\\$subNs" : "" ) . "\\{$name}";
|
||||
$this->entities[$entity] = $entity::resolveEntity();
|
||||
}
|
||||
}
|
||||
@@ -33,11 +34,15 @@ class DatabaseMigrations
|
||||
|
||||
foreach ($iterator as $file) {
|
||||
if ( $file->isFile() || $file->isDir() ) {
|
||||
if ($fileExtension && ( $file->getExtension() === $fileExtension )) {
|
||||
yield $file;
|
||||
if ($fileExtension) {
|
||||
if ( $file->getExtension() === $fileExtension ) {
|
||||
yield $file;
|
||||
}
|
||||
}
|
||||
else {
|
||||
yield $file;
|
||||
if ( $file->isFile() ) {
|
||||
yield $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user