Class Maintenance

Description

The Maintenance:: class provides a set of methods for dealing with maintenance operations run upon login to Horde applications.

Copyright 2001-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Maintenance/Maintenance.php (line 80)


	
			
Variable Summary
Method Summary
 Maintenance Maintenance ([array $params = array()])
 Maintenance &factory (string $module, [array $params = array()])
 string getPostData ()
 array infoMaintenance (string $pref)
 void runMaintenance ()
 integer runMaintenancePage ()
Variables
array $maint_tasks = array() (line 99)

Hash holding maintenance preference names.

Syntax: PREFNAME => interval Valid intervals are: MAINTENANCE_YEARLY, MAINTENANCE_MONTHLY, MAINTENANCE_WEEKLY, MAINTENANCE_DAILY, MAINTENANCE_EVERY, MAINTENANCE_FIRST_LOGIN Operations will be run in the order they appear in the array - MAKE SURE FUNCTIONS ARE IN THE CORRECT ORDER! Operations can appear more than once - they will only be run once per login though (the operation will run the first time it is seen in the array).

This array should be filled in for each Horde module that extends the Maintenance class.

integer $_lastRun = 0 (line 106)

UNIX timestamp of the last maintenance run for user.

array $_taskCache = array() (line 120)

Array to store Maintenance_Task objects.

Maintenance_Tasklist $_tasklist (line 113)

The Maintenance_Tasklist object for this login.

Methods
Constructor Maintenance (line 155)

Constructor.

Maintenance Maintenance ([array $params = array()])
  • array $params: A hash containing the following entries: 'last_maintenance' => The last time maintenance was run (UNIX timestamp).
exportIntervalPrefs (line 266)

Export variable names to use for creating select tables in the preferences menu.

  • return: An array of variable names to be imported into the prefs.php namespace.
array exportIntervalPrefs ()
factory (line 132)

Attempts to return a concrete Maintenance_* object based on the module name passed into it.

  • return: The Maintenance object, or false on error.
Maintenance &factory (string $module, [array $params = array()])
  • string $module: The name of the Horde module.
  • array $params: A hash containing additional data needed by the constructor.
getMaintenanceFormURL (line 311)

Return the URL needed for the maintenance form.

  • return: The URL to redirect to.
string getMaintenanceFormURL ()
getPostData (line 288)

Output hidden for elements for the POST form to ensure the calling script has the same POST elements as when the maintenance operations first run.

  • return: The form data.
string getPostData ()
infoMaintenance (line 245)

Returns the informational text message on what the operation is about to do. Also indicates whether the box should be checked by default or not. Operations that have been locked by the admin will return null.

  • return: 1st element - Description of what the operation is about to do during this login. 2nd element - Whether the preference is set to on or not.
array infoMaintenance (string $pref)
  • string $pref: Name of the operation to get information for.
runMaintenance (line 173)

Do maintenance operations needed for this login.

This function will generate the list of tasks to perform during this login and will redirect to the maintenance page if necessary. This is the function that should be called from the application upon login.

void runMaintenance ()
runMaintenancePage (line 199)

Do the necessary maintenance tasks for this loading of the maintenance page.

This is the function that is called from the maintenance page every time it is loaded.

  • return: The display required for the maintenance page.
integer runMaintenancePage ()

Documentation generated on Sun, 30 Jan 2011 05:19:26 +0000 by phpDocumentor 1.4.3