Replication
in package
Functions for database replication.
I guess it could be used for cluster situations too.
This default class has replication disabled. To enable, replace this class with your own.
Table of Contents
Methods
- adminUrl() : mixed
- Checks we are using the correct server for admin.
- enabled() : bool
- Determine if replication is enabled
- getReadHost() : mixed
- Return the IP address or hostname of the read server to use
- getWriteHost() : mixed
- Return the IP address or hostname of the write server to use
- postFileUpdate() : bool
- Handle replication of a file to other servers.
Methods
adminUrl()
Checks we are using the correct server for admin.
public
static adminUrl() : mixed
Return bool false if the server is correct or the URL to redirect to if the server is incorrect.
enabled()
Determine if replication is enabled
public
static enabled() : bool
Return values
boolgetReadHost()
Return the IP address or hostname of the read server to use
public
static getReadHost() : mixed
getWriteHost()
Return the IP address or hostname of the write server to use
public
static getWriteHost() : mixed
postFileUpdate()
Handle replication of a file to other servers.
public
static postFileUpdate(string $filename) : bool
This is always called, even if replication is not enabled above.
Parameters
- $filename : string
-
The file which has just been added or updated.
Return values
bool —TRUE on success, FALSE on failure.