Download the PHP package messagebooster/uflex without Composer

On this page you can find all versions of the php package messagebooster/uflex. 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 uflex

uFlex 1.0.0

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

Build Status

For more information:

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 https://github.com/ptejada/uFlex/tree/master/db

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

Getting Started

Including it in your project

If using Composer just add ptejada/uflex as a dependency. Note the casing on uflex, all lowercase. Ex:

When using Composer 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

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:

It is preferable that a configuration file like the one above is created per project. This way you can use the configuration file to provide a pre-configured User instance to any PHP script in your project.

Alternatively you could create your own class which configures and start the the User object for you. Ex:

Below is an excerpt from the PHP class file which lists the customizable config properties you could change prior to calling start() on a User instance. Note: the config property is a Collection instance:

Understanding Collections

A Collection is an object representation of an array. Collections have many uses throughout this project and are easy to use. What a Collection does for us is handle the errors for undefined indexes and streamline our code.

Consider this example working with plain arrays:

Here is the same code using a Collection:

For more information check the API Documentation for the Collection class.

Using the Session

The User object provides easy management of the PHP session through its session property which is an instance of the Session class. By default the User class manages the userData namespace in PHP super global $_SESSION but this is configurable by setting config->userSession before the User object is started. This is very powerful since it lets the User class use the PHP session without interfering with other software the their session usage.

The Session class is just an extended Collection so it works like any other collection. The only difference is a few additional methods and the fact that it is a linked collection meaning that any changes made in the object will be reflected on $_SESSION and thus automatically saved on the PHP session.

Consider the following code and its output to give you a better idea of how everything works together:

Here is the output of the previous code:

The Session class can be use for other aspects of your application as well. For example to manage the entire PHP session you could do so by instantiating the Session class without arguments: new ptejada\uFlex\Session()

For more information on the Session class refer to the API Documentation

Extending the User class

In PHP you area able extend classes just like in any object oriented programming language. Therefore you could extend the User class functionality by adding your methods or modifications without having to modify the class file itself. You just have create a new PHP class that extends the User class:


All versions of uflex with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 messagebooster/uflex contains the following files

Loading the files please wait ....