li3_access provides a way to selectively release features.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

This library is now maintained at

Feature toggle library for the Lithium framework.

Feature toggling lets you turn features on and off by changing a configuration setting. This library allows simple Boolean feature toggles, feature toggles based on the result of a function, and feature toggles based on the current environment.


Checkout the code to your library directory:

cd libraries
git clone

Include the library in in your /app/config/bootstrap/libraries.php


Add feature detectors to your app in config/bootstrap/features.php (or somewhere that makes sense for you).


Named features are added using Features::add() along with their detector, which decides whether the feature should be active for the current request. Features can be turned on or off with a simple Boolean detector, calculated in some way with a closure detector, or be sensitive to the current environment by passing an array of environment and detector pairs.

Basic usage with Boolean detector

	// `config/bootstrap/features.php`
	Features::add('new_ui', true);

	// `controllers/Main.php`
	if (Features::check('new_ui')) {
		$template = 'add_new_ui';
	} else {
		$template = 'add';

Closure detector

	// `config/bootstrap/features.php`
	Features::add('new_ui', function() {
			// Logic here to decide if the feature should be enabled.
			// Return true to enable and false to disable.

Environment-specific detectors

	// `config/bootstrap/features.php`
	Features::add('new_ui', array(
		'production' => false,
		'development' => true,
		'staging' => function() {
			// Logic here to decide if the feature should be enabled.


Michael C. Harris

The original author of this library.

GitHub: michaeltwofish

Website: Twofish Creative