Currently php-libsodium 1.x (no longer maintained upstream) is packaged
for EPEL and all releases of Fedora. This version makes the libsodium
calls available with the \Sodium namespace. This will be changed when
PHP 7.2 is released and the calls will use sodium_ instead of the
A php-libsodium 2.x library is available (maintained), only available
for PHP >= 7.0 that also uses the sodium_ convention.
Ideally we'd have a polyfill that takes care of these cases. There is
one, but not sufficient for the EPEL/Fedora case . It rewrites the
\Sodium calls to the PHP 7.2 calls, which only works with
php-libsodium-2.x which is not packaged.
I'm thinking of writing my own polyfill that will expose \Sodium and try
to fallback to sodium_ if available or just "forward" to \Sodium calls
What do you guys think? Is there any path to update to php-libsodium 2.x
in Fedora or is the plan to wait it out for PHP 7.2? I assume PHP 7.2
will be part of RHEL 8, so that would take care of that problem as well ;)