richsage / RMSPushNotificationsBundle

NOT MAINTAINED! ⛔️ Push notifications/messages for mobile devices. Supports iOS, Android (C2DM, GCM), Blackberry and Windows Mobile (toast only). A Symfony2 bundle.
MIT License
321 stars 152 forks source link

Extracting the core library for non Symphony usage? #22

Open obaid opened 11 years ago

obaid commented 11 years ago

Hi, Any chance to extract this library for regular PHP usage?

barryvdh commented 10 years ago

Good idea, was hoping to use this in Laravel or stand-alone. Would be nice if the al the APN/GCM logic etc was a seperate library, and the bundle just pulled that library in and configured it as Symfony Bundle.

mialex commented 8 years ago

I have the same issue, I managed to do that with some kind of tricks.

$container = new ContainerBuilder(); $container->setParameter('kernel.root_dir', $pathToDirWithConfig); $container->setParameter('kernel.cache_dir', $pathToCacheDir);

$bundle = new RMSPushNotificationsBundle(); $bundle->build($container)

$extension = $bundle->getContainerExtension(); $container->registerExtension($extension); $extensions = [$extension->getAlias()]; $container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions));

$loader = new YamlFileLoader($container, new FileLocator($pathToConfigFile)); $container->compile();

Small part of logic that implemented in Symfony kernel