Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Janis
/
btflags
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
982c9531
authored
2018-10-08 12:53:35 +0800
by
Joshua Tundag
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add has
1 parent
c170f000
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
src/BTFlags/Flags.php
src/BTFlags/Flags.php
View file @
982c953
...
...
@@ -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
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment