|
2 | 2 |
|
3 | 3 | namespace MongoDB;
|
4 | 4 |
|
5 |
| -use MongoDB\Driver\Manager; |
6 |
| -use MongoDB\Driver\ReadPreference; |
7 | 5 | use MongoDB\Driver\Server;
|
8 |
| -use MongoDB\Driver\WriteConcern; |
9 | 6 | use MongoDB\Exception\InvalidArgumentTypeException;
|
10 |
| -use ReflectionClass; |
11 | 7 |
|
12 | 8 | /**
|
13 | 9 | * Return whether the first key in the document starts with a "$" character.
|
@@ -57,69 +53,6 @@ function is_last_pipeline_operator_out(array $pipeline)
|
57 | 53 | return key($lastOp) === '$out';
|
58 | 54 | }
|
59 | 55 |
|
60 |
| -/** |
61 |
| - * Returns a ReadPreference corresponding to the Manager's read preference. |
62 |
| - * |
63 |
| - * @internal |
64 |
| - * @todo this function can be removed once PHPC-417 is implemented |
65 |
| - * @param Manager $manager |
66 |
| - * @return ReadPreference |
67 |
| - */ |
68 |
| -function get_manager_read_preference(Manager $manager) |
69 |
| -{ |
70 |
| - $rp = $manager->getReadPreference(); |
71 |
| - |
72 |
| - if ($rp instanceof ReadPreference) { |
73 |
| - return $rp; |
74 |
| - } |
75 |
| - |
76 |
| - $args = array( |
77 |
| - $rp['mode'], |
78 |
| - ); |
79 |
| - |
80 |
| - if (isset($rp['tags'])) { |
81 |
| - $args[] = $rp['tags']; |
82 |
| - } |
83 |
| - |
84 |
| - $rc = new ReflectionClass('MongoDB\Driver\ReadPreference'); |
85 |
| - |
86 |
| - return $rc->newInstanceArgs($args); |
87 |
| -} |
88 |
| - |
89 |
| -/** |
90 |
| - * Returns a WriteConcern corresponding to the Manager's write concern. |
91 |
| - * |
92 |
| - * @internal |
93 |
| - * @todo this function can be removed once PHPC-417 is implemented |
94 |
| - * @param Manager $manager |
95 |
| - * @return WriteConcern |
96 |
| - */ |
97 |
| -function get_manager_write_concern(Manager $manager) |
98 |
| -{ |
99 |
| - $wc = $manager->getWriteConcern(); |
100 |
| - |
101 |
| - if ($wc instanceof WriteConcern) { |
102 |
| - return $wc; |
103 |
| - } |
104 |
| - |
105 |
| - $args = array( |
106 |
| - isset($wc['w']) ? $wc['w'] : -2, |
107 |
| - $wc['wtimeout'], |
108 |
| - ); |
109 |
| - |
110 |
| - if (isset($wc['journal'])) { |
111 |
| - $args[] = $wc['journal']; |
112 |
| - |
113 |
| - if (isset($wc['fsync'])) { |
114 |
| - $args[] = $wc['fsync']; |
115 |
| - } |
116 |
| - } |
117 |
| - |
118 |
| - $rc = new ReflectionClass('MongoDB\Driver\WriteConcern'); |
119 |
| - |
120 |
| - return $rc->newInstanceArgs($args); |
121 |
| -} |
122 |
| - |
123 | 56 | /**
|
124 | 57 | * Generate an index name from a key specification.
|
125 | 58 | *
|
|
0 commit comments