3 namespace Drupal\system\Controller;
5 use Symfony\Component\DependencyInjection\ContainerInterface;
6 use Symfony\Component\HttpFoundation\Response;
7 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
8 use Drupal\system\SystemManager;
11 * Returns responses for System Info routes.
13 class SystemInfoController implements ContainerInjectionInterface {
16 * System Manager Service.
18 * @var \Drupal\system\SystemManager
20 protected $systemManager;
25 public static function create(ContainerInterface $container) {
27 $container->get('system.manager')
32 * Constructs a SystemInfoController object.
34 * @param \Drupal\system\SystemManager $systemManager
35 * System manager service.
37 public function __construct(SystemManager $systemManager) {
38 $this->systemManager = $systemManager;
42 * Displays the site status report.
45 * A render array containing a list of system requirements for the Drupal
46 * installation and whether this installation meets the requirements.
48 public function status() {
49 $requirements = $this->systemManager->listRequirements();
50 return ['#type' => 'status_report_page', '#requirements' => $requirements];
54 * Returns the contents of phpinfo().
56 * @return \Symfony\Component\HttpFoundation\Response
57 * A response object to be sent to the client.
59 public function php() {
60 if (function_exists('phpinfo')) {
63 $output = ob_get_clean();
66 $output = t('The phpinfo() function has been disabled for security reasons. For more information, visit <a href=":phpinfo">Enabling and disabling phpinfo()</a> handbook page.', [':phpinfo' => 'https://www.drupal.org/node/243993']);
68 return new Response($output);