ILIAS
Release_4_4_x_branch Revision 61816
|
This class provides methods for building a DB generation script, getting a full overview on abstract table definitions and more... More...
Public Member Functions | |
__construct () | |
Constructor. | |
setTargetEncoding ($a_encoding) | |
Set the desired target encoding If the target encoding os different from UTF-8 all text values will be shortened to lenght of of the current text field. | |
getTargetEncoding () | |
Returns the target encoding. | |
setBlackList ($a_blacklist) | |
Set Table Black List. | |
getBlackList () | |
Get Table Black List. | |
setWhiteList ($a_whitelist) | |
Set Table White List. | |
getWhiteList () | |
Get Table White List. | |
setFilter ($a_filter, $a_value) | |
Set filter. | |
getTables () | |
Get (all) tables. | |
checkProcessing ($a_table) | |
Check whether a table should be processed or not. | |
buildDBGenerationScript ($a_filename="") | |
Build DB generation script. | |
buildCreateTableStatement ($a_table, $a_file="") | |
Build CreateTable statement. | |
buildAddPrimaryKeyStatement ($a_table, $a_file="") | |
Build AddPrimaryKey statement. | |
buildAddIndexStatements ($a_table, $a_file="") | |
Build AddIndex statements. | |
buildAddUniqueConstraintStatements ($a_table, $a_file="") | |
Build AddUniqueConstraint statements. | |
buildCreateSequenceStatement ($a_table, $a_file="") | |
Build CreateSequence statement. | |
buildSingularSequenceStatement ($a_file="") | |
Build CreateSequence statement (if not belonging to table) | |
buildInsertStatement ($a_table, $a_basedir) | |
Write seerialized insert data to array. | |
buildInsertStatementsXML ($a_table, $a_basedir) | |
buildInsertStatements ($a_table, $a_file="") | |
Build Insert statements. | |
getHTMLOverview ($a_filename="") | |
Get table definition overview in HTML. | |
addTableToOverview ($a_table, $a_tpl, $a_cnt) | |
Add table to overview template. |
Static Public Member Functions | |
static | lookupAbstractedTables () |
Data Fields | |
$whitelist = array() | |
$blacklist = array() | |
$tables = array() |
Protected Member Functions | |
openFile ($a_path) | |
closeFile ($fp) | |
shortenText ($table, $field, $a_value, $a_size) | |
Shorten text depending on target encoding. |
Protected Attributes | |
$target_encoding = 'UTF-8' |
This class provides methods for building a DB generation script, getting a full overview on abstract table definitions and more...
Definition at line 13 of file class.ilDBGenerator.php.
ilDBGenerator::__construct | ( | ) |
Constructor.
Definition at line 24 of file class.ilDBGenerator.php.
ilDBGenerator::addTableToOverview | ( | $a_table, | |
$a_tpl, | |||
$a_cnt | |||
) |
Add table to overview template.
Definition at line 802 of file class.ilDBGenerator.php.
Referenced by getHTMLOverview().
ilDBGenerator::buildAddIndexStatements | ( | $a_table, | |
$a_file = "" |
|||
) |
Build AddIndex statements.
string | table name |
file | file resource or empty string |
Definition at line 470 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript().
ilDBGenerator::buildAddPrimaryKeyStatement | ( | $a_table, | |
$a_file = "" |
|||
) |
Build AddPrimaryKey statement.
string | table name |
file | file resource or empty string |
Definition at line 437 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript().
ilDBGenerator::buildAddUniqueConstraintStatements | ( | $a_table, | |
$a_file = "" |
|||
) |
Build AddUniqueConstraint statements.
string | table name |
file | file resource or empty string |
Definition at line 514 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript().
ilDBGenerator::buildCreateSequenceStatement | ( | $a_table, | |
$a_file = "" |
|||
) |
Build CreateSequence statement.
string | table name |
file | file resource or empty string |
Definition at line 550 of file class.ilDBGenerator.php.
References if.
Referenced by buildDBGenerationScript().
ilDBGenerator::buildCreateTableStatement | ( | $a_table, | |
$a_file = "" |
|||
) |
Build CreateTable statement.
string | table name |
file | file resource or empty string |
Definition at line 379 of file class.ilDBGenerator.php.
References fields.
Referenced by buildDBGenerationScript().
ilDBGenerator::buildDBGenerationScript | ( | $a_filename = "" | ) |
Build DB generation script.
string | output filename, if no filename is given, script is echoed |
Definition at line 268 of file class.ilDBGenerator.php.
References $file, $path, buildAddIndexStatements(), buildAddPrimaryKeyStatement(), buildAddUniqueConstraintStatements(), buildCreateSequenceStatement(), buildCreateTableStatement(), buildInsertStatement(), buildInsertStatements(), buildSingularSequenceStatement(), checkProcessing(), closeFile(), getTables(), and openFile().
ilDBGenerator::buildInsertStatement | ( | $a_table, | |
$a_basedir | |||
) |
Write seerialized insert data to array.
object | $a_table | |
object | $a_basedir |
Definition at line 609 of file class.ilDBGenerator.php.
References $ilLog, $row, fields, and shortenText().
Referenced by buildDBGenerationScript().
ilDBGenerator::buildInsertStatements | ( | $a_table, | |
$a_file = "" |
|||
) |
Build Insert statements.
string | table name |
file | file resource or empty string |
Definition at line 722 of file class.ilDBGenerator.php.
References fields.
Referenced by buildDBGenerationScript().
ilDBGenerator::buildInsertStatementsXML | ( | $a_table, | |
$a_basedir | |||
) |
object | $a_table | |
object | $a_file | [optional] |
Definition at line 673 of file class.ilDBGenerator.php.
References $ilLog, fields, and shortenText().
ilDBGenerator::buildSingularSequenceStatement | ( | $a_file = "" | ) |
Build CreateSequence statement (if not belonging to table)
file | file resource or empty string |
Definition at line 573 of file class.ilDBGenerator.php.
References MDB2\isError().
Referenced by buildDBGenerationScript().
ilDBGenerator::checkProcessing | ( | $a_table | ) |
Check whether a table should be processed or not.
Definition at line 213 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript(), and getHTMLOverview().
|
protected |
Definition at line 248 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript().
ilDBGenerator::getBlackList | ( | ) |
Get Table Black List.
Definition at line 155 of file class.ilDBGenerator.php.
References $blacklist.
ilDBGenerator::getHTMLOverview | ( | $a_filename = "" | ) |
Get table definition overview in HTML.
string | output filename, if no filename is given, script is echoed |
Definition at line 773 of file class.ilDBGenerator.php.
References $tpl, addTableToOverview(), checkProcessing(), getTables(), and ILIAS_VERSION.
ilDBGenerator::getTables | ( | ) |
Get (all) tables.
Definition at line 193 of file class.ilDBGenerator.php.
References $tables, and MDB2\isError().
Referenced by buildDBGenerationScript(), and getHTMLOverview().
ilDBGenerator::getTargetEncoding | ( | ) |
Returns the target encoding.
Definition at line 134 of file class.ilDBGenerator.php.
References $target_encoding.
Referenced by shortenText().
ilDBGenerator::getWhiteList | ( | ) |
Get Table White List.
Definition at line 177 of file class.ilDBGenerator.php.
References $whitelist.
|
static |
Definition at line 37 of file class.ilDBGenerator.php.
References $query, $res, $row, and DB_FETCHMODE_OBJECT.
|
protected |
Definition at line 230 of file class.ilDBGenerator.php.
References $file.
Referenced by buildDBGenerationScript().
ilDBGenerator::setBlackList | ( | $a_blacklist | ) |
Set Table Black List.
(Tables that should not be included in the processing)
array | $a_blacklist | Table Black List |
Definition at line 145 of file class.ilDBGenerator.php.
ilDBGenerator::setFilter | ( | $a_filter, | |
$a_value | |||
) |
Set filter.
Definition at line 185 of file class.ilDBGenerator.php.
ilDBGenerator::setTargetEncoding | ( | $a_encoding | ) |
Set the desired target encoding If the target encoding os different from UTF-8 all text values will be shortened to lenght of of the current text field.
E.g: il_meta_keyword keyword(4000) target encoding: UTF16
=> $value = mb_convert_encoding($value,'UTF-8','UTF-16'); $value = mb_strcut($value,0,4000,'UTF16'); $value = mb_convert_encoding($value,'UTF-16','UTF-8');
object | $a_encoding |
Definition at line 125 of file class.ilDBGenerator.php.
ilDBGenerator::setWhiteList | ( | $a_whitelist | ) |
Set Table White List.
Per default all tables are included in the processing. If a white list ist provided, only them will be used.
array | $a_whitelist | Table White List |
Definition at line 167 of file class.ilDBGenerator.php.
|
protected |
Shorten text depending on target encoding.
string | $table | |
string | $field | |
string | $a_value | |
int | $a_size |
Definition at line 969 of file class.ilDBGenerator.php.
References $ilLog, fields, and getTargetEncoding().
Referenced by buildInsertStatement(), and buildInsertStatementsXML().
ilDBGenerator::$blacklist = array() |
Definition at line 18 of file class.ilDBGenerator.php.
Referenced by getBlackList().
ilDBGenerator::$tables = array() |
Definition at line 19 of file class.ilDBGenerator.php.
Referenced by getTables().
|
protected |
Definition at line 15 of file class.ilDBGenerator.php.
Referenced by getTargetEncoding().
ilDBGenerator::$whitelist = array() |
Definition at line 17 of file class.ilDBGenerator.php.
Referenced by getWhiteList().