t3lib_install Klassenreferenz
Aufstellung aller Elemente
Öffentliche Methoden |
| | t3lib_install () |
| | setValueInLocalconfFile (&$line_array, $variable, $value) |
| | writeToLocalconf_control ($inlines='', $absFullPath='') |
| | checkForBadString ($string) |
| | slashValueForSingleDashes ($value) |
| | getFieldDefinitions_fileContent ($fileContent) |
| | getFieldDefinitions_sqlContent_parseTypes (&$total) |
| | getCollationForCharset ($charset) |
| | getFieldDefinitions_database () |
| | getDatabaseExtra ($FDsrc, $FDcomp, $onlyTableList='', $ignoreNotNullWhenComparing=true) |
| | getUpdateSuggestions ($diffArr, $keyList='extra, diff') |
| | assembleFieldDefinition ($row) |
| | getStatementArray ($sqlcode, $removeNonSQL=0, $query_regex='') |
| | getCreateTables ($statements, $insertCountFlag=0) |
| | getTableInsertStatements ($statements, $table) |
| | performUpdateQueries ($arr, $keyArr) |
| | getListOfTables () |
| | generateUpdateDatabaseForm_checkboxes ($arr, $label, $checked=1, $iconDis=0, $currentValue=array(), $cVfullMsg=0) |
| | getFieldDefinitions_sqlContent ($fileContent) |
Öffentliche Attribute |
|
| $updateIdentity = '' |
|
| $deletedPrefixKey = 'zzz_deleted_' |
|
| $dbUpdateCheckboxPrefix = 'TYPO3_INSTALL[database_update]' |
|
| $localconf_addLinesOnly = 0 |
|
| $localconf_editPointToken = 'INSTALL SCRIPT EDIT POINT TOKEN - all lines after this points may be changed by the install script!' |
|
| $allowUpdateLocalConf = 0 |
|
| $backPath = '../' |
|
| $multiplySize = 1 |
|
| $character_sets = array() |
|
| $setLocalconf = 0 |
|
| $messages = array() |
|
| $touchedLine = 0 |
Dokumentation der Elementfunktionen
| t3lib_install::assembleFieldDefinition |
( |
$ |
row |
) |
|
Converts a result row with field information into the SQL field definition string
- Parameter:
-
- Rückgabe:
- string Field definition
| t3lib_install::checkForBadString |
( |
$ |
string |
) |
|
Checking for linebreaks in the string
- Parameter:
-
- Rückgabe:
- boolean Returns TRUE if string is OK
- Siehe auch:
- setValueInLocalconfFile()
| t3lib_install::generateUpdateDatabaseForm_checkboxes |
( |
$ |
arr, |
|
|
$ |
label, |
|
|
$ |
checked = 1, |
|
|
$ |
iconDis = 0, |
|
|
$ |
currentValue = array(), |
|
|
$ |
cVfullMsg = 0 | |
|
) |
| | |
Creates a table which checkboxes for updating database.
- Parameter:
-
| array | Array of statements (key / value pairs where key is used for the checkboxes) |
| string | Label for the table. |
| boolean | If set, then checkboxes are set by default. |
| boolean | If set, then icons are shown. |
| array | Array of "current values" for each key/value pair in $arr. Shown if given. |
| boolean | If set, will show the prefix "Current value" if $currentValue is given. |
- Rückgabe:
- string HTML table with checkboxes for update. Must be wrapped in a form.
| t3lib_install::getCollationForCharset |
( |
$ |
charset |
) |
|
Look up the default collation for specified character set based on "SHOW CHARACTER SET" output
- Parameter:
-
- Rückgabe:
- string Corresponding default collation
| t3lib_install::getCreateTables |
( |
$ |
statements, |
|
|
$ |
insertCountFlag = 0 | |
|
) |
| | |
Returns tables to create and how many records in each
- Parameter:
-
| array | Array of SQL statements to analyse. |
| boolean | If set, will count number of INSERT INTO statements following that table definition |
- Rückgabe:
- array Array with table definitions in index 0 and count in index 1
| t3lib_install::getDatabaseExtra |
( |
$ |
FDsrc, |
|
|
$ |
FDcomp, |
|
|
$ |
onlyTableList = '', |
|
|
$ |
ignoreNotNullWhenComparing = true | |
|
) |
| | |
Compares two arrays with field information and returns information about fields that are MISSING and fields that have CHANGED. FDsrc and FDcomp can be switched if you want the list of stuff to remove rather than update.
- Parameter:
-
| array | Field definitions, source (from getFieldDefinitions_fileContent()) |
| array | Field definitions, comparison. (from getFieldDefinitions_database()) |
| string | Table names (in list) which is the ONLY one observed. |
| boolean | If set, this function ignores NOT NULL statements of the SQL file field definition when comparing current field definition from database with field definition from SQL file. This way, NOT NULL statements will be executed when the field is initially created, but the SQL parser will never complain about missing NOT NULL statements afterwards. |
- Rückgabe:
- array Returns an array with 1) all elements from $FDsrc that is not in $FDcomp (in key 'extra') and 2) all elements from $FDsrc that is different from the ones in $FDcomp
| t3lib_install::getFieldDefinitions_database |
( |
|
) |
|
Reads the field definitions for the current database
- Rückgabe:
- array Array with information about table.
| t3lib_install::getFieldDefinitions_fileContent |
( |
$ |
fileContent |
) |
|
Reads the field definitions for the input SQL-file string
- Parameter:
-
| string | Should be a string read from an SQL-file made with 'mysqldump [database_name] -d' |
- Rückgabe:
- array Array with information about table.
| t3lib_install::getFieldDefinitions_sqlContent |
( |
$ |
fileContent |
) |
|
Reads the field definitions for the input SQL-file string
- Parameter:
-
| string | Should be a string read from an SQL-file made with 'mysqldump [database_name] -d' |
- Rückgabe:
- array Array with information about table.
- Veraltet:
- since TYPO3 4.2 Use ->getFieldDefinitions_fileContent() instead!
| t3lib_install::getFieldDefinitions_sqlContent_parseTypes |
( |
&$ |
total |
) |
|
Multiplies varchars/tinytext fields in size according to $this->multiplySize Useful if you want to use UTF-8 in the database and needs to extend the field sizes in the database so UTF-8 chars are not discarded. For most charsets available as single byte sets, multiplication with 2 should be enough. For chinese, use 3.
- Parameter:
-
- Rückgabe:
- void private
- Siehe auch:
- getFieldDefinitions_fileContent()
| t3lib_install::getListOfTables |
( |
|
) |
|
Returns list of tables in the database
- Rückgabe:
- array List of tables.
- Siehe auch:
- t3lib_db::admin_get_tables()
| t3lib_install::getStatementArray |
( |
$ |
sqlcode, |
|
|
$ |
removeNonSQL = 0, |
|
|
$ |
query_regex = '' | |
|
) |
| | |
Returns an array where every entry is a single SQL-statement. Input must be formatted like an ordinary MySQL-dump files.
- Parameter:
-
| string | The SQL-file content. Provided that 1) every query in the input is ended with ';' and that a line in the file contains only one query or a part of a query. |
| boolean | If set, non-SQL content (like comments and blank lines) is not included in the final output |
| string | Regex to filter SQL lines to include |
- Rückgabe:
- array Array of SQL statements
| t3lib_install::getTableInsertStatements |
( |
$ |
statements, |
|
|
$ |
table | |
|
) |
| | |
Extracts all insert statements from $statement array where content is inserted into $table
- Parameter:
-
| array | Array of SQL statements |
| string | Table name |
- Rückgabe:
- array Array of INSERT INTO statements where table match $table
| t3lib_install::getUpdateSuggestions |
( |
$ |
diffArr, |
|
|
$ |
keyList = 'extra, |
|
|
diff' |
| |
|
) |
| | |
Returns an array with SQL-statements that is needed to update according to the diff-array
- Parameter:
-
| array | Array with differences of current and needed DB settings. (from getDatabaseExtra()) |
| string | List of fields in diff array to take notice of. |
- Rückgabe:
- array Array of SQL statements (organized in keys depending on type)
| t3lib_install::performUpdateQueries |
( |
$ |
arr, |
|
|
$ |
keyArr | |
|
) |
| | |
Performs the queries passed from the input array.
- Parameter:
-
| array | Array of SQL queries to execute. |
| array | Array with keys that must match keys in $arr. Only where a key in this array is set and true will the query be executed (meant to be passed from a form checkbox) |
- Rückgabe:
- mixed Array with error message from database if any occured. Otherwise true if everything was executed successfully.
| t3lib_install::setValueInLocalconfFile |
( |
&$ |
line_array, |
|
|
$ |
variable, |
|
|
$ |
value | |
|
) |
| | |
This functions takes an array with lines from localconf.php, finds a variable and inserts the new value.
- Parameter:
-
| array | $line_array the localconf.php file exploded into an array by linebreaks. (see writeToLocalconf_control()) |
| string | $variable The variable name to find and substitute. This string must match the first part of a trimmed line in the line-array. Matching is done backwards so the last appearing line will be substituted. |
| string | $value Is the value to be insert for the variable |
- Rückgabe:
- void
- Siehe auch:
- writeToLocalconf_control()
| t3lib_install::slashValueForSingleDashes |
( |
$ |
value |
) |
|
| t3lib_install::t3lib_install |
( |
|
) |
|
Constructor function
- Rückgabe:
- void
| t3lib_install::writeToLocalconf_control |
( |
$ |
inlines = '', |
|
|
$ |
absFullPath = '' | |
|
) |
| | |
Writes or returns lines from localconf.php
- Parameter:
-
| array | Array of lines to write back to localconf.php. Possibly |
| string | Absolute path of alternative file to use (Notice: this path is not validated in terms of being inside 'TYPO3 space') |
- Rückgabe:
- mixed If $inlines is not an array it will return an array with the lines from localconf.php. Otherwise it will return a status string, either "continue" (updated) or "nochange" (not updated)
- Siehe auch:
- setValueInLocalconfFile()
Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:
- /srv/www/vhosts/typo3.local/typo3_src-4.2.10/t3lib/class.t3lib_install.php