Completed
Push — master ( 8040a7...b5bbbe )
by Igor
22:35 queued 13:29
created

progress::printz()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
include_once __DIR__ . '/../include.php';
3
//
4
$config = include_once __DIR__ . '/00_config_connect.php';
5
6
7
//
8
9
class progress {
10
    public static function printz($data)
11
    {
12
        echo "CALL CLASS:   ".json_encode($data)."\n";
13
    }
14
}
15
16
$db = new ClickHouseDB\Client($config);
17
18
// need for test
19
$db->settings()->set('max_block_size', 1);
20
21
22
23
24
// ----------------------------------------  ----------------------------------------
25
$db->progressFunction(function ($data) {
26
    echo "CALL FUNCTION:".json_encode($data)."\n";
27
});
28
$st=$db->select('SELECT number,sleep(0.2) FROM system.numbers limit 5');
29
30
31
// ----------------------------------------  ----------------------------------------
32
$db->settings()->set('http_headers_progress_interval_ms', 15); // change interval
33
34
$db->progressFunction(['progress','printz']);
35
$st=$db->select('SELECT number,sleep(0.1) FROM system.numbers limit 5');