diff options
Diffstat (limited to 'process_sql.php')
| -rw-r--r-- | process_sql.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/process_sql.php b/process_sql.php new file mode 100644 index 0000000..c7c5d73 --- /dev/null +++ b/process_sql.php @@ -0,0 +1,34 @@ +<?php +/** + * @version $Header$ + * @package install + * @subpackage functions + */ + +/** + * Global flag to indicate we are installing + * @ignore + */ +define( 'BIT_INSTALL', 'TRUE' ); + global $failedcommands; +// keep some crappy notices from spewing +$_SERVER['HTTP_HOST'] = 'shell'; +$_SERVER['SERVER_SOFTWARE'] = 'command_line'; + +/** + * required setup + */ +require_once( 'install_lib.php' ); +include("../kernel/includes/setup_inc.php"); + +if( count( $argv ) < 2) { + print "Please enter name of SQL file in db/ directory to process\n"; +} else { + // avoid errors in ADONewConnection() (wrong darabase driver etc...) + $gBitDb = &ADONewConnection($gBitDbType); + if( $gBitDb->Connect($gBitDbHost, $gBitDbUser, $gBitDbPassword, $gBitDbName) ) { + process_sql_file( $argv[1], $gBitDbType, BIT_DB_PREFIX ); + } +} + +?> |
