2008-08-22 09:17:14 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								#!/usr/bin/php -q
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< ? php 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// +----------------------------------------------------------------------+
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// | PHP Version 4                                                        |
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// +----------------------------------------------------------------------+
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// | Copyright (c) 1997-2003 The PHP Group                                |
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// +----------------------------------------------------------------------+
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// | This source file is subject to version 2.02 of the PHP license,      |
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// | that is bundled with this package in the file LICENSE, and is        |
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// | available at through the world-wide-web at                           |
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// | http://www.php.net/license/2_02.txt.                                 |
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// | If you did not receive a copy of the PHP license and are unable to   |
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// | obtain it through the world-wide-web, please send a note to          |
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// | license@php.net so we can mail you a copy immediately.               |
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// +----------------------------------------------------------------------+
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// | Author:  Alan Knowles <alan@akbkhome.com>
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// +----------------------------------------------------------------------+
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								//
 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-12 12:32:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// $Id: createTables.php 315758 2011-08-30 08:11:59Z alan_k $
 
							 
						 
					
						
							
								
									
										
										
										
											2008-08-22 09:17:14 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								//
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// 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' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-08-12 12:32:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if  ( php_sapi_name ()  !=  'cli' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PEAR :: raiseError ( " \n ERROR: You must turn use the cli sapi to run this " ,  null ,  PEAR_ERROR_DIE ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-08-22 09:17:14 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								if  ( ! ini_get ( 'register_argc_argv' ))  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PEAR :: raiseError ( " \n ERROR: You must turn register_argc_argv On in you php.ini file for this to work \n eg. \n \n register_argc_argv = On \n \n " ,  null ,  PEAR_ERROR_DIE ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    exit ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if  ( !@ $_SERVER [ 'argv' ][ 1 ])  { 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-12 12:32:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    PEAR :: raiseError ( " \n ERROR: createTable.php usage: \n \n "  . $_SERVER [ 'argv' ][ 0 ]  .  "  example.ini \n \n " ,  null ,  PEAR_ERROR_DIE ); 
							 
						 
					
						
							
								
									
										
										
										
											2008-08-22 09:17:14 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    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 ( " \n ERROR: 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 ();