982c9531 by Joshua Tundag

add has

1 parent c170f000
......@@ -36,4 +36,20 @@ class Flags{
// Session Driver
return isset($_GET[$flag]) ? $_GET[$flag] : ($_SESSION[$flag] ? $_SESSION[$flag] : $defaultValue);
}
/**
* Checks if the flag exists.
*
* @param string $flag Name of the flag.
* @param bool $encrypted True, if the passed $flag is an encrypted value.
* @param string $driver Storage driver.
*
* @return string
*/
public static function has($flagName, $encrypted = false, $driver = 'cookie'){
$flagManager = new FlagManager();
$flag = $flagManager->getFlag($flagName, $encrypted);
if(!$flag) return null;
return $flagManager->checkFlag($flag, null) !== null;
}
}
\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!