Get rid of custom streams implementation

Bug #490097 reported by Данило Шеган
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php-gettext
Triaged
High
Unassigned

Bug Description

Old issue tracker on Savannah had a submission from an unknown contributor about switching to native PHP streams on https://savannah.nongnu.org/patch/?4094

The full patch was against 1.0.3 so will likely not apply today, but I will still attach it. Here's also the comment original author posted:

"The code does not run well on PHP5, since it uses deprecated 'var' class attributes as well as constructors named like the class (they should be named '__construct()' in PHP5 and up) - this causes php-gettext to throw plenty of warnings when using E_ALL | E_STRICT error reporting.
Since PHP 4.3, stream are supported in PHP as well. The fopen/fread/fseek family is used to manipulate streams, though their names are misleading, because they work on any kind of stream (see http://www.php.net/stream for details).
The patch:
- adds public/private keywords to the vars and functions
- changes the constructor name
- replaces calls to the StreamReader class with calls to fseek, etc. The constructor to gettext_reader now needs to be passed a valid stream resource, such as the return value of fopen('french.mo','r'). PHP supports numerous other stream-data sources, such as HTTP, HTTPS, etc. If there isn't an implementation for a buffered stream already on the web, it should be easy to write one.
- as a result, makes streams.php obsolete
The patch is against php-gettext-1.0.3, use patch -p1 to patch."

Note: many of the PHP5 issues have been fixed already, but getting rid of streams.php would probably be nice as well, and that's what this bug is about. This might also turn in some performance improvements by avoiding going through needless code.

Revision history for this message
Данило Шеган (danilo) wrote :
Changed in php-gettext:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Данило Шеган (danilo)
Revision history for this message
Данило Шеган (danilo) wrote :

I believe native streams implementation doesn't provide as much flexibility as does the existing one, so this is likely never going to be "fixed".

Revision history for this message
Данило Шеган (danilo) wrote :

(Testing my filtering)

Changed in php-gettext:
assignee: Данило Шеган (danilo) → nobody
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.