|
Adodb Dokumentation
V5.14 8 Sept 2011
|


Öffentliche Methoden | |
| dbQuerySet (&$parent, $attributes=NULL) | |
| _tag_open (&$parser, $tag, $attributes) | |
| _tag_cdata (&$parser, $cdata) | |
| _tag_close (&$parser, $tag) | |
| newQuery () | |
| discardQuery () | |
| buildQuery ($sql=NULL) | |
| addQuery () | |
| create (&$xmls) | |
| prefixQuery ($regex, $query, $prefix=NULL) | |
| dbQuerySet (&$parent, $attributes=NULL) | |
| _tag_open (&$parser, $tag, $attributes) | |
| _tag_cdata (&$parser, $cdata) | |
| _tag_close (&$parser, $tag) | |
| newQuery () | |
| discardQuery () | |
| buildQuery ($sql=NULL) | |
| addQuery () | |
| create (&$xmls) | |
| prefixQuery ($regex, $query, $prefix=NULL) | |
Datenfelder | |
| $queries = array() | |
| $query | |
| $prefixKey = '' | |
| $prefixMethod = 'AUTO' | |
Definiert in Zeile 960 der Datei adodb-xmlschema.inc.php.
| _tag_cdata | ( | &$ | parser, |
| $ | cdata | ||
| ) |
XML Callback to process CDATA elements
Erneute Implementation von dbObject.
Definiert in Zeile 1040 der Datei adodb-xmlschema.inc.php.
{
switch( $this->currentElement ) {
// Line of queryset SQL data
case 'QUERY':
$this->buildQuery( $cdata );
break;
default:
}
}

| _tag_cdata | ( | &$ | parser, |
| $ | cdata | ||
| ) |
XML Callback to process CDATA elements
Erneute Implementation von dbObject.
Definiert in Zeile 1139 der Datei adodb-xmlschema03.inc.php.
{
switch( $this->currentElement ) {
// Line of queryset SQL data
case 'QUERY':
$this->buildQuery( $cdata );
break;
default:
}
}

| _tag_close | ( | &$ | parser, |
| $ | tag | ||
| ) |
XML Callback to process end elements
private
Erneute Implementation von dbObject.
Definiert in Zeile 1056 der Datei adodb-xmlschema.inc.php.
{
$this->currentElement = '';
switch( strtoupper( $tag ) ) {
case 'QUERY':
// Add the finished query to the open query set.
$this->addQuery();
break;
case 'SQL':
$this->parent->addSQL( $this->create( $this->parent ) );
xml_set_object( $parser, $this->parent );
$this->destroy();
break;
default:
}
}

| _tag_close | ( | &$ | parser, |
| $ | tag | ||
| ) |
XML Callback to process end elements
private
Erneute Implementation von dbObject.
Definiert in Zeile 1155 der Datei adodb-xmlschema03.inc.php.
{
$this->currentElement = '';
switch( strtoupper( $tag ) ) {
case 'QUERY':
// Add the finished query to the open query set.
$this->addQuery();
break;
case 'SQL':
$this->parent->addSQL( $this->create( $this->parent ) );
xml_set_object( $parser, $this->parent );
$this->destroy();
break;
default:
}
}

| _tag_open | ( | &$ | parser, |
| $ | tag, | ||
| $ | attributes | ||
| ) |
XML Callback to process start elements. Elements currently processed are: QUERY.
private
Erneute Implementation von dbObject.
Definiert in Zeile 1018 der Datei adodb-xmlschema.inc.php.
{
$this->currentElement = strtoupper( $tag );
switch( $this->currentElement ) {
case 'QUERY':
// Create a new query in a SQL queryset.
// Ignore this query set if a platform is specified and it's different than the
// current connection platform.
if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
$this->newQuery();
} else {
$this->discardQuery();
}
break;
default:
// print_r( array( $tag, $attributes ) );
}
}

| _tag_open | ( | &$ | parser, |
| $ | tag, | ||
| $ | attributes | ||
| ) |
XML Callback to process start elements. Elements currently processed are: QUERY.
private
Erneute Implementation von dbObject.
Definiert in Zeile 1117 der Datei adodb-xmlschema03.inc.php.
{
$this->currentElement = strtoupper( $tag );
switch( $this->currentElement ) {
case 'QUERY':
// Create a new query in a SQL queryset.
// Ignore this query set if a platform is specified and it's different than the
// current connection platform.
if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
$this->newQuery();
} else {
$this->discardQuery();
}
break;
default:
// print_r( array( $tag, $attributes ) );
}
}

| addQuery | ( | ) |
Adds a completed query to the query list
Definiert in Zeile 1117 der Datei adodb-xmlschema.inc.php.
{
if( !isset( $this->query ) ) {
return FALSE;
}
$this->queries[] = $return = trim($this->query);
unset( $this->query );
return $return;
}

| addQuery | ( | ) |
Adds a completed query to the query list
Definiert in Zeile 1216 der Datei adodb-xmlschema03.inc.php.
{
if( !isset( $this->query ) ) {
return FALSE;
}
$this->queries[] = $return = trim($this->query);
unset( $this->query );
return $return;
}
| buildQuery | ( | $ | sql = NULL | ) |
Appends a line to a query that is being built line by line
| string | $data | Line of SQL data or NULL to initialize a new query |
Definiert in Zeile 1102 der Datei adodb-xmlschema.inc.php.
{
if( !isset( $this->query ) OR empty( $sql ) ) {
return FALSE;
}
$this->query .= $sql;
return $this->query;
}

| buildQuery | ( | $ | sql = NULL | ) |
Appends a line to a query that is being built line by line
| string | $data | Line of SQL data or NULL to initialize a new query |
Definiert in Zeile 1201 der Datei adodb-xmlschema03.inc.php.
{
if( !isset( $this->query ) OR empty( $sql ) ) {
return FALSE;
}
$this->query .= $sql;
return $this->query;
}
| create | ( | &$ | xmls | ) |
Creates and returns the current query set
| object | $xmls | adoSchema object |
Erneute Implementation von dbObject.
Definiert in Zeile 1135 der Datei adodb-xmlschema.inc.php.
{
foreach( $this->queries as $id => $query ) {
switch( $this->prefixMethod ) {
case 'AUTO':
// Enable auto prefix replacement
// Process object prefix.
// Evaluate SQL statements to prepend prefix to objects
$query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
$query = $this->prefixQuery( '/^\s*((?is)UPDATE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
$query = $this->prefixQuery( '/^\s*((?is)DELETE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
// SELECT statements aren't working yet
#$data = preg_replace( '/(?ias)(^\s*SELECT\s+.*\s+FROM)\s+(\W\s*,?\s*)+((?i)\s+WHERE.*$)/', "\1 $prefix\2 \3", $data );
case 'MANUAL':
// If prefixKey is set and has a value then we use it to override the default constant XMLS_PREFIX.
// If prefixKey is not set, we use the default constant XMLS_PREFIX
if( isset( $this->prefixKey ) AND( $this->prefixKey !== '' ) ) {
// Enable prefix override
$query = str_replace( $this->prefixKey, $xmls->objectPrefix, $query );
} else {
// Use default replacement
$query = str_replace( XMLS_PREFIX , $xmls->objectPrefix, $query );
}
}
$this->queries[$id] = trim( $query );
}
// Return the query set array
return $this->queries;
}


| create | ( | &$ | xmls | ) |
Creates and returns the current query set
| object | $xmls | adoSchema object |
Erneute Implementation von dbObject.
Definiert in Zeile 1234 der Datei adodb-xmlschema03.inc.php.
{
foreach( $this->queries as $id => $query ) {
switch( $this->prefixMethod ) {
case 'AUTO':
// Enable auto prefix replacement
// Process object prefix.
// Evaluate SQL statements to prepend prefix to objects
$query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
$query = $this->prefixQuery( '/^\s*((?is)UPDATE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
$query = $this->prefixQuery( '/^\s*((?is)DELETE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
// SELECT statements aren't working yet
#$data = preg_replace( '/(?ias)(^\s*SELECT\s+.*\s+FROM)\s+(\W\s*,?\s*)+((?i)\s+WHERE.*$)/', "\1 $prefix\2 \3", $data );
case 'MANUAL':
// If prefixKey is set and has a value then we use it to override the default constant XMLS_PREFIX.
// If prefixKey is not set, we use the default constant XMLS_PREFIX
if( isset( $this->prefixKey ) AND( $this->prefixKey !== '' ) ) {
// Enable prefix override
$query = str_replace( $this->prefixKey, $xmls->objectPrefix, $query );
} else {
// Use default replacement
$query = str_replace( XMLS_PREFIX , $xmls->objectPrefix, $query );
}
}
$this->queries[$id] = trim( $query );
}
// Return the query set array
return $this->queries;
}

| dbQuerySet | ( | &$ | parent, |
| $ | attributes = NULL |
||
| ) |
Initializes the query set.
| object | $parent | Parent object |
| array | $attributes | Attributes |
Definiert in Zeile 988 der Datei adodb-xmlschema.inc.php.
{
$this->parent = $parent;
// Overrides the manual prefix key
if( isset( $attributes['KEY'] ) ) {
$this->prefixKey = $attributes['KEY'];
}
$prefixMethod = isset( $attributes['PREFIXMETHOD'] ) ? strtoupper( trim( $attributes['PREFIXMETHOD'] ) ) : '';
// Enables or disables automatic prefix prepending
switch( $prefixMethod ) {
case 'AUTO':
$this->prefixMethod = 'AUTO';
break;
case 'MANUAL':
$this->prefixMethod = 'MANUAL';
break;
case 'NONE':
$this->prefixMethod = 'NONE';
break;
}
}
| dbQuerySet | ( | &$ | parent, |
| $ | attributes = NULL |
||
| ) |
Initializes the query set.
| object | $parent | Parent object |
| array | $attributes | Attributes |
Definiert in Zeile 1087 der Datei adodb-xmlschema03.inc.php.
{
$this->parent = $parent;
// Overrides the manual prefix key
if( isset( $attributes['KEY'] ) ) {
$this->prefixKey = $attributes['KEY'];
}
$prefixMethod = isset( $attributes['PREFIXMETHOD'] ) ? strtoupper( trim( $attributes['PREFIXMETHOD'] ) ) : '';
// Enables or disables automatic prefix prepending
switch( $prefixMethod ) {
case 'AUTO':
$this->prefixMethod = 'AUTO';
break;
case 'MANUAL':
$this->prefixMethod = 'MANUAL';
break;
case 'NONE':
$this->prefixMethod = 'NONE';
break;
}
}
| discardQuery | ( | ) |
Discards the existing query.
Definiert in Zeile 1090 der Datei adodb-xmlschema.inc.php.
{
unset( $this->query );
return TRUE;
}

| discardQuery | ( | ) |
Discards the existing query.
Definiert in Zeile 1189 der Datei adodb-xmlschema03.inc.php.
{
unset( $this->query );
return TRUE;
}
| newQuery | ( | ) |
Re-initializes the query.
Definiert in Zeile 1079 der Datei adodb-xmlschema.inc.php.
{
$this->query = '';
return TRUE;
}

| newQuery | ( | ) |
Re-initializes the query.
Definiert in Zeile 1178 der Datei adodb-xmlschema03.inc.php.
{
$this->query = '';
return TRUE;
}
| prefixQuery | ( | $ | regex, |
| $ | query, | ||
| $ | prefix = NULL |
||
| ) |
Rebuilds the query with the prefix attached to any objects
| string | $regex | Regex used to add prefix |
| string | $query | SQL query string |
| string | $prefix | Prefix to be appended to tables, indices, etc. |
Definiert in Zeile 1177 der Datei adodb-xmlschema.inc.php.
{
if( !isset( $prefix ) ) {
return $query;
}
if( preg_match( $regex, $query, $match ) ) {
$preamble = $match[1];
$postamble = $match[5];
$objectList = explode( ',', $match[3] );
// $prefix = $prefix . '_';
$prefixedList = '';
foreach( $objectList as $object ) {
if( $prefixedList !== '' ) {
$prefixedList .= ', ';
}
$prefixedList .= $prefix . trim( $object );
}
$query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
}
return $query;
}

| prefixQuery | ( | $ | regex, |
| $ | query, | ||
| $ | prefix = NULL |
||
| ) |
Rebuilds the query with the prefix attached to any objects
| string | $regex | Regex used to add prefix |
| string | $query | SQL query string |
| string | $prefix | Prefix to be appended to tables, indices, etc. |
Definiert in Zeile 1276 der Datei adodb-xmlschema03.inc.php.
{
if( !isset( $prefix ) ) {
return $query;
}
if( preg_match( $regex, $query, $match ) ) {
$preamble = $match[1];
$postamble = $match[5];
$objectList = explode( ',', $match[3] );
// $prefix = $prefix . '_';
$prefixedList = '';
foreach( $objectList as $object ) {
if( $prefixedList !== '' ) {
$prefixedList .= ', ';
}
$prefixedList .= $prefix . trim( $object );
}
$query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
}
return $query;
}