php-gettext Depreciated Constructor

Bug #1714111 reported by Bobby Russ
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php-gettext (Ubuntu)
New
Undecided
Unassigned

Bug Description

1) Ubuntu 16.04.3 LTS
2) php-gettext: 1.0.11-2build1
3) No Error Message and smooth running was expected
4) What happened instead:

Deprecation Notice in ./../php/php-gettext/streams.php#48
Methods with the same name as their class will not be constructors in a future version of PHP; StringReader has a deprecated constructor

Backtrace

./../php/php-gettext/gettext.inc#41: require()
./libraries/select_lang.lib.php#477: require_once(./../php/php-gettext/gettext.inc)
./libraries/common.inc.php#569: require(./libraries/select_lang.lib.php)
./index.php#12: require_once(./libraries/common.inc.php)

Deprecation Notice in ./../php/php-gettext/streams.php#84
Methods with the same name as their class will not be constructors in a future version of PHP; FileReader has a deprecated constructor

Backtrace

./../php/php-gettext/gettext.inc#41: require()
./libraries/select_lang.lib.php#477: require_once(./../php/php-gettext/gettext.inc)
./libraries/common.inc.php#569: require(./libraries/select_lang.lib.php)
./index.php#12: require_once(./libraries/common.inc.php)
Deprecation Notice in ./../php/php-gettext/streams.php#145
Methods with the same name as their class will not be constructors in a future version of PHP; CachedFileReader has a deprecated constructor

Backtrace

./../php/php-gettext/gettext.inc#41: require()
./libraries/select_lang.lib.php#477: require_once(./../php/php-gettext/gettext.inc)
./libraries/common.inc.php#569: require(./libraries/select_lang.lib.php)
./index.php#12: require_once(./libraries/common.inc.php)
Deprecation Notice in ./../php/php-gettext/gettext.php#36
Methods with the same name as their class will not be constructors in a future version of PHP; gettext_reader has a deprecated constructor

Backtrace

./../php/php-gettext/gettext.inc#42: require()
./libraries/select_lang.lib.php#477: require_once(./../php/php-gettext/gettext.inc)
./libraries/common.inc.php#569: require(./libraries/select_lang.lib.php)
./index.php#12: require_once(./libraries/common.inc.php)

From what I understand, this is fixed in 1.0.12-0.1 which is included in both 17.04 and 17.10 (Beta).

However, 16.04 LTS does not have this resolution and will keep flagging depreciation errors. While this is not a critical bug, the solution is not overly difficult from what I've read:

sudo nano /usr/share/php/php-gettext/streams.php

Line 48 StringReader Error.

Go to Line 52 and change

function StringReader ($str='') {

TO

function __construct($str='') {

Line 84 FileReader Error

Go to Line 90 and change

function FileReader($filename) {

to

function __construct($filename) {

Line 145 CacheFileReader error

Go to Line 146 and change

function CachedFileReader($filename) {

to

function __construct($filename) {

Using sudo nano /usr/share/php/php-gettext/gettext.php.

Line 36 gettext_reader { error

Go to line 101 and change

function gettext_reader($Reader, $enable_cache = true) {

To

function __construct($Reader, $enable_cache = true) {

Tags: xenial
tags: added: xenial
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.