TYPO3 API  SVNRelease
Public Member Functions | Public Attributes | Protected Member Functions
t3lib_install Class Reference
Inheritance diagram for t3lib_install:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 t3lib_install ()
 setValueInLocalconfFile (&$line_array, $variable, $value, $quoteValue=TRUE)
 setArrayValueInLocalconfFile (array &$lines, $variable, array $value)
 writeToLocalconf_control ($inlines= '', $absFullPath= '')
 writeToLocalconf (array $lines, $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)

Public Attributes

 $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

Protected Member Functions

 array_export (array $variable)

Detailed Description

Definition at line 75 of file class.t3lib_install.php.


Member Function Documentation

t3lib_install::array_export ( array $  variable) [protected]

Returns a parsable string representation of an array variable. This methods enhances standard method var_export from PHP to take TYPO3's CGL into account.

Parameters:
array$variable
Returns:
string

Definition at line 270 of file class.t3lib_install.php.

t3lib_install::assembleFieldDefinition ( row)

Converts a result row with field information into the SQL field definition string

Parameters:
arrayMySQL result row
Returns:
string Field definition

Definition at line 939 of file class.t3lib_install.php.

References $row.

t3lib_install::checkForBadString ( string)

Checking for linebreaks in the string

Parameters:
stringString to test
Returns:
boolean Returns TRUE if string is OK
See also:
setValueInLocalconfFile()

Definition at line 431 of file class.t3lib_install.php.

Referenced by setValueInLocalconfFile().

t3lib_install::generateUpdateDatabaseForm_checkboxes ( arr,
label,
checked = 1,
iconDis = 0,
currentValue = array(),
cVfullMsg = 0 
)

Creates a table which checkboxes for updating database.

Parameters:
arrayArray of statements (key / value pairs where key is used for the checkboxes)
stringLabel for the table.
booleanIf set, then checkboxes are set by default.
booleanIf set, then icons are shown.
arrayArray of "current values" for each key/value pair in $arr. Shown if given.
booleanIf set, will show the prefix "Current value" if $currentValue is given.
Returns:
string HTML table with checkboxes for update. Must be wrapped in a form.

Reimplemented in tx_install.

Definition at line 1112 of file class.t3lib_install.php.

References $content.

t3lib_install::getCollationForCharset ( charset)

Look up the default collation for specified character set based on "SHOW CHARACTER SET" output

Parameters:
stringCharacter set
Returns:
string Corresponding default collation

Definition at line 633 of file class.t3lib_install.php.

References $GLOBALS.

t3lib_install::getCreateTables ( statements,
insertCountFlag = 0 
)

Returns tables to create and how many records in each

Parameters:
arrayArray of SQL statements to analyse.
booleanIf set, will count number of INSERT INTO statements following that table definition
Returns:
array Array with table definitions in index 0 and count in index 1

Definition at line 1008 of file class.t3lib_install.php.

Referenced by tx_install\checkTheDatabase().

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.

Parameters:
arrayField definitions, source (from getFieldDefinitions_fileContent())
arrayField definitions, comparison. (from getFieldDefinitions_database())
stringTable names (in list) which is the ONLY one observed.
booleanIf 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.
Returns:
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

Definition at line 736 of file class.t3lib_install.php.

References t3lib_div\inList().

Referenced by tx_install\checkTheDatabase().

t3lib_install::getFieldDefinitions_database ( )

Reads the field definitions for the current database

Returns:
array Array with information about table.

Definition at line 656 of file class.t3lib_install.php.

References $GLOBALS.

Referenced by tx_install\checkTheDatabase().

t3lib_install::getFieldDefinitions_fileContent ( fileContent)

Reads the field definitions for the input SQL-file string

Parameters:
stringShould be a string read from an SQL-file made with 'mysqldump [database_name] -d'
Returns:
array Array with information about table.

Definition at line 463 of file class.t3lib_install.php.

References $GLOBALS, $value, and t3lib_div\trimExplode().

Referenced by tx_install\checkTheDatabase().

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.

Parameters:
arrayTotal array (from getFieldDefinitions_fileContent())
Returns:
void private
See also:
getFieldDefinitions_fileContent()

Definition at line 563 of file class.t3lib_install.php.

References t3lib_div\makeInstance(), and t3lib_div\trimExplode().

t3lib_install::getListOfTables ( )

Returns list of tables in the database

Returns:
array List of tables.
See also:
t3lib_db::admin_get_tables()

Definition at line 1093 of file class.t3lib_install.php.

References $GLOBALS, and $value.

Referenced by tx_install\checkTheDatabase(), tx_install\cleanupManager(), tx_install\isBasicComplete(), and tx_install\stepOutput().

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.

Parameters:
stringThe 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.
booleanIf set, non-SQL content (like comments and blank lines) is not included in the final output
stringRegex to filter SQL lines to include
Returns:
array Array of SQL statements

Definition at line 966 of file class.t3lib_install.php.

Referenced by tx_install\checkTheDatabase().

t3lib_install::getTableInsertStatements ( statements,
table 
)

Extracts all insert statements from $statement array where content is inserted into $table

Parameters:
arrayArray of SQL statements
stringTable name
Returns:
array Array of INSERT INTO statements where table match $table

Definition at line 1045 of file class.t3lib_install.php.

Referenced by tx_install\checkTheDatabase().

t3lib_install::getUpdateSuggestions ( diffArr,
keyList = 'extra,
diff'   
)

Returns an array with SQL-statements that is needed to update according to the diff-array

Parameters:
arrayArray with differences of current and needed DB settings. (from getDatabaseExtra())
stringList of fields in diff array to take notice of.
Returns:
array Array of SQL statements (organized in keys depending on type)

Definition at line 793 of file class.t3lib_install.php.

References $GLOBALS.

Referenced by tx_install\checkTheDatabase().

t3lib_install::performUpdateQueries ( arr,
keyArr 
)

Performs the queries passed from the input array.

Parameters:
arrayArray of SQL queries to execute.
arrayArray 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)
Returns:
mixed Array with error message from database if any occured. Otherwise true if everything was executed successfully.

Definition at line 1066 of file class.t3lib_install.php.

References $GLOBALS, and $res.

Referenced by tx_install\checkTheDatabase().

t3lib_install::setArrayValueInLocalconfFile ( array &$  lines,
variable,
array $  value 
)

Takes an array with lines from localconf.php, finds a variable and inserts the new array value.

Parameters:
array$linesthe localconf.php file exploded into an array by line breaks. {
See also:
writeToLocalconf_control()}
Parameters:
string$variablethe 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.
array$valuevalue to be assigned to the variable
Returns:
void
See also:
writeToLocalconf_control()

Definition at line 211 of file class.t3lib_install.php.

References t3lib_div\isFirstPartOfStr().

Referenced by tx_dbal_em\updateMapping().

t3lib_install::setValueInLocalconfFile ( &$  line_array,
variable,
value,
quoteValue = TRUE 
)

This functions takes an array with lines from localconf.php, finds a variable and inserts the new value.

Parameters:
array$line_arraythe localconf.php file exploded into an array by linebreaks. (see writeToLocalconf_control())
string$variableThe 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$valueIs the value to be insert for the variable
boolean$quoteValueWhether the given value should be quoted before being written
Returns:
void
See also:
writeToLocalconf_control()

Definition at line 125 of file class.t3lib_install.php.

References $value, checkForBadString(), and slashValueForSingleDashes().

Referenced by tx_install\setupGeneral().

t3lib_install::slashValueForSingleDashes ( value)

Replaces ' with \' and \ with \

Parameters:
stringInput value
Returns:
string Output value
See also:
setValueInLocalconfFile()

Definition at line 442 of file class.t3lib_install.php.

References $value.

Referenced by setValueInLocalconfFile().

t3lib_install::t3lib_install ( )

Constructor function

Returns:
void

Definition at line 101 of file class.t3lib_install.php.

References $GLOBALS.

Referenced by tx_install\tx_install().

t3lib_install::writeToLocalconf ( array $  lines,
absFullPath = '' 
)

Writes lines to localconf.php.

Parameters:
arrayArray of lines to write back to localconf.php
stringAbsolute path of alternative file to use (Notice: this path is not validated in terms of being inside 'TYPO3 space')
Returns:
boolean TRUE if method succeeded, otherwise FALSE

Definition at line 362 of file class.t3lib_install.php.

References $GLOBALS, and t3lib_div\writeFile().

Referenced by tx_dbal_em\updateMapping().

t3lib_install::writeToLocalconf_control ( inlines = '',
absFullPath = '' 
)

Writes or returns lines from localconf.php

Parameters:
arrayArray of lines to write back to localconf.php. Possibly
stringAbsolute path of alternative file to use (Notice: this path is not validated in terms of being inside 'TYPO3 space')
Returns:
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)
See also:
setValueInLocalconfFile()

Reimplemented in tx_install.

Definition at line 301 of file class.t3lib_install.php.

References $GLOBALS.

Referenced by tx_dbal_em\updateMapping(), tx_coreupdates_t3skin\writeNewExtensionList(), tx_coreupdates_installnewsysexts\writeNewExtensionList(), tx_coreupdates_installsysexts\writeNewExtensionList(), and tx_em_Install\writeTsStyleConfig().


Member Data Documentation

t3lib_install::$allowUpdateLocalConf = 0

Definition at line 84 of file class.t3lib_install.php.

t3lib_install::$backPath = '../'

Definition at line 85 of file class.t3lib_install.php.

t3lib_install::$character_sets = array()

Definition at line 88 of file class.t3lib_install.php.

t3lib_install::$dbUpdateCheckboxPrefix = 'TYPO3_INSTALL[database_update]'

Definition at line 81 of file class.t3lib_install.php.

t3lib_install::$deletedPrefixKey = 'zzz_deleted_'

Definition at line 80 of file class.t3lib_install.php.

t3lib_install::$localconf_addLinesOnly = 0

Definition at line 82 of file class.t3lib_install.php.

t3lib_install::$localconf_editPointToken = 'INSTALL SCRIPT EDIT POINT TOKEN - all lines after this points may be changed by the install script!'

Definition at line 83 of file class.t3lib_install.php.

t3lib_install::$messages = array()

Reimplemented in tx_install.

Definition at line 92 of file class.t3lib_install.php.

t3lib_install::$multiplySize = 1

Definition at line 87 of file class.t3lib_install.php.

t3lib_install::$setLocalconf = 0

Definition at line 91 of file class.t3lib_install.php.

t3lib_install::$touchedLine = 0

Definition at line 93 of file class.t3lib_install.php.

t3lib_install::$updateIdentity = ''

Reimplemented in tx_install.

Definition at line 79 of file class.t3lib_install.php.


The documentation for this class was generated from the following file: