Skip to content

Instantly share code, notes, and snippets.

@ivoba
Created April 11, 2022 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivoba/d8c4379236149a8c42e1922ae98a93e3 to your computer and use it in GitHub Desktop.
Save ivoba/d8c4379236149a8c42e1922ae98a93e3 to your computer and use it in GitHub Desktop.
SilverStripe 4.10 & PHP8.1 fix deprecation warnings
"require": {
...
"cweagans/composer-patches": "^1.7"
...
"extra": {
"patches": {
"silverstripe/framework": {
"Fix SilverStripe deprecations error_reporting for PHP 8.1": "./fix-deprecation-error_reporting.4.10.4.patch"
}
}
}
...
Index: src/Core/CoreKernel.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Core/CoreKernel.php b/src/Core/CoreKernel.php
--- a/src/Core/CoreKernel.php (revision 82aba312fe2d8a2563331052d6783556b143e803)
+++ b/src/Core/CoreKernel.php (date 1649429323640)
@@ -461,7 +461,8 @@
error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT | E_NOTICE));
} else {
// Report all errors in dev / test mode
- error_reporting(E_ALL | E_STRICT);
+// error_reporting(E_ALL | E_STRICT);
+ error_reporting(E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED);
}
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment