Workflow

Table of Contents

Here is the workflow to use EZPDO to persist/retrieve your objects.

Configuration

You can use any text editor to modify your own EZPDO configuration file. Configuration options can be specified in either an XML file or an .ini file. A complete list of options with detailed descriptions can be found here. Most of the options are self-explanatory.

Mapping

You start with your existing PHP source code or totally from scratch. Once you decide what classes you want to persist, you insert a few lines of comments in the class files with the special @orm tag.

To map complex object relationships, please take a look at how relationships are handled in EZPDO.

Compile (optional)

If you enable auto_compile in your configuration file, this step is not even needed.

You can explicitly run the EZPDO compiler script on the class files. For example,

  cd /path/to/ezpdo/install
  ./scripts/epc.sh -c path/to/your/config.xml

The special @orm comments you put in the classes give the compiler enough information to generate runtime configuration. Warning and errors are output to the compiler log (which can be specified to either a file or your standard console in your configuration file).

Again, if you enable auto_compile in your configuration file, you can skip this step. Your class will be compiled the first time you persist it.

Runtime

At runtime, you call the persistence manager to manage objects. Make sure to include the EZPDO runtime before you call the manager,

include_once('/path/to/ezpdo/install/ezpdo_runtime.php');

If your config file (config.xml) is in a different directory, you need to load it explicitly. (This is not needed if your scripts and config file live in the same directory.)

include_once('/path/to/ezpdo/install/ezpdo_runtime.php');
epLoadConfig('/path/to/your/config.xml');

For most of the times, you need only six methods (i.e. create, commit, refresh, delete, deleteAll and find) provided from the manager (as shown in the simple example).

4 user comments

  1. EZPDO » Blog Archive » EZPDO in the last week on March 19th, 2005:

    […] ntime API to manage objects, and the mini object query language, EZOQL, to search objects. Auto-compile and auto-flush are another two useful features noted by many. We have also received many […]

  2. EZPDO: An O/R Mapping and Persistence Solution for PHP5 on April 24th, 2005:

    […] F.A.Q.   

    The point of using EZPDO By ezpdo4php on […]

  3. Nick on November 19th, 2005:

    Typos:

    “manger” –> “manager”
    “If the options is disabled” –> “If the option is disabled”
    “infomation” –> “information”
    “curernt” –> “current”

  4. ezpdo4php on November 19th, 2005:

    thanks nick. not corrected.

Post your comments

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

Couldn't find your convert utility. Check that you have ImageMagick installed.