-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Upgrading Zend Framework #5359
Comments
My vote is for leaving the status quo for 3.x, but with a focus on upgrading 4.0 to pull in the latest version of zf1 for 4.x via composer, maybe alpha2. I don't see a problem with 5.0 as a milestone for upgrading to zf2; By the time maybe there will be something better as an alternative? |
I think it's better to frame the biggest component of this RFC as "the future of internationalisation" rather than "the future of Zend Framework in SilverStripe". The other piece "the future of caching", I don't particularly like the ZF caching library and it's possible that another library would serve us better. I don't know if we want to look at a PSR-6 library such as https://github.com/tedious/Stash or https://github.com/symfony/cache (full list here https://packagist.org/providers/psr/cache-implementation) |
Yeah, now I’ve had some more time to think about this I think that’s the best approach. Sticking with ZF1 means much less risk of regression now that master is quite “mature” and closing in on 4.0.
Good point. I’d been thinking solely of keeping things as similar as possible to the status quo (with the intention of targeting 4.0), but if there would be major changes to get ZF2 out the door then we may as well do a wider review of how we do things instead.
I completely agree. I’d stuck with keeping ZF cache as a dependency because we depend on that for the i18n component (and it’s far too slow without caching), but that could be up for debate if we were to look at other internationalisation libraries. If we stick with Zend we could even keep ZF cache for i18n only, and make |
@chillu Can you offer any insight into ad6b7a4? It’s the only thing I’m stuck on with updating to the latest ZF1 and moving to Composer. Based on the discussion in #1457, this might be a showstopper for moving ZF1 out of |
Options are:
I notice that they did include maori in https://github.com/zf1/zend-locale/blob/master/library/Zend/Locale/Data/Translation.php for some reason. :) |
The 2nd option sounds like the only tolerable one... Otherwise, do we upgrade to ZF2? Do we need to live with |
Right, I’ve worked out what’s gone on with the missing Mystery solved, but unfortunately doesn’t solve our problem 😅. It might possibly make the ZF1 maintainers more amenable to a PR though... I’ll open an issue, you never know.
If we decide to upgrade to ZF2, or switch to another package, I think it will need to be a requirement. I can’t find any other i10n/i18n packages that don’t require that extension. Edit: Created an issue here zendframework/zf1#699 |
I think that'd be better than retaining support for old code. It may be that, in cases where |
After a bit of digging, ZF1 is indeed available through composer. I couldn't find an official reference from the ZF website though, might be somebody's pet project. Either way, I don't see a whole lot of benefit in spending energy to get ZF1 out of ZF3 is in development, so it's awkward timing to upgrade to ZF2 (http://framework.zend.com/blog/announcing-the-zend-framework-3-roadmap.html). They seem to be getting close to a release there. I think we can refactor
Note that we might still run into the "missing mi_NZ" locale issue; Debian Stable php-intl package comes with libicu 52. Which in turn packages in CLDR 24. Which doesn't have mi_NZ either (neither does the latest CLDR release). Since we can't hack in support in the same way as with ZF1 there, we would need to implement a locale cascade to fall back to |
Just checking, have you seen my comment above? It is still present, it’s just not bundled in the main release. I wonder if (hope!) libicu will pull in data from the SVN repo... |
Oh, maybe I've looked in the wrong place then? |
I'd be happy to require php-intl for advanced features, but I much prefer to pull in an existing library than having our own wrapper around php-intl. If we require both zf2-i18n and php-intl (or accept limited functionality if it's not available) then what additional features will we need to build? If the missing mi_NZ locale becomes a platform maintenance task, then I'm happy to accept this given we have an upgrade path for users that require mi_NZ (e.g. installation docs for debian, etc). |
I guess upgrading to zf2 (and doing it properly) would make a zf3 upgrade in the future easier, so let's not discount that as a stepping stone. |
Worth noting here that ZF1 reaches its EOL on 28th September. It’s not super critical for us as we don’t rely on some of the more sensitive things like the database components, but it’s another sign that we need to bite the bullet with this task soon :) ZF3 is out now, but requires PHP 5.6. |
When is ZF2 EOL? I guess it's unlikely we'll push to PHP 5.6 for SS4 |
March 31st, 2018 if we stick an LTS version (2.4): https://framework.zend.com/long-term-support |
hmm, we're hoping to support SS4 into 2nd quater of 2020 |
If there was a significant reason to do it, we could put it to the community. |
FYI, I've separated out the i18n discussion to a new RFC (to be written): #6090 |
Agreed |
I've drafted up a new RFC for replacement of zend at #6194 |
Closing in favour of more focused tickets: |
RFC: Upgrading Zend Framework
Author: @kinglozzer
Status: Draft
Version: 0.1
Disclaimer: there are outstanding issues yet to be resolved in this RFC that I am actively seeking opinions on (see the “Problems” section).
Introduction
SilverStripe Framework is currently running a release of Zend Framework 1 dated approximately 2011. We’ve added a few hacks & hotfixes since, but the code is largely unchanged since it was originally added. I think we’re long overdue an update.
We currently depend on the following ZF1 components:
i18n
depends on thisSS_Cache
depends on this, as doesi18n
& ZF1’s Translate component (Translate has opt-in caching of translations, which we do use)DBMoney
depends on this for formattingDBDate
,DBDateTime
,DBTime
all depend on this. There are a few other uses (e.g.Member
uses it to show date format examples), but those would be relatively simple to updatei18n
, a few form fields, ZF1’s Currency & Date components depend on thisMotivation
I can see the following benefits to upgrading to ZF2:
thirdparty/
.thirdparty/
will mean that we get new releases automatically.Proposal
i18n
andSS_Cache
APIs (I’ve done a small amount of work on this).intl
extension is installed (see “Problems” below).intl
(see “Problems” below).DateField
andNumericField
(see “Problems” below).Problems
intl
Significant portions of the code we’re using in ZF1 have no equivalent in ZF2, or now require the
intl
PHP extension. As a result of this, we will either have to refactor these in such a way that the functionality is optional (e.g. form fields are only locale aware ifintl
is installed) or look for alternative libraries that offer similar/equivalent functionality. Many Composer i18n/i10n packages now requireext-intl
, so perhaps this is indicative of modern PHP development.This is probably the main barrier for this RFC. Choosing alternative libraries will be difficult, as it’s hard to guarantee feature parity with what we currently have.
Backward compatibility
The API for the components has changed significantly since ZF1, which will add to upgrade pains. At a fundamental level method names and argument orders have changed (for example
$cache->get($key)
and$cache->save($data, $key)
have become$cache->getItem($key)
and$cache->setItem($key)
), but there are also deeper design changes.Because of this, I’m proposing delaying this work until 5.0 - just because we can break as much stuff as we like in each major release doesn’t mean we should, and there is no urgent need for an upgrade.
Alternatives
The simplest alternative that I can see is to remove
thirdparty/Zend/
and instead install the latest copy of ZF1 with Composer. This solves the issue of our copy of ZF being out of date (ZF1 is still maintained, just not as actively as ZF2) and should help keep us up-to-date with bug fixes. The drawbacks are that we don’t get any new features, and that support for ZF1 will likely end much sooner than ZF2 so we may find ourselves in the same boat further down the river.This alternative proposal may be appropriate for targetting SilverStripe 4.0, with a view to solving the remaining issues of this RFC and upgrading to ZF2 for SilverStripe 5.0.
The text was updated successfully, but these errors were encountered: