1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use Cerbero\SqlDumper\SqlDumper; |
4
|
|
|
|
5
|
|
|
if (!function_exists('ds')) { |
6
|
|
|
/** |
7
|
|
|
* Dump SQL queries executed within the given callback via the default dumper. |
8
|
|
|
* |
9
|
|
|
* @param callable $callback |
10
|
|
|
* @return mixed |
11
|
|
|
*/ |
12
|
|
|
function ds(callable $callback) |
13
|
|
|
{ |
14
|
|
|
return SqlDumper::default($callback); |
15
|
|
|
} |
16
|
|
|
} |
17
|
|
|
|
18
|
|
|
if (!function_exists('dsConsole')) { |
19
|
|
|
/** |
20
|
|
|
* Dump SQL queries executed within the given callback via the console dumper. |
21
|
|
|
* |
22
|
|
|
* @param callable $callback |
23
|
|
|
* @return mixed |
24
|
|
|
*/ |
25
|
|
|
function dsConsole(callable $callback) |
26
|
|
|
{ |
27
|
|
|
return SqlDumper::console($callback); |
28
|
|
|
} |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
if (!function_exists('dsEmail')) { |
32
|
|
|
/** |
33
|
|
|
* Dump SQL queries executed within the given callback via the email dumper. |
34
|
|
|
* |
35
|
|
|
* @param callable $callback |
36
|
|
|
* @return mixed |
37
|
|
|
*/ |
38
|
|
|
function dsEmail(callable $callback) |
39
|
|
|
{ |
40
|
|
|
return SqlDumper::email($callback); |
41
|
|
|
} |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
if (!function_exists('dsHtml')) { |
45
|
|
|
/** |
46
|
|
|
* Dump SQL queries executed within the given callback via the HTML dumper. |
47
|
|
|
* |
48
|
|
|
* @param callable $callback |
49
|
|
|
* @return mixed |
50
|
|
|
*/ |
51
|
|
|
function dsHtml(callable $callback) |
52
|
|
|
{ |
53
|
|
|
return SqlDumper::html($callback); |
54
|
|
|
} |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
if (!function_exists('dsLog')) { |
58
|
|
|
/** |
59
|
|
|
* Dump SQL queries executed within the given callback via the log dumper. |
60
|
|
|
* |
61
|
|
|
* @param callable $callback |
62
|
|
|
* @return mixed |
63
|
|
|
*/ |
64
|
|
|
function dsLog(callable $callback) |
65
|
|
|
{ |
66
|
|
|
return SqlDumper::log($callback); |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
if (!function_exists('dsMarkdown')) { |
71
|
|
|
/** |
72
|
|
|
* Dump SQL queries executed within the given callback via the markdown dumper. |
73
|
|
|
* |
74
|
|
|
* @param callable $callback |
75
|
|
|
* @return mixed |
76
|
|
|
*/ |
77
|
|
|
function dsMarkdown(callable $callback) |
78
|
|
|
{ |
79
|
|
|
return SqlDumper::markdown($callback); |
80
|
|
|
} |
81
|
|
|
} |
82
|
|
|
|