[ Index ]

PHP Cross Reference of phpBB-3.3.3-deutsch

title

Body

[close]

/phpbb/db/tools/ -> tools_interface.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 202 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

tools_interface:: (17 methods):
  perform_schema_changes()
  sql_list_tables()
  sql_table_exists()
  sql_create_table()
  sql_table_drop()
  sql_list_columns()
  sql_column_exists()
  sql_column_add()
  sql_column_change()
  sql_column_remove()
  sql_list_index()
  sql_index_exists()
  sql_create_index()
  sql_index_drop()
  sql_unique_index_exists()
  sql_create_unique_index()
  sql_create_primary_key()


Interface: tools_interface  - X-Ref

Interface for a Database Tools for handling cross-db actions such as altering columns, etc.

perform_schema_changes($schema_changes)   X-Ref
Handle passed database update array.
Expected structure...
Key being one of the following
drop_tables: Drop tables
add_tables: Add tables
change_columns: Column changes (only type, not name)
add_columns: Add columns to a table
drop_keys: Dropping keys
drop_columns: Removing/Dropping columns
add_primary_keys: adding primary keys
add_unique_index: adding an unique index
add_index: adding an index (can be column:index_size if you need to provide size)

The values are in this format:
{TABLE NAME}        => array(
{COLUMN NAME}        => array({COLUMN TYPE}, {DEFAULT VALUE}, {OPTIONAL VARIABLES}),
{KEY/INDEX NAME}    => array({COLUMN NAMES}),
)


return: null
param: array $schema_changes

sql_list_tables()   X-Ref
Gets a list of tables in the database.

return: array        Array of table names  (all lower case)

sql_table_exists($table_name)   X-Ref
Check if table exists

return: bool true if table exists, else false
param: string    $table_name    The table name to check for

sql_create_table($table_name, $table_data)   X-Ref
Create SQL Table

return: array|true    Statements to run, or true if the statements have been executed
param: string    $table_name        The table name to create
param: array        $table_data        Array containing table data.

sql_table_drop($table_name)   X-Ref
Drop Table

return: array|true    Statements to run, or true if the statements have been executed
param: string    $table_name        The table name to drop

sql_list_columns($table_name)   X-Ref
Gets a list of columns of a table.

return: array        Array of column names (all lower case)
param: string $table_name    Table name

sql_column_exists($table_name, $column_name)   X-Ref
Check whether a specified column exist in a table

return: bool        True if column exists, false otherwise
param: string    $table_name        Table to check
param: string    $column_name    Column to check

sql_column_add($table_name, $column_name, $column_data, $inline = false)   X-Ref
Add new column

return: array|true    Statements to run, or true if the statements have been executed
param: string    $table_name        Table to modify
param: string    $column_name    Name of the column to add
param: array        $column_data    Column data
param: bool        $inline            Whether the query should actually be run,

sql_column_change($table_name, $column_name, $column_data, $inline = false)   X-Ref
Change column type (not name!)

return: array|true    Statements to run, or true if the statements have been executed
param: string    $table_name        Table to modify
param: string    $column_name    Name of the column to modify
param: array        $column_data    Column data
param: bool        $inline            Whether the query should actually be run,

sql_column_remove($table_name, $column_name, $inline = false)   X-Ref
Drop column

return: array|true    Statements to run, or true if the statements have been executed
param: string    $table_name        Table to modify
param: string    $column_name    Name of the column to drop
param: bool        $inline            Whether the query should actually be run,

sql_list_index($table_name)   X-Ref
List all of the indices that belong to a table

NOTE: does not list
- UNIQUE indices
- PRIMARY keys

return: array        Array with index names
param: string    $table_name        Table to check

sql_index_exists($table_name, $index_name)   X-Ref
Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes.

return: bool            True if index exists, else false
param: string    $table_name        Table to check the index at
param: string    $index_name        The index name to check

sql_create_index($table_name, $index_name, $column)   X-Ref
Add index

return: array|true    Statements to run, or true if the statements have been executed
param: string    $table_name        Table to modify
param: string    $index_name        Name of the index to create
param: string|array    $column        Either a string with a column name, or an array with columns

sql_index_drop($table_name, $index_name)   X-Ref
Drop Index

return: array|true    Statements to run, or true if the statements have been executed
param: string    $table_name        Table to modify
param: string    $index_name        Name of the index to delete

sql_unique_index_exists($table_name, $index_name)   X-Ref
Check if a specified index exists in table.

NOTE: Does not return normal and PRIMARY KEY indexes

return: bool True if index exists, else false
param: string    $table_name        Table to check the index at
param: string    $index_name        The index name to check

sql_create_unique_index($table_name, $index_name, $column)   X-Ref
Add unique index

return: array|true    Statements to run, or true if the statements have been executed
param: string    $table_name        Table to modify
param: string    $index_name        Name of the unique index to create
param: string|array    $column        Either a string with a column name, or an array with columns

sql_create_primary_key($table_name, $column, $inline = false)   X-Ref
Add primary key

return: array|true    Statements to run, or true if the statements have been executed
param: string    $table_name        Table to modify
param: string|array    $column        Either a string with a column name, or an array with columns
param: bool        $inline            Whether the query should actually be run,



Generated: Sun Feb 14 20:08:31 2021 Cross-referenced by PHPXref 0.7.1