1 | <?php |
||
13 | abstract class AbstractStorageManager |
||
14 | { |
||
15 | /** |
||
16 | * @var StorageInterface|SnapshotInterface[] |
||
17 | */ |
||
18 | protected static $instances = array(); |
||
19 | |||
20 | /** |
||
21 | * Build or get an engine if already built. |
||
22 | * |
||
23 | * @param string $engine |
||
24 | * @param string $database |
||
25 | * @param string|null $host |
||
26 | * @param string|null $user |
||
27 | * @param string|null $pass |
||
28 | * @param int|null $port |
||
29 | * |
||
30 | * @return StorageInterface|SnapshotInterface |
||
31 | */ |
||
32 | final public static function instance($engine, $database, $host = null, $user = null, $pass = null, $port = null) |
||
40 | |||
41 | /** |
||
42 | * Build and register the engine. |
||
43 | * |
||
44 | * @param string $engine |
||
45 | * @param string $host |
||
46 | * @param int $port |
||
47 | * @param string $database |
||
48 | * @param string $user |
||
49 | * @param string $pass |
||
50 | * |
||
51 | * @throws InvalidArgumentException |
||
52 | */ |
||
53 | protected static function buildInstance($engine, $host, $port, $database, $user, $pass) |
||
61 | |||
62 | /** |
||
63 | * @return array |
||
64 | */ |
||
65 | protected static function supportEngines() |
||
69 | |||
70 | /** |
||
71 | * @param string $engine |
||
72 | * @param string $host |
||
73 | * @param int $port |
||
74 | * @param string $database |
||
75 | * @param string $user |
||
76 | * @param string $pass |
||
77 | * |
||
78 | * @return mixed |
||
79 | */ |
||
80 | protected static function buildEngine($engine, $host, $port, $database, $user, $pass) |
||
84 | } |
||
85 |