(04-21-2022, 12:30 AM)XMadMax Wrote: Hello, I developed a CI4 Modular structure, all works Ok, but I have a problem with Seeder.
Migrations (php spark migrate) works ok, because the migrate program uses namespaces, but "php spark db: seed" only uses filesPath config, instead of those path defined in command line (php spark db: seed Users/MySeeder.php)
As suggestion, system/Comands/Database/Seed.php would share $params with Seeder.php to be able to use namespaces.
If, as the example proposed, $params contains 'Users/Database/Seeds/MySeeder.php', in the constructor, $this->seedPath would to be set properly if first part of route is a defined in autoload.php:$psr4
Thanks,
Xavier
Here is an example:
Code:
public $psr4 = [
'MyNameSpace' => APPPATH . 'ThirdParty\MyPackag',
];
Code:
php spark db:seed MyNameSpace\Database\Seeds\UrgenciesSampel
NOTE:
UrgenciesSampel IS HERE :
Code:
app\ThirdParty\MyPackag\Database\Seeds\UrgenciesSampel.php