1. Go to this page and download the library: Download clsmedia/feature-flag library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
clsmedia / feature-flag example snippets
use Clsmedia\FeatureFlag\FeatureFlag;
if (FeatureFlag::isActive('new_checkout')) {
echo 'New checkout is enabled!';
}
// Check if a flag is active
FeatureFlag::isActive('feature1'); // true or false
// Check if a flag is missing (not active)
FeatureFlag::misses('feature1'); // true if not active
// Get all active flags
print_r(FeatureFlag::getFlags());
// Returns true if 'nonexistent' flag is not defined
FeatureFlag::isActive('nonexistent', true); // true
// Returns false if flag not defined (default)
FeatureFlag::isActive('nonexistent'); // false