diff --git a/src/report.cls.php b/src/report.cls.php index 42ea60004..82bf38fea 100644 --- a/src/report.cls.php +++ b/src/report.cls.php @@ -55,10 +55,14 @@ public function post_env() $notes = !empty($_POST['notes']) ? esc_html($_POST['notes']) : ''; + $php_info = !empty($_POST['attach_php']) ? esc_html($_POST['attach_php']) : ''; + $report_php = ($php_info === '1') ? $this->generate_php_report() : ''; + $data = array( 'env' => $report_con, 'link' => $link, 'notes' => $notes, + 'php_info' => $report_php, ); $json = Cloud::post(Cloud::API_REPORT, $data); @@ -77,6 +81,24 @@ public function post_env() return $num; } + /** + * Gathers the PHP information. + * + * @since 7.0 + * @access public + */ + public function generate_php_report($flags = INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES) // INFO_ENVIRONMENT + { + $report = ''; + + ob_start(); + phpinfo($flags); + $report = ob_get_contents(); + ob_end_clean(); + + return $report; + } + /** * Gathers the environment details and creates the report. * Will write to the environment report file. @@ -128,7 +150,7 @@ public function generate_environment_report($options = null) if (is_multisite()) { $options2 = $this->get_options(); foreach ($options2 as $k => $v) { - if ($options[$k] !== $v) { + if (isset($options[$k]) && $options[$k] !== $v) { $options['[Overwritten] ' . $k] = $v; } } diff --git a/tpl/toolbox/report.tpl.php b/tpl/toolbox/report.tpl.php index 46bcb0e64..3e836bbbb 100644 --- a/tpl/toolbox/report.tpl.php +++ b/tpl/toolbox/report.tpl.php @@ -64,6 +64,21 @@ +
- + \ No newline at end of file