| @@ 20-46 (lines=27) @@ | ||
| 17 | * @author Iqbal Maulana <[email protected]> |
|
| 18 | * @created 8/23/16 |
|
| 19 | */ |
|
| 20 | class SnapshotManager extends AbstractStorageManager |
|
| 21 | { |
|
| 22 | /** |
|
| 23 | * @var SnapshotInterface[] |
|
| 24 | */ |
|
| 25 | protected static $instances = array(); |
|
| 26 | ||
| 27 | /** |
|
| 28 | * {@inheritdoc} |
|
| 29 | */ |
|
| 30 | protected static function supportEngines() |
|
| 31 | { |
|
| 32 | return array('mongodb', 'mongo'); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * {@inheritdoc} |
|
| 37 | */ |
|
| 38 | protected static function buildEngine($engine, $host, $port, $database, $user, $pass) |
|
| 39 | { |
|
| 40 | if (in_array($engine, array('mongodb', 'mongo'))) { |
|
| 41 | return new MongoSnapshot(new MongoConfig($database, $host, $user, $pass, $port)); |
|
| 42 | } |
|
| 43 | ||
| 44 | return null; |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 20-46 (lines=27) @@ | ||
| 17 | * @author Iqbal Maulana <[email protected]> |
|
| 18 | * @created 8/21/15 |
|
| 19 | */ |
|
| 20 | class StorageManager extends AbstractStorageManager |
|
| 21 | { |
|
| 22 | /** |
|
| 23 | * @var StorageInterface[] |
|
| 24 | */ |
|
| 25 | protected static $instances = array(); |
|
| 26 | ||
| 27 | /** |
|
| 28 | * {@inheritdoc} |
|
| 29 | */ |
|
| 30 | protected static function supportEngines() |
|
| 31 | { |
|
| 32 | return array('mongodb', 'mongo'); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * {@inheritdoc} |
|
| 37 | */ |
|
| 38 | protected static function buildEngine($engine, $host, $port, $database, $user, $pass) |
|
| 39 | { |
|
| 40 | if (in_array($engine, array('mongodb', 'mongo'))) { |
|
| 41 | return new MongoStorage(new MongoConfig($database, $host, $user, $pass, $port)); |
|
| 42 | } |
|
| 43 | ||
| 44 | return null; |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||