Dotclear 2.24
Loading...
Searching...
No Matches
dcMaintenance Class Reference

Public Member Functions

 __construct ()
 
Tab methods
 addTab (string $id, string $name, array $options=[])
 
 getTab (string $id)
 
 getTabs ()
 
Group methods
 addGroup (string $id, string $name, array $options=[])
 
 getGroup (string $id)
 
 getGroups ()
 
Task methods
 addTask ($task)
 
 getTask (string $id)
 
 getTasks ()
 
 getHeaders ()
 
Log methods
 setLog (string $id)
 
 delLogs ()
 
 getLogs ()
 

Protected Member Functions

 init ()
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Constructor.

References getLogs(), and init().

Member Function Documentation

◆ init()

init ( )
protected

Initialize list of tabs and groups and tasks.

To register a tab or group or task, use behavior dcMaintenanceInit then a method of dcMaintenance like addTab('myTab', ...).

References dcCore\app().

Referenced by __construct().

◆ addTab()

addTab ( string  $id,
string  $name,
array  $options = [] 
)

Adds a tab.

Parameters
string$idThe identifier
string$nameThe name
array$optionsThe options
Returns
self

Referenced by dcMaintenanceAdmin\dcMaintenanceInit().

◆ getTab()

getTab ( string  $id)

Gets the tab.

Parameters
string$idThe identifier
Returns
dcMaintenanceDescriptor|null The tab.

◆ getTabs()

getTabs ( )

Gets the tabs.

Returns
array The tabs.

◆ addGroup()

addGroup ( string  $id,
string  $name,
array  $options = [] 
)

Adds a group.

Parameters
string$idThe identifier
string$nameThe name
array$optionsThe options
Returns
self

◆ getGroup()

getGroup ( string  $id)

Gets the group.

Parameters
string$idThe identifier
Returns
dcMaintenanceDescriptor|null The group.

◆ getGroups()

getGroups ( )

Gets the groups.

Returns
array The groups.

◆ addTask()

addTask (   $task)

Adds a task.

Parameters
mixed$taskThe task, Class name or object
Returns
self

Referenced by dcBuildTools\maintenanceAdmin().

◆ getTask()

getTask ( string  $id)

Gets the task.

Parameters
string$idThe identifier
Returns
mixed The task.

Referenced by setLog().

◆ getTasks()

getTasks ( )

Gets the tasks.

Returns
array The tasks.

◆ getHeaders()

getHeaders ( )

Gets the headers for plugin maintenance admin page.

Returns
string The headers.

◆ setLog()

setLog ( string  $id)

Sets the log for a task.

Parameters
string$idTask ID

References dcCore\app(), getTask(), and dcLog\LOG_TABLE_NAME.

◆ delLogs()

delLogs ( )

Delete all maintenance logs.

References dcCore\app().

◆ getLogs()

getLogs ( )

Get logs

Return [ task id => [ timestamp of last execution, logged on current blog or not ] ]

Returns
array List of logged tasks

References dcCore\app().

Referenced by __construct().


The documentation for this class was generated from the following file: