include/database/DBManagerFactory.php

Show: inherited
Table of Contents

\DBManagerFactory

Package: SugarCRM

Database driver factory

Api
Instantiates and configures appropriate DB drivers  

Properties

Propertypublic  $instances= 'array()'
static
Default valuearray()Details
Type
n/a

Methods

methodpublicdisconnectAll( ) : void
static

Disconnect all DB connections in the system

methodpublicgetDbDrivers( bool $validate = true ) : array
static

Get list of all available DB drivers

Parameters
Name Type Description
$validate bool

Return only valid drivers or all of them?

Returns
Type Description
array List of Db drivers, key - variant (mysql, mysqli), value - driver type (mysql, mssql)
methodpublicgetInstance( string $instanceName = '' ) : object
static

Returns a reference to the DB object for instance $instanceName, or the default instance if one is not specified

Parameters
Name Type Description
$instanceName string

optional, name of the instance

Returns
Type Description
object DBManager instance
methodpublicgetManagerByType( string $type, bool $validate = true ) : string
static

Get DB manager class name by type name

For use in install

Parameters
Name Type Description
$type string
$validate bool

Return only valid drivers or any?

Returns
Type Description
string
methodpublicgetTypeInstance( string $type, array $config = array() ) : object
static

Returns a reference to the DB object of specific type

Parameters
Name Type Description
$type string

DB type

$config array

DB configuration

Returns
Type Description
object DBManager instance
methodpublicisFreeTDS( ) : bool
static

Check if we have freeTDS driver installed Invoked when connected to mssql. checks if we have freetds version of mssql library.

the response is put into a global variable.

Returns
Type Description
bool
methodprotectedscanDriverDir( string $dir, array $drivers, bool $validate = true ) : void
static

Scan directory for valid DB drivers

Parameters
Name Type Description
$dir string
$drivers array
$validate bool

Return only valid drivers or all of them?

Documentation was generated by DocBlox 0.18.1.