You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 31, 2020. It is now read-only.
// $result is TRUE because "8aDk=XiW2E.77tLfuAcB" was not found in a data breach
37
37
```
38
38
39
+
## A simple command line example
40
+
41
+
In this example I'm using `zendframework/zend-diactoros` for HTTP messaging and `php-http/curl-client` as the HTTP client. Let's begin with installation of all required packages:
42
+
43
+
```bash
44
+
$ composer require \
45
+
php-http/message \
46
+
php-http/message-factory \
47
+
php-http/discovery \
48
+
php-http/curl-client \
49
+
zendframework/zend-diactoros \
50
+
zendframework/zend-validator
51
+
```
52
+
53
+
Next thing is I create a file `undisclosed.php` where I will put in my code.
54
+
55
+
```php
56
+
<?php
57
+
58
+
namespace Undisclosed;
59
+
60
+
use Http\Client\Curl\Client;
61
+
use Zend\Diactoros\RequestFactory;
62
+
use Zend\Diactoros\ResponseFactory;
63
+
use Zend\Validator\UndisclosedPassword;
64
+
65
+
require_once __DIR__ .'/vendor/autoload.php';
66
+
67
+
68
+
$requestFactory = new RequestFactory();
69
+
$responseFactory = new ResponseFactory();
70
+
$client = new Client($responseFactory, null);
71
+
72
+
$undisclosedPassword = new UndisclosedPassword($client, $requestFactory, $responseFactory);
73
+
echo'Password "password" is '. ($undisclosedPassword->isValid('password') ?'not disclosed':'disclosed') . PHP_EOL;
74
+
echo'Password "NVt3MpvQ" is '. ($undisclosedPassword->isValid('NVt3MpvQ') ?'not disclosed':'disclosed') . PHP_EOL;
0 commit comments