Webador / SlmQueueBeanstalkd

Beanstalkd adapter for SlmQueue module
Other
10 stars 26 forks source link

Support for ZF3 and slm/queue v1.0 #60

Closed boesing closed 7 years ago

boesing commented 7 years ago

Added support for ZF3 but had to drop PHP 5.3 and PHP 5.4 support. In addition I've added PHP 7 and PHP 7.1.

boesing commented 7 years ago

@juriansluiman Would you please consider merging this? Could need that in a project.

joepsyko commented 7 years ago

Hello,

I tested your branch in my zf3 project.

I think you should change one more thing.

When I run the code I get the following error:

Usage of Zend\ServiceManager\ServiceManager::getServiceLocator is deprecated since v3.0.0; please use the container passed to the factory instead

This is because you put this code inside the factory method called by zf3:

if (method_exists($container, 'getServiceLocator')) {
        $container = $container->getServiceLocator() ?: $container;
}

I already had a module with support for both zf2 and zf3 and I know that zf2 uses the createService() method while zf3 uses the __invoke method, so you don't need to check if the method exists because is deprecated, simply remove those lines fix the problem.

I hope I explained the problem, thank you Joe

boesing commented 7 years ago

Since deprecated is not a serious error, this is exactly as expected. I wont create two methods just to avoid a deprecated notice. You can ignore any deprecation errors by setting the proper error_reporting level.

To make this work with ZF2 and ZF3, this call is necessary.

joepsyko commented 7 years ago

I don't understand why you say that the call is necessary, since zf2 call the createService() service while zf3 calls the __invoke() method.

Can you explain me please?

Thank you

boesing commented 7 years ago

Didn't got you right. Actually I thought you wanted to remove the call at all. Moved it to the Zend\ServiceManager\FactoryInterface::createService method.

joepsyko commented 7 years ago

Thank you

joepsyko commented 7 years ago

I'm sorry to bother you again, but you should fix the same thing in BeanstalkdWorkerControllerFactory, thank you.

boesing commented 7 years ago

I guess that this repository might be dead. The last PR was merged in 2015.

@juriansluiman If you want me to take over this repository, please give me a note so I can maintain this as long as I have time.

joepsyko commented 7 years ago

I'm also available to maintain the repository