Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

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

Closed
wants to merge 10 commits into from
Closed

Conversation

boesing
Copy link

@boesing boesing commented Mar 24, 2017

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 boesing changed the title Support for ZF3 Support for ZF3 and slm/queue v1.0 Mar 24, 2017
@boesing
Copy link
Author

boesing commented Mar 27, 2017

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

@joepsyko
Copy link

joepsyko commented Mar 30, 2017

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
Copy link
Author

boesing commented Mar 30, 2017

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
Copy link

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

As of ZF3, `ServiceManager::getServiceLocator` is marked as deprecated.
Since we only need that in ZF2, I moved the logic to `ZF2` only logic.
@boesing
Copy link
Author

boesing commented Mar 30, 2017

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
Copy link

Thank you

@joepsyko
Copy link

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

@boesing
Copy link
Author

boesing commented Apr 4, 2017

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
Copy link

joepsyko commented Apr 4, 2017

I'm also available to maintain the repository

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants