kunalvarma05 / dropbox-php-sdk

🔥📦 An Easy-to-Use PHP SDK to work with the Dropbox V2 API.
https://kunalvarma05.github.io/dropbox-php-sdk/
MIT License
363 stars 180 forks source link

mcrypt deprecated in php 7.1 #29

Closed mabuonomo closed 7 years ago

mabuonomo commented 7 years ago

Hi, on ubuntu 14.04 with php7.1

Deprecated: Function mcrypt_create_iv() is deprecated in /var/www/html/abbashare/vendor/kunalvarma05/dropbox-php-sdk/src/Dropbox/Security/McryptRandomStringGenerator.php on line 47

From php.net: The Mcrypt library has been declared DEPRECATED since PHP 7.1, to use in its OpenSSL

kunalvarma05 commented 7 years ago

Hey,

I'm working on a PHP7+ only version of the package.

For now, instead of the Kunnu/Dropbox/Security/McryptRandomStringGenerator class, you can use the Kunnu/Dropbox/Security/OpenSslRandomStringGenerator class.

This can be configured while initializing the Dropbox class. You can follow the Advanced Configuration guide which shows how you can swap the default McryptRandomStringGenerator with the OpenSslRandomStringGenerator or with your own implementation of the RandomStringGeneratorInterface.

Thanks for reporting :)

Spreeuw commented 6 years ago

Perhaps add a fallback to random_bytes() in case ext/openssl is not installed?