Download the PHP package fgremez/flagbag without Composer

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

FlagBag

A lightweight PHP library to manipulate bitmask integers as typed objects.

No dependencies. No framework required.

Installation

Requirements: PHP >= 8.1

Concept

Each flag is a power of 2. The stored value is the sum of active flags.

This allows efficient storage (a single integer column) and native SQL filtering:

Usage

1. Define a FlagBag

Extend FlagBag and declare your boolean properties with #[FlagBit]. Each value must be a power of 2.

2. Hydrate from an integer

3. Read a flag

4. Write a flag

5. Chaining

6. Integrate with any class

The column stays a plain integer — no custom ORM type needed.

Exceptions

Exception Thrown when
UnknownFlagException get()/set() called with a flag name that does not exist
InvalidFlagBitValueException A #[FlagBit] value is not a power of 2
FlagBitCollisionException Two properties share the same #[FlagBit] value

Integer limits

Storage Size Max flags Max value
TINYINT 8 bits 7 127
SMALLINT 16 bits 15 32 767
INT 32 bits 31 2 147 483 647
BIGINT 64 bits 62 ~4.6×10¹⁸

License

MIT — see LICENSE


All versions of flagbag with dependencies

PHP Build Version
Package Version
Requires php Version >=8.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 fgremez/flagbag contains the following files

Loading the files please wait ...