Class: adoSchema
Source Location: /includes/classes/adodb/adodb-xmlschema.inc.php
Loads and parses an XML file, creating an array of "ready-to-run" SQL statements
Author(s):
- Richard Tango-Lowy & Dan Cech
Version:
|
|
|
Class Details
Class Variables
Class Methods
constructor adoSchema [line 1302]
adoSchema adoSchema(
&$db, object
$db)
|
|
Creates an adoSchema object Creating an adoSchema object is the first step in processing an XML schema. The only parameter is an ADOdb database connection object, which must already have been created.
Parameters:
method ContinueOnError [line 1396]
bool ContinueOnError(
[bool
$mode = NULL])
|
|
Enables/disables SQL continue on error. Call this method to enable or disable continuation of SQL execution if an error occurs. If the mode is set to TRUE (continue), AXMLS will continue to apply SQL to the database, even if an error occurs. If the mode is set to FALSE (halt), AXMLS will halt execution of generated sql if an error occurs, though parsing of the schema will continue.
Tags:
Parameters:
method ConvertSchemaFile [line 1747]
string ConvertSchemaFile(
string
$filename, [string
$newVersion = NULL], [string
$newFile = NULL])
|
|
Converts an XML schema file to the specified DTD version. Call this method to convert the specified XML schema file to a different AXMLS DTD version. For instance, to convert a schema created for an pre-1.0 version for AXMLS (DTD version 0.1) to a newer version of the DTD (e.g. 0.2). If no DTD version parameter is specified, the schema will be converted to the current DTD version. If the newFile parameter is provided, the converted schema will be written to the specified file.
Tags:
Parameters:
method ConvertSchemaString [line 1699]
string ConvertSchemaString(
string
$schema, [string
$newVersion = NULL], [string
$newFile = NULL])
|
|
Converts an XML schema string to the specified DTD version. Call this method to convert a string containing an XML schema to a different AXMLS DTD version. For instance, to convert a schema created for an pre-1.0 version for AXMLS (DTD version 0.1) to a newer version of the DTD (e.g. 0.2). If no DTD version parameter is specified, the schema will be converted to the current DTD version. If the newFile parameter is provided, the converted schema will be written to the specified file.
Tags:
Parameters:
method Destroy [line 2193]
Destroys an adoSchema object. Call this method to clean up after an adoSchema object that is no longer in use.
Tags:
method ExecuteInline [line 1375]
bool ExecuteInline(
[bool
$mode = NULL])
|
|
Enables/disables inline SQL execution. Call this method to enable or disable inline execution of the schema. If the mode is set to TRUE (inline execution), AXMLS applies the SQL to the database immediately as each schema entity is parsed. If the mode is set to FALSE (post execution), AXMLS parses the entire schema and you will need to call adoSchema::ExecuteSchema() to apply the schema to the database.
Tags:
Parameters:
method ExecuteSchema [line 1565]
integer ExecuteSchema(
[array
$sqlArray = NULL], [boolean
$continueOnErr = NULL])
|
|
Applies the current XML schema to the database (post execution). Call this method to apply the current schema (generally created by calling ParseSchema() or ParseSchemaString() ) to the database (creating the tables, indexes, and executing other SQL specified in the schema) after parsing.
Tags:
Parameters:
method ExtractSchema [line 1936]
string ExtractSchema(
[boolean
$data = FALSE])
|
|
Extracts an XML schema from an existing database. Call this method to create an XML schema string from an existing database. If the data parameter is set to TRUE, AXMLS will include the data from the database in the schema.
Tags:
Parameters:
method ParseSchema [line 1415]
array ParseSchema(
$filename, [bool
$returnSchema = FALSE], string
$file)
|
|
Loads an XML schema from a file and converts it to SQL. Call this method to load the specified schema (see the DTD for the proper format) from the filesystem and generate the SQL necessary to create the database described.
Tags:
Parameters:
method ParseSchemaFile [line 1432]
array ParseSchemaFile(
$filename, [bool
$returnSchema = FALSE], string
$file)
|
|
Loads an XML schema from a file and converts it to SQL. Call this method to load the specified schema from a file (see the DTD for the proper format) and generate the SQL necessary to create the database described by the schema.
Tags:
Parameters:
method ParseSchemaString [line 1484]
array ParseSchemaString(
string
$xmlstring, [bool
$returnSchema = FALSE])
|
|
Converts an XML schema string to SQL. Call this method to parse a string containing an XML schema (see the DTD for the proper format) and generate the SQL necessary to create the database described by the schema.
Tags:
Parameters:
method PrintSQL [line 1592]
array PrintSQL(
[string
$format = 'NONE'])
|
|
Returns the current SQL array. Call this method to fetch the array of SQL queries resulting from ParseSchema() or ParseSchemaString().
Tags:
Parameters:
method RemoveSchema [line 1527]
array RemoveSchema(
$filename, [bool
$returnSchema = FALSE], string
$file)
|
|
Loads an XML schema from a file and converts it to uninstallation SQL. Call this method to load the specified schema (see the DTD for the proper format) from the filesystem and generate the SQL necessary to remove the database described.
Tags:
Parameters:
method RemoveSchemaString [line 1542]
array RemoveSchemaString(
string
$schema, [bool
$returnSchema = FALSE])
|
|
Converts an XML schema string to uninstallation SQL. Call this method to parse a string containing an XML schema (see the DTD for the proper format) and generate the SQL necessary to uninstall the database described by the schema.
Tags:
Parameters:
method SaveSQL [line 1606]
boolean SaveSQL(
[string
$filename = './schema.sql'])
|
|
Saves the current SQL array to the local filesystem as a list of SQL queries. Call this method to save the array of SQL queries (generally resulting from a parsed XML schema) to the filesystem.
Tags:
Parameters:
method SchemaFileVersion [line 1888]
string SchemaFileVersion(
string
$filename)
|
|
Returns the AXMLS Schema Version of the requested XML schema file. Call this method to obtain the AXMLS DTD version of the requested XML schema file.
Tags:
Parameters:
method SchemaStringVersion [line 1914]
string SchemaStringVersion(
string
$xmlstring)
|
|
Returns the AXMLS Schema Version of the provided XML schema string. Call this method to obtain the AXMLS DTD version of the provided XML schema string.
Tags:
Parameters:
method SetPrefix [line 2043]
boolean SetPrefix(
[string
$prefix = ''], [boolean
$underscore = TRUE])
|
|
Sets a prefix for database objects Call this method to set a standard prefix that will be prepended to all database tables and indices when the schema is parsed. Calling setPrefix with no arguments clears the prefix.
Tags:
Parameters:
method SetUpgradeMethod [line 1333]
string SetUpgradeMethod(
[string
$method = ''])
|
|
Sets the method to be used for upgrading an existing database Use this method to specify how existing database objects should be upgraded. The method option can be set to ALTER, REPLACE, BEST, or NONE. ALTER attempts to alter each database object directly, REPLACE attempts to rebuild each object from scratch, BEST attempts to determine the best upgrade method for each object, and NONE disables upgrading. This method is not yet used by AXMLS, but exists for backward compatibility. The ALTER method is automatically assumed when the adoSchema object is instantiated; other upgrade methods are not currently supported.
Tags:
Parameters:
method TransformSchema [line 1777]
void TransformSchema(
$schema,
$xsl, [
$schematype = 'string'])
|
|
Parameters:
method _file_get_contents [line 1725]
void _file_get_contents(
$path)
|
|
Parameters:
|
|