From 14c9366aac697e87499c5748b36fa7bf5e6cd320 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 22 Aug 2008 09:17:14 -0400 Subject: include external libs in a subdir to make install easier darcs-hash:20080822131714-84dde-6978424ded2ed1041a65142a25560654ac717fcd.gz --- extlib/DB/DataObject/createTables.php | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 extlib/DB/DataObject/createTables.php (limited to 'extlib/DB/DataObject/createTables.php') diff --git a/extlib/DB/DataObject/createTables.php b/extlib/DB/DataObject/createTables.php new file mode 100755 index 000000000..c0659574e --- /dev/null +++ b/extlib/DB/DataObject/createTables.php @@ -0,0 +1,59 @@ +#!/usr/bin/php -q + +// +----------------------------------------------------------------------+ +// +// $Id: createTables.php,v 1.24 2006/01/13 01:27:55 alan_k 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'; +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); + +// use debug level from file if set.. +DB_DataObject::debugLevel(isset($options['debug']) ? $options['debug'] : 1); + +$generator = new DB_DataObject_Generator; +$generator->start(); + -- cgit v1.2.3-54-g00ecf