Skip to content

prepare 2.5.0 release #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Feb 13, 2018
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c1fca88
[CH3370] Support publishing events via ld-relay
arun251 May 25, 2017
ae90fe1
Rename `apiKey` to `sdkKey`
arun251 May 25, 2017
384a406
Add documentation for GuzzleEventPublisher and CurlEventPublisher
arun251 May 25, 2017
c87b2f5
Merge pull request #4 from launchdarkly/arun/relay-events
arun251 May 25, 2017
e90344f
Merge branch 'master'
arun251 Oct 6, 2017
fbe5bfc
implement private user attributes
eplusminus Oct 13, 2017
7e95406
oh what the heck, let's write pure functions even in PHP
eplusminus Oct 13, 2017
9926122
consistent test names
eplusminus Oct 13, 2017
51a6af1
revise private user info naming conventions & methods to match Java SDK
eplusminus Oct 18, 2017
0bac87f
typo
eplusminus Oct 18, 2017
7475d87
unit tests for user builder
eplusminus Oct 18, 2017
913146e
factor out common logic
eplusminus Oct 18, 2017
2cfebd2
stop trying to do HTTP after we get a 401
eplusminus Oct 20, 2017
29ad461
better implementation - put entire client offline the first time we s…
eplusminus Oct 20, 2017
86b4524
revert unneeded changes
eplusminus Oct 20, 2017
02f4cef
revert CurlEventPublisher changes - see PR comments
eplusminus Oct 20, 2017
15fd0ef
typo
eplusminus Oct 21, 2017
a3b86ca
use underscore naming convention for config options
eplusminus Jan 1, 2018
90dfe93
document private attribute options (and all user builder setters)
eplusminus Jan 1, 2018
5dd9a15
Update PHP version for Circle's Ubuntu 12.04 machine
arun251 Jan 3, 2018
551f104
Merge pull request #9 from eplusminus/eb/stop-on-401
arun251 Jan 3, 2018
159ca6c
Merge pull request #8 from eplusminus/eb/private-attrs
arun251 Jan 3, 2018
cf1a4cd
Fix CircleCI/APCu build issue
arun251 Jan 3, 2018
f60a6a5
Merge pull request #12 from launchdarkly/fix-apcu
arun251 Jan 3, 2018
7533d22
Don't return custom attributes as json array. (#14)
ashanbrown Jan 10, 2018
06e82f7
Merge branch 'master'
arun251 Jan 12, 2018
ecf17df
add semantic version operators
eli-darkly Jan 16, 2018
2c0a5cd
switch to herrera-io/version library
eli-darkly Jan 19, 2018
fe268d6
add normalization of shortened versions
eli-darkly Jan 19, 2018
70b205c
add prerelease version test
eli-darkly Jan 19, 2018
9eea481
fix composer.lock
eli-darkly Jan 19, 2018
4727062
fix 1.0 documentation link
eli-darkly Jan 23, 2018
c46c5e1
Merge pull request #16 from launchdarkly/eb/ch7989/fix-doc-link
arun251 Jan 24, 2018
330d422
remove 3rd-party semver dependency, substitute our own semver impleme…
eli-darkly Feb 3, 2018
0cabb1b
remove newer PHPUnit usage
eli-darkly Feb 3, 2018
ae300f5
can't do computed property in older PHP
eli-darkly Feb 3, 2018
d6c4db0
Merge pull request #15 from launchdarkly/eb/semver-operators
eli-darkly Feb 9, 2018
95dea40
version 2.5.0
eli-darkly Feb 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
factor out common logic
  • Loading branch information
eplusminus committed Oct 18, 2017
commit 913146e7bfa626879cfb52c31221a0ca8ac9de94
39 changes: 15 additions & 24 deletions src/LaunchDarkly/EventSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,19 @@ private function filterEvent($e) {
return $ret;
}

private function isPrivateAttr($name, $userPrivateAttrs) {
return ($this->_allAttrsPrivate ||
array_search($name, $userPrivateAttrs) !== FALSE ||
array_search($name, $this->_privateAttrNames) !== FALSE);
private function filterAttrs($attrs, &$json, $userPrivateAttrs, &$allPrivateAttrs) {
foreach ($attrs as $key => $value) {
if ($value != null) {
if ($this->_allAttrsPrivate ||
array_search($key, $userPrivateAttrs) !== FALSE ||
array_search($key, $this->_privateAttrNames) !== FALSE) {
$allPrivateAttrs[$key] = true;
}
else {
$json[$key] = $value;
}
}
}
}

private function serializeUser($user) {
Expand All @@ -57,28 +66,10 @@ private function serializeUser($user) {
'lastName' => $user->getLastName(),
'anonymous' => $user->getAnonymous()
);
foreach ($attrs as $key => $value) {
if ($value != null) {
if ($this->isPrivateAttr($key, $userPrivateAttrs)) {
$allPrivateAttrs[$key] = $key;
}
else {
$json[$key] = $value;
}
}
}
$this->filterAttrs($attrs, $json, $userPrivateAttrs, $allPrivateAttrs);
if (!empty($user->getCustom())) {
$customs = array();
foreach ($user->getCustom() as $key => $value) {
if ($value != null) {
if ($this->isPrivateAttr($key, $userPrivateAttrs)) {
$allPrivateAttrs[$key] = $key;
}
else {
$customs[$key] = $value;
}
}
}
$this->filterAttrs($user->getCustom(), $customs, $userPrivateAttrs, $allPrivateAttrs);
$json['custom'] = $customs;
}
if (count($allPrivateAttrs)) {
Expand Down