Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constants defined twice in 3.x versions #105

Closed
driehle opened this issue Mar 27, 2018 · 4 comments
Closed

Constants defined twice in 3.x versions #105

driehle opened this issue Mar 27, 2018 · 4 comments

Comments

@driehle
Copy link

driehle commented Mar 27, 2018

In the 3.x versions, the Sodium.stub.php is added as an autoload file in composer.json and the sodium_compat packages is required as well:

https://github.com/paragonie/halite/blob/v3.x/composer.json

This leads to a lot of errors of constants which are defined twice:

PHP Notice:  Constant sodium\CRYPTO_AEAD_AES256GCM_KEYBYTES already defined in C:\project\vendor\paragonie\halite\stub\Sodium.stub.php on line 8
PHP Notice:  Constant sodium\CRYPTO_AEAD_AES256GCM_NSECBYTES already defined in C:\project\vendor\paragonie\halite\stub\Sodium.stub.php on line 9
PHP Notice:  Constant sodium\CRYPTO_AEAD_AES256GCM_NPUBBYTES already defined in C:\project\vendor\paragonie\halite\stub\Sodium.stub.php on line 10
PHP Notice:  Constant sodium\CRYPTO_AEAD_AES256GCM_ABYTES already defined in C:\project\vendor\paragonie\halite\stub\Sodium.stub.php on line 11
PHP Notice:  Constant sodium\CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES already defined in C:\project\vendor\paragonie\halite\stub\Sodium.stub.php on line 12
PHP Notice:  Constant sodium\CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES already defined in C:\project\vendor\paragonie\halite\stub\Sodium.stub.php on line 13
PHP Notice:  Constant sodium\CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES already defined in C:\project\vendor\paragonie\halite\stub\Sodium.stub.php on line 14
[....]

I think this part your be removed from composer.json for the 3.x version of halite:

        "files": [
            "stub/Sodium.stub.php"
        ]
@paragonie-scott
Copy link
Member

Just so you know, only Halite 4.0 and newer are supported as of today: https://github.com/paragonie/halite#installing-halite

@driehle
Copy link
Author

driehle commented Mar 27, 2018

So there is no supported version for PHP 7.1? I think this would be quite easy to fix and it would restore compatibility for PHP 7.1...

@paragonie-scott
Copy link
Member

Not officially.

I'll still fix it, but supporting versions of PHP that don't have native libsodium support are massively unrewarding and so we decided to cut it off at 7.2. I strongly urge everyone to upgrade to Halite v4.

@paragonie-scott
Copy link
Member

https://github.com/paragonie/halite/releases/tag/v3.4.0 said that 3.4.0 was the final v3 release. I'm releasing v3.4.1 which is the final, final v3 release to fix this issue. Please make plans to upgrade to Halite 4.x and PHP 7.2 as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants