fix many PHP 8.4 compatibility issues
This commit is contained in:
@ -107,6 +107,16 @@ class SystemUtil {
|
||||
Logger::log($message . 'FOUND!');
|
||||
}
|
||||
|
||||
// Check for Xml
|
||||
$message = 'Checking for installed xml ... ';
|
||||
if (!extension_loaded('SimpleXML')) {
|
||||
Logger::log($message . 'NOT FOUND!');
|
||||
Logger::log(" -- You don't have xml installed! Check: https://www.php.net/manual/en/xml.setup.php");
|
||||
$success = false;
|
||||
} else {
|
||||
Logger::log($message . 'FOUND!');
|
||||
}
|
||||
|
||||
if (!$success) {
|
||||
// Missing requirements
|
||||
self::quit();
|
||||
|
@ -22,7 +22,7 @@ abstract class WebReader {
|
||||
* @param callable $function
|
||||
* @return Response
|
||||
*/
|
||||
public static function getUrl($url, callable $function = null) {
|
||||
public static function getUrl($url, ?callable $function = null) {
|
||||
$request = static::newRequest($url);
|
||||
$response = $request->send();
|
||||
if ($function) {
|
||||
@ -73,7 +73,7 @@ abstract class WebReader {
|
||||
* @param callable $function
|
||||
* @return Response
|
||||
*/
|
||||
public static function postUrl($url, $content = null, callable $function = null) {
|
||||
public static function postUrl($url, $content = null, ?callable $function = null) {
|
||||
$request = static::newRequest($url);
|
||||
$request->getOptions()->set(CURLOPT_POST, true); // post method
|
||||
if ($content) {
|
||||
|
Reference in New Issue
Block a user