From 05df7949fee1d5c3d9eec45cadbb8351dfd7ce80 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 9 Jul 2008 11:30:01 -0400 Subject: [PATCH] Fix create_schema.php to work with the current version of ISSO and BSDb * docs/tools/create_schema.php --- docs/tools/create_schema.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/tools/create_schema.php b/docs/tools/create_schema.php index d5f78f8..f1e8730 100644 --- a/docs/tools/create_schema.php +++ b/docs/tools/create_schema.php @@ -3,11 +3,15 @@ // creates schema file output // $Id$ -ini_set('include_path', ini_get('include_path') . ':/Server/htdocs'); -require_once(ISSO . '/App.php'); +error_reporting(E_ALL ^ E_NOTICE); -$db = BSApp::LoadModule('DbMySQL'); -$input = BSApp::LoadModule('Input'); +define('ISSO', dirname(dirname(getcwd()))); +require_once ISSO . '/App.php'; +require_once ISSO . '/DbMySqlI.php'; +require_once ISSO . '/Input.php'; + +$db = BSApp::$db = new BSDbMySqlI(); +$input = BSApp::$input = new BSInput(); if (empty($_REQUEST['submit'])) { @@ -35,13 +39,13 @@ if (empty($_REQUEST['submit'])) } else { - $db->connect($input->in['server'], $input->in['username'], $input->in['password'], $input->in['database'], false); + $db->connect($input->in['server'], $input->in['username'], $input->in['password'], $input->in['database']); $t = ($input->in['encase'] ? '`' : ''); $prefix = ($input->in['prefix'] ? '" . TABLE_PREFIX . "' : ''); $tables = $db->query("SHOW TABLES"); - while ($table = $db->fetchArray($tables, false)) + while ($table = $tables->fetchArray(false)) { $table = $table[0]; $list = array(); @@ -50,7 +54,7 @@ else $build = "CREATE TABLE $t$prefix$table$t\n(\n"; $indexes = $db->query("SHOW INDEX FROM $table"); - while ($index = $db->fetchArray($indexes)) + while ($index = $indexes->fetchArray()) { array_walk($index, 'trim'); @@ -84,7 +88,7 @@ else } $fields = $db->query("DESCRIBE $table"); - while ($field = $db->fetchArray($fields)) + while ($field = $fields->fetchArray()) { array_walk($field, 'trim'); -- 2.22.5