ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:xmlschema

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v5:dictionary:xmlschema [2016/01/19 19:42] – ↷ Links adapted because of a move operation 66.249.64.103v5:dictionary:xmlschema [2018/06/11 10:05] (current) – [Executing the Schema] function calls starting with lowercase (#426) dregad
Line 151: Line 151:
  */  */
 $db = ADONewConnection( $platform ); $db = ADONewConnection( $platform );
-$db->Connect( $dbHost, $dbUser, $dbPassword, $dbName );+$db->connect( $dbHost, $dbUser, $dbPassword, $dbName );
  
 /* Use the database connection to create a new adoSchema object. /* Use the database connection to create a new adoSchema object.
Line 157: Line 157:
 $schema = new adoSchema( $db ); $schema = new adoSchema( $db );
  
-/* Call ParseSchema() to build SQL from the XML schema file. +/* Call parseSchema() to build SQL from the XML schema file. 
- * Then call ExecuteSchema() to apply the resulting SQL to + * Then call executeSchema() to apply the resulting SQL to 
  * the database.  * the database.
  */  */
-$sql = $schema->ParseSchema( $schemaFile ); +$sql = $schema->parseSchema( $schemaFile ); 
-$result = $schema->ExecuteSchema();+$result = $schema->executeSchema();
 </code> </code>
  
Line 169: Line 169:
 <code php> <code php>
 $db = ADONewConnection( 'mysql' ); $db = ADONewConnection( 'mysql' );
-$db->Connect( 'host', 'user', 'password', 'database' );+$db->connect( 'host', 'user', 'password', 'database' );
 </code> </code>
  
Line 178: Line 178:
 </code> </code>
  
-Third, call ParseSchema() to parse the schema and then ''executeSchema()'' to apply it to the database. You must pass ''parseSchema()'' the path and filename of your schema file.+Third, call parseSchema() to parse the schema and then ''executeSchema()'' to apply it to the database. You must pass ''parseSchema()'' the path and filename of your schema file.
  
 <code php> <code php>
-$schema->ParseSchema( $schemaFile );  +$schema->parseSchema( $schemaFile );  
-$schema->ExecuteSchema(); +$schema->executeSchema(); 
 </code> </code>
  
Line 192: Line 192:
 AXMLS consists of two parts: the **schema description**, or **DTD**, and the PHP class that manipulates and parses the schema. This document introduces the reader to many of the tools AXMLS provides to manage and manipulate a schema. AXMLS consists of two parts: the **schema description**, or **DTD**, and the PHP class that manipulates and parses the schema. This document introduces the reader to many of the tools AXMLS provides to manage and manipulate a schema.
 ==== Executing the Schema ==== ==== Executing the Schema ====
-AXMLS provides two different methods for applying the SQL resulting from a parsed schema to the  database: **inline execution** and **post execution**. Use the [[v5:axmls:continueonerror|ContinueOnError()]] method to specify whether or not database execution should attempt to continue if an error occurs.+AXMLS provides two different methods for applying the SQL resulting from a parsed schema to the  database: **inline execution** and **post execution**. Use the [[v5:axmls:continueonerror|continueOnError()]] method to specify whether or not database execution should attempt to continue if an error occurs.
  
 **Inline Execution** applies each schema entity to the database immediately after that entity is parsed. I.e., the first table is read from the schema and applied to the database, then the second table, etc. **Inline Execution** applies each schema entity to the database immediately after that entity is parsed. I.e., the first table is read from the schema and applied to the database, then the second table, etc.
Line 200: Line 200:
  
 // Inline Execution // Inline Execution
-$schema->ContinueOnError( TRUE ); +$schema->continueOnError( TRUE ); 
-$schema->ExecuteInline( TRUE ); +$schema->executeInline( TRUE ); 
-$schema->ParseSchemaFile( "schema.xml" );+$schema->parseSchemaFile( "schema.xml" );
 </code> </code>
  
Line 212: Line 212:
 // Post Execution (default) // Post Execution (default)
 $schema->executeInline( FALSE ); $schema->executeInline( FALSE );
-$schema->ParseSchemaFile( "schema.xml" ); +$schema->parseSchemaFile( "schema.xml" ); 
-$schema->ExecuteSchema();+$schema->executeSchema();
 </code> </code>
  
v5/dictionary/xmlschema.1453228961.txt.gz · Last modified: 2017/04/21 11:27 (external edit)