-
Notifications
You must be signed in to change notification settings - Fork 7
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
Ready to use in Symfony3 #28
Conversation
Hi Terox! Thanks for your contribution, our team will take a look at this and try to get it merged |
@@ -37,7 +28,7 @@ public function setLength($length) | |||
*/ | |||
public function generate() | |||
{ | |||
return $this->secureRandom->nextBytes($this->length); | |||
return random_bytes($this->length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
random_bytes()
only seems to be available in PHP 7 - perhaps https://github.com/symfony/polyfill-php70 could be used?
edit: didn't realise this was already included by symfony security stuff, my bad!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I think if we're going to rely on random_bytes
, we need to be explicit in the polyfill package as a dependency of ours.
We can't necessarily rely on the security component including it.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, tests will need fixing before this is merged.
composer.json
Outdated
"doctrine/common": "~2.2", | ||
"doctrine/orm": "~2.2", | ||
"symfony/security": "~2.1", | ||
"symfony/options-resolver": "~2.1", | ||
"symfony/security": "~2.8|~3.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is to support Symfony 3 as well, then what about 3.0 and 3.1?
I'd suggest a change to: ^2.8|^3.0
composer.json
Outdated
"symfony/security": "~2.1", | ||
"symfony/options-resolver": "~2.1", | ||
"symfony/security": "~2.8|~3.2", | ||
"symfony/options-resolver": "~2.8|~3.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same requirements change on this as the symfony/security
@@ -37,7 +28,7 @@ public function setLength($length) | |||
*/ | |||
public function generate() | |||
{ | |||
return $this->secureRandom->nextBytes($this->length); | |||
return random_bytes($this->length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I think if we're going to rely on random_bytes
, we need to be explicit in the polyfill package as a dependency of ours.
We can't necessarily rely on the security component including it.
Nice work, thanks @terox! |
Please, could you check the changes? I removed the PHP 5.4 from |
Looks good, thanks for the contribution. We'll merge and tag a version early next week 👍 |
Thank you so much for this fantastic bundle ;) |
Hello!
I have changed some files to do this bundle compatible with Symfony2/3.