-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.php
50 lines (45 loc) · 1.11 KB
/
run.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
include_once 'vendor/autoload.php';
//Boot DAL
$resolver = new \Packaged\Dal\DalResolver(
new \Packaged\Config\Provider\Ini\IniConfigProvider('conf/connections.ini'),
new \Packaged\Config\Provider\Ini\IniConfigProvider('conf/datastores.ini')
);
$resolver->boot();
//Boot Eloquent
$capsule = new Illuminate\Database\Capsule\Manager;
$capsule->addConnection(
[
'driver' => 'mysql',
'host' => '127.0.0.1',
'database' => 'packaged_dal',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
]
);
$capsule->setEventDispatcher(
new \Illuminate\Events\Dispatcher(new \Illuminate\Container\Container())
);
$capsule->setAsGlobal();
$capsule->bootEloquent();
$libs = [
new \DalBench\Dal\DalPdoBench(),
new \DalBench\Dal\DalCqlBench(),
new \DalBench\Eloquent\EloquentBench(),
];
shuffle($libs);
\DalBench\Bench::$runs = 4;
\DalBench\Bench::$perRun = 1000;
/**
* @var $libs \DalBench\Bench[]
*/
foreach($libs as $lib)
{
echo "Testing " . get_class($lib) . "\n";
$lib->execute();
echo "\n";
}
echo "\n";