PHPackages                             ptejada/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. ptejada/uflex

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

ptejada/uflex
=============

All in one PHP user authentication class

1.0.7(9y ago)1158.1k391MITPHPPHP &gt;=5.3.0

Since May 27Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (15)Used By (1)

Cancellation Notice
-------------------

[](#cancellation-notice)

Future development has been canceled. I recommend using a framework with built-in user authentication and authorization like [Laravel](https://laravel.com/)

uFlex 1.0.x
===========

[](#uflex-10x)

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)[![Stories in Ready](https://camo.githubusercontent.com/9b0dec61a0d7566c4f6976510c70a38b3a2a9324bc1e5ab47be87cac0694a7aa/68747470733a2f2f62616467652e776166666c652e696f2f7074656a6164612f75666c65782e7376673f6c6162656c3d7265616479267469746c653d5265616479)](http://waffle.io/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 0.9x versions...
===============================

[](#upgrading-from-09x-versions)

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 just include the `vendor/autoload.php` in your application if it has 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](#including-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 configured the `start()` method must be call in order for the user authentication process to start. For Example:

```
