Merge pull request #1 from olssonm/dev
Updates to dependencies and documentation.
This commit is contained in:
commit
2416c9f9ca
|
|
@ -1,8 +1,11 @@
|
||||||
language: php
|
language: php
|
||||||
php:
|
php:
|
||||||
- 5.5
|
|
||||||
- 5.6
|
- 5.6
|
||||||
- 7.0
|
- 7.0
|
||||||
- nightly
|
- nightly
|
||||||
|
|
||||||
before_script: composer install
|
before_script:
|
||||||
|
- travis_retry composer self-update
|
||||||
|
- travis_retry composer install --prefer-dist --no-interaction
|
||||||
|
|
||||||
|
script: phpunit
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015 Marcus Olsson <hello@marcusolsson.me>
|
Copyright (c) 2016 Marcus Olsson <hello@marcusolsson.me>
|
||||||
|
|
||||||
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
> of this software and associated documentation files (the "Software"), to deal
|
> of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
37
README.md
37
README.md
|
|
@ -40,22 +40,23 @@ If you've added `Olssonm\Zxcvbn` as an alias, your can access Zxcvbn easily from
|
||||||
|
|
||||||
``` php
|
``` php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Zxcvbn;
|
use Zxcvbn;
|
||||||
|
|
||||||
class MyClass
|
class MyClass extends MyOtherClass
|
||||||
{
|
{
|
||||||
public function myFunction()
|
public function myFunction()
|
||||||
{
|
{
|
||||||
$zxcvbn = Zxcvbn::passwordStrength('password');;
|
$zxcvbn = Zxcvbn::passwordStrength('password');
|
||||||
dd($zxcvbn->passwordStrength('password'));
|
dd($zxcvbn);
|
||||||
|
|
||||||
// array:6 [
|
// array:6 [▼
|
||||||
// "crack_time" => 5.0E-5
|
// "crack_time" => 5.0E-5
|
||||||
// "calc_time" => 0.1857271194458
|
// "calc_time" => 0.12961101531982
|
||||||
// "password" => "password"
|
// "password" => "password"
|
||||||
// "entropy" => 0.0
|
// "entropy" => 0.0
|
||||||
// "match_sequence" => array:1 []
|
// "match_sequence" => array:1 []
|
||||||
// "score" => 0
|
// "score" => 0
|
||||||
// ]
|
// ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -72,8 +73,11 @@ The package gives you two different validation rules that you may use; `zxcvbn_m
|
||||||
|
|
||||||
`zxcvbn_min` allows you to set up a rule for minimum score that the value beeing tested should adhere to.
|
`zxcvbn_min` allows you to set up a rule for minimum score that the value beeing tested should adhere to.
|
||||||
|
|
||||||
***Syntax***
|
**Syntax**
|
||||||
`'input' => 'zxcvbn_min:min_value'`
|
|
||||||
|
input' => 'zxcvbn_min:min_value'
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
|
||||||
``` php
|
``` php
|
||||||
<?php
|
<?php
|
||||||
|
|
@ -91,8 +95,11 @@ In this example the password should at least have a "score" of three (3) to pass
|
||||||
|
|
||||||
This is a bit more interesting. `zxcvbn_dictionary` allows you to input both the users username and/or email, and their password. The validator checks that the password doesn't exist in the username, or that they are too similar.
|
This is a bit more interesting. `zxcvbn_dictionary` allows you to input both the users username and/or email, and their password. The validator checks that the password doesn't exist in the username, or that they are too similar.
|
||||||
|
|
||||||
***Syntax***
|
**Syntax**
|
||||||
`'input' => 'xcvbn_dictionary:username,email'`
|
|
||||||
|
'input' => 'xcvbn_dictionary:username,email'
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
|
||||||
``` php
|
``` php
|
||||||
<?php
|
<?php
|
||||||
|
|
@ -143,7 +150,7 @@ $ phpunit
|
||||||
|
|
||||||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
|
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
|
||||||
|
|
||||||
© 2015 [Marcus Olsson](https://marcusolsson.me).
|
© 2016 [Marcus Olsson](https://marcusolsson.me).
|
||||||
|
|
||||||
[ico-version]: https://img.shields.io/packagist/v/olssonm/l5-zxcvbn.svg?style=flat-square
|
[ico-version]: https://img.shields.io/packagist/v/olssonm/l5-zxcvbn.svg?style=flat-square
|
||||||
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
|
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,12 @@
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php" : ">=5.3.0",
|
"php" : ">=5.3.0",
|
||||||
"illuminate/support": "~5.1",
|
"illuminate/support": "~5.3",
|
||||||
"bjeavons/zxcvbn-php": "0.1.4"
|
"bjeavons/zxcvbn-php": "^0.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit" : "4.*",
|
"phpunit/phpunit" : "4.*",
|
||||||
"orchestra/testbench": "~3.0",
|
"orchestra/testbench": "~3.3"
|
||||||
"scrutinizer/ocular": "~1.1"
|
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
@ -44,7 +43,7 @@
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.x-dev"
|
"dev-master": "2.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimum-stability": "stable"
|
"minimum-stability": "stable"
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,8 @@ class ZxcvbnServiceProvider extends ServiceProvider
|
||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->app['zxcvbn'] = $this->app->share(function ($app) {
|
$this->app->bind('zxcvbn', function ($app) {
|
||||||
return new ZxcvbnPhp($this->app['config']);
|
return new ZxcvbnPhp();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue