Closed Rockstar04 closed 7 years ago
+1
+1
+1
Actually it looks like 1.4.4 has been updated for the new ServiceManger already. It was issues with how my code was overriding ZfcUser classes that caused an issue I assumed was ZF3 incompatibility.
@Rockstar04 I could be wrong, but I don't think it's that simple. ZfcUser requires ZfcBase which in turn requires zend-mvc ~2.1. If one tries to use ZfcUser with zend-mvc 3, then there's a conflict.
Now...there may be a way around this that I don't know about. If so, please enlighten me. Otherwise, if my understanding is correct, then ZfcBase's dependencies need to be updated or, better yet, ZfcBase should be dropped as a dependency for ZfcUser....which is the goal of #560.
If I'm right, please re-open. If not, please help me to use zend-mvc 3 correctly. I'd appreciate it. :-)
@telkins You are right, I was looking over quite a few of my projects dependencies yesterday and forgot about the tie to zend-mvc, I was just looking over the version history here and got ahead of myself.
@Rockstar04 👍 Nice...! The dependencies can be a bit tricky, sometimes. I'm hoping that #560 can be resolved quickly since there doesn't appear to be any need for it any longer. Once that's done, I think the task becomes relatively straightforward. Let's hope so, anyway. :-)
I'm doing some changes on the dev-master to add support for ZF3. Also because there are chaanges in the factoryInterface and so on ;)
@stijnhau Can you do it in 1.x, without BC breaks?
@Danielss89 I will first do the dev-master because that is the one i'm using ;) and i don't have that much time. Did already a small change and should have no BC break(Not yet commited)
@stijnhau Any ETA...?
@telkins I hope to finish dev-master this weekend
https://github.com/stijnhau/ZfcUser/tree/ZF3
For people who wants to help also ;) Or people that are intrested to see the changes. Have updated the composer.json file Dropped zfcBase dependency(only dropped nothing changed yet will see where it's used and do changes then). Working on factories now. This way i'm working they also should be compatible with ZF2 and ZF3
@stijnhau create a PR from that
@svycka The moment i'm ready i will Todo:
you can do changes on PR so why ou cant create it now and do your changes later? it would be easier to see what you changed and comment what you did wrong, suggest what to fix and so on
@svycka I'm more a fan of creating the PR when it's ready so that way ou cna see the working result cause now it to uch a work in progress.
@stijnhau I think that saving both SMv2 and SMv3 compaibility is not a good idea.
@oprokidnev Why do u think it's a bad idea?
My 2 cents: I think both SMv2 and SMv3 should be supported. Otherwise, there need to be separate versions of ZfcUser.
While I would prefer to move ahead and stay at the cutting edge, having only support for the latest and greatest, there are some situations where it's not possible/realistic. The ZF developers have provided a way to support both versions simultaneously for a reason. It's because not everyone will be willing/able to move forward.
Also, keep in mind that a single dependency can potentially be a single factor in forcing one forward or keeping one back. I've gone through the work of upgrading to SMv3 and found that a single dependency, like ZfcUser, will hold me back. Of course, if ZfcUser now suddenly supports only SMv3, then those who are not ready to move ahead will be forced to...or they will miss out on further ZfcUser fixes/features.
So, supporting both is a good step forward...at least if there's only going to be one version. If it's a matter of how to move ahead with 1.x, then support for both is the only realistic/pragmatic solution. If it's a matter of having a ZfcUser solution that only supports SMv3, then I think that means an introduction of a 2.x version is necessary, since it will no longer be backward compatible.
My vote for now: bridge the gap and support both. It's a relatively simple fix and any disadvantages (that I can think of) are negligible.
Yes telkins that is the reason i wan't to have SMv2 and SMv3 support.
Havin major issue at the moment with refactoring. Event's is still undecided how i'm going to handle those so put in comment for now. https://github.com/zendframework/zend-mvc-plugin-flashmessenger Check that repo it is the slashmessanger but it support onnly zend-mvc 3.x branch. Any idea how we can work around that?
@stijnhau you could probably add a Composer script that checks the installed version of zend-mvc
and if it is ^3.0 then also install the necessary zend-mvc-plugin-*
repositories.
My 2 cents though would be to explictly declare ZfcUser 1.x as being for ZF2 and do a ZfcUser 2.x release for ZF3. Last time I was actively using ZfcUser I advocated for v2.x to be split, putting MVC integration into a separate package and so allowing easier reuse of the ZfcUser "core" in other contexts (eg: Apigility). That would also help in this case: MVC 2.x and MVC 3.x support could be provided through separate packages, if necessary.
After more thought, In the interim I suggest this: we release a ZfcUser v2.x that supports only zend-mvc
3.x but is otherwise identical to ZfcUser 1.x, then relabel the current master branch as ZfcUser 3.x (since it already has BC-breaking changes committed, IIRC). It does, however, mean we are now concurrently maintaining 3 branches, so maybe lock <3.0 to only backporting of critical bug fixes?
(that "we" seems to be just Daniel now, tbh, so of course it would be up to him if he wants to expend that maintenance effort)
Okez you are right a change i did earlier already requires MVCv3 and php 5.6 so i've updated the composer fiole to request the new changes. Will see that i can look for the event tomorrow and can do a testrun and update the readme
I will do a reply tomorrow evening on what i decide with branches and BC.
@stijnhau You've just mention why (zend-mvc-* repos). The second point is that this module requires massive refactoring:
Saving BC would make module development harder. Module is stable enought for now and new version of module should only be compatible with latest dev options
@oprokidnev Wat is wrong with the service config like it is used in the dev master at the moment?
An update on the state of the change: Having issues at the moment withthe autenticate function that gives a fatal somewhere(do not have the code or testexample next to me)
I decided to go the following way: ZfcUser 1.x = Supports ZF2.0 - Only receives security updates ZfcUser 2.x = Copy of current 1.x, but with refactors(and BC breaks) to support servicemanager 3 ZfcIser master = Future version, with many changes and BC breaks.
I have vacation next week, and will update Github accordingly. Feel free to create PR's :)
I propse 1 change extra for zfcuser 2.0 Thé user_id to id
@stijnhau No, that is too big a BC. I want BC breaks to be as few and small as possible.
Agreed but it will be a new major version. So I don't see a reason to keep that faulty dB design
If you have an existing app and want's to upgrade to ZF3, you want as minimal changes as possible. Changing user_id to id will require you to change a lot of your entities with an association to the user entity, and you will have to change your database also, which can be a bit difficult.
The "new" version of ZfcUser, is not meant for upgrading, but for new project, so there it is fine to do the change.
@Danielss89 You can try my fork as a base. Has reached some forms to be working, but currently has no time for this. BC breaks with zf2. https://github.com/oprokidnev/ZfcUser/tree/zf3 https://github.com/oprokidnev/ZfcBase/tree/zf3
Hi All
I've finally had some more time to work on this(it required more work than i first thought). Anyway, i pushed a 2.x
branch, i haven't tagged yet, as i would like your feedback and testing for this.
@Danielss89 Can you take a look at my fork of the master for V3 support? Cause i'm stuck somewhere TypeError File: C:\Program Files (x86)\Zend\ZendServer\data\apps\httpdefault\0\Zf2TestProject\1.0.0_12\vendor\zf-commons\zfc-user\src\ZfcUser\Authentication\Adapter\Db.php:52 Message: Argument 1 passed to ZfcUser\Authentication\Adapter\Db::authenticate() must be an instance of ZfcUser\Authentication\Adapter\AdapterChainEvent, instance of Zend\EventManager\Event given, called in C:\Program Files (x86)\Zend\ZendServer\data\apps\httpdefault\0\Zf2TestProject\1.0.0_12\vendor\zendframework\zend-eventmanager\src\EventManager.php on line 271 Stack trace:
And if you look at the stacktrace the correct event is passes to the listener but when the listener is triggered it somehow back the wrong one.
@Danielss89 here's my feedback:
^
instead of ~
for version pinning (https://getcomposer.org/doc/articles/versions.md#caret)ProvidesEventsForm
and ProvidesEventsInputFilter
. We could keep the class to make things easy, but it's contents could be replaced by a use
of that trait. I haven't updated any of my projects to use ZF3 components yet (:disappointed:) so I can't actually test these changes beyond code review and running the tests.
I have doine some work for the dev master branch. Its currently works with ZF3 but there is still some cleanup needed and the user mapper has some todo's as weel. But it is already using tablegateway and not the db mapper like before.
@Danielss89 @adamlundrigan
There is an issue with extending forms via event (https://github.com/ZF-Commons/ZfcUser/wiki/How-to-modify-the-form-objects-used-by-ZfcUser) in 2.x-dev. Attaching listeners to authenticate.fail of ZfcUser\Authentication\Adapter\AdapterChain and init of ZfcUser\Form\Login failed for me. ProvidesEventsForm does not inject shared manager at all. EventProvider injects new instance of SharedEventManager that is different from one that could be get via application events in Module::onBootstrap().
When you're ready Zfcuser version 2? I can not migrate to zf3!
Go ! +1 !!
Any news about ZF3 support?
no i'm sorry
There are still some problems with the PR, so i can't merge yet. Unfortunately i'm extremely busy right now, so i don't have the time to fix at this moment. Please feel free to create PR's agains mine, and help fix the bugs.
@Danielss89 Can you say wat your issues are at the moment?
@stijnhau Well, i know there are some problems with the event stuff, but if you read the backlog of this issue, then it explains it better.
Please help, I am install stijnhau/ZfcUser from git hub and when I try to install zf-commons/zfc-user-doctrine-orm from composer I have an error:
composer require zf-commons/zfc-user-doctrine-orm
Using version ^1.0 for zf-commons/zfc-user-doctrine-orm
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- zf-commons/zfc-user-doctrine-orm 1.0.1 requires doctrine/doctrine-orm-module 0.* -> satisfiable by doctrine/doctrine-orm-module[0.1.0, 0.10.0, 0.11.0, 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.5.6, 0.5.7, 0.6.0, 0.7.0, 0.8.0, 0.8.0-beta1, 0.8.0-beta2, 0.8.0-beta3, 0.8.0-beta4, 0.9.0, 0.9.1, 0.9.2] but these conflict with your requirements or minimum-stability.
- zf-commons/zfc-user-doctrine-orm 1.0.0 requires doctrine/doctrine-orm-module 0.* -> satisfiable by doctrine/doctrine-orm-module[0.1.0, 0.10.0, 0.11.0, 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.5.6, 0.5.7, 0.6.0, 0.7.0, 0.8.0, 0.8.0-beta1, 0.8.0-beta2, 0.8.0-beta3, 0.8.0-beta4, 0.9.0, 0.9.1, 0.9.2] but these conflict with your requirements or minimum-stability.
- Installation request for zf-commons/zfc-user-doctrine-orm ^1.0 -> satisfiable by zf-commons/zfc-user-doctrine-orm[1.0.0, 1.0.1].
What me do?
any update on this? my module depends on this to allow my module to upgrade to zend framework 3
silent
Me too - my module depends on this, any update?
ZF3 has officially been released: https://framework.zend.com/blog/2016-06-28-zend-framework-3.html