PHP SDK
PHPv0.1.3
Terminal window
Requirements
Section titled “Requirements”- PHP 8.1+
- PDO extension (for SQLite cache)
- cURL extension
- Redis extension (optional)
Installation
Section titled “Installation”composer require flags-gg/flags-phpQuick Start
Section titled “Quick Start”<?phprequire_once 'vendor/autoload.php';
use FlagsGG\Client;
$client = new Client();$client->setAuth( projectId: 'your-project-id', agentId: 'your-agent-id', environmentId: 'your-environment-id');
// Check a flagif ($client->is('new-feature')->enabled()) { echo "Feature is enabled!";}
// Or use the shorthandif ($client->isEnabled('new-feature')) { echo "Feature is enabled!";}
// List all flags$flags = $client->list();foreach ($flags as $flag) { echo $flag->details->name . ': ' . ($flag->enabled ? 'enabled' : 'disabled') . "\n";}