Get rid of custom streams implementation
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:/
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://
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('
- 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.
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".