PHP GEN Documentation

Last modified: 25 Dec 2006.


Requirements

Optional:

Installation

Taken from the README file.
  1. Make sure Pear::DB package (http://pear.php.net/package/DB) is installed on your system.
  2. !!IMPORTANT: Make sure php's magic_quotes_gpc is enabled while using PHP GEN!! You can set this in php.ini or per directory using htaccess (if supported by your webserver).

    An example .htaccess:

    php_value magic_quotes_gpc 1

  3. Decompress the tarball (OK, I guess you already did so)
  4. Move the contents to a directory accessible by the webserver (referring to as /www/php_gen/ from now on)
  5. Create .htaccess shown above in /www/php_gen/ if necessary
  6. Make following directories writable to the user running the webserver: Also make sure all (if any) files and subdirectories contained in those directores are writable by that user.
  7. Configure the folder and database connection settings in /www/php_gen/common/config.php. ! Don't just copy this file from an older release, as new configuration settings might be added !
  8. Point your browser to the web page corresponding to /www/php_gen/engine/install.php
  9. If all tests ran succesful, you can continue to "Select Table"

Sample Tables

To use the sample tables:

  1. Create a database testdb.
  2. Execute the SQL queries listed in /www/php_gen/testdb/testdb.mysql (warning: this file contains queries to drop tables 'product' and 'brand' should they already exist).
  3. Configure PHP GEN to use testdb in /www/php_gen/common/config.php (set 'DB_NAME' to 'testdb')
  4. Point your browser to /www/php_gen/engine/select_table.php.
  5. Generate scripts for the table 'product', restoring configuration from testdb.product.php. Configurations for tables 'brand' and 'category' are included but they don't do anything special.

Select Table

On this page you can select for which table you'd like to generate scripts. A checkbox is available for restoring a previous config file (if available in /www/php_gen/table_config/)

Configure Table

On this page you can enter basic configuration for each table column.

Additional Info

Following options are common to all types, which was configured for each field in the previous step:

Following options are 'Type' dependent, which was configured for each field in the previous step:

* only supported when using MySQL (for now)

Generate Scripts

If everything went OK, you should be offered a link to the list page and a link to step 1 to configure more tables.
If something went wrong... double check your configurations (of both PHP GEN and current table) or you can leave a message at the support forums.

Changes

Past changes to this document include: