Jun
18

I just discovered today ezpdo a simple solution for PHP 5 Object Relational Mapping and Data Persistence.

The goal of this project is to design a lightweight and easy-to-use persistence solution for PHP. This is how the project got its name, Easy PHP Data Objects (EZPDO). Simplicity is the key. Constantly we keep the following requirements in mind when designing EZPDO.

Some features of ezpdo are listed below :

  • Minimum SQL knowledge required
  • Requires minimum ORM specification
  • No Phing! No need of explicit command line compile
  • Works with existing code and database
  • Has a small runtime core to guarentee performance
  • Handles 1:N, and M:N relationships automatically
  • Provides a simple runtime API
  • Supports object query (EZOQL)
  • Auto generates database tables
  • Test-driven with continuous integration
  • A sample usage :

    /**
    * Class of a book
    * @orm mysql://dbuser:secret@localhost/ezpdo
    */
    class Book {

    /**
    * @orm char(64)
    */
    public $title;

    /**
    * @orm char(32)
    */
    public $author;

    /**
    * @orm integer
    */
    public $pages;

    /**
    * @orm boolean
    */
    public $is_easy_to_read;

    /**
    * Your regular code for the class here.
    * ……
    */
    }

    Notice the @orm tags in comments which are used by the ezpdo.

    EZPDO have nothing to do with PDO (PHP5 Data Object), anyway its using ADODB as database abstraction. Very easy to use as its name indicates. I would prefer if it was using ADODB Lite Or just simply PDO … Anyway you should give it a try, there is good documentation and tutorials in the website.

  • EZPDO Website
  • Download EZPDO
  • Tags: No Tags

    5 Responses

    • Comment by xman101
      June 26th, 2005 at 4:48 am

      Using adodb_lite is really simple in EZPDO. one way of doing that is to have local.php placed under the ezpdo install dir that defines EP_LIBS_ADODB. here is an example of local.php.

      /**
      * The following let EZPDO use adodb_lite
      */
      if (!defined(’EP_LIBS_ADODB’)) {
      define(’EP_LIBS_ADODB’, /path/to/adodb_lite’);
      }

      it worked for me like a charm, but i need yet to do some benchmarking to see how much performance improvement we can get.

    • Comment by Hatem
      June 26th, 2005 at 8:35 am

      Yeah that’s why I was talking about it, coz its easy to integrate with adodb :-)

      But I read in php|arch june 2005 edition a comparative of ezpdo with DB DataObject and Propel, it shows that number of queries in ezpdo is very very high for example (Modify an existant student : DB DataObject 2queries, Propel 6 queries and ezpdo 2518 Queries !!) I guess there is more optimisation to do !

    • Comment by xman101
      June 26th, 2005 at 2:59 pm

      optimization is under way i was told by the ezpdo dev folks. the php-a article was a great effort. though some of the points (negative) no longer hold as ezpdo has been greatly improved over the past months. as a user i have seen that. i hope oak or elnayaf will have time to make a post to clarify some of the things mentioned in that article.

    • Comment by Hatem
      June 26th, 2005 at 9:28 pm

      Anyway I find its idea is great, im trying to have a look on code as I have time.

    • Comment by xman101
      June 29th, 2005 at 5:38 pm

      just to quickly drop a line that ezpdo.net has just published a [url=http://www.ezpdo.net/blog/?p=860]before-and-after performance comparions[/url] in terms of number of queries triggered by object operations, and [url=http://www.ezpdo.net/blog/?p=859]their comments[/url] to the php |arch article. looks like ezpdo is really moving along pretty fast. nice.

    Leave a Response

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>