From 2b44ed609d2814a601de77489cce9e9e0b774867 Mon Sep 17 00:00:00 2001 From: kremsy Date: Fri, 10 Mar 2017 20:09:39 +0100 Subject: [PATCH] included zip into requirements, php 7 users which did not have them crashed --- README.md | 1 + core/ErrorHandler.php | 3 ++- core/Utils/SystemUtil.php | 12 +++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 945b2f52..12eb3b64 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ http://www.maniacontrol.com - php_curl - php_xmlrpc (TM only, recommended for SM) - php_zlib + - php_zip ### How to report bugs or request features?: - Write a mail to bugs(at)maniacontrol(dot)com diff --git a/core/ErrorHandler.php b/core/ErrorHandler.php index a853a2d1..f1674398 100644 --- a/core/ErrorHandler.php +++ b/core/ErrorHandler.php @@ -404,7 +404,8 @@ class ErrorHandler { * @param \Exception $exception * @param bool $shutdown */ - public function handleException(\Exception $exception, $shutdown = true) { + public function handleException($exception, $shutdown = true) { + //Removed error type, as php throwed the exception in a case and it was not from class Exception weiredly $message = "[ManiaControl EXCEPTION]: {$exception->getMessage()}"; $exceptionClass = get_class($exception); diff --git a/core/Utils/SystemUtil.php b/core/Utils/SystemUtil.php index b8c957fd..5c0942d0 100644 --- a/core/Utils/SystemUtil.php +++ b/core/Utils/SystemUtil.php @@ -77,11 +77,21 @@ class SystemUtil { Logger::log($message . 'FOUND!'); } + // Check for ZIP + $message = 'Checking for installed PHP ZIP ... '; + if (!extension_loaded('zip')) { + Logger::log($message . 'NOT FOUND!'); + Logger::log(" -- You don't have php-zip installed! Check: http://at1.php.net/manual/en/zip.installation.php"); + $success = false; + } else { + Logger::log($message . 'FOUND!'); + } + // Check for Zlib $message = 'Checking for installed Zlib ... '; if (!extension_loaded('zlib')) { Logger::log($message . 'NOT FOUND!'); - Logger::log(" -- You don't have Zlib installed! Check: http://php.net/manual/de/zlib.setup.php"); + Logger::log(" -- You don't have Zlib installed! Check: http://php.net/manual/en/zlib.setup.php"); $success = false; } else { Logger::log($message . 'FOUND!');