示例#1
0
 function it_should_allow_multiple_clients_using_same_deployment()
 {
     $deploymentUuid = 'ae15f7c0-df1f-11e2-bfc7-7c6d628b25f7';
     $c1 = \Myna\Myna::init($deploymentUuid);
     $c2 = \Myna\Myna::init($deploymentUuid);
     $v1 = $c1->suggest('single');
     $v2 = $c2->suggest('single');
     assert(get_class($v1) === 'Myna\\Data\\Variant');
     assert(get_class($v2) === 'Myna\\Data\\Variant');
     $c1->reward('single');
     $c2->reward('single');
 }
示例#2
0
文件: index.php 项目: myna/myna-php
<!DOCTYPE html>
<html>
<head>
  <title>Myna PHP Demo</title>
</head>
<body>
  <h1>Myna PHP Demo</h1>
<?php 
require_once '../src/autoload.php';
// Turn on logging
\Myna\Log::$enabled = true;
$experimentId = '8ebfeab2-c308-413f-93ff-45beb603949a';
$deploymentUuid = 'ae15f7c0-df1f-11e2-bfc7-7c6d628b25f7';
$client = \Myna\Myna::init($deploymentUuid);
$suggestion = $client->suggest($experimentId);
echo "<p>Suggestion is {$suggestion->name}</p>";
?>
</body>
</html>