• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP update_check_requirements函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中update_check_requirements函数的典型用法代码示例。如果您正苦于以下问题:PHP update_check_requirements函数的具体用法?PHP update_check_requirements怎么用?PHP update_check_requirements使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了update_check_requirements函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $io = new DrupalStyle($input, $output);
     $this->get('site')->loadLegacyFile('/core/includes/update.inc');
     $this->get('site')->loadLegacyFile('/core/includes/install.inc');
     $updateRegistry = $this->getDrupalService('update.post_update_registry');
     drupal_load_updates();
     update_fix_compatibility();
     $updates = update_get_update_list();
     $postUpdates = $updateRegistry->getPendingUpdateInformation();
     $requirements = update_check_requirements();
     $severity = drupal_requirements_severity($requirements);
     $io->newLine();
     if ($severity == REQUIREMENT_ERROR || $severity == REQUIREMENT_WARNING) {
         $io->info($this->trans('commands.update.debug.messages.requirements-error'));
         $tableHeader = [$this->trans('commands.update.debug.messages.severity'), $this->trans('commands.update.debug.messages.title'), $this->trans('commands.update.debug.messages.value'), $this->trans('commands.update.debug.messages.description')];
         $tableRows = [];
         foreach ($requirements as $requirement) {
             if (isset($requirement['minimum schema']) & in_array($requirement['minimum schema'], array(REQUIREMENT_ERROR, REQUIREMENT_WARNING))) {
                 $tableRows[] = [$requirement['severity'], $requirement['title'], $requirement['value'], $requirement['description']];
             }
         }
         $io->table($tableHeader, $tableRows);
         return;
     }
     if (empty($updates)) {
         $io->info($this->trans('commands.update.debug.messages.no-updates'));
         return;
     }
     $tableHeader = [$this->trans('commands.update.debug.messages.module'), $this->trans('commands.update.debug.messages.update-n'), $this->trans('commands.update.debug.messages.description')];
     $io->info($this->trans('commands.update.debug.messages.module-list'));
     $tableRows = [];
     foreach ($updates as $module => $module_updates) {
         foreach ($module_updates['pending'] as $update_n => $update) {
             list(, $description) = explode($update_n . " - ", $update);
             $tableRows[] = [$module, $update_n, trim($description)];
         }
     }
     $io->table($tableHeader, $tableRows);
     $tableHeader = [$this->trans('commands.update.debug.messages.module'), $this->trans('commands.update.debug.messages.post-update'), $this->trans('commands.update.debug.messages.description')];
     $io->info($this->trans('commands.update.debug.messages.module-list-post-update'));
     $tableRows = [];
     foreach ($postUpdates as $module => $module_updates) {
         foreach ($module_updates['pending'] as $postUpdateFunction => $message) {
             $tableRows[] = [$module, $postUpdateFunction, $message];
         }
     }
     $io->table($tableHeader, $tableRows);
 }
开发者ID:killua99,项目名称:DrupalConsole,代码行数:49,代码来源:DebugCommand.php


示例2: execute

 /**
  * @param \Symfony\Component\Console\Input\InputInterface   $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $io = new DrupalStyle($input, $output);
     $this->get('site')->loadLegacyFile('/core/includes/update.inc');
     $this->get('site')->loadLegacyFile('/core/includes/install.inc');
     drupal_load_updates();
     update_fix_compatibility();
     $requirements = update_check_requirements();
     $severity = drupal_requirements_severity($requirements);
     $updates = update_get_update_list();
     $io->newLine();
     if ($severity == REQUIREMENT_ERROR || $severity == REQUIREMENT_WARNING) {
         $this->populateRequirements($io, $requirements);
     } elseif (empty($updates)) {
         $io->info($this->trans('commands.update.debug.messages.no-updates'));
     } else {
         $this->populateUpdate($io, $updates);
         $this->populatePostUpdate($io);
     }
 }
开发者ID:mnico,项目名称:DrupalConsole,代码行数:24,代码来源:DebugCommand.php


示例3: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $table = $this->getHelperSet()->get('table');
     $table->setlayout($table::LAYOUT_COMPACT);
     include_once DRUPAL_ROOT . '/core/includes/update.inc';
     include_once DRUPAL_ROOT . '/core/includes/install.inc';
     $module_handler = $this->getModuleHandler();
     drupal_load_updates();
     update_fix_compatibility();
     $updates = update_get_update_list();
     $requirements = update_check_requirements();
     $severity = drupal_requirements_severity($requirements);
     if ($severity == REQUIREMENT_ERROR || $severity == REQUIREMENT_WARNING) {
         $output->writeln('[-] <info>' . $this->trans('commands.update.debug.messages.requirements-error') . '</info>');
         $table->setHeaders([$this->trans('commands.update.debug.messages.severity'), $this->trans('commands.update.debug.messages.title'), $this->trans('commands.update.debug.messages.value'), $this->trans('commands.update.debug.messages.description')]);
         foreach ($requirements as $requirement) {
             if (isset($requirement['minimum schema']) & in_array($requirement['minimum schema'], array(REQUIREMENT_ERROR, REQUIREMENT_WARNING))) {
                 $table->addRow([$requirement['severity'], $requirement['title'], $requirement['value'], $requirement['description']]);
             }
         }
         $table->render($output);
         return;
     }
     if (empty($updates)) {
         $output->writeln('[-] <info>' . $this->trans('commands.update.debug.messages.no-updates') . '</info>');
         return;
     }
     $table->setHeaders([$this->trans('commands.update.debug.messages.module'), $this->trans('commands.update.debug.messages.update-n'), $this->trans('commands.update.debug.messages.description')]);
     $output->writeln('<info>' . $this->trans('commands.update.debug.messages.module-list') . '</info>');
     foreach ($updates as $module => $module_updates) {
         foreach ($module_updates['pending'] as $update_n => $update) {
             list(, $description) = split($update_n . " - ", $update);
             $table->addRow([$module, $update_n, trim($description)]);
         }
     }
     $table->render($output);
 }
开发者ID:xsw3ws,项目名称:DrupalConsole,代码行数:37,代码来源:UpdateDebugCommand.php


示例4: handle

 /**
  * Returns a database update page.
  *
  * @param string $op
  *   The update operation to perform. Can be any of the below:
  *    - info
  *    - selection
  *    - run
  *    - results
  * @param \Symfony\Component\HttpFoundation\Request $request
  *   The current request object.
  *
  * @return \Symfony\Component\HttpFoundation\Response
  *   A response object object.
  */
 public function handle($op, Request $request)
 {
     require_once $this->root . '/core/includes/install.inc';
     require_once $this->root . '/core/includes/update.inc';
     drupal_load_updates();
     update_fix_compatibility();
     if ($request->query->get('continue')) {
         $_SESSION['update_ignore_warnings'] = TRUE;
     }
     $regions = array();
     $requirements = update_check_requirements();
     $severity = drupal_requirements_severity($requirements);
     if ($severity == REQUIREMENT_ERROR || $severity == REQUIREMENT_WARNING && empty($_SESSION['update_ignore_warnings'])) {
         $regions['sidebar_first'] = $this->updateTasksList('requirements');
         $output = $this->requirements($severity, $requirements, $request);
     } else {
         switch ($op) {
             case 'selection':
                 $regions['sidebar_first'] = $this->updateTasksList('selection');
                 $output = $this->selection($request);
                 break;
             case 'run':
                 $regions['sidebar_first'] = $this->updateTasksList('run');
                 $output = $this->triggerBatch($request);
                 break;
             case 'info':
                 $regions['sidebar_first'] = $this->updateTasksList('info');
                 $output = $this->info($request);
                 break;
             case 'results':
                 $regions['sidebar_first'] = $this->updateTasksList('results');
                 $output = $this->results($request);
                 break;
                 // Regular batch ops : defer to batch processing API.
             // Regular batch ops : defer to batch processing API.
             default:
                 require_once $this->root . '/core/includes/batch.inc';
                 $regions['sidebar_first'] = $this->updateTasksList('run');
                 $output = _batch_page($request);
                 break;
         }
     }
     if ($output instanceof Response) {
         return $output;
     }
     $title = isset($output['#title']) ? $output['#title'] : $this->t('Drupal database update');
     return $this->bareHtmlPageRenderer->renderBarePage($output, $title, 'maintenance_page', $regions);
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:63,代码来源:DbUpdateController.php


示例5: module_list

    require_once DRUPAL_ROOT . '/includes/install.inc';
    require_once DRUPAL_ROOT . '/includes/file.inc';
    require_once DRUPAL_ROOT . '/modules/system/system.install';
    // Load module basics.
    include_once DRUPAL_ROOT . '/includes/module.inc';
    $module_list['system']['filename'] = 'modules/system/system.module';
    $module_list['filter']['filename'] = 'modules/filter/filter.module';
    module_list(TRUE, FALSE, $module_list);
    drupal_load('module', 'system');
    drupal_load('module', 'filter');
    // Set up $language, since the installer components require it.
    drupal_init_language();
    // Set up theme system for the maintenance page.
    drupal_maintenance_theme();
    // Check the update requirements for Drupal.
    update_check_requirements();
    // Redirect to the update information page if all requirements were met.
    install_goto('update.php?op=info');
}
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_maintenance_theme();
// Turn error reporting back on. From now on, only fatal errors (which are
// not passed through the error handler) will cause a message to be printed.
ini_set('display_errors', TRUE);
// Only proceed with updates if the user is allowed to run them.
if ($update_access_allowed) {
    include_once DRUPAL_ROOT . '/includes/install.inc';
    include_once DRUPAL_ROOT . '/includes/batch.inc';
    drupal_load_updates();
    update_fix_d7_requirements();
    update_fix_compatibility();
开发者ID:veggieryan,项目名称:drupal,代码行数:31,代码来源:update.php


示例6: drupal_maintenance_theme

drupal_maintenance_theme();
// Turn error reporting back on. From now on, only fatal errors (which are
// not passed through the error handler) will cause a message to be printed.
ini_set('display_errors', TRUE);
// Only proceed with updates if the user is allowed to run them.
if (update_access_allowed()) {
    include_once DRUPAL_ROOT . '/includes/install.inc';
    include_once DRUPAL_ROOT . '/includes/batch.inc';
    drupal_load_updates();
    update_fix_compatibility();
    // Check the update requirements for all modules. If there are warnings, but
    // no errors, skip reporting them if the user has provided a URL parameter
    // acknowledging the warnings and indicating a desire to continue anyway. See
    // drupal_requirements_url().
    $skip_warnings = !empty($_GET['continue']);
    update_check_requirements($skip_warnings);
    $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'));
开发者ID:ludichrislyts,项目名称:fieldWork,代码行数:31,代码来源:update.php


示例7: module_list

    require_once DRUPAL_ROOT . '/includes/install.inc';
    require_once DRUPAL_ROOT . '/includes/file.inc';
    require_once DRUPAL_ROOT . '/modules/system/system.install';
    // Load module basics.
    include_once DRUPAL_ROOT . '/includes/module.inc';
    $module_list['system']['filename'] = 'modules/system/system.module';
    $module_list['filter']['filename'] = 'modules/filter/filter.module';
    module_list(TRUE, FALSE, $module_list);
    drupal_load('module', 'system');
    drupal_load('module', 'filter');
    // Set up $language, since the installer components require it.
    drupal_init_language();
    // Set up theme system for the maintenance page.
    drupal_maintenance_theme();
    // Check the update requirements for Drupal.
    $warnings = update_check_requirements();
    // Display the warning messages (if any) in a dedicated maintenance page,
    // or redirect to the update information page if no message.
    if ($warnings) {
        drupal_maintenance_theme();
        print theme('update_page', '<form method="post" action="update.php?op=info"><input type="submit" value="Continue" /></form>', FALSE);
        exit;
    }
    // Write D7 settings file.
    update_check_d7_settings();
    install_goto('update.php?op=info');
}
update_prepare_d7_bootstrap();
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_maintenance_theme();
// Turn error reporting back on. From now on, only fatal errors (which are
开发者ID:rolfington,项目名称:drupal,代码行数:31,代码来源:update.php



注:本文中的update_check_requirements函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP update_comment_cache函数代码示例发布时间:2022-05-23
下一篇:
PHP update_category_cache函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap