Monday, August 11. 2008Zend Framework 1.6.0 Preview, or, PHP 4 is DeadPHP 4 officially died Friday. I started programming PHP with release candidates of 4.0.0 -- which simultaneously introduced me to the GNU C compiler and toolset. My first official job using PHP was at a shop that was using PHP 3, and considering the costs of upgrading to PHP 4 -- which clearly offerred many benefits over its predecessor. I switched to PHP 5 as soon as the first official release was made four years ago -- the pains of reference handling with objects, the introduction of a unified constructor, first-class support for overloading, and SimpleXML won me over immediately, and I've never looked back. Goodbye, PHP 4; long live PHP! I'm celebrating with the second release candidate of Zend Framework 1.6.0, which should drop today. There are a ton of new features available that I'm really excited about. I'm not going to go into implementation details here, but instead catalogue some of the larger and more interesting changes that are part of the release. Dojo IntegrationI've blogged a number of times about this, but a picture is worth a thousand words... or lines of code, in this matter. I'm going to show these as images, as I still need to determine how and where to get a public demo up, so bear with me. First:
What you're looking at is a form generated using Zend_Form (or, in this case, Zend_Dojo_Form). It contains four subforms, each represented by a tab. (I also created an additional decorator that creates the fifth tab.) The form elements are all Dijits, presenting a common look-and-feel, and have a variety of validators and features themselves. The fifth tab shows off some fun features of Dojo: the ContentPane actually has no content, but was defined with an 'href' attribute pointing to a resource on the server. On this particular page, I define a dojo Grid that consumes an ItemFileReadStore -- a fancy word for a remotable dojo.data resource. I used Zend_Dojo_Data to provide that, and the result is that, when you click on the tab, the following loads dynamically:
This stuff is ridiculously easy to pull off and create now -- which means I no longer have any excuse for crappy looking forms or not adding ajax features to apps. In experimenting with Dojo, I also discovered its build tools. Once your code is developed, it's a trivial task to tally up all your dojo.require statements, throw them in a build profile, and create a layer for use with your application. Doing so has tremendous performance and bandwidth benefits, and can mean the difference between a good application and a great one, in terms of user experience. I'll blog more on this later, but I'm excited that, because we're shipping a full source build of Dojo, this support will be delivered to ZF users out of the box. Unit testing infrastructure
I've also blogged about this before.
I've been using the There's nothing quite like having the assurance that your entire application -- not just your models -- works according to the expectations you've worked up, and that the document structure adheres to the design. This is going to become a must-have component for serious ZF developers. Captcha SupportCaptchas have become an essential tool in the anti-spam arsenal of most sites. While tools such as Akismet are fantastic, it's even better not to even need to send data to Akismet to process in the first place. Stas worked up a nice design for captchas as we were finishing 1.5.0, but we didn't have time to complete it before shipping the release. This turned out to be fortuitous, as we have received community contributions of Figlet and ReCaptcha support since then. Zend_Captcha provides adapters for each of these, as well as for a GD-based image captcha. You can now pick and choose which works best for your site or altruistic leanings; using them in your forms is as simple as creating a Zend_Form element. SOAP SupportZend_Soap has been languishing in the incubator since before the 1.0 release. The WSDL autogeneration was mostly untested, and for several use cases, completely broken. Additionally, I had created but never completed testing and documenting Zend_Soap_Server, a thin wrapper on top of PHP's own SoapServer class. Alex took Zend_Soap on as a project for 1.6.0, and has done tremendous things with it. He has even created a compatibility matrix that users can update to show how WSDL autodiscovery works with various SOAP clients -- which will help us improve it in the future. Form ImprovementsThere have been many feature requests and bugs filed against Zend_Form since its debut in 1.5.0, and I tried to address the most requested and critical of these for the release. There are several improvements that should make using Zend_Form easier and more flexible:
FireBug SupportThe author of FirePHP, Christoph Dorn, has committed a new component to ZF, Zend_Wildfire. Wildfire is a project for standardizing communication channels between components; FirePHP is one implementation that communicates with the FireBug console for Firefox. The Zend_Wildfire component consists of a log writer, Zend_Log_Writer_Firebug, and a profiler, Zend_Db_Profiler_Firebug, which logs DB profiling information for use in FireBug. Together, these allow you to do more informed debugging in your browser, and can complement PHP debuggers such as XDebug and the Zend Debugger. Pagination SupportRaise your hand if you've ever needed to provide paginated result sets for your data -- good, I see a ton of virtual hands waving out there. Pagination is something that needs to be done frequently, usually needs to be tailored to your data and site, and is almost invariably a pain every single time. Zend_Paginator aims to make it simple.
Any iterable data set can be consumed by Zend_Paginator. You then need only
specify what the current page number is and how many results per page to
display -- it works out the calculations, and, when used in conjunction with
the And then there was...There are too many improvements and features really to count at this stage. We had originally intended this release to be smaller and offer fewer features, but as the time for release came closer, we discovered we had another monster on our hands. There is much to be excited about with this release -- and still much, much more in the wings for future releases. We are planning on tightening our release cycle so that we can offer more frequent and less intimidating releases in the future. Combine this with improvements we've been making to the proposal process, and you should be seeing more great things coming from the community -- more frequently! A huge thank you to all contributors, the Dojo team for answering my many questions, and my family for putting up with my long hours the last couple months. Happy developing!
Posted by Matthew Weier O'Phinney
in PHP
at
13:15
| Comments (21)
| Trackback (1)
Defined tags for this entry: php, zend framework
Comments
Display comments as
(Linear | Threaded)
If only PHP4 would have lived a little bit longer to see the second release candidate of ZF
Hi Matthew,
Great news... awful question but here it goes anyways: When can we expect ZF 1.6 to be stable? By all means guesstimate I need to ascertain whether i should upgrade to 1.6. Currently working on a new project due mid-Sep 08. 1.6.0 final will be out before the end of this month.
I would wish ZF would stick with its original promise, KISS, not trying to compete with PEAR on the breadth of packages. Instead more and more packages are being added while there is plenty of work left in existing packages like the http client, the feed parser etc.
ZF users do not necessarily want to go to other frameworks and libraries to get the functionality they need. Additionally, like PEAR, ZF is a community driven project; many of the new features are features that have gone through the proposal process and are contributed because a number of developers have expressed a need and come up with a solution.
Finally, we are well aware that there are issues with existing packages; we do keep an issue tracker to keep track of these. However, we must balance the severity of issues when prioritizing for each release, and with the shear volume of packages, we cannot get to every issue for every release (though we are striving harder to do so). Well thats a change in philosophie that was never announced. In the beginning it was about providing solid KISS packages that are well documented for the core needs of people.
Also if there are open bugs for a year and there is a patch for a few months, I have a hard time understanding why a patch does not make it in. Anyways its becoming clearer and clearer that whoever is behind the steering wheel is not now following the original mission statement (in open source its obviously legit to change) and that ZF now tries to take PEAR head-on. Kinda a pitty that back then there was no attempt made to work together with the PEAR community with the "excuse" we just want to provide solid core components and while the core components are by far not solid yet, more and more components are getting added. Obviously the test and documentation situation is still better in ZF across the board. But you are aware that all these components need maintainers. That maintainers move on etc. Soon you will see similar issues that PEAR has faced. Only with the difference that you guys splintered the PHP lib development community further. And for what gain? This bogus "clean IP" argument? If there's been any change in philosophy, then it may have occurred when I joined Zend to manage the ZF project. That said, I did a lot of research in to the past development- and future direction- of ZF before starting to influence the direction of the project in any substantial way. And the ZF team has tried to be as open as possible with every decision; in my experience with OS projects we consult the community relatively often to determine the direction of the project. If you think there's more that we can do, please let us know.
I can assure you that we have no intention whatsoever of 'to take PEAR head-on'- or any other project, for that matter. The fact is, the PHP community is huge and there is room for all of these projects. And considering that it is impossible to come up with a single solution that is optimal for every developer, I believe choice is a very good thing in this case. I see your point about the issues, and I plan to address it by posting a report based on issue age very prominently. This will be rolled out with a general update to the issue tracker that should make it easier to use and clearer for new contributors. Hopefully this will be available around the 1.6 release. We have also begun to discuss the issue of maintainers moving on, but we don't have a final process to put in to place yet. To be honest, Lukas, I feel that you're being very hard on the ZF project lately. I'm not sure why, but I do want to make it clear that many people find it to be a very useful project, and despite the concerns that you seem to have with how the project is run, our contributors and users have done an outstanding job in building both the project and community. That said, I'll take all the criticism that you can throw at Zend and the ZF project and try to do what I can with it. ,Wil Maybe I am still bitter that nobody at Zend bothered to speak with PEAR before launching ZF. Of course the PHP community is big, but I never understood why Zend felt that there was no way to cooperate. I am sure if they would have pored their ressources into PEAR we would be further along today.
Now I must say that I can see that ZF packages were designed and documented. But given that they are riddled with bugs PEAR has long fixed, I am wondering at what gain? And with the change of philosophie I feel like you gave people a false lure (as in that they thought they could expect all components to be made as solid as other solutions before you guys branch out). At least I was expecting this and after my first couple month project using Zend, I feel that without having PEAR packages to look at, to fix ZF bugs, I would be in trouble. Which is something I would expect other open source developers would naturally do to begin with if it wasnt for this clean IP BS, which I will never get tired knocking. Just to make it clear, I am not telling people to ignore ZF in favor of PEAR. I am trying to tell the ZF developers to stay true to their original mission statement and then I will gladly grab what's in ZF before going to PEAR packages for niche features.
Lukas,
When will you commit these bug fixes that you mentioned getting from PEAR?
#3.1.1.1.1.1.1
Slango
on
2008-08-14 16:28
(Reply)
Okay, that was a bit douchey of me. My two cents is this: ZF is an open source project, and anyone is welling to contribute. Zend has laid an excellent foundation for future development and improvements, but if anyone is unhappy about the number of un-addressed bugs or the quality of components, it's up to them to make changes. As far as I'm concerned, since Zend has given anyone the opportunity to contribute, they have no responsibility to act on any agenda but their own.
What's more, this whole ZF vs. PEAR nonsense is beginning to bug me. I encourage Zend to take PEAR head on. In a free market competitors will struggle to gain the upper-hand by satisfying consumers more than the other, and in the end, the beneficiaries are the users. I think it's the same with developers. Whichever project satisfies their needs more will earn their support. Perhaps the supporters of PEAR ought to mobilize and fight back. Make no mistake, nothing precludes a developer from contributing to both.
#3.1.1.1.1.1.1.1
Slango
on
2008-08-16 00:08
(Reply)
s/anyone is welling to contribute/anyone who is willing to can contribute/
#3.1.1.1.1.1.1.1.1
Slango
on
2008-08-16 00:10
(Reply)
Well I have provided patches, others have supplied patches. But instead of applying them, more and more new packages are added for functionality that exists else where already (maybe not as compatible with PHP5 or as well documented, but again originally ZF wanted to focus on doing the core set "right").
Also ZF chose to require a CLA. I (not sure if you follow my blog on pooteeweet.org) and others have made it clear why we feel that CLA's in general and the Apache base CLA's in particular (unclear clause about patents) is unacceptable for any sane OSS developer. Hi Matthew,
I have to partially disagree. There're several issues opened for more than year, much longer than a number of packeges live in ZF. E.g.: framework.zend.com/issues/browse/ZF-1398 framework.zend.com/issues/browse/ZF-1541 (Long time awaited improvement) framework.zend.com/issues/browse/ZF-1688 (Postponed? 12 votes!) framework.zend.com/issues/browse/ZF-1842 Where's the 80/20 rule? I don't believe that 80% of users will ever need any service component, but certainly more than 90% use Zend_DB now. Asome job people.
One question about zend_form: I look at zf documentation and I can't figure out how to setting a form level error message http://framework.zend.com/manual/en/zend.form.forms.html#zend.form.forms.validation.errors
I've been reading the articles on ZF throughout your blog. Maybe here might not be the right place but I'd be really grateful for some input!
Is it worth holding out for a refactor of the ZF for PHP 5.3 and if not do you think it be easy to upgrade/path previous versions to any new versions which support 5.3? From what I can see we won't see a production ready version until after christmas at the earliest of 5.3 ... I wouldn't hold out for a PHP 5.3 version of ZF. We have only done some very, very prelimnary scoping of ZF 2.0, which will be the first version to support PHP 5.3. Why? because until this month, the features to be included in 5.3 have been very much in flux. Additionally, it doesn't make sense for us to support 5.3 until it has (a) stabilized its API, and (b) had some measure of adoption.
The features we plan to adopt will likely have wide-ranging effects on the framework, and we will need to plan carefully. While we will allow backwards compatibility breaks for 2.0, we also want to have as many tools in place to allow migration from pre-2.0 versions. Identifying the new PHP features we wish to use and providing the migration tools will take time. At this point, we do not envision a ZF version that makes full use of 5.3 until mid- to late 2009 (though we will, and do, _run_ on 5.3 prior to that). do you have a public demo of the dojo stuff yet?
my main interest is with dojo.data interacting with the server. in dojo 1.2 there is a jsonRestStore. are there any good examples demonstrating a Zend Rest Server? i don't necessarily need rest but it seems to be a conceptually simple way to serve data. basically, getting dojo.data to interact with the server is the missing link for me at the moment. I don't have a public example up yet, but there will be one no later than when we go live with 1.6.0 (we're adding a demo area to the ZF site).
I've done a fair bit with using ZF actions to return dojo.data payloads using Zend_Dojo_Data. It's trivial -- simply add your Iterable object or array to the Zend_Dojo_Data object, and echo it. I've used it to feed grids, ComboBoxes, and FilteringSelects with no issues. i've managed to get the ZF actions to feed the data. the problems i have are probably more on the dojo side. for example, if i create a new item in the store then what do i do about it's id? i figured that if i used a jsonRestStore with a compatible Rest server then some of these problems might fix themselves. i would hope that if i attach a grid to a jsonRestStore then if i edit an item in the grid or add a new one then the store will know what to do and talk to the server in a way that the server understands and my data will all work without me needing to get involved.
it would be nice if it could be as simple as this: Zend - give the service/resource an address (URI) - connect it to a resource (typically a db) Dojo - point the store to the server - connect the widget to the store my problem is not so much formatting the data but it's determining how the client and the server should make requests and respond with each other in a way that works for both of them. What you're talking about is a writable dojo.data store... and this I have not yet attempted. It's a feature I would like to support through a class extension to Zend_Controller_Action to make it trivial to do so, but for now, you have to hack it on your own.
Look for this sort of support in future releases of ZF - likely in the 1.8.0 time frame. Add Comment
|
Calendar
QuicksearchLinks
CategoriesSyndicate This BlogShow tagged entries |
|||||||||||||||||||||||||||||||||||||||||||||||||








The second 1.6 Release Candidate was published earlier this day and - wow - we’re going to get a lot of new stuff to play with. Or like Matthew put it: There are a ton of new features available that I’m really excited about. Word! Not only...
Tracked: Aug 11, 18:03