ILIAS
Release_4_2_x_branch Revision 61807
|
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. | |
buildCreateSequenceStatement ($a_table, $a_file="") | |
Build CreateSequence statement. | |
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.
References $ilDB.
ilDBGenerator::addTableToOverview | ( | $a_table, | |
$a_tpl, | |||
$a_cnt | |||
) |
Add table to overview template.
Definition at line 718 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 457 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 424 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 501 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 366 of file class.ilDBGenerator.php.
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 261 of file class.ilDBGenerator.php.
References $file, $path, buildAddIndexStatements(), buildAddPrimaryKeyStatement(), buildCreateSequenceStatement(), buildCreateTableStatement(), buildInsertStatement(), buildInsertStatements(), 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 525 of file class.ilDBGenerator.php.
References $ilLog, $row, 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 638 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript().
ilDBGenerator::buildInsertStatementsXML | ( | $a_table, | |
$a_basedir | |||
) |
object | $a_table | |
object | $a_file | [optional] |
Definition at line 589 of file class.ilDBGenerator.php.
References $ilLog, and shortenText().
ilDBGenerator::checkProcessing | ( | $a_table | ) |
Check whether a table should be processed or not.
Definition at line 206 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript(), and getHTMLOverview().
|
protected |
Definition at line 241 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 689 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 $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.
|
protected |
Definition at line 223 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 885 of file class.ilDBGenerator.php.
References $ilLog, 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().