File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ public function saveChunk()
98
98
99
99
return true ;
100
100
} catch (\Exception $ e ) {
101
+ error_log ("Could not store chunk: " . $ e ->getMessage () . "\n" . $ e ->getTraceAsString ());
101
102
try {
102
103
if (isset ($ chunkQuery )) {
103
104
$ this ->config ->getGridFs ()->chunks ->remove ($ chunkQuery );
@@ -158,13 +159,13 @@ public function deleteChunks()
158
159
159
160
public function ensureIndices ()
160
161
{
161
- $ gridFs = $ this ->config ->getGridFs ();
162
+ $ chunksCollection = $ this ->config ->getGridFs ()-> chunks ;
162
163
$ indexKeys = ['files_id ' => 1 , 'n ' => 1 ];
163
164
$ indexOptions = ['unique ' => true , 'background ' => true ];
164
- if (method_exists ($ gridFs , 'createIndex ' )) { // only available for PECL mongo >= 1.5.0
165
- $ gridFs ->createIndex ($ indexKeys , $ indexOptions );
165
+ if (method_exists ($ chunksCollection , 'createIndex ' )) { // only available for PECL mongo >= 1.5.0
166
+ $ chunksCollection ->createIndex ($ indexKeys , $ indexOptions );
166
167
} else {
167
- $ gridFs ->ensureIndex ($ indexKeys , $ indexOptions );
168
+ $ chunksCollection ->ensureIndex ($ indexKeys , $ indexOptions );
168
169
}
169
170
}
170
171
You can’t perform that action at this time.
0 commit comments