本文整理匯總了PHP中Maintenance::factory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Maintenance::factory方法的具體用法?PHP Maintenance::factory怎麽用?PHP Maintenance::factory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Maintenance
的用法示例。
在下文中一共展示了Maintenance::factory方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: header
*/
include_once '../lib/base.php';
include_once HORDE_LIBS . 'Horde/Maintenance.php';
/* Make sure there is a user logged in. */
if (!Auth::getAuth()) {
$url = Horde::url($registry->getParam('webroot', 'horde') . '/login.php', true);
$url = Util::addParameter($url, 'url', Horde::selfUrl());
header('Location: ' . $url);
exit;
}
/* If no 'module' parameter passed in, return error. */
if (!($module = basename(Util::getFormData('module', '')))) {
Horde::fatal(PEAR::raiseError(_("Do not directly access maintenance.php")), __FILE__, __LINE__);
}
/* Load the module specific maintenance class now. */
if (!($maint =& Maintenance::factory($module))) {
Horde::fatal(PEAR::raiseError(_("The Maintenance:: class did not load successfully")), __FILE__, __LINE__);
}
/* Have the maintenance module do all necessary processing. */
list($action, $tasks) = $maint->runMaintenancePage();
/* Print top elements of confirmation page. */
require HORDE_TEMPLATES . '/common-header.inc';
require HORDE_TEMPLATES . '/maintenance/maintenance_top.inc';
if ($action == MAINTENANCE_OUTPUT_CONFIRM) {
/* Confirmation-style output */
require HORDE_TEMPLATES . '/maintenance/confirm_top.inc';
if ($browser->hasFeature('javascript')) {
include HORDE_TEMPLATES . '/maintenance/javascript.inc';
}
/* $pref, $descrip, & $checked need to be set for the templates. */
foreach ($tasks as $pref) {