2017 © Pedro Peláez
 

library authentic

image

phroute/authentic

  • Saturday, April 16, 2016
  • by mrjgreen
  • Repository
  • 2 Watchers
  • 6 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Authentic

Build Status Coverage Status, (*1)

Authentic is a simple, framwork agnostic authentication library, designed to be flexible and easy to integrate with any PHP project., (*2)

use Phroute\Authentic\Authenticator;

/**
 * Your application user repository
 * Implements:
 *    public function findById($id);
 *    public function findByLogin($login);
 *    public function registerUser(array $userDetails);
 */
$userRepository = new UserRepository();

$auth = new Authenticator($userRepository);

use Phroute\Authentic\Exception\AuthenticationException; $credentials = array( 'email' => 'email@example.com', 'password' => 'pa55w0rd' ); $rememberMe = true; try { $auth->authenticate($credentials, $rememberMe); }catch(AuthenticationException $e) { return false; // Nope... } // Aaaaand we're in... return true;

The Versions