Download the PHP package mflor/pwned without Composer

On this page you can find all versions of the php package mflor/pwned. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pwned

Pwned

Build Status Coverage Status Total Downloads Latest Version License

A clean and simple PHP library for interacting with all HaveIBeenPwned.com's API endpoints

This package wraps the entire HaveIBeenPwned API in a simple, easy to use, PHP library, that can be used in any project.

Many other packages wrapping the API, are either supposed to be used in a framework, or only wraps the password checker.

Installation

Install the library with composer:

Authorisation

Authorisation is required for all APIs that enable searching HIBP by email address, namely retrieving all breaches for an account and retrieving all pastes for an account. An HIBP subscription key is required to make an authorised call and can be obtained on the API key page.

Setup

Usage

Breaches

Pastes

Passwords

Both search and occurrences takes a second boolean parameter, to disable padding for request. Be aware, that this is less secure, than having the padding enabled, which is default. Read more about the padding in Troy Hunt's blog post

Exceptions

This package will throw custom exceptions if a Client Error occures.

\Mflor\Pwned\Exceptions\BadRequestException is thrown on status code 400

\Mflor\Pwned\Exceptions\UnauthorizedException is thrown on status code 401

\Mflor\Pwned\Exceptions\ForbiddenException is thrown on status code 403

\Mflor\Pwned\Exceptions\NotFoundException is thrown on status code 404

\Mflor\Pwned\Exceptions\TooManyRequestsException is thrown on status code 429

\Mflor\Pwned\Exceptions\ServiceUnavailableException is thrown on status code 503

Code Description
400 Bad request — the account does not comply with an acceptable format (i.e. it's an empty string)
401 Unauthorised — either no API key was provided or it wasn't valid
403 Forbidden — no user agent has been specified in the request
404 Not found — the account could not be found and has therefore not been pwned
429 Too many requests — the rate limit has been exceeded
503 Service unavailable — usually returned by Cloudflare if the underlying service is not available

Testing

You can run all tests by executing either of the following commands:

License

MIT


All versions of pwned with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
ext-json Version *
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mflor/pwned contains the following files

Loading the files please wait ....