Skip to content
Commits on Source (6)
......@@ -70,8 +70,10 @@ 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['Homepage121118'])) {
$user->expHomepage121818 = $_POST['Homepage121118'];
if (isset($_COOKIE['mexp'])) {
$manager = Core\Di\Di::_()->get('Experiments\Manager');
$bucket = $manager->getBucketForExperiment('Homepage200619');
$user->expHomepage200619 = $bucket->getId();
$user->save();
}
......
......@@ -26,7 +26,7 @@ class Message
{
$this->from = [
'name' => 'Minds',
'email' => 'info@minds.com',
'email' => 'no-reply@minds.com',
];
}
......
......@@ -25,6 +25,9 @@ class Manager
'clickmail.info',
'marketlink.info',
'atnextmail.com',
'hostguru.top',
'daymailonline.com',
'uber-mail.com',
];
public function __construct($service = null, $spamBlocksManager = null)
......
<?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
......@@ -18,6 +18,7 @@ class Manager
/** @param array $experiments */
private $experiments = [
'Homepage121118' => Hypotheses\Homepage121118::class,
'Homepage200619' => Hypotheses\Homepage200619::class,
];
public function __construct($sampler = null)
......
......@@ -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(
......
......@@ -475,4 +475,6 @@ $CONFIG->set('features', [
'helpdesk' => true,
'top-feeds' => true,
'dark-mode' => true,
]);
\ No newline at end of file
]);
$CONFIG->set('last_tos_update', 1);
\ No newline at end of file