class SystemInfoController in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/src/Controller/SystemInfoController.php \Drupal\system\Controller\SystemInfoController
Returns responses for System Info routes.
Hierarchy
- class \Drupal\system\Controller\SystemInfoController implements ContainerInjectionInterface
Expanded class hierarchy of SystemInfoController
File
- core/
modules/ system/ src/ Controller/ SystemInfoController.php, line 13
Namespace
Drupal\system\ControllerView source
class SystemInfoController implements ContainerInjectionInterface {
/**
* System Manager Service.
*
* @var \Drupal\system\SystemManager
*/
protected $systemManager;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('system.manager'));
}
/**
* Constructs a SystemInfoController object.
*
* @param \Drupal\system\SystemManager $systemManager
* System manager service.
*/
public function __construct(SystemManager $systemManager) {
$this->systemManager = $systemManager;
}
/**
* Displays the site status report.
*
* @return array
* A render array containing a list of system requirements for the Drupal
* installation and whether this installation meets the requirements.
*/
public function status() {
$requirements = $this->systemManager
->listRequirements();
return [
'#type' => 'status_report_page',
'#requirements' => $requirements,
];
}
/**
* Returns the contents of phpinfo().
*
* @return \Symfony\Component\HttpFoundation\Response
* A response object to be sent to the client.
*/
public function php() {
if (function_exists('phpinfo')) {
ob_start();
phpinfo();
$output = ob_get_clean();
}
else {
$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',
]);
}
return new Response($output);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SystemInfoController:: |
protected | property | System Manager Service. | |
SystemInfoController:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
SystemInfoController:: |
public | function | Returns the contents of phpinfo(). | |
SystemInfoController:: |
public | function | Displays the site status report. | |
SystemInfoController:: |
public | function | Constructs a SystemInfoController object. |