PHPackages                             messagebooster/uflex - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. messagebooster/uflex

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

messagebooster/uflex
====================

All in one PHP user authentication class

1.0.2(11y ago)021MITPHPPHP &gt;=5.3.0

Since May 27Pushed 11y ago1 watchersCompare

[ Source](https://github.com/MessageBooster/uFlex)[ Packagist](https://packagist.org/packages/messagebooster/uflex)[ Docs](http://ptejada.com/projects/uFlex)[ RSS](/packages/messagebooster-uflex/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

uFlex 1.0.0
===========

[](#uflex-100)

A simple all-in-one PHP user Authentication library. This library is developed, maintained and tested in a **PHP 5.3.x** environment. The UnitTest also runs on Travis-CI for **PHP 5.4.x** and **PHP 5.5.x**.

The single class file `class.uFlex.php` code can be found on the [Legacy Branch](https://github.com/ptejada/uFlex/tree/legacy)

[![Build Status](https://camo.githubusercontent.com/a5d8a83672f2b6a64f2a91e5631884a26f87df2b1e9353bc80cfc130c7cc9178/68747470733a2f2f7472617669732d63692e6f72672f7074656a6164612f75466c65782e7376673f6272616e63683d312e302d444556)](https://travis-ci.org/ptejada/uFlex)

For more information:

- Check the examples here
- Try the demo in this package and review its source
- See the methods documentation here
- For more detailed documentation check generated PHPDoc

Upgrading from previous version...
==================================

[](#upgrading-from-previous-version)

Before updating you will need to run a SQL upgrade script. Make sure you backup your database before running the upgrade script. Refer to the DB directory

If not using Composer instead of including a PHP class you will include the `autoload.php` script in your application which will auto include the library classes as required.

If using composer then the just include the `vendor/autoload.php` in your application if is not already been included.

Overall version 1.0 takes a more object oriented approach and follows conventions more closely. For more information check out the [API Changes](http://ptejada.com/projects/uFlex/documentation_api_changes)

Getting Started
===============

[](#getting-started)

- [Including it in your project](#includding-it-in-your-project)
- [Configuring the User object](#configuring-the-user-object)
- [Understanding Collections](#understanding-collections)
- [Using the Session](#using-the-session)
- [Extending the User class](#extending-the-user-class)

Including it in your project
----------------------------

[](#including-it-in-your-project)

If using [Composer](https://getcomposer.org/) just add `ptejada/uflex` as a dependency. Note the casing on `uflex`, all lowercase. Ex:

```
{
    "require": {
        "ptejada/uflex": "1.*"
    }
}

```

When using [Composer](https://getcomposer.org/) use the `vendor/autoload.php` script to include the library in your project.

If not using Composer then clone this repository in your project. Use the `autoload.php` script to include the library in your project.

Configuring the User object
---------------------------

[](#configuring-the-user-object)

When the `User` class is instantiated not much happens, the session is not initialized nor a DB connection is established. This is to allow the class to be configured. Once the configured the `start()` method must be call in order for the user authentication process to start. For Example:

```
