LogoPhly, boy, phly
the weblog and site of Matthew Weier O'Phinney

Tuesday, April 7. 2009

Zend Framework 1.8 PREVIEW Release

By the time you read this, the Zend Framework team will have released a preview release of 1.8.0. While the final release is scheduled for later this month, this release represents the hard work of many contributors and shows off a variety of powerful new components.

If you're a Zend Framework user, you should give the preview release a spin, to see what it can do:

  • 1.8 Preview Release (zip)
  • 1.8 Preview Release (tarball)

One common criticism of Zend Framework is that it doesn't fulfill the traditional definition of a framework. One definition cited has been from TheFreeDictionary, and includes the following two potential matches:

A structure for supporting or enclosing something else, especially a skeletal support used as the basis for something being constructed.
A set of assumptions, concepts, values, and practices that constitutes a way of viewing reality.

The argument is that ZF does not provide the "assumptions" or opinions on how an application should be built. However, this makes sense only if you buy into the idea that a framework should always follow the "convention over configuration" rule -- which we soundly reject with Zend Framework. Our opinion has always been that developers know best how their application should be built, and that ZF code should support the myriad uses to which they will put it.

That said, with the addition of Zend_Application and Zend_Tool, Zend Framework now provides a comprehensive framework for its users that is opinionated and provides the flexibility for developers to impose whatever structure they need.

Zend_Tool provides a tooling framework for Zend Framework. It allows you to create your own tooling providers that can then be utilized by tooling clients, which utilize an RPC style architecture. We now ship a Console or command line interface (CLI) client that allows you to perform a variety of tasks -- such as setting up your initial project structure, adding new resources to a project, adding action methods and view scripts to controllers, and more. As an example, you can now do this:


% zf create project foo

and generate the skeleton for a new project in a directory named "foo", with the following structure:


|-- application
|   |-- Bootstrap.php
|   |-- configs
|   |   `-- application.ini
|   |-- controllers
|   |   |-- ErrorController.php
|   |   `-- IndexController.php
|   |-- models
|   `-- views
|       |-- helpers
|       `-- scripts
|           |-- error
|           |   `-- error.phtml
|           `-- index
|               `-- index.phtml
|-- library
|-- public
|   |-- .htaccess
|   `-- index.php
`-- tests
    |-- application
    |   `-- bootstrap.php
    |-- library
    |   `-- bootstrap.php
    `-- phpunit.xml

In the future, we will be adding more support to this. A big kudos to Ralph Schindler for doing the heavy lifting on this project.

Zend_Application provides both bootstrapping of your PHP environment as well as your application environment. When using Zend_Application, you will create an application bootstrap class that can either use resource plugin classes or define initialization routines internally; regardless, it allows you to define resource dependencies and bootstrap the various facets of your application. Even better, it introduces modules as first-class citizens of your applications. With the introduction of Zend_Loader_Autoloader_Resource and Zend_Application_Module_Autoloader, you can now use autoloading to resolve the various resource classes in your modules -- such as models, forms, and plugins. This tremendously simplifies the story for utilizing resources from other modules, as well as using resources within the same module. A big thank you goes out to Ben Scholzen for getting the ball rolling on Zend_Application and his significant contributions to the component.

There are many other stories in this release:

  • Amazon EC2 and S3 support (contributed by Jon Whitcraft and Justin Plock/Stas Malyshev, respectively)
  • Zend_Navigation, a comprehensive solution to generating and organizing navigation elements for use with breadcrumbs, navigation menus, sitemaps, and more (contributed by Robin Skoglund and Geoffrey Tran, from Zym)
  • Numerous additions to Zend_Validate and Zend_Filter support (primarily by Thomas Weidner)
  • Improvements to Zend_Search_Lucene support including searching multiple indexes and keyword field search via query strings (contributed by Alexander Veremyev)
  • Improvements to Zend_Pdf, including page scaling, shifting, and skewing (contributed by Alexander Veremyev)
  • and more...

A hearty thanks to all who have contributed so far in this release. Start testing it, and let us know what we can improve for the final 1.8 release later this month!

Posted by Matthew Weier O'Phinney in PHP at 22:27 | Comments (50) | Trackback (1)
Defined tags for this entry: php, zend framework
Related entries by tags:
Module Bootstraps in Zend Framework: Do's and Don'ts
Responding to Different Content Types in RESTful ZF Apps
Symfony Live 2010
Creating Re-Usable Zend_Application Resource Plugins
Quick Start to Zend_Application_Bootstrap

Trackbacks
Trackback specific URI for this entry

Zend Framework 1.8 and Beyond
Zend Framewor 1.8 is almost ready and as such, it’s time for me to look into what it’s got. There’s a good listing of what’s new over here and really on the surface it doesn’t look like much. But as a person who’s be...
Weblog: Darryl E. Clarke
Tracked: Apr 18, 11:37

Comments
Display comments as (Linear | Threaded)

In my opinion 1.8 will be one of the most important releases for ZF yet. While it is great to give every developer the opportunity to set up the application his own way, providing a ready-to-go solution for bootstraping will ease the collaboration between developers. You no longer have to dig into the source code to find out how things work - when you know Zend_Application you are all set. I think I won't need to tell anybody about the usefulness of Zend_Tool. ;-)

I hope that Zend_Navigation doesn't get lost in all the news though. I know it from its Zym days and I really like the idea and implementation. You will need some kind of navigation on 99.99% of your websites, so give everyone the tools to handle that is one another huge step - give it a try!
#1 mzeis on 2009-04-08 02:07 (Reply)
Hi,

Got one question, how resources are gonna be autoloaded ? Because this doesn't seems to work... This is from last function on main Bootstrap:

$acl = new 'MyModule_Model_Acl($auth);

Fatal error: Class 'MyModule_Model_Acl' not found in D:\_Work\site\application\Bootstrap.php on line 154
#2 Cristian on 2009-04-08 02:18 (Reply)
Would love to see this little one fixed .. *nudge nudge*:
http://framework.zend.com/issues/browse/ZF-6185

:-)
#3 Lukas (Link) on 2009-04-08 03:07 (Reply)
Great news Matthey. Can you tell me something about how and when Zend_Application and especially Zend_Tool will be incorporated into Zend Studio for Eclipse? Thanks!
#4 Gordon on 2009-04-08 03:12 (Reply)
Thats supposed to spell Matthew. Sorry. Still too early :-)
#4.1 Gordon on 2009-04-08 03:14 (Reply)
Great news, surely going to take a spin.

Only waiting on some 'password protection' ability for Zend_Pdf though ;-)
#5 Snef on 2009-04-08 03:53 (Reply)
This sure is great stuff, Zend_Application and Zend_Navigation were really missing, the first thing I did when starting a new app was copying over the bootstrap which justs feels wrong. :-)

Hope the issue I had with Zym_Navigation got fixed: if you had a custom default route (say, :section/:article) which all gets handled by Content module, the navigation would get confused which menu item was active (in my menu I change the :section part of the route).

Anyway, looking forward to seeing ZF 1.8 final.
#6 Dado on 2009-04-08 04:03 (Reply)
I would like to see http://framework.zend.com/issues/browse/ZF-5163 fixed. It's really trivial to fix and more than just a minor bug IMHO.
#7 Torsten on 2009-04-08 04:08 (Reply)
Zend_Application_Bootstrap_IBootstrap, Zend_Application_Bootstrap_IResourceBootstrap, Zend_Application_Resource_IResource??

What naming conventions are those? Shouldn´t it be: Zend_Application_Bootstrap_Interface, Zend_Application_Bootstrap_Resource_Interface, Zend_Application_Resource_Interface?
#8 Marc Jakubowski (Link) on 2009-04-08 06:20 (Reply)
We're moving away from '_Interface' in preparation for namespaces in PHP 5.3. Having the final segment of the classname use that verbiage will cause headaches later, as Interface is a reserved word.

I'm trying to decide if we'll go with I[Name], [Name]Interface, or just good, plain old descriptive naming at this point; we'll have a decision before 1.8.0 GA goes out the door.
#8.1 Matthew Weier O'Phinney (Link) on 2009-04-08 07:05 (Reply)
Ah ok, thought it might have to do with 5.3+namespaces, but was surprised that Zend_Application seems to be the only/first component to embrace that style. I thought that all components would change to the new style at once when 5.3 is final and there would be a new major release of ZF for that.
#8.1.1 Marc Jakubowski (Link) on 2009-04-08 07:25 (Reply)
I strongly dislike the direction of I[Name]. This would be a rather bad convention IMO. Are we to start naming our variables by type as well? a la: intFoo, strBar, ...

Please, please let it be [Name]Interface, or "just good, plain old descriptive naming."
#8.1.2 Stewart Lord on 2009-04-17 16:56 (Reply)
We're planning on following PEAR2 standards at this point. Those standards require plain old descriptive naming for interfaces and abstract classes -- though abstract classes may have a suffix of 'Abstract'. (Zend_Application in current trunk follows these conventions now.)
#8.1.2.1 Matthew Weier O'Phinney (Link) on 2009-04-19 08:09 (Reply)
I'm so glad! Thanks for the follow-up. Keep up the great work!
#8.1.2.1.1 Stewart Lord on 2009-04-26 13:47 (Reply)
And they are using _Base instead of _Abstract for the abstract classes as well.

One of the best things Zend has done was have a uniform naming convention in Zend Framework... I'd hate to see that die.
#8.2 WC on 2009-04-08 07:23 (Reply)
It won't die.. it's just that everything will be rewritten at some point ;-)
#8.2.1 Harro on 2009-04-08 08:21 (Reply)
Abstract is another protected keyword in PHP, and when we migrate to namespaces, this will also be problematic.

I will be firming up guidelines in the next two weeks for naming conventions of Interfaces and Abstract classes. In coming releases, we will be migrating to these conventions, while leaving the original classes/interfaces available. This will provide a gradual migration path as we prepare our 5.3 support.
#8.2.2 Matthew Weier O'Phinney (Link) on 2009-04-08 09:06 (Reply)
Matthew, please feel very much encouraged to bring your findings to the internals mailinglists. We should really update the current class naming guidelines in the manual and we might even implement some user and internal restrictions to "forcefully" guide people to prevent issues in their current and future code.
#8.2.2.1 Lukas (Link) on 2009-04-08 09:08 (Reply)
Lukas, yes, I plan to. :-) I'm also discussing the conventions with Travis Swicegood, Paul M. Jones, and Helgi so that we can ensure that we're at least mostly compliant with what PEAR2 will recommend (and thus remain compatible between the two projects and any projects following PEAR2 guidelines).
#8.2.2.1.1 Matthew Weier O'Phinney (Link) on 2009-04-08 09:12 (Reply)
Don't wait too long. Especially if we need to make internal changes this needs to start happening sooner rather than later. Also there are a few bright minds on the list that might have a thing to say as well :-)
#8.2.2.1.1.1 Lukas (Link) on 2009-04-08 09:15 (Reply)
Can Zend_Tool generate a modular directory structure?
#9 MB on 2009-04-08 11:19 (Reply)
I'm waiting for an answer too
#9.1 AJ on 2009-04-16 06:46 (Reply)
Not yet, but likely it will be able to prior to the 1.8 GA release.
#9.2 Matthew Weier O'Phinney (Link) on 2009-04-16 06:49 (Reply)
Can we already manage the application modules with Zend Tool?
#9.2.1 AJ on 2009-05-01 06:47 (Reply)
Not yet, but that functionality will be coming soon.
#9.2.1.1 Matthew Weier O'Phinney (Link) on 2009-05-01 07:46 (Reply)
The release notes didn't mention Zend_Loader_Autoloader, which if I remember correctly was a dependency for Zend_Application.

It looks like Zend_Loader_Autoloader is in the tarball. I haven't tried it yet, is it usable in the Preview Release?

Thanks,
--Rob
#10 Rob T. on 2009-04-08 13:46 (Reply)
Yep, Zend_Loader_Autoloader and the resource autoloader are in the tarball, and completely tested and documented!
#10.1 Matthew Weier O'Phinney (Link) on 2009-04-08 13:52 (Reply)
Speeding up ZF load time with resource autoloader:

If I followed things correctly, there was work to be done to speed up ZF load time by using the resource auto loader and removing many of the require_once() calls to allow for lazy loading only what is needed.

Now that the resource (auto)loader is in 1.8, when is this work targeted for?

Thanks,
--Rob T.
#10.1.1 Rob T. on 2009-04-10 10:47 (Reply)
While the autoloader can help speed things up, it does best when you strip require_once calls from the library. Unfortunately, we cannot do that in a packaged release until 2.0, as current revisions do not require autoloading in order to work. In the meantime, the performance appendix provides instructions on how to do so, and they can easily be added to a deploy script.
#10.1.1.1 Matthew Weier O'Phinney (Link) on 2009-04-10 11:59 (Reply)
I thought it might be 2.0. I did some quick searching for a 2.0 time-line or roadmap, but didn't find any.

Thanks,
--Rob
#10.1.1.1.1 Rob T. on 2009-04-10 12:23 (Reply)
Great news, thanks!

Do you have any porting notes you could share for those of us who might be migrating from pastebin/bugapps's My_Application and My_Application_Loader to Zend_Application?

Thanks,
--Rob
#11 Rob T. on 2009-04-08 13:56 (Reply)
I'm trying to play with Zend Tool, but it keeps throwing an Invalid Argument error when trying to run mkdir() on line 15 in Zend/Tool/Project/Provider/Project.php. I'm running on win and think that may have something to do with it. I've tried endless variations on the path name and still no luck. Any help? Also 'directory' is misspelled on line 18. This is probably not the best forum for this post, but I though I would throw it out there.
#12 anon on 2009-04-09 04:53 (Reply)
I experienced the same. I opened an issue report for it: http://framework.zend.com/issues/browse/ZF-6262

It works if you put the path name in the initial command (see the report for details).
#12.1 Glen Ainscow on 2009-04-10 15:41 (Reply)
Thanks Glen. Looks like Ralph is on it, so we should have a fix for 1.8.
#12.1.1 anon on 2009-04-13 18:30 (Reply)
I've been so excited for this release! I have been checking the ZF homepage almost every day hoping that it has finally been released. Especially for Zend_Application and the resource autoloader for Modules...I can't wait! I will have to play around with the preview release.

Thanks for all your hard work...and your blog! You've helped me a lot!
#13 Andrew Havens on 2009-04-09 21:58 (Reply)
I finally managed to run my own Zend_Tool_Framework_Provider action, however currently its only able to preform generator actions on filesystem.

What about provider actions that can initialize current environment and obtain database access to perform database specific actions ?

I've created my own implementation to that problem, but it's lame so I was hoping that ZF will solve that issue in a more elegant way.

Do you have plans for such behaviour and if so when we can expect some preview release ?
#14 Przemyslaw Wroblewski on 2009-04-10 09:22 (Reply)
We have discussed this internally. Right now, we're looking at consuming Zend_Application within Zend_Tool_Project to grab DB connection details and setup the DB adapter. However, useful as this may be, we're not considering it a "must have" for the 1.8 release. Once we have figured it out, though, we will likely release the providers to drop into your library until they can appear in an official packaged release.
#14.1 Matthew Weier O'Phinney (Link) on 2009-04-10 10:39 (Reply)
I am very happy to see zf moving forward!!

I was embarrassed that there is no mention of speed improvements. I thought this would be the main priority of future releases?

Thinking of zf 2.0: will it be completely restructured to make use of php 5.3+ features (namespaces, functions, etc)?
#15 coding horror on 2009-04-11 09:15 (Reply)
While we are keeping an eye on performance, it is not the main priority of our roadmap. The 1.8 release is focussing on rapid application development tooling -- Zend_Tool and Zend_Application -- which is a different kind of performance altogether. :-)

ZF 2.0 will likely focus on PHP 5.3; to what extent, we haven't fully decided at this time.
#15.1 Matthew Weier O'Phinney (Link) on 2009-04-11 10:26 (Reply)
"which is a different kind of performance altogether."
:-D true.

Thanks, I am looking forward to it.
#15.1.1 coding horror on 2009-04-11 13:09 (Reply)
Cool, this looks like a copy of the CakePHP structure and bake shell :-)
#16 Simon (Link) on 2009-04-15 06:38 (Reply)
Ralph, the lead on Zend_Tool, actually looked to a number of projects for inspiration, including Symfony, CakePHP, Rails and Django. There will likely be something familiar in the tool for people coming from many backgrounds.
#16.1 Matthew Weier O'Phinney (Link) on 2009-04-15 06:45 (Reply)
Not sure how to report this so I'll put it here and those that know may be able to check if this is a bug and if so, has been reported:
I'm currently using ZF-1.7.3 and

Zend_Date::now()->get('WEEKDAY')

returns the correct day of the week (Wednesday)

However when I change to using ZF-1.8.0PR
the same command generates

WWedK104613960002009
#17 Jim Clements on 2009-04-15 19:42 (Reply)
Jim:
The manual clearly states since before release 1.0 that you should use the constant Zend_Date::WEEKDAY.

Zend_Date::now()->get(Zend_Date::WEEKDAY);

Using the content of a constant is never a good idea as there could be reasons to change the content, but never to change the constant itself.

In this case the date validator, and the date rendering did not work like described in the manual. This bugs have been fixed by changing the content of the contants like several times in past through the rest of the framework.

I expect that you are using ISO notation so the given string should correctly be rendered to "W Weekday3Digit K DayOfYear SwatchTime Year4Digits".

I would propose that you use Zend_Date like described in the manual, by using constants when you really want constants, and not by giving strings which would mean that you want to create your own format.

Use Zend_Date::now()->toString('WEEKDAY') in 1.7.3 to see what I meant with bug in the rendering engine.

Greeting
Thomas
#17.1 Thomas Weidner (Link) on 2009-04-16 01:28 (Reply)
Zend/Console.php ???
Zend_Console_Context_Interface&Zend_Build_Manifest not exists.
#18 sasezaki (Link) on 2009-04-16 14:39 (Reply)
Zend_Console was added for a previous incarnation of Zend_Tool; it's now removed from trunk. Thanks for bringing it to my attention!
#18.1 Matthew Weier O'Phinney (Link) on 2009-04-16 15:48 (Reply)
Small bug in Zend_View_Helper_Json, $options is used in Zend_Json::encode but is only set if $keepLayouts is an array.
#19 Erik on 2009-04-23 16:03 (Reply)
This is fixed in the repo already and will release with the GA release.
#19.1 Matthew Weier O'Phinney (Link) on 2009-04-24 09:14 (Reply)
I'm eagerly anticipating the final release of 1.8. The one thing i liked about your post was that you clarified what a framework actually is and what it isn't. I too, was under the assumption that a framework should follow convention over configuration, but now have changed my mind.
#20 Revolves (Link) on 2009-04-24 08:34 (Reply)
When I attempted to setup the structure like done in the example above, I recieved the following error:

Fatal error: Class 'Zend_Controller_Action' not found in C:\wamp\www\ZendFramewo
rk1.8.0\application\controllers\IndexController.php on line 3

The command I executed was:

zf create project C:\wamp\www\ZendFramewo
rk1.8.0\

Can anyon help me out? Any help would be GREATLY appreciated.

- Moshe
#21 Moshe Teutsch on 2009-04-28 06:24 (Reply)

Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

 
 
  • Home
  • Resume
  • Blog
  • Phly PEAR Channel
  • Contact Me
  • About this site

ZCE

Zend Education Advisory Board Member

Add to Technorati Favorites

Calendar

Back March '10 Forward
Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

Quicksearch

Links

  • PHLY - PHp LibrarY
  • Paul M. Jones
  • Mike Naberezny
  • Shahar Evron
  • Planet PHP
  • Zend Where I now work
  • Garden.org Where I once worked

Archives

March 2010
February 2010
January 2010
Recent...
Older...

Categories

XML Linux
XML Personal
XML Aikido
XML Family
XML Programming
XML Dojo
XML Perl
XML PHP

All categories

Syndicate This Blog

XML RSS 0.91 feed
XML RSS 1.0 feed
XML RSS 2.0 feed
ATOM/XML ATOM 0.3 feed
ATOM/XML ATOM 1.0 feed
XML RSS 2.0 Comments

Show tagged entries

xml best practices
xml books
xml conferences
xml cw09
xml decorators
xml dojo
xml dpc08
xml file_fortune
xml git
xml linux
xml mvc
xml oop
xml pear
xml perl
xml personal
xml php
xml phpworks08
xml programming
xml rest
xml ubuntu
xml vim
xml webinar
xml zendcon
xml zendcon08
xml zendcon09
xml zend framework
© 2004 - present, Matthew Weier O'Phinney
matthew-web <at> weierophinney.net