本文整理汇总了PHP中update_batch函数的典型用法代码示例。如果您正苦于以下问题:PHP update_batch函数的具体用法?PHP update_batch怎么用?PHP update_batch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_batch函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drupal_load_updates
include_once DRUPAL_ROOT . '/includes/install.inc';
include_once DRUPAL_ROOT . '/includes/batch.inc';
drupal_load_updates();
update_fix_d7_requirements();
update_fix_compatibility();
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
switch ($op) {
// update.php ops
case 'selection':
if (isset($_GET['token']) && $_GET['token'] == drupal_get_token('update')) {
$output = update_selection_page();
break;
}
case 'Apply pending updates':
if (isset($_GET['token']) && $_GET['token'] == drupal_get_token('update')) {
update_batch();
break;
}
case 'info':
$output = update_info_page();
break;
case 'results':
$output = update_results_page();
break;
// Regular batch ops : defer to batch processing API
// Regular batch ops : defer to batch processing API
default:
update_task_list('run');
$output = _batch_page();
break;
}
示例2: isset
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
switch ($op) {
// update.php ops.
case 'selection':
if (isset($_GET['token']) && drupal_valid_token($_GET['token'], 'update')) {
$output = update_selection_page();
break;
}
case 'Apply pending updates':
if (isset($_GET['token']) && drupal_valid_token($_GET['token'], 'update')) {
// Generate absolute URLs for the batch processing (using $base_root),
// since the batch API will pass them to url() which does not handle
// update.php correctly by default.
$batch_url = $base_root . drupal_current_script_url();
$redirect_url = $base_root . drupal_current_script_url(array('op' => 'results'));
update_batch($_POST['start'], $redirect_url, $batch_url);
break;
}
case 'info':
$output = update_info_page();
break;
case 'results':
$output = update_results_page();
break;
// Regular batch ops : defer to batch processing API.
// Regular batch ops : defer to batch processing API.
default:
update_task_list('run');
$output = _batch_page();
break;
}
示例3: drupal_load_updates
include_once DRUPAL_ROOT . '/includes/batch.inc';
drupal_load_updates();
update_fix_compatibility();
// Check the update requirements for all modules.
update_check_requirements();
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
switch ($op) {
// update.php ops.
case 'selection':
if (isset($_GET['token']) && $_GET['token'] == drupal_get_token('update')) {
$output = update_selection_page();
break;
}
case 'Apply pending updates':
if (isset($_GET['token']) && $_GET['token'] == drupal_get_token('update')) {
update_batch($_POST['start'], $base_url . '/update.php?op=results', $base_url . '/update.php');
break;
}
case 'info':
$output = update_info_page();
break;
case 'results':
$output = update_results_page();
break;
// Regular batch ops : defer to batch processing API.
// Regular batch ops : defer to batch processing API.
default:
update_task_list('run');
$output = _batch_page();
break;
}
示例4: update_task_list
$token = $request->query->get('token');
if (isset($token) && \Drupal::csrfToken()->validate($token, 'update')) {
$regions['sidebar_first'] = update_task_list('select');
$output = update_selection_page();
break;
}
case 'Apply pending updates':
$token = $request->query->get('token');
if (isset($token) && \Drupal::csrfToken()->validate($token, 'update')) {
$regions['sidebar_first'] = update_task_list('run');
// Generate absolute URLs for the batch processing (using $base_root),
// since the batch API will pass them to url() which does not handle
// update.php correctly by default.
$batch_url = $base_root . drupal_current_script_url();
$redirect_url = $base_root . drupal_current_script_url(array('op' => 'results'));
$output = update_batch($request->request->get('start'), $redirect_url, $batch_url);
break;
}
case 'info':
$regions['sidebar_first'] = update_task_list('info');
$output = update_info_page();
break;
case 'results':
$regions['sidebar_first'] = update_task_list();
$output = update_results_page();
break;
// Regular batch ops : defer to batch processing API.
// Regular batch ops : defer to batch processing API.
default:
$regions['sidebar_first'] = update_task_list('run');
$output = _batch_page($request);