Zend Framework is out

An case you missed it (it’s all over Planet PHP), the first release of the Zend framework is out. Have only glanced so far so have no valid opinion – will be spending a good while looking first. Andi Gutmans announced it here along with further information here.

In a way, it marks a big shift in PHP as a community – an unavoidable meeting of voluntary contribution vs. commercial development. No things will probably not be the same again but at the same time, seeing this released is, for me, like a big sigh of relief – some wheels just aren’t fun to keep reinventing.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • Nikobass

    What is the point of Zend Framework? We already have PEAR/PECL as a php community..

  • http://www.phppatterns.com HarryF

    What is the point of Zend Framework? We already have PEAR/PECL as a php community..

    Without meaning to offend anyone, think you already answered your own question.

    Rather than repeat old arguments, let me put together some things I personally want from a PHP code base I’m building on, which I can’t (always) get from PEAR (PECL is really a different story).

    - Maintained – it’s been tested against new PHP versions, bugs fixed etc. API versioning also managed.

    - Consistency – across the code base, things are done in pretty much the same way and done sensibly (e.g. error handling, complex data types, etc.)

    - Completeness – the code base has clear objectives for the problems it’s trying to solve and addresses all of them with usable code that does all of what it’s supposed to

    - Documented + examples + unit tests (actually the latter seems to be missing from the ZF download)

    There’s probably more but that’s off the top of my head.

    Given that the Zend Framework is providing controllers (and an MVC implementation), that first point (maintained) is perhaps the most important.

  • Pingback: PhogBlog » Zend Framework released

  • lmpmbernardo

    my first impression is that I am not impressed. hopefully that will change. for instance, what’s the deal with the hierarchy of Exception classes that do nothing but extend the standard Exception class? what about YAGNI and KISS besides DRY? even the developers seem confused with them….

  • Anonymous

    Actually, I think that’s really useful. You can use it to test if an exception came from their stuff or your own. You can ignore that feature entirely, still “catch (Exception $e)”, and it will work just the same.

  • lsmith

    Just extending Exceptions is pointless class bloat. You could just as well use an “exception code” scheme for that. But I presume these are just placeholders that will get expanded once they actually know what to put in these exceptions.

    The code looks decent. I look specifically at the DB stuff, since thats my main area of expertise. Its alright, but lacks behind in a lot of areas. Even PEAR::DB should be more reliable when trying to attain portability at this point. There is a really wierd, aka stupid, quoteInto() method, which makes no sense what so ever (this is illustrates the obvious: they do not have better coders than other high profile PHP projects). Their query creation class could help in making a few things portable, but essentially mean you are not writing any SQL in which case I would probably prefer using a true ORM to begin with (which they seem to have cut out).

    What I find peculiar though is that their main selling points are not bundled with the release or are severely outdated. I am talking about the tests and the documentation. I can see some things being outdated in the documentation but the CS is totaly utterly out of date. This strikes me as really wierd. Do they internally use a different documentation or how can they leave the CS out dated?

    So to conclude at this point the API looks coherent, there is a fair share of documentation. But there is nothing there that really impresses me. But then again they still have some work ahead of them. The ezComponents are already a lot futher, but neither the Zend Framework nor ezComponents really have a chance (or intend) to displace PEAR which will beat them on maturity and scope for atleast the next 1-2 years. What comes then? Who knows? I have stated often that I feel that PEAR needs to reorganize to better deal with its success.

  • Buddha443556

    What happen to keeping it simple? Putting the Controller, View and Database together you wind up with a couple tons of includes. As is, this isn’t running anywhere but a dedicated server with an opcode cache and lots memory. Which of course, makes it perfect for the Enterprise environment.

    What’s with the database? They describe it as a light layer on top PDO. Something wrong with PDO? Not complex enough? You would think they could embrace something with the word “Object” in the name.

    In the View, did they actually abstract the HTML for forms? PHP is a server page language and they find it simpler to abstract the HTML? They of course needed an object for the view – can’t keep too simple, right?

    I’m sure they had no choice but to go with the “Monolithic” Front Controller so I won’t even go there.

    Thankfully, it’s just a preview and there are plenty of good ideas in there too.

  • Ren

    Wouldn’t say extending Exceptions where total bloat, I think subclassed exceptions should have more detail about the event that cause the exception. And I don’t mean just the class of the exception.

    As for the rest of the framework, only really used ZSearch so far, and apart from a few minor issues, it seems todo what it says on the tin. :)

    Glanced at the Front Controller/Routing, and doesn’t have any improvements over my own code atm. Though the comments do say its going to be replaced with something more flexible.

    Not quite sure why the JSON is there, as been using the extension which I thought was getting incorporated into the core at some point.

  • http://www.phppatterns.com HarryF

    Not quite sure why the JSON is there, as been using the extension which I thought was getting incorporated into the core at some point.

    Likewise that puzzles me. I don’t feel like I have a right to an opinion yet – there’s too many eyes watching and it’s too easy to be flippant without really looking. But, despite that, there what seem some strange choices in there (along with what seem good ones) – in particular I wonder about a framework which effectively markets the services of companies like Google Amazon and Yahoo so early in it’s design – perhaps there’s a demand and perhaps it helps promote but still.

    Particularily interested in that Lucene stuff ATM – search is something I think noone has solved well in PHP yet.

    May dump some first impressions eventually.

  • lsmith

    remember that they are targetting 5.0.x as the minimal version and so they cannot rely on newer bundle extensions (thats why they do not even rely on pdo).

  • Ren

    Particularily interested in that Lucene stuff ATM—search is something I think noone has solved well in PHP yet.

    Seems pretty good. It has limitations that need more work to remove. Atm it can only create an index, or query one. Imagine alot of people would like to either remove indexed documents, or update a indexed document, neither seems possible atm. So using it in things like Wikis etc are limited for the time being.

  • http://witmatix.com basbd

    Is it just me, or is the documention all messed up? For instance, in the Zend_Db_DataObject docs, the first code example requires the ZActiveRecord class and makes a call to the setDatabaseAdapter function:

    require_once('ZActiveRecord/ZActiveRecord.php');
    
    // Create a ZDBAdapter for ZActiveRecordBase.
    $db = new ZDBAdapterMySQL(array('host'     => 'localhost',
                                    'username' => 'user',
                                    'password' => 'password',
                                    'database' => 'test'));
    
    ZActiveRecord::setDatabaseAdapter($db);

    But no ZActiveRecord file/class exists in the framework. Another example: to create a database object, the documentation provides this code:

    require_once 'Zend/Db.php';
    $params = array (
        'adapter'  => 'pdoMysql',
        'host'     => '127.0.0.1',
        'username' => 'malory',
        'password' => '******',
        'dbname'   => 'camelot'
    );
    
    $db = Zend_Db::factory($params);

    But running this will throw an exception, because the correct call to the factory function requires the adapter as the first parameter, like so:

    $db = Zend_Db::factory('pdo_Mysql', $params);

    Seems like some blarring inconsistencies between the code and the documentation.

  • http://www.phppatterns.com HarryF

    Is it just me, or is the documention all messed up?

    You need to read this

  • malikyte

    I would have to assume that the framework lends itself to a certain areas of using services from sites such as Yahoo and/or Amazon because those companies happen to have PHP people working there. (i.e.: Rasmus -> Yahoo)

    I think for a core and initial release it’s a mistake. Worry about the basics and put out eye-candy later. If the main meal isn’t prepared well, who cares about the side-dishes?

  • Pingback: SitePoint Blogs » Zend Framework: Looking Good

  • Nikobass

    Thanks for your response Harry.

  • Pingback: PHP-DSL at Suttree, Elixir for Immortal Baboon

  • Pingback: SyntheticRabbit: Blog > News for the week of 3/8/06