compatibility with PHP 7 #378

Closed
opened 2026-10-04 23:55:39 +02:00 by adam · 4 comments
Owner

Many deprecated/notice (even fatal error) messages come with PHP 7 and Piwigo 2.7

Many deprecated/notice (even fatal error) messages come with PHP 7 and Piwigo 2.7 <!-- github-sync-id:121477685 -->
adam closed this issue 2026-10-04 23:55:39 +02:00
Author
Owner

After a recent upgrade to PHP 7, I get the following warnings in the log :

PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FeedHtmlField has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 275
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FeedDate has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 703
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; RSSCreator091 has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 879
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; RSSCreator20 has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 1017
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; PIECreator01 has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 1034
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; AtomCreator03 has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 1092
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; MBOXCreator has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 1160
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; OPMLCreator has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 1247

After a recent upgrade to PHP 7, I get the following warnings in the log : PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FeedHtmlField has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 275 PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FeedDate has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 703 PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; RSSCreator091 has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 879 PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; RSSCreator20 has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 1017 PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; PIECreator01 has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 1034 PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; AtomCreator03 has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 1092 PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; MBOXCreator has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 1160 PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; OPMLCreator has a deprecated constructor in /home/carte-fh/galerie_photo/include/feedcreator.class.php on line 1247 <!-- github-comment-id:224673070 -->
Author
Owner

Was this ever fixed? I had to fix it myself in Piwigo 2.8.6. I simply replaced all the function calls by __construct and got it working. So function

function OPMLCreator() {
$this->encoding = "utf-8";
}

function __construct() {
$this->encoding = "utf-8";
}

However, would be great if this was fixed officially.

Was this ever fixed? I had to fix it myself in Piwigo 2.8.6. I simply replaced all the function calls by __construct and got it working. So function function OPMLCreator() { $this->encoding = "utf-8"; } function __construct() { $this->encoding = "utf-8"; } However, would be great if this was fixed officially. <!-- github-comment-id:285868708 -->
Author
Owner

I was trying to upload the changed file, however, I am not familiar with git. How to add the fixed file to this project, or how to at least contribute to a review so it becomes added after review?

I was trying to upload the changed file, however, I am not familiar with git. How to add the fixed file to this project, or how to at least contribute to a review so it becomes added after review? <!-- github-comment-id:285869569 -->
Author
Owner

According to the docs, yes, php7 is supported.
http://piwigo.org/doc/doku.php?id=dev:changes_in_2.8#php_7

However it looks like some classes have fallen through the cracks.

According to the docs, yes, php7 is supported. http://piwigo.org/doc/doku.php?id=dev:changes_in_2.8#php_7 However it looks like some classes have fallen through the cracks. <!-- github-comment-id:289347382 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#378