Tracker
class Tracker (View source)
This class tracks changes on databases, tables and views.
Properties
static protected array | $trackingCache | Cache to avoid quering tracking status multiple times. |
Methods
Actually enables tracking. This needs to be done after all underlaying code is initialized.
No description
No description
Gets the on/off value of the Tracker module, starts initialization.
Gets the tracking status of a table, is it active or disabled ?
Returns the comment line for the log.
Creates tracking version of a table / view (in other words: create a job to track future changes on the table).
Creates tracking version of a database (in other words: create a job to track future changes on the database).
Activates tracking of a table.
Deactivates tracking of a table.
Parses a query. Gets
- statement identifier (UPDATE, ALTER TABLE, ...)
- type of statement, is it part of DDL or DML ?
- tablename
Analyzes a given SQL statement and saves tracking data.
Details
static void
enable()
Actually enables tracking. This needs to be done after all underlaying code is initialized.
static void
disable()
No description
static bool
isEnabled()
No description
static bool
isActive()
Gets the on/off value of the Tracker module, starts initialization.
static bool
isTracked(string $dbName, string $tableName)
Gets the tracking status of a table, is it active or disabled ?
static string
getLogComment()
Returns the comment line for the log.
static bool
createVersion(string $dbName, string $tableName, string $version, string $trackingSet = '', bool $isView = false)
Creates tracking version of a table / view (in other words: create a job to track future changes on the table).
static bool
createDatabaseVersion(string $dbName, string $version, string $query, string $trackingSet = 'CREATE DATABASE,ALTER DATABASE,DROP DATABASE')
Creates tracking version of a database (in other words: create a job to track future changes on the database).
static bool
activateTracking(string $dbname, string $tablename, string $version)
Activates tracking of a table.
static bool
deactivateTracking(string $dbname, string $tablename, string $version)
Deactivates tracking of a table.
static array
parseQuery(string $query)
Parses a query. Gets
- statement identifier (UPDATE, ALTER TABLE, ...)
- type of statement, is it part of DDL or DML ?
- tablename
static void
handleQuery(string $query)
Analyzes a given SQL statement and saves tracking data.