PHP 클래스 DBConnection, glpi

저자: sabuj.das
파일 보기 프로젝트 열기: glpi-project/glpi 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$notable

공개 메소드들

메소드 설명
changeCronTaskStatus ( $enable = true ) Enable or disable db replication check cron task
createDBSlaveConfig ( ) Create a default slave DB configuration file
createMainConfig ( $host, $user, $password, $DBname ) : boolean Create GLPI main configuration file
createSlaveConnectionFile ( $host, $user, $password, $DBname ) : boolean Create slave DB configuration file
cronCheckDBreplicate ( $task ) Cron process to check DB replicate state
cronInfo ( $name )
deleteDBSlaveConfig ( ) Delete slave DB configuration file
displayMySQLError ( ) Display a common mysql connection error
establishDBConnection ( $use_slave, $required, $display = true ) Establish a connection to a mysql server (main or replicate)
getDBSlaveConf ( $choice = NULL ) : DBmysql Read slave DB configuration file
getHistoryMaxDate ( $DBconnection ) Get history max date of a GLPI DB
getReadConnection ( ) : DBmysql Get Connection to slave, if exists, and if configured to be used for read only request
getReplicateDelay ( $choice = NULL ) : integer Get delay between slave and master
getTypeName ( $nb )
isDBSlaveActive ( ) : true Indicates is the DB replicate is active or not
saveDBSlaveConf ( $host, $user, $password, $DBname ) Save changes to the slave DB configuration file
showAllReplicateDelay ( ) Display in HTML, delay between master and slave 1 line per slave is multiple
showSystemInformations ( $width )
switchToMaster ( ) Switch database connection to master
switchToSlave ( ) Switch database connection to slave

메소드 상세

changeCronTaskStatus() 정적인 공개 메소드

Enable or disable db replication check cron task
static public changeCronTaskStatus ( $enable = true )

createDBSlaveConfig() 정적인 공개 메소드

Create a default slave DB configuration file
static public createDBSlaveConfig ( )

createMainConfig() 정적인 공개 메소드

Create GLPI main configuration file
부터: 9.1
static public createMainConfig ( $host, $user, $password, $DBname ) : boolean
$user
$password
$DBname
리턴 boolean

createSlaveConnectionFile() 정적인 공개 메소드

Create slave DB configuration file
static public createSlaveConnectionFile ( $host, $user, $password, $DBname ) : boolean
리턴 boolean for success

cronCheckDBreplicate() 정적인 공개 메소드

Cron process to check DB replicate state
static public cronCheckDBreplicate ( $task )
$task to log and get param

cronInfo() 정적인 공개 메소드

static public cronInfo ( $name )
$name

deleteDBSlaveConfig() 정적인 공개 메소드

Delete slave DB configuration file
static public deleteDBSlaveConfig ( )

displayMySQLError() 정적인 공개 메소드

Display a common mysql connection error
static public displayMySQLError ( )

establishDBConnection() 정적인 공개 메소드

Establish a connection to a mysql server (main or replicate)
static public establishDBConnection ( $use_slave, $required, $display = true )
$use_slave try to connect to slave server first not to main server
$required connection to the specified server is required (if connection failed, do not try to connect to the other server)
$display display error message (true by default)

getDBSlaveConf() 정적인 공개 메소드

Read slave DB configuration file
static public getDBSlaveConf ( $choice = NULL ) : DBmysql
$choice integer, host number (default NULL)
리턴 DBmysql object

getHistoryMaxDate() 정적인 공개 메소드

Get history max date of a GLPI DB
static public getHistoryMaxDate ( $DBconnection )
$DBconnection DB conneciton used

getReadConnection() 정적인 공개 메소드

Get Connection to slave, if exists, and if configured to be used for read only request
static public getReadConnection ( ) : DBmysql
리턴 DBmysql object

getReplicateDelay() 정적인 공개 메소드

Get delay between slave and master
static public getReplicateDelay ( $choice = NULL ) : integer
$choice integer, host number (default NULL)
리턴 integer

getTypeName() 정적인 공개 메소드

static public getTypeName ( $nb )

isDBSlaveActive() 정적인 공개 메소드

Indicates is the DB replicate is active or not
static public isDBSlaveActive ( ) : true
리턴 true if active / false if not active

saveDBSlaveConf() 정적인 공개 메소드

Save changes to the slave DB configuration file
static public saveDBSlaveConf ( $host, $user, $password, $DBname )
$host
$user
$password
$DBname

showAllReplicateDelay() 정적인 공개 메소드

Display in HTML, delay between master and slave 1 line per slave is multiple
static public showAllReplicateDelay ( )

showSystemInformations() 공개 메소드

public showSystemInformations ( $width )
$width

switchToMaster() 정적인 공개 메소드

Switch database connection to master
static public switchToMaster ( )

switchToSlave() 정적인 공개 메소드

Switch database connection to slave
static public switchToSlave ( )

프로퍼티 상세

$notable 보호되어 있는 정적으로 프로퍼티

protected static $notable