30 protected static function md5dir($dir) {
32 $extensions_allowed = [
'php',
'js',
'css'];
40 $dh = new \DirectoryIterator($dir);
41 foreach ($dh as $fileinfo) {
42 if ($fileinfo->isDot()) {
46 if ($fileinfo->isDir()) {
47 $buffer .= self::md5dir($fileinfo->getPathname());
50 if (!in_array($fileinfo->getExtension(), $extensions_allowed)) {
55 $buffer .= md5_file(
$filename) .
" {$filename}" . PHP_EOL;
83 $phpinfo = [
'phpinfo' => []];
86 if (preg_match_all(
'#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s', ob_get_clean(), $matches, PREG_SET_ORDER)) {
87 foreach ($matches as $match) {
89 $phpinfo[$match[1]] = [];
90 }
else if (isset($match[3])) {
91 $phpinfo[end(array_keys($phpinfo))][$match[2]] = isset($match[4]) ? [$match[3], $match[4]] : $match[3];
93 $phpinfo[end(array_keys($phpinfo))][] = $match[2];
98 return $event->getValue() .
elgg_echo(
'diagnostics:report:php', [print_r($phpinfo,
true)]);
111 return $event->getValue() .
elgg_echo(
'diagnostics:report:globals', [
$output]);
elgg_get_release()
Get the current Elgg release.
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
static getPHPInfo(\Elgg\Event $event)
Get some information about the php install.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
static getSigs(\Elgg\Event $event)
Get some information about the files installed on a system.
static getBasic(\Elgg\Event $event)
Generate a basic report.
static md5dir($dir)
Recursively list through a directory tree producing a hash of all installed files.
elgg_strlen()
Wrapper function for mb_strlen().
static getGlobals(\Elgg\Event $event)
Get global variables.
Event handlers for Developers plugin.
elgg_get_root_path()
Get the project path (where composer is installed), ending with slash.
static sanitize($path, $append_slash=true)
Sanitize file paths ensuring that they begin and end with slashes etc.
Models an event passed to event handlers.