From: Robert Sesek Date: Wed, 9 Jul 2008 15:30:01 +0000 (-0400) Subject: Fix create_schema.php to work with the current version of ISSO and BSDb X-Git-Tag: 3.1.2~3 X-Git-Url: https://src.bluestatic.org/?a=commitdiff_plain;h=05df7949fee1d5c3d9eec45cadbb8351dfd7ce80;p=isso.git Fix create_schema.php to work with the current version of ISSO and BSDb * docs/tools/create_schema.php --- 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');