https://github.com/thiagodp/phputil-flags-pdo
PDO-based storage for the phputil/flags framework
https://github.com/thiagodp/phputil-flags-pdo
feature flag framework library pdo php storage toggle
Last synced: 2 months ago
JSON representation
PDO-based storage for the phputil/flags framework
- Host: GitHub
- URL: https://github.com/thiagodp/phputil-flags-pdo
- Owner: thiagodp
- License: mit
- Created: 2024-05-08T18:06:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-09T21:34:02.000Z (over 1 year ago)
- Last Synced: 2025-03-30T15:36:02.369Z (about 1 year ago)
- Topics: feature, flag, framework, library, pdo, php, storage, toggle
- Language: PHP
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# phputil/flags-pdo
[](https://packagist.org/packages/phputil/flags-pdo)

[](https://packagist.org/packages/phputil/flags-pdo)
[](https://packagist.org/packages/phputil/flags-pdo)
> A PDO-based storage for the [phputil/flags](https://github.com/thiagodp/phputil-flags) feature flags framework
Currently supported drivers:
- sqlite
- mysql
## Installation
> Requires PHP 7.4+ and extension `pdo`
```bash
composer require phputil/flags-pdo
```
⚠ Note: You may need to enable the PDO extension you want to use.
For instance, if you want to use `sqlite`:
1. Find your `php.ini` file:
`php --ini`
2. Open your `php.ini` and uncomment (or add) the following line:
`extension=pdo_sqlite`
## Usage
```php
require_once 'vendor/autoload.php';
use phputil\flags\pdo\PDOBasedStorage;
$pdo = /* create you PDO instance here, e.g.: new PDO( 'sqlite:example.sqlite' ) */;
$storage = new PDOBasedStorage( $pdo );
// Now use it with phputil\flags
$flags = new phputil\flags\FlagManager( $storage );
...
```
## License
[MIT](/LICENSE) © [Thiago Delgado Pinto](https://github.com/thiagodp)