From 04ee32f702ce3da3f1deb67302e689afecbe0b50 Mon Sep 17 00:00:00 2001 From: mattab Date: Thu, 27 Nov 2014 15:16:38 +1300 Subject: Fixes #6468 Error in system check when always_populate_raw_post_data is not -1 on PHP 5.6+ --- plugins/Installation/Controller.php | 65 +++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 24 deletions(-) (limited to 'plugins/Installation/Controller.php') diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php index 28650856d9..69b14c7a89 100644 --- a/plugins/Installation/Controller.php +++ b/plugins/Installation/Controller.php @@ -635,30 +635,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin { $view->infos = self::getSystemInformation(); - $view->helpMessages = array( - 'zlib' => 'Installation_SystemCheckZlibHelp', - 'gzopen' => 'Installation_SystemCheckZlibHelp', - 'SPL' => 'Installation_SystemCheckSplHelp', - 'iconv' => 'Installation_SystemCheckIconvHelp', - 'mbstring' => 'Installation_SystemCheckMbstringHelp', - 'Reflection' => 'Required extension that is built in PHP, see http://www.php.net/manual/en/book.reflection.php', - 'json' => 'Installation_SystemCheckWarnJsonHelp', - 'libxml' => 'Installation_SystemCheckWarnLibXmlHelp', - 'dom' => 'Installation_SystemCheckWarnDomHelp', - 'SimpleXML' => 'Installation_SystemCheckWarnSimpleXMLHelp', - 'set_time_limit' => 'Installation_SystemCheckTimeLimitHelp', - 'mail' => 'Installation_SystemCheckMailHelp', - 'parse_ini_file' => 'Installation_SystemCheckParseIniFileHelp', - 'glob' => 'Installation_SystemCheckGlobHelp', - 'debug_backtrace' => 'Installation_SystemCheckDebugBacktraceHelp', - 'create_function' => 'Installation_SystemCheckCreateFunctionHelp', - 'eval' => 'Installation_SystemCheckEvalHelp', - 'gzcompress' => 'Installation_SystemCheckGzcompressHelp', - 'gzuncompress' => 'Installation_SystemCheckGzuncompressHelp', - 'pack' => 'Installation_SystemCheckPackHelp', - 'php5-json' => 'Installation_SystemCheckJsonHelp', - 'session.auto_start' => 'Installation_SystemCheckSessionAutostart', - ); + $view->helpMessages = $this->getSystemCheckHelpMessages(); $view->problemWithSomeDirectories = (false !== array_search(false, $view->infos['directories'])); } @@ -746,4 +723,44 @@ class Controller extends \Piwik\Plugin\ControllerAdmin return $result; }); } + + /** + * @return array + */ + private function getSystemCheckHelpMessages() + { + $helpMessages = array( + // Extensions + 'zlib' => 'Installation_SystemCheckZlibHelp', + 'gzopen' => 'Installation_SystemCheckZlibHelp', + 'SPL' => 'Installation_SystemCheckSplHelp', + 'iconv' => 'Installation_SystemCheckIconvHelp', + 'mbstring' => 'Installation_SystemCheckMbstringHelp', + 'Reflection' => 'Required extension that is built in PHP, see http://www.php.net/manual/en/book.reflection.php', + 'json' => 'Installation_SystemCheckWarnJsonHelp', + 'libxml' => 'Installation_SystemCheckWarnLibXmlHelp', + 'dom' => 'Installation_SystemCheckWarnDomHelp', + 'SimpleXML' => 'Installation_SystemCheckWarnSimpleXMLHelp', + + // Functions + 'set_time_limit' => 'Installation_SystemCheckTimeLimitHelp', + 'mail' => 'Installation_SystemCheckMailHelp', + 'parse_ini_file' => 'Installation_SystemCheckParseIniFileHelp', + 'glob' => 'Installation_SystemCheckGlobHelp', + 'debug_backtrace' => 'Installation_SystemCheckDebugBacktraceHelp', + 'create_function' => 'Installation_SystemCheckCreateFunctionHelp', + 'eval' => 'Installation_SystemCheckEvalHelp', + 'gzcompress' => 'Installation_SystemCheckGzcompressHelp', + 'gzuncompress' => 'Installation_SystemCheckGzuncompressHelp', + 'pack' => 'Installation_SystemCheckPackHelp', + 'php5-json' => 'Installation_SystemCheckJsonHelp', + ); + + // Add standard message for required PHP.ini settings + $requiredSettings = SystemCheck::getRequiredPhpSettings(); + foreach($requiredSettings as $requiredSetting) { + $helpMessages[$requiredSetting] = Piwik::translate('Installation_SystemCheckPhpSetting', $requiredSetting); + } + return $helpMessages; + } } -- cgit v1.2.3