Skip to content
Snippets Groups Projects
Select Git revision
  • e6e349202919c903e16aced52198621883fc7e96
  • 11.x default protected
  • 11.2.x protected
  • 10.6.x protected
  • 10.5.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

system.module

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    UpdateController.php 1.44 KiB
    <?php
    
    /**
     * @file
     * Contains \Drupal\update\Controller\UpdateController
     */
    
    namespace Drupal\update\Controller;
    
    use Drupal\Core\ControllerInterface;
    use Drupal\Core\Extension\ModuleHandlerInterface;
    use Symfony\Component\DependencyInjection\ContainerInterface;
    
    /**
     * Controller routines for update routes.
     */
    class UpdateController implements ControllerInterface {
    
      /**
       * Module handler service.
       *
       * @var \Drupal\Core\Extension\ModuleHandlerInterface
       */
      protected $moduleHandler;
    
      /**
       * Constructs update status data.
       *
       * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
       *   Module Handler Service.
       */
      public function __construct(ModuleHandlerInterface $module_handler) {
        $this->moduleHandler = $module_handler;
      }
    
      /**
       * {@inheritdoc}
       */
      public static function create(ContainerInterface $container) {
        return new static(
          $container->get('module_handler')
        );
      }
    
      /**
       * Returns a page about the update status of projects.
       *
       * @return array
       *   A build array with the update status of projects.
       */
      public function updateStatus() {
        $build  = array(
          '#theme' => 'update_report'
        );
        if ($available = update_get_available(TRUE)) {
          $this->moduleHandler->loadInclude('update', 'compare.inc');
          $build['#data'] = update_calculate_project_data($available);
        }
        else {
          $build['#data'] = _update_no_data();
        }
        return $build;
      }
    
    }