1 | <?php |
||
20 | class Database |
||
21 | { |
||
22 | /** |
||
23 | * MySQL driver name |
||
24 | */ |
||
25 | const DRIVER_MYSQL = 'mysql'; |
||
26 | |||
27 | /** |
||
28 | * Database handler |
||
29 | * @var \PDO |
||
30 | */ |
||
31 | private $pdo; |
||
32 | |||
33 | /** |
||
34 | * @var string|null |
||
35 | */ |
||
36 | private $driver; |
||
37 | |||
38 | /** |
||
39 | * @var Cache\ManageInterface|null |
||
40 | */ |
||
41 | private $cache; |
||
42 | |||
43 | /** |
||
44 | * @var Delay\ManageInterface|null |
||
45 | */ |
||
46 | private $delay; |
||
47 | |||
48 | /** |
||
49 | * Database constructor. |
||
50 | * |
||
51 | * @param \PDO $pdo |
||
52 | */ |
||
53 | public function __construct(\PDO $pdo) |
||
61 | |||
62 | /** |
||
63 | * Driver special treatment |
||
64 | * |
||
65 | * @return int|bool |
||
66 | */ |
||
67 | private function initialize() |
||
75 | |||
76 | /** |
||
77 | * Cache manager |
||
78 | * |
||
79 | * @return Cache\ManageInterface |
||
80 | * @throws DatabaseException |
||
81 | */ |
||
82 | public function cache() |
||
93 | |||
94 | /** |
||
95 | * Delay manager |
||
96 | * |
||
97 | * @return Delay\ManageInterface |
||
98 | * @throws DatabaseException |
||
99 | */ |
||
100 | public function delay() |
||
111 | } |
||
112 |