Bug#907583: php7.0-json: The file /usr/share/php/Services/JSON.php triggers PHP deprecation warnings, file /usr/share/php/Services/JSON.php
Thank you for this reassignment, Ondřej! So things become clear to me, and I can attach the patch to fix the bug. Best regards, Georges. Ondřej Surý a écrit : > Control: reassign -1 php-services-json > > The file belongs to php-services-json package. > > Ondrej > -- > Ondřej Surý > ond...@sury.org > > > > > On 29 Aug 2018, at 20:49, Georges Khaznadar wrote: > > > > Package: php7.0-json > > Version: 7.0.29-1+b2 > > Severity: normal > > > > Dear Maintainer, > > > > When upgrading one server from PHP5 to PHP7.0, and fixing problems > > which this could create, I found that one of the services throwed > > lots of warnings like: > > "Methods with the same name as their class will not be constructors in a > > future > > version of PHP" > > > > The fix (which I applied successfully by hand), is to use the functions > > "__construct()" as per > > the documentation of PHP: > > http://www.php.net/manual/en/language.oop5.decon.php > > > > The version of PHP7.0 on the server touched by the bug is currently the last > > one, > > 7.0.31-1 > > > > Unfortunately, I could not figure out easily how the faulty file, > > /usr/share/php/Services/JSON.php > > is created by the build process, so I do not know how to make a useful > > patch to > > fix this issue. > > > > Best regards, Georges. > > > > > > > > -- Package-specific info: > > Additional PHP 7.0 information > > > > PHP @PHP_VERSION SAPI (php7.0query -S): > > > > PHP 7.0 Extensions (php7.0query -M -v): > > > > Configuration files: > > /etc/php/7.0/mods-available/json.ini > > extension=json.so > > > > > > -- System Information: > > Debian Release: buster/sid > > APT prefers stable > > APT policy: (900, 'stable'), (499, 'testing'), (400, 'unstable') > > Architecture: amd64 (x86_64) > > > > Kernel: Linux 4.16.0-2-amd64 (SMP w/4 CPU cores) > > Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), > > LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8) > > Shell: /bin/sh linked to /bin/dash > > Init: systemd (via /run/systemd/system) > > LSM: AppArmor: enabled > > > > Versions of packages php7.0-json depends on: > > ii libc6 2.27-5 > > ii php-common 1:61 > > ii php7.0-common 7.0.29-1+b2 > > ii ucf3.0038 > > > > php7.0-json recommends no packages. > > > > php7.0-json suggests no packages. > > > > Versions of packages php7.0-common depends on: > > ii libc6 2.27-5 > > ii libssl1.1 1.1.0h-4 > > ii php-common 1:61 > > ii ucf 3.0038 > > > > Versions of packages php7.0-cli depends on: > > ii libc62.27-5 > > ii libedit2 3.1-20180525-1 > > ii libmagic11:5.33-3 > > ii libpcre3 2:8.39-9 > > ii libssl1.11.1.0h-4 > > ii libxml2 2.9.4+dfsg1-7+b1 > > ii mime-support 3.61 > > ii php7.0-common7.0.29-1+b2 > > ii php7.0-opcache 7.0.29-1+b2 > > ii php7.0-readline 7.0.29-1+b2 > > ii tzdata 2018e-1 > > ii ucf 3.0038 > > ii zlib1g 1:1.2.11.dfsg-1 > > > > Versions of packages php7.0-cli suggests: > > ii php-pear 1:1.10.5+submodules+notgz-1 > > > > Versions of packages php7.0-fpm depends on: > > ii libapparmor12.13-8 > > ii libc6 2.27-5 > > ii libmagic1 1:5.33-3 > > ii libpcre32:8.39-9 > > ii libssl1.1 1.1.0h-4 > > ii libsystemd0 239-7 > > ii libxml2 2.9.4+dfsg1-7+b1 > > ii mime-support3.61 > > ii php7.0-cli 7.0.29-1+b2 > > ii php7.0-common 7.0.29-1+b2 > > ii php7.0-opcache 7.0.29-1+b2 > > ii procps 2:3.3.15-2 > > ii tzdata 2018e-1 > > ii ucf 3.0038 > > ii zlib1g 1:1.2.11.dfsg-1 > > > > Versions of packages php7.0-fpm suggests: > > ii php-pear 1:1.10.5+submodules+notgz-1 > > > > -- no debconf information > > > -- Georges KHAZNADAR et Jocelyne FOURNIER 22 rue des mouettes, 59240 Dunkerque France. Téléphone +33 (0)3 28 29 17 70 Description: fix for deprecated constructors inherited from PHP4 This patch uses the constructors which exist since PHP5, and avoid the deprecation message: "Methods with the same name as their class will not be constructors in a future version of PHP" Author: Georges Khaznadar Bug-Debian: https://bugs.debian.org/907583 --- --- php-services-json-1.0.3.orig/Services_JSON-1.0.3/JSON.php +++ php-services-json-1.0.3/Services_JSON-1.0.3/JSON.php @@ -139,7 +139,7 @@ class Services_JSON * strings or numbers, if you return an object, make sure it does * not have a toJSON method, otherwise an error will occur. */ -function Services_JSON($use = 0) +function __construct($use = 0) { $this->use = $use; $this->_mb_strlen= function_exists('mb_strlen'); @@ -909,7 +909,7 @@ if (class_exists('PEAR_Error')) { class Services_JSON_Error extends PEAR_Error { -
Bug#907583: php7.0-json: The file /usr/share/php/Services/JSON.php triggers PHP deprecation warnings, file /usr/share/php/Services/JSON.php
Control: reassign -1 php-services-json The file belongs to php-services-json package. Ondrej -- Ondřej Surý ond...@sury.org > On 29 Aug 2018, at 20:49, Georges Khaznadar wrote: > > Package: php7.0-json > Version: 7.0.29-1+b2 > Severity: normal > > Dear Maintainer, > > When upgrading one server from PHP5 to PHP7.0, and fixing problems > which this could create, I found that one of the services throwed > lots of warnings like: > "Methods with the same name as their class will not be constructors in a > future > version of PHP" > > The fix (which I applied successfully by hand), is to use the functions > "__construct()" as per > the documentation of PHP: http://www.php.net/manual/en/language.oop5.decon.php > > The version of PHP7.0 on the server touched by the bug is currently the last > one, > 7.0.31-1 > > Unfortunately, I could not figure out easily how the faulty file, > /usr/share/php/Services/JSON.php > is created by the build process, so I do not know how to make a useful patch > to > fix this issue. > > Best regards, Georges. > > > > -- Package-specific info: > Additional PHP 7.0 information > > PHP @PHP_VERSION SAPI (php7.0query -S): > > PHP 7.0 Extensions (php7.0query -M -v): > > Configuration files: > /etc/php/7.0/mods-available/json.ini > extension=json.so > > > -- System Information: > Debian Release: buster/sid > APT prefers stable > APT policy: (900, 'stable'), (499, 'testing'), (400, 'unstable') > Architecture: amd64 (x86_64) > > Kernel: Linux 4.16.0-2-amd64 (SMP w/4 CPU cores) > Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), > LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8) > Shell: /bin/sh linked to /bin/dash > Init: systemd (via /run/systemd/system) > LSM: AppArmor: enabled > > Versions of packages php7.0-json depends on: > ii libc6 2.27-5 > ii php-common 1:61 > ii php7.0-common 7.0.29-1+b2 > ii ucf3.0038 > > php7.0-json recommends no packages. > > php7.0-json suggests no packages. > > Versions of packages php7.0-common depends on: > ii libc6 2.27-5 > ii libssl1.1 1.1.0h-4 > ii php-common 1:61 > ii ucf 3.0038 > > Versions of packages php7.0-cli depends on: > ii libc62.27-5 > ii libedit2 3.1-20180525-1 > ii libmagic11:5.33-3 > ii libpcre3 2:8.39-9 > ii libssl1.11.1.0h-4 > ii libxml2 2.9.4+dfsg1-7+b1 > ii mime-support 3.61 > ii php7.0-common7.0.29-1+b2 > ii php7.0-opcache 7.0.29-1+b2 > ii php7.0-readline 7.0.29-1+b2 > ii tzdata 2018e-1 > ii ucf 3.0038 > ii zlib1g 1:1.2.11.dfsg-1 > > Versions of packages php7.0-cli suggests: > ii php-pear 1:1.10.5+submodules+notgz-1 > > Versions of packages php7.0-fpm depends on: > ii libapparmor12.13-8 > ii libc6 2.27-5 > ii libmagic1 1:5.33-3 > ii libpcre32:8.39-9 > ii libssl1.1 1.1.0h-4 > ii libsystemd0 239-7 > ii libxml2 2.9.4+dfsg1-7+b1 > ii mime-support3.61 > ii php7.0-cli 7.0.29-1+b2 > ii php7.0-common 7.0.29-1+b2 > ii php7.0-opcache 7.0.29-1+b2 > ii procps 2:3.3.15-2 > ii tzdata 2018e-1 > ii ucf 3.0038 > ii zlib1g 1:1.2.11.dfsg-1 > > Versions of packages php7.0-fpm suggests: > ii php-pear 1:1.10.5+submodules+notgz-1 > > -- no debconf information >
Bug#907583: php7.0-json: The file /usr/share/php/Services/JSON.php triggers PHP deprecation warnings, file /usr/share/php/Services/JSON.php
Package: php7.0-json Version: 7.0.29-1+b2 Severity: normal Dear Maintainer, When upgrading one server from PHP5 to PHP7.0, and fixing problems which this could create, I found that one of the services throwed lots of warnings like: "Methods with the same name as their class will not be constructors in a future version of PHP" The fix (which I applied successfully by hand), is to use the functions "__construct()" as per the documentation of PHP: http://www.php.net/manual/en/language.oop5.decon.php The version of PHP7.0 on the server touched by the bug is currently the last one, 7.0.31-1 Unfortunately, I could not figure out easily how the faulty file, /usr/share/php/Services/JSON.php is created by the build process, so I do not know how to make a useful patch to fix this issue. Best regards, Georges. -- Package-specific info: Additional PHP 7.0 information PHP @PHP_VERSION SAPI (php7.0query -S): PHP 7.0 Extensions (php7.0query -M -v): Configuration files: /etc/php/7.0/mods-available/json.ini extension=json.so -- System Information: Debian Release: buster/sid APT prefers stable APT policy: (900, 'stable'), (499, 'testing'), (400, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 4.16.0-2-amd64 (SMP w/4 CPU cores) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages php7.0-json depends on: ii libc6 2.27-5 ii php-common 1:61 ii php7.0-common 7.0.29-1+b2 ii ucf3.0038 php7.0-json recommends no packages. php7.0-json suggests no packages. Versions of packages php7.0-common depends on: ii libc6 2.27-5 ii libssl1.1 1.1.0h-4 ii php-common 1:61 ii ucf 3.0038 Versions of packages php7.0-cli depends on: ii libc62.27-5 ii libedit2 3.1-20180525-1 ii libmagic11:5.33-3 ii libpcre3 2:8.39-9 ii libssl1.11.1.0h-4 ii libxml2 2.9.4+dfsg1-7+b1 ii mime-support 3.61 ii php7.0-common7.0.29-1+b2 ii php7.0-opcache 7.0.29-1+b2 ii php7.0-readline 7.0.29-1+b2 ii tzdata 2018e-1 ii ucf 3.0038 ii zlib1g 1:1.2.11.dfsg-1 Versions of packages php7.0-cli suggests: ii php-pear 1:1.10.5+submodules+notgz-1 Versions of packages php7.0-fpm depends on: ii libapparmor12.13-8 ii libc6 2.27-5 ii libmagic1 1:5.33-3 ii libpcre32:8.39-9 ii libssl1.1 1.1.0h-4 ii libsystemd0 239-7 ii libxml2 2.9.4+dfsg1-7+b1 ii mime-support3.61 ii php7.0-cli 7.0.29-1+b2 ii php7.0-common 7.0.29-1+b2 ii php7.0-opcache 7.0.29-1+b2 ii procps 2:3.3.15-2 ii tzdata 2018e-1 ii ucf 3.0038 ii zlib1g 1:1.2.11.dfsg-1 Versions of packages php7.0-fpm suggests: ii php-pear 1:1.10.5+submodules+notgz-1 -- no debconf information