TYPO3  7.6
Public Member Functions | Protected Member Functions | List of all members
DatabaseConnect Class Reference
Inheritance diagram for DatabaseConnect:
AbstractStepAction AbstractAction StepInterface ActionInterface

Public Member Functions

 needsExecution ()
 
- Public Member Functions inherited from AbstractStepAction
 setStepsCounter ($current, $total)
 
 getCurrentStep ()
 
 getTotalSteps ()
 
- Public Member Functions inherited from AbstractAction
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager)
 
 injectView (\TYPO3\CMS\Install\View\FailsafeView $view)
 
 handle ()
 
 setToken ($token)
 
 setController ($controller)
 
 setAction ($action)
 
 setPostValues (array $postValues)
 
 setLastError (array $lastError)
 
 setMessages (array $messages=array())
 
- Public Member Functions inherited from StepInterface
 execute ()
 

Protected Member Functions

 executeAction ()
 
 getConfiguredOrDefaultPort ()
 
 isHostConfigured ()
 
 isConfigurationComplete ()
 
 isConnectionWithUnixDomainSocketPossible ()
 
 setDbalInputFieldsToRender ()
 
 getAvailableDbalDrivers ()
 
 getSupportedDbalDrivers ()
 
 getSelectedDbalDriver ()
 
 getConfiguredUsername ()
 
 getConfiguredPassword ()
 
 getConfiguredHost ()
 
 getConfiguredPort ()
 
 getConfiguredSocket ()
 
- Protected Member Functions inherited from AbstractStepAction
 assignSteps ()
 
- Protected Member Functions inherited from AbstractAction
 initializeHandle ()
 
 executeAction ()
 
 isDbalEnabled ()
 
 getContext ()
 
 loadExtLocalconfDatabaseAndExtTables ()
 
 getHashedPassword ($password)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractStepAction
 $currentStep = 0
 
 $totalSteps = 0
 

Detailed Description

Database connect step:

Definition at line 26 of file DatabaseConnect.php.

Member Function Documentation

executeAction ( )
protected
getAvailableDbalDrivers ( )
protected

Returns a list of database drivers that are available on current server.

Returns
array

Definition at line 478 of file DatabaseConnect.php.

References DatabaseConnect\getSelectedDbalDriver(), and DatabaseConnect\getSupportedDbalDrivers().

Referenced by DatabaseConnect\executeAction().

getConfiguredHost ( )
protected

Returns configured host with port split off if given

Returns
string

Definition at line 627 of file DatabaseConnect.php.

References $GLOBALS.

Referenced by DatabaseConnect\executeAction().

getConfiguredOrDefaultPort ( )
protected

Render connect port and label

Returns
int Configured or default port

Definition at line 252 of file DatabaseConnect.php.

References DatabaseConnect\getConfiguredPort(), DatabaseConnect\getSelectedDbalDriver(), and AbstractAction\isDbalEnabled().

Referenced by DatabaseConnect\executeAction().

getConfiguredPassword ( )
protected

Returns configured password, if set

Returns
string

Definition at line 616 of file DatabaseConnect.php.

References $GLOBALS.

Referenced by DatabaseConnect\executeAction().

getConfiguredPort ( )
protected

Returns configured port. Gets port from host value if port is not yet set.

Returns
int

Definition at line 642 of file DatabaseConnect.php.

References $GLOBALS.

Referenced by DatabaseConnect\getConfiguredOrDefaultPort().

getConfiguredSocket ( )
protected

Returns configured socket, if set

Returns
string|NULL

Definition at line 658 of file DatabaseConnect.php.

References $GLOBALS.

Referenced by DatabaseConnect\isConnectionWithUnixDomainSocketPossible().

getConfiguredUsername ( )
protected

Returns configured username, if set

Returns
string

Definition at line 605 of file DatabaseConnect.php.

References $GLOBALS.

Referenced by DatabaseConnect\executeAction().

getSelectedDbalDriver ( )
protected

Get selected dbal driver if any

Returns
string Dbal driver or empty string if not yet selected

Definition at line 553 of file DatabaseConnect.php.

References $GLOBALS.

Referenced by DatabaseConnect\executeAction(), DatabaseConnect\getAvailableDbalDrivers(), DatabaseConnect\getConfiguredOrDefaultPort(), and DatabaseConnect\setDbalInputFieldsToRender().

getSupportedDbalDrivers ( )
protected

Returns a list of DBAL supported database drivers, with a user-friendly name and any PHP module dependency.

Returns
array

Definition at line 521 of file DatabaseConnect.php.

Referenced by DatabaseConnect\getAvailableDbalDrivers().

isConfigurationComplete ( )
protected

Check LocalConfiguration.php for required database settings:

  • 'host' is mandatory and must not be empty
  • 'port' OR 'socket' is mandatory, but may be empty
  • 'username' and 'password' are mandatory, but may be empty
Returns
bool TRUE if required settings are present

Definition at line 340 of file DatabaseConnect.php.

References $GLOBALS, and DatabaseConnect\isHostConfigured().

Referenced by DatabaseConnect\needsExecution().

isConnectionWithUnixDomainSocketPossible ( )
protected

Test if a unix domain socket can be opened. This does not authenticate but only tests if a connect is successful.

Returns
bool TRUE on success

Definition at line 412 of file DatabaseConnect.php.

References DatabaseConnect\getConfiguredSocket().

isHostConfigured ( )
protected

Check LocalConfiguration.php for required database settings:

  • 'host' is mandatory and must not be empty
  • 'port' OR 'socket' is mandatory, but may be empty
Returns
bool TRUE if host is set

Definition at line 317 of file DatabaseConnect.php.

References $GLOBALS.

Referenced by DatabaseConnect\isConfigurationComplete(), and DatabaseConnect\needsExecution().

needsExecution ( )

Step needs to be executed if database connection is not successful.

Exceptions
\TYPO3\CMS\Install\Controller\Exception\RedirectException
Returns
bool

Implements StepInterface.

Definition at line 198 of file DatabaseConnect.php.

References DatabaseConnect\isConfigurationComplete(), AbstractAction\isDbalEnabled(), and DatabaseConnect\isHostConfigured().

setDbalInputFieldsToRender ( )
protected

Render fields required for successful connect based on dbal driver selection. Hint: There is a code duplication in handle() and this method. This is done by intention to keep this code area easy to maintain and understand.

Returns
void

Definition at line 441 of file DatabaseConnect.php.

References $GLOBALS, and DatabaseConnect\getSelectedDbalDriver().

Referenced by DatabaseConnect\executeAction().