cvs: pear /MDB MDB_test.php

From: Date: Fri, 31 May 2002 11:11:34 +0000
Subject: cvs: pear /MDB MDB_test.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4316@lists.php.net to get a copy of this message
lsmith Fri May 31 07:11:34 2002 EDT Modified files: /pear/MDB MDB_test.php Log: added some more comments to explain the xml schema manager a bit more Index: pear/MDB/MDB_test.php diff -u pear/MDB/MDB_test.php:1.6 pear/MDB/MDB_test.php:1.7 --- pear/MDB/MDB_test.php:1.6 Thu May 30 10:22:59 2002 +++ pear/MDB/MDB_test.php Fri May 31 07:11:33 2002 @@ -1,7 +1,7 @@ <?php /* * - * @(#) $Header: /usr/repository/pear/MDB/MDB_test.php,v 1.6 2002/05/30 14:22:59 lsmith Exp $ + * @(#) $Header: /usr/repository/pear/MDB/MDB_test.php,v 1.7 2002/05/31 11:11:33 lsmith Exp $ * */ require_once("manager.php"); @@ -19,9 +19,10 @@ $input_file = 'metapear_test_db.schema'; $database_variables = array( ); - +// lets create the database using 'metapear_test_db.schema' +// if you have allready run this script you should have 'metapear_test_db.schema.before' +// in that case MDb will just compare the two schemas and make any necessary modifications to the existing DB $result = $manager->updateDatabase($input_file, $input_file.".before", $dsn, $database_variables); - echo $manager->database->database_name; // just for kicks you can mess up this part to see some pear error handling $user = 'metapear'; @@ -127,11 +128,15 @@ echo "tableInfo on a string:<br>"; echo Var_Dump::display($db->tableInfo("numbers"))."<br>"; - +// ok noew lets create a new xml schema file from the existing DB +// we will not use the 'metapear_test_db.schema' for this +// this feature is especially interesting for people that have an existing Db and want to move to MDB's xml schema management $manager->setupDatabase($dsn); $manager->getDefinitionFromDatabase(); +// this is the database definition as an array echo Var_Dump::display($manager->database_definition)."<br>"; +// new we will write this array as an xml schema file $manager->debug = "Output"; echo $manager->dumpDatabase(array( "Output" => "Dump",

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