Pelzini

This is the code documentation for the Pelzini project

Page options:

Inherited members

class DatabaseOutputter

Outputs the tree to a database.

Authors

Variables

NameVisibilityDescription
$extra_insert_data 
$since_versions (static) 

Functions

NameVisibilityDescription
addSinceVersionpublic (static)Adds a @since version to from a CodeParserItem to the internal list
affected_rowsprotectedReturns the number of rows affected in the last query
check_layoutpublicUpdates the database layout to match the layout file
commit_transactionprotectedThe database engine should commit a transaction. If transactions are not supported, it should do nothing.
connectprotectedConnects to the database
create_tableprotectedCreates a table
do_insertprotectedExecutes an insert query for the data provided.
do_multiple_insertprotectedExecutes an insert query for the data provided.
do_updateprotectedExecutes an update query for the data provided.
fetch_assocprotectedFetches a row from the database (assoc)
fetch_rowprotectedFetches a row from the database (numerical)
getSinceVersionIdprivateGets the database id of a record for a specific @since version
get_alter_column_queryprotectedGets the query that alters a column to match the new SQL definition
get_column_detailsprotectedShould return a multi-dimentional array of the column details
get_index_detailsprotectedShould return a multi-dimentional array of the index details
get_sql_typeprotectedConverts an internal type into the database-specific SQL type.
get_table_listprotectedReturns an array of the tables in this database
insert_idprotectedReturns the autogenerated id created in the last query
outputpublicDoes the actual outputting of the file objects (and theihttps://www.nationalcrimecheck.com.au/r sub-objects) to the database
queryprotectedExecutes a database query
rollback_transactionprotectedThe database engine should rollback a transaction. If transactions are not supported, it should do nothing.
save_author_itemsprivateSaves author information about an item
save_classprivateSaves a class to the database
save_constantprivateSaves a constant to the database
save_enumerationprivateSaves a enumeration to the database
save_example_itemsprivateSaves 'example' information about an item
save_functionprivateSaves a function to the database
save_info_tag_itemsprivateSaves info tags for an item
save_interfaceprivateSaves an interface to the database
save_see_itemsprivateSaves 'see also' information about an item
save_table_itemsprivateSaves table usage information about an item
save_variableprivateSaves a variable to the database
sql_safenprotectedSafens some input
start_transactionprotectedThe database engine should start a transaction. If transactions are not supported, it should do nothing.

public addSinceVersion

void DatabaseOutputter::addSinceVersion ( CodeParserItem $parser_item , mixed $parent );

Adds a @since version to from a CodeParserItem to the internal list
This list is used to fill a table with all of the versions of the program in existance

protected affected_rows

void $DatabaseOutputter->affected_rows ( mixed $res );

Returns the number of rows affected in the last query

public check_layout

unknown $DatabaseOutputter->check_layout ( string $layout_filename );

Updates the database layout to match the layout file
NOTE: currently only supports column and table adding and updating, not removal.

protected commit_transaction

void $DatabaseOutputter->commit_transaction ( );

The database engine should commit a transaction. If transactions are not supported, it should do nothing.

protected connect

void $DatabaseOutputter->connect ( );

Connects to the database

protected create_table

void $DatabaseOutputter->create_table ( mixed $table_name , mixed $columns );

Creates a table

protected do_insert

void $DatabaseOutputter->do_insert ( mixed $table , mixed $data );

Executes an insert query for the data provided.

protected do_multiple_insert

void $DatabaseOutputter->do_multiple_insert ( mixed $table , mixed $data );

Executes an insert query for the data provided.

protected do_update

void $DatabaseOutputter->do_update ( mixed $table , mixed $data , mixed $where );

Executes an update query for the data provided.

protected fetch_assoc

void $DatabaseOutputter->fetch_assoc ( mixed $res );

Fetches a row from the database (assoc)

protected fetch_row

void $DatabaseOutputter->fetch_row ( mixed $res );

Fetches a row from the database (numerical)

private getSinceVersionId

unknown $DatabaseOutputter->getSinceVersionId ( mixed $since_version );

Gets the database id of a record for a specific @since version

protected get_alter_column_query

void $DatabaseOutputter->get_alter_column_query ( mixed $table , mixed $column_name , mixed $new_type , mixed $null_allowed );

Gets the query that alters a column to match the new SQL definition

protected get_column_details

void $DatabaseOutputter->get_column_details ( mixed $table_name );

Should return a multi-dimentional array of the column details
Format:
Array [
  [0] => Array [
     'Field' => field name
     'Type' => field type, (e.g. 'serial', 'smallnum' or 'identifier')
     'NotNull' => nullable?, (true or false)
     'Key' => indexed?, ('PRI' for primary key)
     ]
   [1] => ...
   [n] => ...

protected get_index_details

void $DatabaseOutputter->get_index_details ( mixed $table_name );

Should return a multi-dimentional array of the index details
Format:
Array [
  [0] => Array [
     'Fields' => array of field names
     ]
  [1] => ...
  [n] => ...

protected get_sql_type

string $DatabaseOutputter->get_sql_type ( string $internal_type_name );

Converts an internal type into the database-specific SQL type.
The defined internal types are:
  - serial: a number that automatically increments whenever a record is added
  - smallnum: a small number. needs to be able to hold at least 32,767 possible values (e.g. a 16-bit signed integer)
  - largenum: a large number. needs to be the same size or larger than a serial type
  - string: a character field long enough to hold identifiers of objects (e.g. function names)
  - text: a field that can hold arbitary pieces of text larger than 65536 chars in length.

protected get_table_list

void $DatabaseOutputter->get_table_list ( );

Returns an array of the tables in this database

protected insert_id

void $DatabaseOutputter->insert_id ( );

Returns the autogenerated id created in the last query

public output

unknown $DatabaseOutputter->output ( array $files , Config $config );

Does the actual outputting of the file objects (and theihttps://www.nationalcrimecheck.com.au/r sub-objects) to the database

protected query

void $DatabaseOutputter->query ( mixed $query );

Executes a database query

protected rollback_transaction

void $DatabaseOutputter->rollback_transaction ( );

The database engine should rollback a transaction. If transactions are not supported, it should do nothing.

private save_author_items

void $DatabaseOutputter->save_author_items ( mixed $link_type , mixed $link_id , mixed $items );

Saves author information about an item

private save_class

void $DatabaseOutputter->save_class ( mixed $class , mixed $file_id , mixed $file_namespace );

Saves a class to the database

private save_constant

void $DatabaseOutputter->save_constant ( mixed $constant [, mixed $file_id [, mixed $enumeration_id ]] );

Saves a constant to the database

private save_enumeration

void $DatabaseOutputter->save_enumeration ( mixed $enumeration [, mixed $file_id ] );

Saves a enumeration to the database

private save_example_items

void $DatabaseOutputter->save_example_items ( mixed $link_type , mixed $link_id , mixed $items );

Saves 'example' information about an item

private save_function

void $DatabaseOutputter->save_function ( mixed $function , mixed $file_id , mixed $class_id , mixed $interface_id , mixed $file_namespace );

Saves a function to the database

private save_info_tag_items

void $DatabaseOutputter->save_info_tag_items ( mixed $link_type , mixed $link_id , mixed $items );

Saves info tags for an item

private save_interface

void $DatabaseOutputter->save_interface ( mixed $interface , mixed $file_id , mixed $file_namespace );

Saves an interface to the database

private save_see_items

void $DatabaseOutputter->save_see_items ( mixed $link_type , mixed $link_id , mixed $items );

Saves 'see also' information about an item

private save_table_items

void $DatabaseOutputter->save_table_items ( mixed $link_type , mixed $link_id , mixed $items );

Saves table usage information about an item

private save_variable

void $DatabaseOutputter->save_variable ( mixed $variable [, mixed $class_id [, mixed $interface_id ]] );

Saves a variable to the database

protected sql_safen

void $DatabaseOutputter->sql_safen ( string $input );

Safens some input

protected start_transaction

void $DatabaseOutputter->start_transaction ( );

The database engine should start a transaction. If transactions are not supported, it should do nothing.