ML icon indicating copy to clipboard operation
ML copied to clipboard

Not working in PHP 8.2 because of voku/portable-utf8/src/voku/helper/UTF8.php

Open follestad opened this issue 3 years ago • 7 comments

I get the following error when using this Rubix ML with PHP 8.2:

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 4653

.wamania/php-stemmer v2.2.0 requires voku/portable-utf8 (^5.4).

I wasn't able to include a newer version of voku/portable-utf8, because it wouldn't match the requirements for Rubix ML / php-stemmer.

follestad avatar Jan 04 '23 15:01 follestad

Hey thanks for the heads up @follestad ... definitely something we'll look into further!

If you want to hack it for now, you could remove the wamania/php-stemmer dependency and delete the WordStemmer tokenizer. We only use this library for one thing and it's the Word Stemmer tokenizer.

https://github.com/RubixML/ML/blob/master/src/Tokenizers/WordStemmer.php#L6

andrewdalpino avatar Jan 06 '23 06:01 andrewdalpino

Hiya, any updates to this?

tyteen4a03 avatar Feb 20 '23 11:02 tyteen4a03

I have a fork for that Package.... https://github.com/ThomasEnssner/portable-utf8/releases/tag/5.5.0

Change your Dependency to "voku/portable-utf8": "5.x-dev" and add this to your composer.json file

"repositories": [
    {
      "type": "github",
      "url": "https://github.com/ThomasEnssner/portable-utf8"
    }
]

ThomasEnssner avatar Mar 06 '23 09:03 ThomasEnssner

2.3.2 will use a new version 3 of PHP Stemmer, hopefully that fixes your issue

andrewdalpino avatar Mar 12 '23 22:03 andrewdalpino

Just as a heads-up: If you do not want to fork repos because of trivial issues (such as this one here), https://github.com/symplify/vendor-patches comes in very handy.

myfluxi avatar Apr 08 '23 16:04 myfluxi

PHP 8.2 support for wamania/php-stemmer: https://github.com/wamania/php-stemmer/pull/26

marclaporte avatar May 18 '23 02:05 marclaporte

Has this been resolved now?

andrewdalpino avatar May 27 '23 20:05 andrewdalpino