ona  18.1.1
About: OpenNetAdmin provides a database managed inventory of your IP network (with Web and CLI interface).
  Fossies Dox: ona-18.1.1.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

adoSchema Class Reference

Public Member Functions

 __construct ( $db)
 
 SetUpgradeMethod ( $method='')
 
 ExecuteInline ( $mode=NULL)
 
 ContinueOnError ( $mode=NULL)
 
 ParseSchema ( $filename, $returnSchema=FALSE)
 
 ParseSchemaFile ( $filename, $returnSchema=FALSE)
 
 ParseSchemaString ( $xmlstring, $returnSchema=FALSE)
 
 RemoveSchema ( $filename, $returnSchema=FALSE)
 
 RemoveSchemaString ( $schema, $returnSchema=FALSE)
 
 ExecuteSchema ( $sqlArray=NULL, $continueOnErr=NULL)
 
 PrintSQL ( $format='NONE')
 
 SaveSQL ( $filename='./schema.sql')
 
 create_parser ()
 
 _tag_open (&$parser, $tag, $attributes)
 
 _tag_cdata (&$parser, $cdata)
 
 _tag_close (&$parser, $tag)
 
 ConvertSchemaString ( $schema, $newVersion=NULL, $newFile=NULL)
 
 _file_get_contents ($path)
 
 ConvertSchemaFile ( $filename, $newVersion=NULL, $newFile=NULL)
 
 TransformSchema ( $schema, $xsl, $schematype='string')
 
 xslt_error_handler ( $parser, $errno, $level, $fields)
 
 SchemaFileVersion ( $filename)
 
 SchemaStringVersion ( $xmlstring)
 
 ExtractSchema ( $data=FALSE)
 
 SetPrefix ( $prefix='', $underscore=TRUE)
 
 prefix ( $name='')
 
 supportedPlatform ( $platform=NULL)
 
 clearSQL ()
 
 addSQL ( $sql=NULL)
 
 getSQL ( $format=NULL, $sqlArray=NULL)
 
 Destroy ()
 
 __construct ( $db)
 
 SetUpgradeMethod ( $method='')
 
 ExistingData ( $mode=NULL)
 
 ExecuteInline ( $mode=NULL)
 
 ContinueOnError ( $mode=NULL)
 
 ParseSchema ( $filename, $returnSchema=FALSE)
 
 ParseSchemaFile ( $filename, $returnSchema=FALSE)
 
 ParseSchemaString ( $xmlstring, $returnSchema=FALSE)
 
 RemoveSchema ( $filename, $returnSchema=FALSE)
 
 RemoveSchemaString ( $schema, $returnSchema=FALSE)
 
 ExecuteSchema ( $sqlArray=NULL, $continueOnErr=NULL)
 
 PrintSQL ( $format='NONE')
 
 SaveSQL ( $filename='./schema.sql')
 
 create_parser ()
 
 _tag_open (&$parser, $tag, $attributes)
 
 _tag_cdata (&$parser, $cdata)
 
 _tag_close (&$parser, $tag)
 
 ConvertSchemaString ( $schema, $newVersion=NULL, $newFile=NULL)
 
 ConvertSchemaFile ( $filename, $newVersion=NULL, $newFile=NULL)
 
 TransformSchema ( $schema, $xsl, $schematype='string')
 
 xslt_error_handler ( $parser, $errno, $level, $fields)
 
 SchemaFileVersion ( $filename)
 
 SchemaStringVersion ( $xmlstring)
 
 ExtractSchema ( $data=FALSE, $indent=' ', $prefix='', $stripprefix=false)
 
 SetPrefix ( $prefix='', $underscore=TRUE)
 
 prefix ( $name='')
 
 supportedPlatform ( $platform=NULL)
 
 clearSQL ()
 
 addSQL ( $sql=NULL)
 
 getSQL ( $format=NULL, $sqlArray=NULL)
 
 Destroy ()
 

Public Attributes

 $sqlArray
 
 $db
 
 $dict
 
 $currentElement = ''
 
 $upgrade = ''
 
 $objectPrefix = ''
 
 $mgq
 
 $debug
 
 $versionRegex = '/<schema.*?( version="([^"]*)")?.*?>/'
 
 $schemaVersion
 
 $success
 
 $executeInline
 
 $continueOnError
 
 $existingData
 

Detailed Description

Definition at line 1219 of file adodb-xmlschema.inc.php.

Constructor & Destructor Documentation

◆ __construct() [1/2]

adoSchema::__construct (   $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
object$dbADOdb database connection object.

Definition at line 1305 of file adodb-xmlschema.inc.php.

References $db.

◆ __construct() [2/2]

adoSchema::__construct (   $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
object$dbADOdb database connection object.

Definition at line 1409 of file adodb-xmlschema03.inc.php.

References $db.

Member Function Documentation

◆ _file_get_contents()

adoSchema::_file_get_contents (   $path)

Definition at line 1729 of file adodb-xmlschema.inc.php.

Referenced by ConvertSchemaFile(), and TransformSchema().

◆ _tag_cdata() [1/2]

adoSchema::_tag_cdata ( $parser,
  $cdata 
)

XML Callback to process CDATA elements

@access private

Definition at line 1674 of file adodb-xmlschema.inc.php.

◆ _tag_cdata() [2/2]

adoSchema::_tag_cdata ( $parser,
  $cdata 
)

XML Callback to process CDATA elements

@access private

Definition at line 1833 of file adodb-xmlschema03.inc.php.

◆ _tag_close() [1/2]

adoSchema::_tag_close ( $parser,
  $tag 
)

XML Callback to process end elements

@access private

Definition at line 1683 of file adodb-xmlschema.inc.php.

◆ _tag_close() [2/2]

adoSchema::_tag_close ( $parser,
  $tag 
)

XML Callback to process end elements

@access private

Definition at line 1842 of file adodb-xmlschema03.inc.php.

◆ _tag_open() [1/2]

adoSchema::_tag_open ( $parser,
  $tag,
  $attributes 
)

XML Callback to process start elements

@access private

Definition at line 1651 of file adodb-xmlschema.inc.php.

References supportedPlatform().

◆ _tag_open() [2/2]

adoSchema::_tag_open ( $parser,
  $tag,
  $attributes 
)

XML Callback to process start elements

@access private

Definition at line 1808 of file adodb-xmlschema03.inc.php.

References supportedPlatform().

◆ addSQL() [1/2]

adoSchema::addSQL (   $sql = NULL)

Adds SQL into the SQL array.

Parameters
mixed$sqlSQL to Add
Returns
boolean TRUE if successful, else FALSE.

@access private

Definition at line 2129 of file adodb-xmlschema.inc.php.

References $debug, $sql, ContinueOnError(), and ExecuteInline().

Referenced by addSQL().

◆ addSQL() [2/2]

adoSchema::addSQL (   $sql = NULL)

Adds SQL into the SQL array.

Parameters
mixed$sqlSQL to Add
Returns
boolean TRUE if successful, else FALSE.

@access private

Definition at line 2311 of file adodb-xmlschema03.inc.php.

References $debug, $sql, addSQL(), ContinueOnError(), and ExecuteInline().

◆ clearSQL() [1/2]

adoSchema::clearSQL ( )

Clears the array of generated SQL.

@access private

Definition at line 2117 of file adodb-xmlschema.inc.php.

◆ clearSQL() [2/2]

adoSchema::clearSQL ( )

Clears the array of generated SQL.

@access private

Definition at line 2299 of file adodb-xmlschema03.inc.php.

◆ ContinueOnError() [1/2]

adoSchema::ContinueOnError (   $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.

Parameters
bool$modeexecute
Returns
bool current continueOnError mode
See also
addSQL(), ExecuteSchema()

Definition at line 1400 of file adodb-xmlschema.inc.php.

References $continueOnError.

Referenced by addSQL(), and ExecuteSchema().

◆ ContinueOnError() [2/2]

adoSchema::ContinueOnError (   $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.

Parameters
bool$modeexecute
Returns
bool current continueOnError mode
See also
addSQL(), ExecuteSchema()

Definition at line 1546 of file adodb-xmlschema03.inc.php.

References $continueOnError.

◆ ConvertSchemaFile() [1/2]

adoSchema::ConvertSchemaFile (   $filename,
  $newVersion = NULL,
  $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.

See also
ConvertSchemaString()
Parameters
string$filenameName of XML schema file that will be converted.
string$newVersionDTD version to convert to.
string$newFileFile name of (converted) output file.
Returns
string Converted XML schema or FALSE if an error occurs.

Definition at line 1751 of file adodb-xmlschema.inc.php.

References $schemaVersion, $version, _file_get_contents(), SchemaFileVersion(), and TransformSchema().

Referenced by ParseSchema(), and RemoveSchema().

◆ ConvertSchemaFile() [2/2]

adoSchema::ConvertSchemaFile (   $filename,
  $newVersion = NULL,
  $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.

See also
ConvertSchemaString()
Parameters
string$filenameName of XML schema file that will be converted.
string$newVersionDTD version to convert to.
string$newFileFile name of (converted) output file.
Returns
string Converted XML schema or FALSE if an error occurs.

Definition at line 1911 of file adodb-xmlschema03.inc.php.

References $schemaVersion, $version, _file_get_contents(), SchemaFileVersion(), and TransformSchema().

◆ ConvertSchemaString() [1/2]

adoSchema::ConvertSchemaString (   $schema,
  $newVersion = NULL,
  $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.

See also
ConvertSchemaFile()
Parameters
string$schemaString containing XML schema that will be converted.
string$newVersionDTD version to convert to.
string$newFileFile name of (converted) output file.
Returns
string Converted XML schema or FALSE if an error occurs.

Definition at line 1703 of file adodb-xmlschema.inc.php.

References $schemaVersion, $version, SchemaStringVersion(), and TransformSchema().

◆ ConvertSchemaString() [2/2]

adoSchema::ConvertSchemaString (   $schema,
  $newVersion = NULL,
  $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.

See also
ConvertSchemaFile()
Parameters
string$schemaString containing XML schema that will be converted.
string$newVersionDTD version to convert to.
string$newFileFile name of (converted) output file.
Returns
string Converted XML schema or FALSE if an error occurs.

Definition at line 1862 of file adodb-xmlschema03.inc.php.

References $schemaVersion, $version, SchemaStringVersion(), and TransformSchema().

◆ create_parser() [1/2]

adoSchema::create_parser ( )

Create an xml parser

Returns
object PHP XML parser object

@access private

Definition at line 1634 of file adodb-xmlschema.inc.php.

Referenced by ParseSchemaFile(), and ParseSchemaString().

◆ create_parser() [2/2]

adoSchema::create_parser ( )

Create an xml parser

Returns
object PHP XML parser object

@access private

Definition at line 1791 of file adodb-xmlschema03.inc.php.

◆ Destroy() [1/2]

adoSchema::Destroy ( )

Destroys an adoSchema object.

Call this method to clean up after an adoSchema object that is no longer in use.

Deprecated:
adoSchema now cleans up automatically.

Definition at line 2197 of file adodb-xmlschema.inc.php.

◆ Destroy() [2/2]

adoSchema::Destroy ( )

Destroys an adoSchema object.

Call this method to clean up after an adoSchema object that is no longer in use.

Deprecated:
adoSchema now cleans up automatically.

Definition at line 2379 of file adodb-xmlschema03.inc.php.

◆ ExecuteInline() [1/2]

adoSchema::ExecuteInline (   $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.

Parameters
bool$modeexecute
Returns
bool current execution mode
See also
ParseSchema(), ExecuteSchema()

Definition at line 1379 of file adodb-xmlschema.inc.php.

References $executeInline.

Referenced by addSQL().

◆ ExecuteInline() [2/2]

adoSchema::ExecuteInline (   $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.

Parameters
bool$modeexecute
Returns
bool current execution mode
See also
ParseSchema(), ExecuteSchema()

Definition at line 1525 of file adodb-xmlschema03.inc.php.

References $executeInline.

◆ ExecuteSchema() [1/2]

adoSchema::ExecuteSchema (   $sqlArray = NULL,
  $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.

See also
ParseSchema(), ParseSchemaString(), ExecuteInline()
Parameters
array$sqlArrayArray of SQL statements that will be applied rather than the current schema.
boolean$continueOnErrContinue to apply the schema even if an error occurs.
Returns
integer 0 if failure, 1 if errors, 2 if successful.

Definition at line 1569 of file adodb-xmlschema.inc.php.

References $sqlArray, $success, and ContinueOnError().

◆ ExecuteSchema() [2/2]

adoSchema::ExecuteSchema (   $sqlArray = NULL,
  $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.

See also
ParseSchema(), ParseSchemaString(), ExecuteInline()
Parameters
array$sqlArrayArray of SQL statements that will be applied rather than the current schema.
boolean$continueOnErrContinue to apply the schema even if an error occurs.
Returns
integer 0 if failure, 1 if errors, 2 if successful.

Definition at line 1726 of file adodb-xmlschema03.inc.php.

References $sqlArray, $success, and ContinueOnError().

◆ ExistingData()

adoSchema::ExistingData (   $mode = NULL)

Specifies how to handle existing data row when there is a unique key conflict.

The existingData setting specifies how the parser should handle existing rows when a unique key violation occurs during the insert. This can happen when inserting data into an existing table with one or more primary keys or unique indexes. The existingData method takes one of three options: XMLS_MODE_INSERT attempts to always insert the data as a new row. In the event of a unique key violation, the database will generate an error. XMLS_MODE_UPDATE attempts to update the any existing rows with the new data based upon primary or unique key fields in the schema. If the data row in the schema specifies no unique fields, the row data will be inserted as a new row. XMLS_MODE_IGNORE specifies that any data rows that would result in a unique key violation be ignored; no inserts or updates will take place. For backward compatibility, the default setting is XMLS_MODE_INSERT, but XMLS_MODE_UPDATE will generally be the most appropriate setting.

Parameters
int$modeXMLS_MODE_INSERT, XMLS_MODE_UPDATE, or XMLS_MODE_IGNORE
Returns
int current mode

Definition at line 1490 of file adodb-xmlschema03.inc.php.

References $existingData.

◆ ExtractSchema() [1/2]

adoSchema::ExtractSchema (   $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.

Parameters
boolean$dataInclude data in schema dump
Returns
string Generated XML schema

Definition at line 1940 of file adodb-xmlschema.inc.php.

References $rs, and $type.

◆ ExtractSchema() [2/2]

adoSchema::ExtractSchema (   $data = FALSE,
  $indent = '  ',
  $prefix = '',
  $stripprefix = 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.

Parameters
boolean$dataInclude data in schema dump @indent string indentation to use @prefix string extract only tables with given prefix @stripprefix strip prefix string when storing in XML schema
Returns
string Generated XML schema

Definition at line 2103 of file adodb-xmlschema03.inc.php.

References $rs, and $type.

◆ getSQL() [1/2]

adoSchema::getSQL (   $format = NULL,
  $sqlArray = NULL 
)

Gets the SQL array in the specified format.

Parameters
string$formatFormat
Returns
mixed SQL

@access private

Definition at line 2171 of file adodb-xmlschema.inc.php.

References $sqlArray.

Referenced by PrintSQL().

◆ getSQL() [2/2]

adoSchema::getSQL (   $format = NULL,
  $sqlArray = NULL 
)

Gets the SQL array in the specified format.

Parameters
string$formatFormat
Returns
mixed SQL

@access private

Definition at line 2353 of file adodb-xmlschema03.inc.php.

References $sqlArray.

◆ ParseSchema() [1/2]

adoSchema::ParseSchema (   $filename,
  $returnSchema = FALSE 
)

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.

See also
ParseSchemaString()
Parameters
string$fileName of XML schema file.
bool$returnSchemaReturn schema rather than parsing.
Returns
array Array of SQL queries, ready to execute

Definition at line 1419 of file adodb-xmlschema.inc.php.

References ConvertSchemaFile(), and ParseSchemaString().

◆ ParseSchema() [2/2]

adoSchema::ParseSchema (   $filename,
  $returnSchema = FALSE 
)

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. This method automatically converts the schema to the latest axmls schema version.

See also
ParseSchemaString()
Parameters
string$fileName of XML schema file.
bool$returnSchemaReturn schema rather than parsing.
Returns
array Array of SQL queries, ready to execute

Definition at line 1567 of file adodb-xmlschema03.inc.php.

References ConvertSchemaFile(), and ParseSchemaString().

◆ ParseSchemaFile() [1/2]

adoSchema::ParseSchemaFile (   $filename,
  $returnSchema = FALSE 
)

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.

Parameters
string$fileName of XML schema file.
bool$returnSchemaReturn schema rather than parsing.
Returns
array Array of SQL queries, ready to execute.
Deprecated:
Replaced by adoSchema::ParseSchema() and adoSchema::ParseSchemaString()
See also
ParseSchema(), ParseSchemaString()

Definition at line 1436 of file adodb-xmlschema.inc.php.

References $sqlArray, create_parser(), and SchemaFileVersion().

◆ ParseSchemaFile() [2/2]

adoSchema::ParseSchemaFile (   $filename,
  $returnSchema = FALSE 
)

Loads an XML schema from a file and converts it to SQL.

Call this method to load the specified schema directly from a file (see the DTD for the proper format) and generate the SQL necessary to create the database described by the schema. Use this method when you are dealing with large schema files. Otherwise, ParseSchema() is faster. This method does not automatically convert the schema to the latest axmls schema version. You must convert the schema manually using either the ConvertSchemaFile() or ConvertSchemaString() method.

See also
ParseSchema()
ConvertSchemaFile()
ConvertSchemaString()
Parameters
string$fileName of XML schema file.
bool$returnSchemaReturn schema rather than parsing.
Returns
array Array of SQL queries, ready to execute.
Deprecated:
Replaced by adoSchema::ParseSchema() and adoSchema::ParseSchemaString()
See also
ParseSchema(), ParseSchemaString()

Definition at line 1592 of file adodb-xmlschema03.inc.php.

References $sqlArray, create_parser(), logMsg(), and SchemaFileVersion().

◆ ParseSchemaString() [1/2]

adoSchema::ParseSchemaString (   $xmlstring,
  $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.

See also
ParseSchema()
Parameters
string$xmlstringXML schema string.
bool$returnSchemaReturn schema rather than parsing.
Returns
array Array of SQL queries, ready to execute.

Definition at line 1488 of file adodb-xmlschema.inc.php.

References $sqlArray, create_parser(), and SchemaStringVersion().

Referenced by ParseSchema(), and RemoveSchemaString().

◆ ParseSchemaString() [2/2]

adoSchema::ParseSchemaString (   $xmlstring,
  $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.

See also
ParseSchema()
Parameters
string$xmlstringXML schema string.
bool$returnSchemaReturn schema rather than parsing.
Returns
array Array of SQL queries, ready to execute.

Definition at line 1644 of file adodb-xmlschema03.inc.php.

References $sqlArray, create_parser(), logMsg(), and SchemaStringVersion().

◆ prefix() [1/2]

adoSchema::prefix (   $name = '')

Returns an object name with the current prefix prepended.

Parameters
string$nameName
Returns
string Prefixed name

@access private

Definition at line 2080 of file adodb-xmlschema.inc.php.

◆ prefix() [2/2]

adoSchema::prefix (   $name = '')

Returns an object name with the current prefix prepended.

Parameters
string$nameName
Returns
string Prefixed name

@access private

Definition at line 2253 of file adodb-xmlschema03.inc.php.

◆ PrintSQL() [1/2]

adoSchema::PrintSQL (   $format = 'NONE')

Returns the current SQL array.

Call this method to fetch the array of SQL queries resulting from ParseSchema() or ParseSchemaString().

Parameters
string$formatFormat: HTML, TEXT, or NONE (PHP array)
Returns
array Array of SQL statements or FALSE if an error occurs

Definition at line 1596 of file adodb-xmlschema.inc.php.

References $sqlArray, and getSQL().

◆ PrintSQL() [2/2]

adoSchema::PrintSQL (   $format = 'NONE')

Returns the current SQL array.

Call this method to fetch the array of SQL queries resulting from ParseSchema() or ParseSchemaString().

Parameters
string$formatFormat: HTML, TEXT, or NONE (PHP array)
Returns
array Array of SQL statements or FALSE if an error occurs

Definition at line 1753 of file adodb-xmlschema03.inc.php.

References $sqlArray, and getSQL().

◆ RemoveSchema() [1/2]

adoSchema::RemoveSchema (   $filename,
  $returnSchema = FALSE 
)

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.

See also
RemoveSchemaString()
Parameters
string$fileName of XML schema file.
bool$returnSchemaReturn schema rather than parsing.
Returns
array Array of SQL queries, ready to execute

Definition at line 1531 of file adodb-xmlschema.inc.php.

References ConvertSchemaFile(), and RemoveSchemaString().

◆ RemoveSchema() [2/2]

adoSchema::RemoveSchema (   $filename,
  $returnSchema = FALSE 
)

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.

See also
RemoveSchemaString()
Parameters
string$fileName of XML schema file.
bool$returnSchemaReturn schema rather than parsing.
Returns
array Array of SQL queries, ready to execute

Definition at line 1688 of file adodb-xmlschema03.inc.php.

References ConvertSchemaFile(), and RemoveSchemaString().

◆ RemoveSchemaString() [1/2]

adoSchema::RemoveSchemaString (   $schema,
  $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.

See also
RemoveSchema()
Parameters
string$schemaXML schema string.
bool$returnSchemaReturn schema rather than parsing.
Returns
array Array of SQL queries, ready to execute.

Definition at line 1546 of file adodb-xmlschema.inc.php.

References $version, ParseSchemaString(), SchemaStringVersion(), and TransformSchema().

Referenced by RemoveSchema().

◆ RemoveSchemaString() [2/2]

adoSchema::RemoveSchemaString (   $schema,
  $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.

See also
RemoveSchema()
Parameters
string$schemaXML schema string.
bool$returnSchemaReturn schema rather than parsing.
Returns
array Array of SQL queries, ready to execute.

Definition at line 1703 of file adodb-xmlschema03.inc.php.

References $version, ParseSchemaString(), SchemaStringVersion(), and TransformSchema().

◆ SaveSQL() [1/2]

adoSchema::SaveSQL (   $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.

Parameters
string$filenamePath and name where the file should be saved.
Returns
boolean TRUE if save is successful, else FALSE.

Definition at line 1610 of file adodb-xmlschema.inc.php.

References $sqlArray.

◆ SaveSQL() [2/2]

adoSchema::SaveSQL (   $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.

Parameters
string$filenamePath and name where the file should be saved.
Returns
boolean TRUE if save is successful, else FALSE.

Definition at line 1767 of file adodb-xmlschema03.inc.php.

References $sqlArray.

◆ SchemaFileVersion() [1/2]

adoSchema::SchemaFileVersion (   $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.

See also
SchemaStringVersion()
Parameters
string$filenameAXMLS schema file
Returns
string Schema version number or FALSE on error

Definition at line 1892 of file adodb-xmlschema.inc.php.

Referenced by ConvertSchemaFile(), and ParseSchemaFile().

◆ SchemaFileVersion() [2/2]

adoSchema::SchemaFileVersion (   $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.

See also
SchemaStringVersion()
Parameters
string$filenameAXMLS schema file
Returns
string Schema version number or FALSE on error

Definition at line 2052 of file adodb-xmlschema03.inc.php.

◆ SchemaStringVersion() [1/2]

adoSchema::SchemaStringVersion (   $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.

See also
SchemaFileVersion()
Parameters
string$xmlstringXML schema string
Returns
string Schema version number or FALSE on error

Definition at line 1918 of file adodb-xmlschema.inc.php.

Referenced by ConvertSchemaString(), ParseSchemaString(), and RemoveSchemaString().

◆ SchemaStringVersion() [2/2]

adoSchema::SchemaStringVersion (   $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.

See also
SchemaFileVersion()
Parameters
string$xmlstringXML schema string
Returns
string Schema version number or FALSE on error

Definition at line 2078 of file adodb-xmlschema03.inc.php.

◆ SetPrefix() [1/2]

adoSchema::SetPrefix (   $prefix = '',
  $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.

Parameters
string$prefixPrefix that will be prepended.
boolean$underscoreIf TRUE, automatically append an underscore character to the prefix.
Returns
boolean TRUE if successful, else FALSE

Definition at line 2047 of file adodb-xmlschema.inc.php.

References logMsg().

◆ SetPrefix() [2/2]

adoSchema::SetPrefix (   $prefix = '',
  $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.

Parameters
string$prefixPrefix that will be prepended.
boolean$underscoreIf TRUE, automatically append an underscore character to the prefix.
Returns
boolean TRUE if successful, else FALSE

Definition at line 2220 of file adodb-xmlschema03.inc.php.

References logMsg().

◆ SetUpgradeMethod() [1/2]

adoSchema::SetUpgradeMethod (   $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.

Parameters
string$methodUpgrade method (ALTER|REPLACE|BEST|NONE)
Returns
string Upgrade method used

Definition at line 1337 of file adodb-xmlschema.inc.php.

References $upgrade, and upgrade().

◆ SetUpgradeMethod() [2/2]

adoSchema::SetUpgradeMethod (   $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.

Parameters
string$methodUpgrade method (ALTER|REPLACE|BEST|NONE)
Returns
string Upgrade method used

Definition at line 1442 of file adodb-xmlschema03.inc.php.

References $upgrade, and upgrade().

◆ supportedPlatform() [1/2]

adoSchema::supportedPlatform (   $platform = NULL)

Checks if element references a specific platform

Parameters
string$platformRequested platform
Returns
boolean TRUE if platform check succeeds

@access private

Definition at line 2100 of file adodb-xmlschema.inc.php.

References logMsg().

Referenced by _tag_open().

◆ supportedPlatform() [2/2]

adoSchema::supportedPlatform (   $platform = NULL)

Checks if element references a specific platform

Parameters
string$platformRequested platform
Returns
boolean TRUE if platform check succeeds

@access private

Definition at line 2273 of file adodb-xmlschema03.inc.php.

References logMsg().

◆ TransformSchema() [1/2]

adoSchema::TransformSchema (   $schema,
  $xsl,
  $schematype = 'string' 
)

◆ TransformSchema() [2/2]

adoSchema::TransformSchema (   $schema,
  $xsl,
  $schematype = 'string' 
)

Definition at line 1941 of file adodb-xmlschema03.inc.php.

References _file_get_contents().

◆ xslt_error_handler() [1/2]

adoSchema::xslt_error_handler (   $parser,
  $errno,
  $level,
  $fields 
)

Processes XSLT transformation errors

Parameters
object$parserXML parser object
integer$errnoError number
integer$levelError level
array$fieldsError information fields

@access private

Definition at line 1840 of file adodb-xmlschema.inc.php.

References E_USER_ERROR.

◆ xslt_error_handler() [2/2]

adoSchema::xslt_error_handler (   $parser,
  $errno,
  $level,
  $fields 
)

Processes XSLT transformation errors

Parameters
object$parserXML parser object
integer$errnoError number
integer$levelError level
array$fieldsError information fields

@access private

Definition at line 2000 of file adodb-xmlschema03.inc.php.

References E_USER_ERROR.

Member Data Documentation

◆ $continueOnError

adoSchema::$continueOnError

Definition at line 1294 of file adodb-xmlschema.inc.php.

Referenced by ContinueOnError().

◆ $currentElement

adoSchema::$currentElement = ''

Definition at line 1243 of file adodb-xmlschema.inc.php.

◆ $db

adoSchema::$db

Definition at line 1231 of file adodb-xmlschema.inc.php.

Referenced by __construct().

◆ $debug

adoSchema::$debug

Definition at line 1267 of file adodb-xmlschema.inc.php.

Referenced by addSQL().

◆ $dict

adoSchema::$dict

Definition at line 1237 of file adodb-xmlschema.inc.php.

◆ $executeInline

adoSchema::$executeInline

Definition at line 1289 of file adodb-xmlschema.inc.php.

Referenced by ExecuteInline().

◆ $existingData

adoSchema::$existingData

Definition at line 1398 of file adodb-xmlschema03.inc.php.

Referenced by ExistingData().

◆ $mgq

adoSchema::$mgq

Definition at line 1261 of file adodb-xmlschema.inc.php.

◆ $objectPrefix

adoSchema::$objectPrefix = ''

Definition at line 1255 of file adodb-xmlschema.inc.php.

◆ $schemaVersion

adoSchema::$schemaVersion

Definition at line 1279 of file adodb-xmlschema.inc.php.

Referenced by ConvertSchemaFile(), and ConvertSchemaString().

◆ $sqlArray

adoSchema::$sqlArray

◆ $success

adoSchema::$success

Definition at line 1284 of file adodb-xmlschema.inc.php.

Referenced by ExecuteSchema().

◆ $upgrade

adoSchema::$upgrade = ''

Definition at line 1249 of file adodb-xmlschema.inc.php.

Referenced by SetUpgradeMethod().

◆ $versionRegex

adoSchema::$versionRegex = '/<schema.*?( version="([^"]*)")?.*?>/'

Definition at line 1273 of file adodb-xmlschema.inc.php.


The documentation for this class was generated from the following files: