Skip to content

Autodiscover V2 #5

@acidlake

Description

@acidlake

Since at this moment the framework spect certain folder structure for things like, migrations, services, etc for the auto discover to load the services and like that the container will do the proper injection, so the proposed solution is that in the app scope, or in modules scope the idea is to allow for auto discover to work no matter the folder, the proposed solution is to do an auto scan for all folders and do certain actions based on Attributes, for example Migrations, Services, Components, Views etc, and to avoid performance issue have a similar class map cache file, that do auto purge, and only on directory or file change it will update the corresponding entry line on the file, this will avoid any performance overhead.

At this moment we only care for #[Service] and #[Migration] and im also thinking on create a new attribute to not pollute the Service attribute with something like #[Discoverable] this can be logic class that are not exactly a service, this this proposed change the app and modules scope can trully have any directory structure of course in modules it should always respect the config folder and forge.json outside, and ModuleNameModule.php required file in /src/.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions