Download the PHP package tatter/preferences without Composer

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

Tatter\Preferences

Persistent user-specific settings for CodeIgniter 4

Coverage Status

Quick Start

  1. Install with Composer: > composer require --dev tatter/preferences
  2. Load the helper: helper('preferences');
  3. Use the function to get and set: $theme = preference('theme'); preference('theme', 'dark');

Description

Preferences is a wrapper for CodeIgniter Settings to provide user context to each setting. This allows you to get and set preferences on a per-user basis with a single command.

Installation

Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:

Or, install manually by downloading the source files and adding the directory to app/Config/Autoload.php.

Once the files are downloaded and included in the autoload, run any library migrations to ensure the database is set up correctly:

Preferences suggests the Composer provision for codeigniter4/authentication-implementation as describe in the CodeIgniter authentication guidelines. Without this each preference will be limited to the session duration so it is highly recommended you install and configure a supported package.

Usage

Preferences requires CodeIgniter Settings so you may use all the same classes and functions described in its documentation as well. To access the user-specific context settings call the preference() function anywhere you would normally use setting():

Note: Be sure to load the helper file (helper('preferences')) before using the helper function.

preference() will retrieve and store contextual settings for the current authenticated user. If no user is authenticated then it will fall back on the Session class with semi-persistent settings for as long as the session lasts.

Placeholder Config

In most cases each setting should have a corresponding Config file. Sometimes these settings will not fit under an existing logical grouping, so this library provides a "placeholder" Config (Tatter\Preferences\Config\Preferences). You may add your own version in *app/ to supply default values:

Any function calls with the class unspecified will reference the Preferences class:

Hint: Don't forget that libraries and modules can provide Config properties via Registrars

Troubleshooting

Preferences is a very "thin" library conjoining Settings and your authentication library of choice. Most likely any issues are related to one of the underlying libraries and should be directed there, but if you believe there is a problem or a feature request appropriate to this repository then feel free to open an Issue or Pull Request.


All versions of preferences with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
codeigniter4/settings Version ^2.1
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 tatter/preferences contains the following files

Loading the files please wait ....