cvs: pear /MDB reverse_engineer_xml_schema.php

From: Date: Mon, 26 Aug 2002 13:32:07 +0000
Subject: cvs: pear /MDB reverse_engineer_xml_schema.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5979@lists.php.net to get a copy of this message
lsmith Mon Aug 26 09:32:07 2002 EDT Modified files: /pear/MDB reverse_engineer_xml_schema.php Log: you can now specify if you want to dump everything, only the structure or only the content of a database the script is still lame and ugly :-) Index: pear/MDB/reverse_engineer_xml_schema.php diff -u pear/MDB/reverse_engineer_xml_schema.php:1.6 pear/MDB/reverse_engineer_xml_schema.php:1.7 --- pear/MDB/reverse_engineer_xml_schema.php:1.6 Sat Aug 24 18:18:53 2002 +++ pear/MDB/reverse_engineer_xml_schema.php Mon Aug 26 09:32:06 2002 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: reverse_engineer_xml_schema.php,v 1.6 2002/08/24 22:18:53 lsmith Exp $ +// $Id: reverse_engineer_xml_schema.php,v 1.7 2002/08/26 13:32:06 lsmith Exp $ // /** @@ -68,16 +68,29 @@ if(MDB::isError($err)) { $error = $err->getMessage(); } else { + $manager->captureDebugOutput(TRUE); + $manager->database->setOption('log_line_break', '<br>'); if($_REQUEST['action']) { set_time_limit(0); } if($_REQUEST['action'] == 'dump') { + switch ($_REQUEST['dump']) { + case 'structure': + $dump_what = MDB_MANAGER_DUMP_STRUCTURE; + break; + case 'content': + $dump_what = MDB_MANAGER_DUMP_CONTENT; + break; + default: + $dump_what = MDB_MANAGER_DUMP_ALL; + break; + } Var_Dump::display($manager->dumpDatabase( array( 'Output_Mode' => 'file', 'Output' => $_REQUEST['file'] ), - MDB_MANAGER_DUMP_ALL + $dump_what )); } else if($_REQUEST['action'] == 'create') { Var_Dump::display($manager->updateDatabase($_REQUEST['file'])); @@ -86,8 +99,14 @@ } $warnings = $manager->getWarnings(); if(count($warnings) > 0) { + echo 'Warnings<br>'; Var_Dump::display($warnings); } + if($manager->options['debug']) { + echo 'Debug messages<br>'; + echo $manager->debugOutput().'<br>'; + } + echo 'Database structure<br>'; Var_Dump::display($manager->database_definition); $manager->disconnect(); } @@ -123,6 +142,17 @@ <br /> Dump: <input type="radio" name="action" value="dump" /> + <select name="dump"> + <option value="all"'); + if(!isset($_REQUEST['dump']) || $_REQUEST['dump'] == 'all') {echo ('selected');} + echo ('>All</option> + <option value="all"'); + if(isset($_REQUEST['dump']) && $_REQUEST['dump'] == 'structure') {echo ('selected');} + echo ('>Structure</option> + <option value="all"'); + if(isset($_REQUEST['dump']) && $_REQUEST['dump'] == 'content') {echo ('selected');} + echo ('>Content</option> + </select> <br /> Create: <input type="radio" name="action" value="create" />

« previous php.pear.cvs (#5979) next »