Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
160
Issues
160
List
Boards
Labels
Service Desk
Milestones
Merge Requests
40
Merge Requests
40
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
7aec53d2
Commit
7aec53d2
authored
24 minutes ago
by
Mark Harding
Committed by
Mark Harding
20 minutes ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(experiment): setup experiment for Homepage200619
parent
0e1180af
master
No related merge requests found
Pipeline
#67146840
passed with stages
in 6 minutes and 29 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
3 deletions
+41
-3
register.php
Controllers/api/v1/register.php
+2
-2
Homepage200619.php
Core/Experiments/Hypotheses/Homepage200619.php
+37
-0
Manager.php
Core/Experiments/Manager.php
+1
-0
ManagerSpec.php
Spec/Core/Experiments/ManagerSpec.php
+1
-1
No files found.
Controllers/api/v1/register.php
View file @
7aec53d2
...
...
@@ -70,8 +70,8 @@ class register implements Interfaces\Api, Interfaces\ApiIgnorePam
$user
=
register_user
(
$_POST
[
'username'
],
$_POST
[
'password'
],
$_POST
[
'username'
],
$_POST
[
'email'
],
false
);
$guid
=
$user
->
guid
;
if
(
isset
(
$_POST
[
'Homepage
121118
'
]))
{
$user
->
expHomepage
121818
=
$_POST
[
'Homepage121118
'
];
if
(
isset
(
$_POST
[
'Homepage
200619
'
]))
{
$user
->
expHomepage
200619
=
$_POST
[
'Homepage200619
'
];
$user
->
save
();
}
...
...
This diff is collapsed.
Click to expand it.
Core/Experiments/Hypotheses/Homepage200619.php
0 → 100644
View file @
7aec53d2
<?php
/**
*
*/
namespace
Minds\Core\Experiments\Hypotheses
;
use
Minds\Core\Experiments\Bucket
;
class
Homepage200619
implements
HypothesisInterface
{
/**
* Return the id for the hypothesis
* @return string
*/
public
function
getId
()
{
return
"Homepage200619"
;
}
/**
* Return the buckets for the hypothesis
* @return Bucket[]
*/
public
function
getBuckets
()
{
return
[
(
new
Bucket
)
->
setId
(
'base'
)
->
setWeight
(
75
),
(
new
Bucket
)
->
setId
(
'variant1'
)
->
setWeight
(
25
),
//25 pct of users will be in this bucket
];
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Core/Experiments/Manager.php
View file @
7aec53d2
...
...
@@ -18,6 +18,7 @@ class Manager
/** @param array $experiments */
private
$experiments
=
[
'Homepage121118'
=>
Hypotheses\Homepage121118
::
class
,
'Homepage200619'
=>
Hypotheses\Homepage200619
::
class
,
];
public
function
__construct
(
$sampler
=
null
)
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Experiments/ManagerSpec.php
View file @
7aec53d2
...
...
@@ -20,7 +20,7 @@ class ManagerSpec extends ObjectBehavior
function
it_should_return_a_list_of_experiments
()
{
$this
->
getExperiments
()
->
shouldHaveCount
(
1
);
$this
->
getExperiments
()
->
shouldHaveCount
(
2
);
}
function
it_should_return_bucket_for_experiment
(
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment