From 8df3db566a3a937b45ebf11adb90d265e6f5e2d4 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 17 Nov 2019 20:45:02 +0100 Subject: initial checking of customized version 1.0rc9 --- vendor/adodb/adodb-php/tests/test-xmlschema.php | 53 +++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 vendor/adodb/adodb-php/tests/test-xmlschema.php (limited to 'vendor/adodb/adodb-php/tests/test-xmlschema.php') diff --git a/vendor/adodb/adodb-php/tests/test-xmlschema.php b/vendor/adodb/adodb-php/tests/test-xmlschema.php new file mode 100644 index 0000000..c56cfec --- /dev/null +++ b/vendor/adodb/adodb-php/tests/test-xmlschema.php @@ -0,0 +1,53 @@ +Connect( 'localhost', 'root', '', 'test' ) || die('fail connect1'); + +// To create a schema object and build the query array. +$schema = new adoSchema( $db ); + +// To upgrade an existing schema object, use the following +// To upgrade an existing database to the provided schema, +// uncomment the following line: +#$schema->upgradeSchema(); + +print "SQL to build xmlschema.xml:\n
";
+// Build the SQL array
+$sql = $schema->ParseSchema( "xmlschema.xml" );
+
+var_dump( $sql );
+print "
\n"; + +// Execute the SQL on the database +//$result = $schema->ExecuteSchema( $sql ); + +// Finally, clean up after the XML parser +// (PHP won't do this for you!) +//$schema->Destroy(); + + + +print "SQL to build xmlschema-mssql.xml:\n
";
+
+$db2 = ADONewConnection('mssql');
+$db2->Connect('','adodb','natsoft','northwind') || die("Fail 2");
+
+$db2->Execute("drop table simple_table");
+
+$schema = new adoSchema( $db2 );
+$sql = $schema->ParseSchema( "xmlschema-mssql.xml" );
+
+print_r( $sql );
+print "
\n"; + +$db2->debug=1; + +foreach ($sql as $s) +$db2->Execute($s); -- cgit v1.2.3-54-g00ecf