PHP Class N98\Magento\DbSettings

Database settings. The Magento database settings are stored in a SimpleXMLElement structure
Inheritance: implements ArrayAcces\ArrayAccess, implements IteratorAggregat\IteratorAggregate
Afficher le fichier Open project: netz98/n98-magerun Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $file )
getConfig ( ) : array content of previous $dbSettings field of the DatabaseHelper
getConnection ( ) : PDO Connects to the database without initializing magento
getDatabaseName ( ) : string
getDsn ( ) : string Get Mysql PDO DSN
getHost ( ) : string
getIterator ( ) : ArrayIterator
getMysqlClientToolConnectionString ( )
getPassword ( ) : string
getPort ( ) : string
getTablePrefix ( ) : string
getUnixSocket ( ) : string
getUsername ( ) : string
isSocketConnect ( ) : boolean
offsetExists ( $offset ) : boolean
offsetGet ( $offset ) : mixed
offsetSet ( mixed $offset, mixed $value )
offsetUnset ( mixed $offset )
setFile ( string $file )

Private Methods

Méthode Description
parseResources ( SimpleXMLElement $resources ) helper method to parse config file segment related to the database settings
quoteIdentifier ( string $identifier ) : string Mysql quoting of an identifier

Method Details

__construct() public méthode

public __construct ( string $file )
$file string path to app/etc/local.xml

getConfig() public méthode

content of previous $dbSettings field of the DatabaseHelper
public getConfig ( ) : array
Résultat array

getConnection() public méthode

Connects to the database without initializing magento
public getConnection ( ) : PDO
Résultat PDO

getDatabaseName() public méthode

public getDatabaseName ( ) : string
Résultat string of the database identifier, null if not in use

getDsn() public méthode

Get Mysql PDO DSN
public getDsn ( ) : string
Résultat string

getHost() public méthode

public getHost ( ) : string
Résultat string hostname, null if there is no hostname setup (e.g. unix_socket)

getIterator() public méthode

public getIterator ( ) : ArrayIterator
Résultat ArrayIterator

getMysqlClientToolConnectionString() public méthode

getPassword() public méthode

public getPassword ( ) : string
Résultat string password

getPort() public méthode

public getPort ( ) : string
Résultat string port, null if not setup

getTablePrefix() public méthode

public getTablePrefix ( ) : string
Résultat string table prefix, null if not in the settings (no or empty prefix)

getUnixSocket() public méthode

public getUnixSocket ( ) : string
Résultat string unix socket, null if not in use

getUsername() public méthode

public getUsername ( ) : string
Résultat string username

isSocketConnect() public méthode

public isSocketConnect ( ) : boolean
Résultat boolean

offsetExists() public méthode

public offsetExists ( $offset ) : boolean
Résultat boolean true on success or false on failure.

offsetGet() public méthode

public offsetGet ( $offset ) : mixed
Résultat mixed Can return all value types.

offsetSet() public méthode

public offsetSet ( mixed $offset, mixed $value )
$offset mixed
$value mixed

offsetUnset() public méthode

public offsetUnset ( mixed $offset )
$offset mixed

setFile() public méthode

public setFile ( string $file )
$file string path to app/etc/local.xml