This class provides methods for building a DB generation script, getting a full overview on abstract table definitions and more...
More...
|
| __construct () |
| Constructor. More...
|
|
| setTargetEncoding ($a_encoding) |
| Set the desired target encoding If the target encoding os different from UTF-8 all text values will be shortened to length of of the current text field. More...
|
|
| getTargetEncoding () |
| Returns the target encoding. More...
|
|
| setBlackList ($a_blacklist) |
| Set Table Black List. More...
|
|
| getBlackList () |
| Get Table Black List. More...
|
|
| setWhiteList ($a_whitelist) |
| Set Table White List. More...
|
|
| getWhiteList () |
| Get Table White List. More...
|
|
| setFilter ($a_filter, $a_value) |
|
| getTables () |
|
| checkProcessing ($a_table) |
| Check whether a table should be processed or not. More...
|
|
| buildDBGenerationScript ($a_filename="") |
| Build DB generation script. More...
|
|
| buildCreateTableStatement ($a_table, $a_file="") |
| Build CreateTable statement. More...
|
|
| buildAddPrimaryKeyStatement ($a_table, $a_file="") |
| Build AddPrimaryKey statement. More...
|
|
| buildAddIndexStatements ($a_table, $a_file="") |
| Build AddIndex statements. More...
|
|
| buildAddUniqueConstraintStatements ($a_table, $a_file="") |
| Build AddUniqueConstraint statements. More...
|
|
| buildCreateSequenceStatement ($a_table, $a_file="") |
| Build CreateSequence statement. More...
|
|
| buildSingularSequenceStatement ($a_file="") |
| Build CreateSequence statement (if not belonging to table) More...
|
|
| buildInsertStatement ($a_table, $a_basedir) |
| Write seerialized insert data to array. More...
|
|
| buildInsertStatementsXML ($a_table, $a_basedir) |
|
| buildInsertStatements ($a_table, $a_file="") |
| Build Insert statements. More...
|
|
| getHTMLOverview ($a_filename="") |
| Get table definition overview in HTML. More...
|
|
| addTableToOverview ($a_table, $a_tpl, $a_cnt) |
| Add table to overview template. More...
|
|
This class provides methods for building a DB generation script, getting a full overview on abstract table definitions and more...
- Author
- Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
- Version
- Id
- class.ilDBUpdate.php 18649 2009-01-21 09:59:23Z akill
Definition at line 13 of file class.ilDBGenerator.php.
◆ __construct()
ilDBGenerator::__construct |
( |
| ) |
|
◆ addTableToOverview()
ilDBGenerator::addTableToOverview |
( |
|
$a_table, |
|
|
|
$a_tpl, |
|
|
|
$a_cnt |
|
) |
| |
Add table to overview template.
Definition at line 729 of file class.ilDBGenerator.php.
References array.
Referenced by getHTMLOverview().
730 $fields = $this->analyzer->getFieldInformation($a_table);
731 $indices = $this->analyzer->getIndicesInformation($a_table);
732 $constraints = $this->analyzer->getConstraintsInformation($a_table);
733 $pk = $this->analyzer->getPrimaryKeyInformation($a_table);
734 $auto = $this->analyzer->getAutoIncrementField($a_table);
735 $has_sequence = $this->analyzer->hasSequence($a_table);
738 if (isset($this->filter[
"has_sequence"])) {
739 if ((!$has_sequence && $auto ==
"" && $this->filter[
"has_sequence"])
740 || (($has_sequence || $auto !=
"") && !$this->filter[
"has_sequence"])
747 $indices_output =
false;
748 if (is_array($indices) && count($indices) > 0 && !$this->filter[
"skip_indices"]) {
749 foreach ($indices as $index => $def) {
751 foreach ($def[
"fields"] as $f => $pos) {
754 $a_tpl->setCurrentBlock(
"index");
755 $a_tpl->setVariable(
"VAL_INDEX", $def[
"name"]);
756 $a_tpl->setVariable(
"VAL_FIELDS", implode($f2,
", "));
757 $a_tpl->parseCurrentBlock();
758 $indices_output =
true;
760 $a_tpl->setCurrentBlock(
"index_table");
761 $a_tpl->parseCurrentBlock();
765 $constraints_output =
false;
766 if (is_array($constraints) && count($constraints) > 0 && !$this->filter[
"skip_constraints"]) {
767 foreach ($constraints as $index => $def) {
769 foreach ($def[
"fields"] as $f => $pos) {
772 $a_tpl->setCurrentBlock(
"constraint");
773 $a_tpl->setVariable(
"VAL_CONSTRAINT", $def[
"name"]);
774 $a_tpl->setVariable(
"VAL_CTYPE", $def[
"type"]);
775 $a_tpl->setVariable(
"VAL_CFIELDS", implode($f2,
", "));
776 $a_tpl->parseCurrentBlock();
777 $constraints_output =
true;
779 $a_tpl->setCurrentBlock(
"constraint_table");
780 $a_tpl->parseCurrentBlock();
784 $fields_output =
false;
785 foreach ($fields as $field => $def) {
787 if (isset($this->filter[
"alt_types"])) {
788 if (($def[
"alt_types"] ==
"" && $this->filter[
"alt_types"])
789 || ($def[
"alt_types"] !=
"" && !$this->filter[
"alt_types"])
794 if (isset($this->filter[
"type"])) {
795 if ($def[
"type"] != $this->filter[
"type"]) {
799 if (isset($this->filter[
"nativetype"])) {
800 if ($def[
"nativetype"] != $this->filter[
"nativetype"]) {
804 if (isset($this->filter[
"unsigned"])) {
805 if ($def[
"unsigned"] != $this->filter[
"unsigned"]) {
810 $a_tpl->setCurrentBlock(
"field");
811 if (empty($pk[
"fields"][$field])) {
812 $a_tpl->setVariable(
"VAL_FIELD", strtolower($field));
814 $a_tpl->setVariable(
"VAL_FIELD",
"<u>" . strtolower($field) .
"</u>");
816 $a_tpl->setVariable(
"VAL_TYPE", $def[
"type"]);
817 $a_tpl->setVariable(
"VAL_LENGTH", (!is_null($def[
"length"])) ? $def[
"length"] :
" ");
819 if (strtolower($def[
"default"]) ==
"current_timestamp") {
821 unset($def[
"default"]);
824 $a_tpl->setVariable(
"VAL_DEFAULT", (!is_null($def[
"default"])) ? $def[
"default"] :
" ");
825 $a_tpl->setVariable(
"VAL_NOT_NULL", (!is_null($def[
"notnull"])) ? (($def[
"notnull"]) ?
"true" :
"false") :
" ");
826 $a_tpl->setVariable(
"VAL_FIXED", (!is_null($def[
"fixed"])) ? (($def[
"fixed"]) ?
"true" :
"false") :
" ");
827 $a_tpl->setVariable(
"VAL_UNSIGNED", (!is_null($def[
"unsigned"])) ? (($def[
"unsigned"]) ?
"true" :
"false") :
" ");
828 $a_tpl->setVariable(
"VAL_ALTERNATIVE_TYPES", ($def[
"alt_types"] !=
"") ? $def[
"alt_types"] :
" ");
829 $a_tpl->setVariable(
"VAL_NATIVETYPE", ($def[
"nativetype"] !=
"") ? $def[
"nativetype"] :
" ");
830 $a_tpl->parseCurrentBlock();
831 $fields_output =
true;
834 if ($fields_output) {
835 $a_tpl->setCurrentBlock(
"field_table");
836 $a_tpl->parseCurrentBlock();
840 if ($indices_output || $fields_output || $constraints_output) {
841 $a_tpl->setCurrentBlock(
"table");
842 $a_tpl->setVariable(
"TXT_TABLE_NAME", strtolower($a_table));
843 if ($has_sequence || $auto !=
"") {
844 $a_tpl->setVariable(
"TXT_SEQUENCE",
"Has Sequence");
846 $a_tpl->setVariable(
"TXT_SEQUENCE",
"No Sequence");
848 $a_tpl->setVariable(
"VAL_CNT", (
int)$a_cnt);
849 $a_tpl->parseCurrentBlock();
Create styles array
The data for the language used.
◆ buildAddIndexStatements()
ilDBGenerator::buildAddIndexStatements |
( |
|
$a_table, |
|
|
|
$a_file = "" |
|
) |
| |
Build AddIndex statements.
- Parameters
-
string | table name |
file | file resource or empty string |
Definition at line 446 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript().
447 $ind = $this->analyzer->getIndicesInformation($a_table,
true);
449 if (is_array($ind)) {
450 foreach ($ind as $i) {
451 if ($i[
"fulltext"]) {
456 $in_st =
"\n" .
'$in_fields = array(';
458 foreach ($i[
"fields"] as $f => $pos) {
459 $in_st .= $sep .
'"' . $f .
'"';
463 $in_st .=
'$ilDB->addIndex("' . $a_table .
'", $in_fields, "' . $i[
"name"] .
'"' . $ft .
');' .
"\n";
468 fwrite($a_file, $in_st);
◆ buildAddPrimaryKeyStatement()
ilDBGenerator::buildAddPrimaryKeyStatement |
( |
|
$a_table, |
|
|
|
$a_file = "" |
|
) |
| |
Build AddPrimaryKey statement.
- Parameters
-
string | table name |
file | file resource or empty string |
Definition at line 418 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript().
419 $pk = $this->analyzer->getPrimaryKeyInformation($a_table);
421 if (is_array($pk[
"fields"]) && count($pk[
"fields"]) > 0) {
422 $pk_st =
"\n" .
'$pk_fields = array(';
424 foreach ($pk[
"fields"] as $f => $pos) {
425 $pk_st .= $sep .
'"' . $f .
'"';
429 $pk_st .=
'$ilDB->addPrimaryKey("' . $a_table .
'", $pk_fields);' .
"\n";
434 fwrite($a_file, $pk_st);
◆ buildAddUniqueConstraintStatements()
ilDBGenerator::buildAddUniqueConstraintStatements |
( |
|
$a_table, |
|
|
|
$a_file = "" |
|
) |
| |
Build AddUniqueConstraint statements.
- Parameters
-
string | table name |
file | file resource or empty string |
Definition at line 481 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript().
482 $con = $this->analyzer->getConstraintsInformation($a_table,
true);
484 if (is_array($con)) {
485 foreach ($con as $i) {
486 $in_st =
"\n" .
'$in_fields = array(';
488 foreach ($i[
"fields"] as $f => $pos) {
489 $in_st .= $sep .
'"' . $f .
'"';
493 $in_st .=
'$ilDB->addUniqueConstraint("' . $a_table .
'", $in_fields, "' . $i[
"name"] .
'");' .
"\n";
498 fwrite($a_file, $in_st);
◆ buildCreateSequenceStatement()
ilDBGenerator::buildCreateSequenceStatement |
( |
|
$a_table, |
|
|
|
$a_file = "" |
|
) |
| |
Build CreateSequence statement.
- Parameters
-
string | table name |
file | file resource or empty string |
Definition at line 511 of file class.ilDBGenerator.php.
Referenced by buildDBGenerationScript().
512 $seq = $this->analyzer->hasSequence($a_table);
513 if ($seq !==
false) {
514 $seq_st =
"\n" .
'$ilDB->createSequence("' . $a_table .
'", ' . (int)$seq .
');' .
"\n";
519 fwrite($a_file, $seq_st);
◆ buildCreateTableStatement()
ilDBGenerator::buildCreateTableStatement |
( |
|
$a_table, |
|
|
|
$a_file = "" |
|
) |
| |
Build CreateTable statement.
- Parameters
-
string | table name |
file | file resource or empty string |
Definition at line 367 of file class.ilDBGenerator.php.
References fields.
Referenced by buildDBGenerationScript().
368 $fields = $this->analyzer->getFieldInformation($a_table,
true);
370 $create_st =
"\n\n//\n// " . $a_table .
"\n//\n";
371 $create_st .=
'$fields = array (' .
"\n";
373 foreach ($fields as $f => $def) {
375 $create_st .=
"\t" . $f_sep .
'"' . $f .
'" => array (' .
"\n";
378 foreach ($def as $k => $v) {
379 if ($k !=
"nativetype" && $k !=
"alt_types" && $k !=
"autoincrement" && !is_null($v)) {
384 $v = $v ?
"true" :
"false";
395 $create_st .=
"\t\t" . $a_sep .
'"' . $k .
'" => ' . $v .
"\n";
399 $create_st .=
"\t" .
')' .
"\n";
401 $create_st .=
');' .
"\n";
402 $create_st .=
'$ilDB->createTable("' . $a_table .
'", $fields);' .
"\n";
407 fwrite($a_file, $create_st);
◆ buildDBGenerationScript()
ilDBGenerator::buildDBGenerationScript |
( |
|
$a_filename = "" | ) |
|
Build DB generation script.
- Parameters
-
string | output filename, if no filename is given, script is echoed |
Definition at line 275 of file class.ilDBGenerator.php.
References $file, $ok, $path, $start, array, buildAddIndexStatements(), buildAddPrimaryKeyStatement(), buildAddUniqueConstraintStatements(), buildCreateSequenceStatement(), buildCreateTableStatement(), buildInsertStatement(), buildInsertStatements(), buildSingularSequenceStatement(), checkProcessing(), closeFile(), getTables(), and openFile().
276 if (@is_dir($a_filename)) {
280 $isDirectory =
false;
285 if ($a_filename !=
"" and !$isDirectory) {
286 $file = fopen($a_filename,
"w");
288 $start =
'<?php' .
"\n" .
'function setupILIASDatabase()' .
"\n{\n";
289 $start .=
"\t" .
'global $ilDB;' .
"\n\n";
291 } elseif ($isDirectory) {
299 foreach ($this->tables as $table) {
301 if ($a_filename !=
"") {
324 if (in_array($table,
array(
'usr_session_stats',
'usr_session_raw',
'il_plugin'))) {
331 #$this->buildInsertStatementsXML($table,$path); 340 if ($a_filename !=
"") {
341 echo "<br><b>missing: " . $table .
"</b>";
350 if ($a_filename ==
"") {
352 } elseif (!$isDirectory) {
buildAddIndexStatements($a_table, $a_file="")
Build AddIndex statements.
buildInsertStatement($a_table, $a_basedir)
Write seerialized insert data to array.
buildAddPrimaryKeyStatement($a_table, $a_file="")
Build AddPrimaryKey statement.
buildCreateTableStatement($a_table, $a_file="")
Build CreateTable statement.
buildInsertStatements($a_table, $a_file="")
Build Insert statements.
Create styles array
The data for the language used.
buildSingularSequenceStatement($a_file="")
Build CreateSequence statement (if not belonging to table)
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
checkProcessing($a_table)
Check whether a table should be processed or not.
buildAddUniqueConstraintStatements($a_table, $a_file="")
Build AddUniqueConstraint statements.
buildCreateSequenceStatement($a_table, $a_file="")
Build CreateSequence statement.
◆ buildInsertStatement()
ilDBGenerator::buildInsertStatement |
( |
|
$a_table, |
|
|
|
$a_basedir |
|
) |
| |
Write seerialized insert data to array.
- Parameters
-
object | $a_table | |
object | $a_basedir | |
- Returns
Definition at line 560 of file class.ilDBGenerator.php.
References $ilLog, $row, array, fields, and shortenText().
Referenced by buildDBGenerationScript().
563 $ilLog->write(
'Starting export of:' . $a_table);
565 $set = $this->il_db->query(
"SELECT * FROM " . $this->il_db->quoteIdentifier($a_table));
569 mkdir($a_basedir .
'/' . $a_table .
'_inserts', fileperms($a_basedir));
572 while ($rec = $this->il_db->fetchAssoc($set)) {
574 foreach ($rec as $f => $v) {
575 if ($this->
fields[$f][
'type'] ==
'text' and $this->
fields[$f][
'length'] >= 1000) {
580 $this->
fields[$f][
'type'],
585 $rows[$a_table][
$row ++] = $values;
588 $ilLog->write(
'Writing insert statements after 1000 lines...');
589 $fp = fopen($a_basedir .
'/' . $a_table .
'_inserts/' . $filenum ++ .
'.data',
'w');
590 fwrite($fp, serialize((
array)$rows));
598 $fp = fopen($a_basedir .
'/' . $a_table .
'_inserts/' . $filenum ++ .
'.data',
'w');
599 fwrite($fp, serialize((
array)$rows) .
"\n");
603 $ilLog->write(
'Finished export of: ' . $a_table);
604 if (function_exists(
'memory_get_usage')) {
605 $ilLog->write(
'Memory usage: ' . memory_get_usage(
true));
shortenText($table, $field, $a_value, $a_size)
Shorten text depending on target encoding.
Create styles array
The data for the language used.
◆ buildInsertStatements()
ilDBGenerator::buildInsertStatements |
( |
|
$a_table, |
|
|
|
$a_file = "" |
|
) |
| |
Build Insert statements.
- Parameters
-
string | table name |
file | file resource or empty string |
Definition at line 660 of file class.ilDBGenerator.php.
References array, and fields.
Referenced by buildDBGenerationScript().
661 if ($a_table ==
"lng_data") {
665 $set = $this->il_db->query(
"SELECT * FROM " . $this->il_db->quoteIdentifier($a_table));
668 while ($rec = $this->il_db->fetchAssoc($set)) {
673 foreach ($rec as $f => $v) {
675 $types[] =
'"' . $this->
fields[$f][
"type"] .
'"';
676 $v = str_replace(
'\\',
'\\\\', $v);
677 $values[] =
"'" . str_replace(
"'",
"\'", $v) .
"'";
678 $i_str[] =
"'" . $f .
"' => array('" . $this->
fields[$f][
"type"] .
"', '" . str_replace(
"'",
"\'", $v) .
"')";
680 $fields_str =
"(" . implode($fields,
",") .
")";
681 $types_str =
"array(" . implode($types,
",") .
")";
682 $values_str =
"array(" . implode($values,
",") .
")";
683 $ins_st =
"\n" .
'$ilDB->insert("' . $a_table .
'", array(' .
"\n";
684 $ins_st .= implode($i_str,
", ") .
"));\n";
692 fwrite($a_file, $ins_st);
Create styles array
The data for the language used.
◆ buildInsertStatementsXML()
ilDBGenerator::buildInsertStatementsXML |
( |
|
$a_table, |
|
|
|
$a_basedir |
|
) |
| |
- Parameters
-
object | $a_table | |
object | $a_file | [optional] |
- Returns
Definition at line 618 of file class.ilDBGenerator.php.
References $ilLog, $w, array, fields, and shortenText().
621 include_once
'./Services/Xml/classes/class.ilXmlWriter.php';
623 $w->xmlStartTag(
'Table',
array(
'name' => $a_table ));
625 $set = $this->il_db->query(
"SELECT * FROM " . $this->il_db->quoteIdentifier($a_table));
628 while ($rec = $this->il_db->fetchAssoc($set)) {
629 #$ilLog->write('Num: '.$num++); 630 $w->xmlStartTag(
'Row');
635 foreach ($rec as $f => $v) {
636 if ($this->
fields[$f][
'type'] ==
'text' and $this->
fields[$f][
'length'] >= 1000) {
642 'type' => $this->
fields[$f][
'type'],
646 $w->xmlEndTag(
'Row');
648 $w->xmlEndTag(
'Table');
650 $w->xmlDumpFile($a_basedir .
'/' . $a_table .
'.xml',
false);
shortenText($table, $field, $a_value, $a_size)
Shorten text depending on target encoding.
Create styles array
The data for the language used.
◆ buildSingularSequenceStatement()
ilDBGenerator::buildSingularSequenceStatement |
( |
|
$a_file = "" | ) |
|
Build CreateSequence statement (if not belonging to table)
- Parameters
-
file | file resource or empty string |
Definition at line 530 of file class.ilDBGenerator.php.
References $r.
Referenced by buildDBGenerationScript().
531 $r = $this->manager->listSequences();
533 foreach (
$r as $seq) {
534 if (!in_array($seq, $this->tables)) {
536 if ($seq ==
"sahs_sc13_seq") {
540 $create_st =
"\n" .
'$ilDB->createSequence("' . $seq .
'");' .
"\n";
545 fwrite($a_file, $create_st);
◆ checkProcessing()
ilDBGenerator::checkProcessing |
( |
|
$a_table | ) |
|
◆ closeFile()
ilDBGenerator::closeFile |
( |
|
$fp | ) |
|
|
protected |
◆ getBlackList()
ilDBGenerator::getBlackList |
( |
| ) |
|
◆ getHTMLOverview()
ilDBGenerator::getHTMLOverview |
( |
|
$a_filename = "" | ) |
|
Get table definition overview in HTML.
- Parameters
-
string | output filename, if no filename is given, script is echoed |
Definition at line 704 of file class.ilDBGenerator.php.
References $tpl, addTableToOverview(), checkProcessing(), getTables(), and ILIAS_VERSION.
705 $tpl =
new ilTemplate(
"tpl.db_overview.html",
true,
true,
"Services/Database");
709 foreach ($this->tables as $table) {
718 $tpl->setVariable(
"TXT_TITLE",
"ILIAS Abstract DB Tables (" .
ILIAS_VERSION .
")");
720 if ($a_filename ==
"") {
addTableToOverview($a_table, $a_tpl, $a_cnt)
Add table to overview template.
special template class to simplify handling of ITX/PEAR
checkProcessing($a_table)
Check whether a table should be processed or not.
◆ getTables()
ilDBGenerator::getTables |
( |
| ) |
|
◆ getTargetEncoding()
ilDBGenerator::getTargetEncoding |
( |
| ) |
|
◆ getWhiteList()
ilDBGenerator::getWhiteList |
( |
| ) |
|
◆ lookupAbstractedTables()
static ilDBGenerator::lookupAbstractedTables |
( |
| ) |
|
|
static |
- Returns
- array
- Deprecated:
- abstraction_progress is no longer used in ILIAS
Definition at line 56 of file class.ilDBGenerator.php.
References $ilDB, $names, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.
59 $query =
"SELECT DISTINCT(table_name) FROM abstraction_progress ";
71 'acc_user_access_key',
74 'qpl_question_orderinghorizontal',
75 'qpl_question_fileupload',
78 'style_template_class',
82 'page_editor_settings',
103 'qpl_qst_textsubset',
Create styles array
The data for the language used.
◆ openFile()
ilDBGenerator::openFile |
( |
|
$a_path | ) |
|
|
protected |
◆ setBlackList()
ilDBGenerator::setBlackList |
( |
|
$a_blacklist | ) |
|
Set Table Black List.
(Tables that should not be included in the processing)
- Parameters
-
array | $a_blacklist | Table Black List |
Definition at line 163 of file class.ilDBGenerator.php.
164 $this->blacklist = $a_blacklist;
◆ setFilter()
ilDBGenerator::setFilter |
( |
|
$a_filter, |
|
|
|
$a_value |
|
) |
| |
◆ setTargetEncoding()
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 length 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');
- Parameters
-
- Returns
Definition at line 142 of file class.ilDBGenerator.php.
143 $this->target_encoding = $a_encoding;
◆ setWhiteList()
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.
- Parameters
-
array | $a_whitelist | Table White List |
Definition at line 185 of file class.ilDBGenerator.php.
186 $this->whitelist = $a_whitelist;
◆ shortenText()
ilDBGenerator::shortenText |
( |
|
$table, |
|
|
|
$field, |
|
|
|
$a_value, |
|
|
|
$a_size |
|
) |
| |
|
protected |
Shorten text depending on target encoding.
- Parameters
-
string | $table | |
string | $field | |
string | $a_value | |
int | $a_size | |
- Returns
- string
Definition at line 867 of file class.ilDBGenerator.php.
References $ilLog, fields, getTargetEncoding(), and ilStr\shortenText().
Referenced by buildInsertStatement(), and buildInsertStatementsXML().
876 include_once
'./Services/Utilities/classes/class.ilStr.php';
879 $shortened = mb_convert_encoding($shortened,
'UTF-8', $this->
getTargetEncoding());
881 if (strlen($a_value) != strlen($shortened)) {
882 $ilLog->write(
'Table : ' . $table);
883 $ilLog->write(
'Field : ' . $field);
884 $ilLog->write(
'Type : ' . $this->
fields[$field][
'type']);
885 $ilLog->write(
'Length : ' . $this->
fields[$field][
'length']);
886 $ilLog->write(
'Before : ' . $a_value);
887 $ilLog->write(
'Shortened : ' . $shortened);
888 $ilLog->write(
'Strlen Before: ' . strlen($a_value));
889 $ilLog->write(
'Strlen After : ' . strlen($shortened));
static shortenText($a_string, $a_start_pos, $a_num_bytes, $a_encoding='UTF-8')
Shorten text to the given number of bytes.
getTargetEncoding()
Returns the target encoding.
◆ $blacklist
ilDBGenerator::$blacklist = array() |
|
protected |
◆ $filter
ilDBGenerator::$filter = array() |
|
protected |
◆ $tables
ilDBGenerator::$tables = array() |
|
protected |
◆ $target_encoding
ilDBGenerator::$target_encoding = 'UTF-8' |
|
protected |
◆ $whitelist
ilDBGenerator::$whitelist = array() |
|
protected |
The documentation for this class was generated from the following file: