Skip to content

Commit 8c41a61

Browse files
committed
config.php.example updates
1 parent 658a339 commit 8c41a61

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

config.php.example

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
11
<?php
22

33
$reviewhost = array(
4+
// Replace hostname and database in this setting
45
'dsn' => 'mysql:host=hostname:3306;dbname=database',
56
'user' => 'user',
67
'password' => 'password',
8+
// See http://www.percona.com/doc/percona-toolkit/2.0/pt-query-digest.html#cmdoption-pt-query-digest--review
79
'review_table' => 'review',
10+
// This table is optional. You don't need it, but you lose detailed stats
11+
// See http://www.percona.com/doc/percona-toolkit/2.0/pt-query-digest.html#cmdoption-pt-query-digest--review-history
812
'history_table' => 'review_history',
913
);
1014

1115
$explainhosts = array(
1216
'label1' => array(
13-
'dsn' => 'mysql:host=hostname1:3306;dbname=database1',
17+
'dsn' => 'mysql:host=hostname1:3306',
1418
'user' => 'user',
15-
'password' => 'password'
19+
'password' => 'password',
20+
// By default we scan the host to see what databases we can run a
21+
// explain on. To disable this behavour, set an array here
22+
'databases' => array(
23+
'database1',
24+
'database2',
25+
'database4'
1626
),
27+
),
1728
'label2' => array(
18-
'dsn' => 'mysql:host=hostname2:3306;dbname=database2',
29+
'dsn' => 'mysql:host=hostname2:3306',
1930
'user' => 'user',
20-
'password' => 'password'
21-
),
22-
'label3' => array(
23-
'dsn' => 'mysql:host=hostname3:3306;dbname=database3',
24-
'user' => 'user',
25-
'password' => 'password'
26-
)
31+
'password' => 'password',
32+
// You can also just set the field and keep it empty. We will scan for valid databases
33+
'databases' => array(),
34+
),
35+
// ad nauseum...
2736
);

init.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
unset($query);
88

99
foreach ($explainhosts as $label => $host) {
10-
if (!key_exists('databases', $explainhosts[$label])) {
10+
if (!key_exists('databases', $explainhosts[$label]) || !count($explainhosts[$label]['databases'])) {
1111
$ebh = new PDO($host['dsn'], $host['user'], $host['password']);
1212
$query = $ebh->prepare('SHOW DATABASES');
1313
$query->execute();

0 commit comments

Comments
 (0)