If you want seom 3rd libraries tun in both Web and Console, register them here.
public static loadProviders ( ) : Windwalker\DI\ServiceProviderInterface[] | ||
return | Windwalker\DI\ServiceProviderInterface[] |
/** * loadProviders * * @return ServiceProviderInterface[] */ public static function loadProviders() { /* * Get Global Providers * ----------------------------------------- * If you want a provider can be used in every applications (for example: Web and Console), * set it in Windwalker\Windwalker object. */ $providers = array_merge(parent::loadProviders(), Windwalker::loadProviders()); /* * Default Providers: * ----------------------------------------- * This is some default service providers, we don't recommend to remove them, * But you can replace with yours, Make sure all the needed container key has * registered in your own providers. */ // $providers['event'] = new Provider\EventProvider; // $providers['database'] = new Provider\DatabaseProvider; // $providers['lang'] = new Provider\LanguageProvider; // $providers['cache'] = new Provider\CacheProvider; // $providers['datetime'] = new Provider\DateTimeProvider; /* * Custom Providers: * ----------------------------------------- * You can add your own providers here. If you installed a 3rd party packages from composer, * but this package need some init logic, create a service provider to do it and register them here. */ // Custom Providers here... return $providers; }
/** * loadProviders * * @return ServiceProviderInterface[] */ public static function loadProviders() { /* * Get Global Providers * ----------------------------------------- * If you want a provider can be used in every applications (for example: Web and Console), * set it in Windwalker\Windwalker object. */ $providers = array_merge(parent::loadProviders(), Windwalker::loadProviders()); // Custom Providers here... $providers['debug'] = new Provider\WhoopsProvider(); return $providers; }