Info.php in DRD Agent 4.0.x
File
src/Agent/Action/Info.php
View source
<?php
namespace Drupal\drd_agent\Agent\Action;
use Drupal;
use Drupal\Core\Site\Settings;
use Drupal\drd_agent\Agent\Remote\Monitoring;
use Drupal\drd_agent\Agent\Remote\SecurityReview;
class Info extends Base {
public function execute() {
$config = $this->configFactory
->get('system.site');
$result = [
'root' => DRUPAL_ROOT,
'version' => Drupal::VERSION,
'name' => $config
->get('name'),
'globals' => [],
'settings' => Settings::getAll(),
'review' => SecurityReview::create($this->container)
->collect(),
'monitoring' => Monitoring::create($this->container)
->collect(),
];
if ($systemManager = $this->container
->get('system.manager')) {
$result['requirements'] = $systemManager
->listRequirements();
}
$result['variables'] = $GLOBALS['config'];
foreach ($GLOBALS as $key => $value) {
if (!in_array($key, [
'config',
'GLOBALS',
'autoloader',
'kernel',
'request',
])) {
$result['globals'][$key] = $value;
}
}
return $result;
}
}
Classes
Name |
Description |
Info |
Provides a 'Info' code. |