function SystemInfoController::php
Same name and namespace in other branches
- 11.x core/modules/system/src/Controller/SystemInfoController.php \Drupal\system\Controller\SystemInfoController::php()
- 10 core/modules/system/src/Controller/SystemInfoController.php \Drupal\system\Controller\SystemInfoController::php()
- 9 core/modules/system/src/Controller/SystemInfoController.php \Drupal\system\Controller\SystemInfoController::php()
- 8.9.x core/modules/system/src/Controller/SystemInfoController.php \Drupal\system\Controller\SystemInfoController::php()
Returns the contents of phpinfo().
Attributes
#[Route(path: '/admin/reports/status/php', name: 'system.php', requirements: [
'_permission' => 'administer site configuration',
], options: [
'_admin_route' => FALSE,
])]
Return value
\Symfony\Component\HttpFoundation\Response A response object to be sent to the client.
File
-
core/
modules/ system/ src/ Controller/ SystemInfoController.php, line 71
Class
- SystemInfoController
- Returns responses for System Info routes.
Namespace
Drupal\system\ControllerCode
public function php() {
if (function_exists('phpinfo')) {
ob_start();
$phpinfo_flags = Settings::get('sa_core_2023_004_phpinfo_flags', ~(INFO_VARIABLES | INFO_ENVIRONMENT));
phpinfo($phpinfo_flags);
$output = ob_get_clean();
}
else {
$output = $this->t('The phpinfo() function is disabled. See <a href=":url" target="_blank">PHP documentation</a>.', [
':url' => 'https://www.php.net/manual/function.phpinfo.php',
]);
}
return new Response($output);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.