-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support PHP 8.2 (one nice day) #4918
Comments
OK, fixed the second one via |
Oh yes, much better (enabled rewrite mod):
|
We should at least cherry-pick 157ca19. 1e821ec + cda1ae2 are indeed monkey-patching Zend 1 and my previous comment is a reason to drop it. Or at least not to use it in our framework + mods code. I mean, if someone is still on, say, Debian 10 (PHP 7.3) and runs IW2 mods w/ "good old" Zend forms, why not to keep that setup working at least for a few IW2 majors? |
Ok, Zend relies on dynamic properties more than I think. E.g. in |
According to PHP RFC: Deprecate dynamic properties PHP 9.0 will throw a fatal error. Would generous use of The PHP maintainers would like to ship Debian bookworm with php8.2, we'll need to fix the icinga packages before the freeze on February 12th 2023 to keep them in the next stable release. This doesn't leave us which much time to get this issue fixed "one nice day". |
Our PM prefers a Zend 1 fork which can PHP 8.2. But it's TBD which one... |
lessphp needs some changes for php8.2 too. The I made it work with: --- icingaweb2/library/vendor/lessphp/lib/Less/Tree/Color.php 2022-12-05 09:38:44.727695421 +0100
+++ /usr/share/icingaweb2/library/vendor/lessphp/lib/Less/Tree/Color.php 2022-12-05 10:55:37.050370167 +0100
@@ -11,6 +11,7 @@
public $alpha;
public $isTransparentKeyword;
public $type = 'Color';
+ public $name = 'n/a';
public function __construct( $rgb, $a = 1, $isTransparentKeyword = null ) {
if ( $isTransparentKeyword ) {
diff -ruN icingaweb2/library/vendor/lessphp/lib/Less/Tree/Dimension.php /usr/share/icingaweb2/library/vendor/lessphp/lib/Less/Tree/Dimension.php
--- icingaweb2/library/vendor/lessphp/lib/Less/Tree/Dimension.php 2022-12-05 09:38:44.731695381 +0100
+++ /usr/share/icingaweb2/library/vendor/lessphp/lib/Less/Tree/Dimension.php 2022-12-05 10:36:51.322573492 +0100
@@ -11,6 +11,7 @@
public $value;
public $unit;
public $type = 'Dimension';
+ public $parensInOp;
public function __construct( $value, $unit = null ) {
$this->value = floatval( $value );
diff -ruN icingaweb2/library/vendor/lessphp/lib/Less/Tree/Operation.php /usr/share/icingaweb2/library/vendor/lessphp/lib/Less/Tree/Operation.php
--- icingaweb2/library/vendor/lessphp/lib/Less/Tree/Operation.php 2022-12-05 09:38:44.731695381 +0100
+++ /usr/share/icingaweb2/library/vendor/lessphp/lib/Less/Tree/Operation.php 2022-12-05 10:37:52.665853687 +0100
@@ -12,6 +12,7 @@
public $operands;
public $isSpaced;
public $type = 'Operation';
+ public $parensInOp;
/**
* @param string $op
diff -ruN icingaweb2/library/vendor/lessphp/lib/Less/Tree/Variable.php /usr/share/icingaweb2/library/vendor/lessphp/lib/Less/Tree/Variable.php
--- icingaweb2/library/vendor/lessphp/lib/Less/Tree/Variable.php 2022-12-05 09:38:44.735695341 +0100
+++ /usr/share/icingaweb2/library/vendor/lessphp/lib/Less/Tree/Variable.php 2022-12-05 10:37:34.578065823 +0100
@@ -13,6 +13,7 @@
public $currentFileInfo;
public $evaluating = false;
public $type = 'Variable';
+ public $parensInOp;
/**
* @param string $name
--- Icinga/Less/ColorProp.php 2022-12-05 09:41:04.106295070 +0100
+++ /usr/share/php/Icinga/Less/ColorProp.php 2022-12-05 10:44:08.829813222 +0100
@@ -21,7 +21,7 @@
protected $index;
/** @var string Color variable name */
- protected $name;
+ public $name;
public function __construct()
{
diff -ruN Icinga/Util/LessParser.php /usr/share/php/Icinga/Util/LessParser.php
--- Icinga/Util/LessParser.php 2022-12-05 09:41:04.130294827 +0100
+++ /usr/share/php/Icinga/Util/LessParser.php 2022-12-05 10:45:25.949009831 +0100
@@ -10,6 +10,8 @@
class LessParser extends lessc
{
+ public $importDisabled;
+
public function __construct()
{
$this->setOption('plugins', [new Visitor()]); HTMLPurifier changes: --- icingaweb2/library/vendor/HTMLPurifier/AttrTransform/NameSync.php 2022-12-05 09:38:44.171700964 +0100
+++ /usr/share/icingaweb2/library/vendor/HTMLPurifier/AttrTransform/NameSync.php 2022-12-05 11:06:01.043360406 +0100
@@ -8,6 +8,8 @@
class HTMLPurifier_AttrTransform_NameSync extends HTMLPurifier_AttrTransform
{
+ public $idDef;
+
public function __construct()
{
$this->idDef = new HTMLPurifier_AttrDef_HTML_ID();
diff -ruN icingaweb2/library/vendor/HTMLPurifier/Lexer.php /usr/share/icingaweb2/library/vendor/HTMLPurifier/Lexer.php
--- icingaweb2/library/vendor/HTMLPurifier/Lexer.php 2022-12-05 09:38:44.055702121 +0100
+++ /usr/share/icingaweb2/library/vendor/HTMLPurifier/Lexer.php 2022-12-05 11:05:21.755804666 +0100
@@ -48,6 +48,8 @@
*/
public $tracksLineNumbers = false;
+ public $_entity_parser;
+
// -- STATIC ----------------------------------------------------------
/** Further icingaweb2 changes in addition to those from #4920: --- Icinga/Web/Navigation/ConfigMenu.php 2022-12-05 09:41:04.178294342 +0100
+++ /usr/share/php/Icinga/Web/Navigation/ConfigMenu.php 2022-12-05 10:22:45.480701123 +0100
@@ -33,6 +33,8 @@
protected $state;
+ protected $title;
+
public function __construct()
{
$this->children = [ icinga-php-library changes for options present in diff -ruN icinga-php/ipl/vendor/ipl/sql/src/Config.php /usr/share/icinga-php/ipl/vendor/ipl/sql/src/Config.php
--- icinga-php/ipl/vendor/ipl/sql/src/Config.php 2022-12-05 10:59:49.479548990 +0100
+++ /usr/share/icinga-php/ipl/vendor/ipl/sql/src/Config.php 2022-12-05 10:21:06.309935810 +0100
@@ -33,6 +33,9 @@
}
}
+ /** @var string Database type */
+ public $type;
+
/** @var string Type of the DBMS */
public $db;
@@ -51,6 +54,9 @@
/** @var string Password to use for authentication */
public $password;
+ /** @var bool Use SSL for connection */
+ public $use_ssl;
+
/**
* Character set for the connection
* Properties for all the (optional) resource options should probably be added. E.g.: --- a/vendor/ipl/sql/src/Config.php
+++ b/vendor/ipl/sql/src/Config.php
@@ -33,6 +33,9 @@ class Config
}
}
+ /** @var string Database type */
+ public $type;
+
/** @var string Type of the DBMS */
public $db;
@@ -51,6 +54,27 @@ class Config
/** @var string Password to use for authentication */
public $password;
+ /** @var bool Use SSL for connection */
+ public $use_ssl;
+
+ /** @var bool Don't verify SSL cerificate */
+ public $ssl_do_not_verify_server_cert;
+
+ /** @var string Path to SSL certificate */
+ public $ssl_cert;
+
+ /** @var string Path to SSL key */
+ public $ssl_key;
+
+ /** @var string Path to SSL CA file */
+ public $ssl_ca;
+
+ /** @var string Path to SSL CA directory */
+ public $ssl_capath;
+
+ /** @var string SSL ciphers */
+ public $ssl_cipher;
+
/**
* Character set for the connection
* icinga-php-thirdparty changes for icingadb-web: diff -ruN icinga-php/vendor/vendor/guzzlehttp/psr7/src/CachingStream.php /usr/share/icinga-php/vendor/vendor/guzzlehttp/psr7/src/CachingStream.php
--- icinga-php/vendor/vendor/guzzlehttp/psr7/src/CachingStream.php 2022-12-05 10:58:51.728196678 +0100
+++ /usr/share/icinga-php/vendor/vendor/guzzlehttp/psr7/src/CachingStream.php 2022-12-05 11:10:42.980166081 +0100
@@ -20,6 +20,8 @@
/** @var int Number of bytes to skip reading due to a write on the buffer */
private $skipReadBytes = 0;
+ private $stream;
+
/**
* We will treat the buffer object as the body of the stream
* icingadb-web changes: --- a/library/Icingadb/Widget/Detail/DowntimeCard.php
+++ b/library/Icingadb/Widget/Detail/DowntimeCard.php
@@ -15,6 +15,9 @@ class DowntimeCard extends BaseHtmlEleme
{
protected $downtime;
+ protected $start;
+ protected $end;
+
protected $duration;
protected $defaultAttributes = ['class' => 'progress-bar downtime-progress']; |
🚀Cool!🚀 Please could you, as the author of those changes, PR them to upstream? |
If they don't have a CLA like Icinga. As a volunteer I don't get paid enough to deal with the legal shenanigans of CLAs. I already spend far too much time on license & copyright review of new upstream releases. These changes seem trivial enough to not be copyrightable, but if they are then I disclaim any rights, anyone is free to use those changes as they see fit. dompdf 2.0.0 has changes for PHP 8.2: guzzlehttp/psr7 is already fixed since 2.4.0: HTMLPurifier is already fixed since 4.15.0: lessphp: |
@TAINCER Can you please get an overview of what has already been done and what still needs to be done? You are also welcome to review the linked PR. |
icinga-php-library 0.11.0 (re)introduced deprecation warnings:
The guzzlehttp/psr7 file in question is also provided by icinga-php-thirdparty. |
Grabbing the latest ipl/sql repo and dumping it over the top worked for me on debian bookworm. I tried to grab the latest guzzlehttp/psr7 version from here: https://github.com/guzzle/psr7 but that makes things much worse (the UI doesn't load at all, with include errors), so I'm not sure which one to get. Debian bookworm is out and about, and we have started using it in production for new images. Got any quick tip on how to remove the deprecated warning related to guzzle? I would love to see the packages.icinga.com repo updated with debian 12 at some point, for those early adopters :) |
Ah I see a PR is awaiting merge #4920 so perhaps I should just wait for that. |
It works, now. |
Describe the bug
While visiting http://10.27.0.188/icingaweb2/ I get:
Deprecated: Creation of dynamic property Icinga\Application\Modules\Module::$configdir is deprecated in /usr/share/icingaweb2/library/Icinga/Application/Modules/Module.php on line 264
Fatal error: Uncaught Error: Class "Locale" not found in /usr/share/icinga-php/ipl/vendor/ipl/i18n/src/Locale.php:122 Stack trace: #0 /usr/share/icinga-php/ipl/vendor/ipl/i18n/src/Locale.php(87): ipl\I18n\Locale->parseLocale() #1 /usr/share/icingaweb2/library/Icinga/Application/Web.php(500): ipl\I18n\Locale->getPreferred() #2 /usr/share/icingaweb2/library/Icinga/Application/ApplicationBootstrap.php(719): Icinga\Application\Web->detectLocale() #3 /usr/share/icingaweb2/library/Icinga/Application/Web.php(103): Icinga\Application\ApplicationBootstrap->setupInternationalization() #4 /usr/share/icingaweb2/library/Icinga/Application/ApplicationBootstrap.php(416): Icinga\Application\Web->bootstrap() #5 /usr/share/icingaweb2/library/Icinga/Application/webrouter.php(105): Icinga\Application\ApplicationBootstrap::start() #6 /usr/share/icingaweb2/public/index.php(4): require_once('...') #7 {main} thrown in /usr/share/icinga-php/ipl/vendor/ipl/i18n/src/Locale.php on line 122
To Reproduce
apt -t experimental install libapache2-mod-php8.2
git clone https://github.com/Icinga/icingaweb2.git /usr/share/icingaweb2
ln -vs /usr/share/icingaweb2/packages/files/apache/icingaweb2.conf /etc/apache2/conf-enabled/
systemctl reload apache2.service
git clone https://github.com/Icinga/icinga-php-library.git /usr/share/icinga-php/ipl
git clone https://github.com/Icinga/icinga-php-thirdparty.git /usr/share/icinga-php/vendor
Expected behavior
It works.
The text was updated successfully, but these errors were encountered: