#!/usr/bin/php -q // +----------------------------------------------------------------------+ // // $Id: createTables.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $ // // since this version doesnt use overload, // and I assume anyone using custom generators should add this.. define('DB_DATAOBJECT_NO_OVERLOAD',1); require_once 'DB/DataObject/Generator.php'; if (!ini_get('register_argc_argv')) { PEAR::raiseError("\nERROR: You must turn register_argc_argv On in you php.ini file for this to work\neg.\n\nregister_argc_argv = On\n\n", null, PEAR_ERROR_DIE); exit; } if (!@$_SERVER['argv'][1]) { PEAR::raiseError("\nERROR: createTable.php usage:\n\nC:\php\pear\DB\DataObjects\createTable.php example.ini\n\n", null, PEAR_ERROR_DIE); exit; } $config = parse_ini_file($_SERVER['argv'][1], true); foreach($config as $class=>$values) { $options = &PEAR::getStaticProperty($class,'options'); $options = $values; } $options = &PEAR::getStaticProperty('DB_DataObject','options'); if (empty($options)) { PEAR::raiseError("\nERROR: could not read ini file\n\n", null, PEAR_ERROR_DIE); exit; } set_time_limit(0); DB_DataObject::debugLevel(1); $generator = new DB_DataObject_Generator; $generator->start();