-
Notifications
You must be signed in to change notification settings - Fork 0
/
epo.php
69 lines (61 loc) · 1.45 KB
/
epo.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Created by JetBrains PhpStorm.
* User: savy_m
* Date: 24/05/13
* Time: 16:22
* To change this template use File | Settings | File Templates.
*/
namespace Lib;
class EPO extends \PDO
{
public $num_queries = 0;
/**
* @param $dsn
* @param null $username
* @param null $password
* @param array $driver_options
*/
public function __construct($dsn, $username = null, $password = null, array $driver_options = array())
{
parent::__construct($dsn, $username, $password, $driver_options);
}
/**
* @param string $statement
* @return int
*/
public function exec($statement)
{
PDOS::incNbQuery();
return parent::exec($statement);
}
/**
* @param string $statement
* @return \PDOStatement
*/
public function query($statement)
{
PDOS::incNbQuery();
return parent::query($statement);
}
}
class EPOStatement extends \PDOStatement
{
protected $epo;
protected function __construct(EPO $epo)
{
$this->epo = $epo;
}
/**
* @param array $input_parameters
* @return bool
*/
public function execute($input_parameters = array())
{
PDOS::incNbQuery();
if ($input_parameters == array())
return parent::execute();
else
return parent::execute($input_parameters);
}
}