Summary
Define a wheels.ServiceProviderInterface with register(container) and boot(app) methods. Plugins that implement this interface get the modern lifecycle; others continue with mixin injection. This is the key 3.x bridge to the 4.0 Service Provider model (#1917).
Proposed Interface
// vendor/wheels/ServiceProviderInterface.cfc
interface {
/**
* Register services, bindings, and config with the DI container.
* Called during plugin load phase.
*/
public void function register(required any container);
/**
* Boot the plugin after all providers have registered.
* Access to routes, middleware, events, and resolved services.
*/
public void function boot(required any app);
}
Dual-Mode Support
A plugin can include both a ServiceProvider.cfc implementing this interface AND legacy mixin methods during migration:
plugins/myPlugin/
├── MyPlugin.cfc ← legacy mixin plugin (still works)
├── ServiceProvider.cfc ← new-style provider (also detected)
└── plugin.json ← manifest
Detection
During $pluginsProcess():
- Check for
ServiceProvider.cfc in plugin directory
- If found, instantiate and verify it implements the interface
- Collect all providers, call
register() in load order
- After all registered, call
boot() in load order
Files
- New:
vendor/wheels/ServiceProviderInterface.cfc
- Modified:
vendor/wheels/Plugins.cfc — detect and invoke service providers
Phase
Phase 3 — Migration Path to Service Providers (3.x → 4.0 bridge)
Related
Summary
Define a
wheels.ServiceProviderInterfacewithregister(container)andboot(app)methods. Plugins that implement this interface get the modern lifecycle; others continue with mixin injection. This is the key 3.x bridge to the 4.0 Service Provider model (#1917).Proposed Interface
// vendor/wheels/ServiceProviderInterface.cfc interface { /** * Register services, bindings, and config with the DI container. * Called during plugin load phase. */ public void function register(required any container); /** * Boot the plugin after all providers have registered. * Access to routes, middleware, events, and resolved services. */ public void function boot(required any app); }Dual-Mode Support
A plugin can include both a
ServiceProvider.cfcimplementing this interface AND legacy mixin methods during migration:ServiceProvider.cfcexists,register()andboot()are calledDetection
During
$pluginsProcess():ServiceProvider.cfcin plugin directoryregister()in load orderboot()in load orderFiles
vendor/wheels/ServiceProviderInterface.cfcvendor/wheels/Plugins.cfc— detect and invoke service providersPhase
Phase 3 — Migration Path to Service Providers (3.x → 4.0 bridge)
Related