dokuwiki
                                
                                 dokuwiki copied to clipboard
                                
                                    dokuwiki copied to clipboard
                            
                            
                            
                        Make 3rd party libs composer dependencies
We've started the process of using composer for 3rd party libs already, but we still have a few that are just copies in our own code and thus hard to update. We need to find proper maintained upstream projects for them, replace them with other libraries or decide to maintain our own package of it.
- [ ] DifferenceEngine.php
- [ ] JpegMeta.php
- [x] EmailAddressValidator.php
- [x] feedcreator.class.php
- [x] IXR_Library.php
Keeping them as is will not be feasible for much longer because of the speed the PHP project is now moving. Some of these libs will start failing in the upcoming PHP releases.
Replacing the Difference Engine is difficult. As explained in 72dbd63d98c44aa8e0ea55c910ab9e59cdd676c0 there's quite some evolution in what we're using.
There are https://github.com/pear/Text_Diff and https://github.com/horde/horde/tree/master/framework/Text_Diff - However both do not include the changes made by PHPWiki and MediaWiki to actually format the diff output to tables.
MediaWiki's implementation has had some changes in the past as well, but is not installable as a separate composer source. https://github.com/wikimedia/mediawiki/tree/master/includes/diff - it seems not to include the changes needed for 3way merges we have in our patch above (which is not in master yet).
Making a separate composer package based on our current version + 3way patch + mediawiki changes + maybe changes from Horde might be a way to go. It would also be a fine opportunity for anyone who want have their own Open Source Project.
JpegMeta seems to be completely abandoned, it has bugs (#1932) and no follow up projects are known to me. We'd probably fare best if we'd replace it by something else completely.
A good candidate seems to be https://github.com/lsolesen/pel
A library supporting reading and writing metadata for more than JPEG files (eg PDF, ODT, etc) would be awesome, too. But I'm not aware of any PHP libraries offering that.
For the EmailAddressValidator this seems to be okay: https://github.com/aziraphale/email-address-validator It was last changed in 2015 though. OTOH there's not much innovation needed here.
We should see if our patches a18f9d4ad88e6e67819bb34b4f1592ea6450ae8e and c9ec6231967652cf58f7840063ed94a26e6d8b37 are needed on that version and if they are accepted by the maintainer.
There are also a few automatic exports from google code which can be found when searching for  php-email-address-validation. But none of them seems to be maintained.
An even better alternative would be to use PHP's own validation with filter_var() http://php.net/manual/en/filter.examples.validation.php It should be available from 5.2 onwards. However a quick check shows that it does not pass all our tests (IPv6, local addresses and local part comments fail).
There seems to be a follow up project for FeedCreator here: https://github.com/flack/UniversalFeedCreator last change in 2016.
We do have some changes in our version and need to check which of them need to be applied to the above project: https://github.com/splitbrain/dokuwiki/commits/master/inc/feedcreator.class.php
Another possible JpegMeta replacement  might be https://github.com/PHPExif/php-exif. It can use either the native PHP exif extension, which supports at least a bunch of common image file formats in addition to JPEG, or the external exiftool, which supports a whole lot more file formats, not only images (see https://sno.phy.queensu.ca/~phil/exiftool/#supported).
Which backend to use should probably be made configurable, since the exiftool backend requires the installation of extra software and might be slower.
For the fileuploader is used a small javascript library valums Ajax Upload (old site: http://valums.com/ajax-upload/) , which is not maintained any more. See for last maintenance attempt: https://github.com/Valums-File-Uploader/file-uploader So far I know and see, there are no open issues known that affect us.
Who knows a good replacement for this javascript file uploader?
For the IXRLibrary we could use https://github.com/kissifrot/php-ixr - it hasn't updated since 2016, but also has no open issues or pull requests. Wordpress used to use their own version of this lib from which we ported some stuff a while ago. We need to check how our changes are reflected in the kissifrot version.
A predecessor for the Valums file uploader is the Fine-file-uploader https://github.com/FineUploader/fine-uploader, which has a MIT license according to https://github.com/Valums-File-Uploader/file-uploader/issues/58, but it is unfortunately not maintained anymore.
An nice alternative seems https://uppy.io/ - https://github.com/transloadit/uppy (MIT license) available via npm.
Bit longer overview: https://ourcodeworld.com/articles/read/715/top-7-best-open-source-javascript-and-jquery-file-uploader-plugins
Another candidate for exif data: https://github.com/diderich/metadata