PHPackages                             cpliakas/doctrine-password - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. cpliakas/doctrine-password

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

cpliakas/doctrine-password
==========================

Adds a password type to Doctrine that hashes and compares passwords using the phpass library.

1.0.0(12y ago)410.2k↓41.7%[2 issues](https://github.com/cpliakas/doctrine-password/issues)GPL-3.0PHPPHP &gt;=5.3.0

Since Jun 16Pushed 12y ago1 watchersCompare

[ Source](https://github.com/cpliakas/doctrine-password)[ Packagist](https://packagist.org/packages/cpliakas/doctrine-password)[ Docs](https://github.com/cpliakas/doctrine-password)[ RSS](/packages/cpliakas-doctrine-password/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Doctrine Password Type
======================

[](#doctrine-password-type)

This project provides a password type for [Doctrine](http://www.doctrine-project.org/) that automatically hashes passwords using the [PHP Password Library](https://github.com/rchouinard/phpass)and provides a helper method to compare them to raw data submitted by end users. The primary goal is to make it stupid-simple to store hashed passwords in a database and check if passwords submitted by end users are valid.

Installation
------------

[](#installation)

This library can be installed with [Composer](http://gtcomposer.org). Define the following requirement in your project's `composer.json` file:

```
{
    "require": {
        "cpliakas/doctrine-password": "*"
    }
}
```

Then follow Composer's [Installation / Usage](https://github.com/composer/composer#installation--usage)guide to install this library.

Usage
-----

[](#usage)

This library assumes that the developer is familiar with [Doctrine ORM](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html), otherwise the code snippets below won't make much sense.

First, define your entity. Use the "password" type for the column storing passwords:

```
