Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
8a73c759
Commit
8a73c759
authored
Jan 29, 2018
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #457
parents
d3a3c4e8
371d3b82
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
7 deletions
+14
-7
ChangeStream.php
src/ChangeStream.php
+4
-2
Bucket.php
src/GridFS/Bucket.php
+1
-0
ReadableStream.php
src/GridFS/ReadableStream.php
+2
-2
StreamWrapper.php
src/GridFS/StreamWrapper.php
+2
-1
WritableStream.php
src/GridFS/WritableStream.php
+2
-1
MapReduceResult.php
src/MapReduceResult.php
+1
-0
BulkWrite.php
src/Operation/BulkWrite.php
+1
-1
ChangeStream.php
src/Operation/ChangeStream.php
+1
-0
No files found.
src/ChangeStream.php
View file @
8a73c759
...
...
@@ -17,6 +17,7 @@
namespace
MongoDB
;
use
MongoDB\BSON\Serializable
;
use
MongoDB\Driver\Cursor
;
use
MongoDB\Driver\Exception\ConnectionTimeoutException
;
use
MongoDB\Driver\Exception\RuntimeException
;
...
...
@@ -66,7 +67,7 @@ class ChangeStream implements Iterator
}
/**
* @return MongoDB\Driver\CursorId
* @return
\
MongoDB\Driver\CursorId
*/
public
function
getCursorId
()
{
...
...
@@ -144,7 +145,8 @@ class ChangeStream implements Iterator
throw
new
ResumeTokenException
(
"Cannot extract a resumeToken from an empty document"
);
}
if
(
$document
instanceof
Serializable
)
{
return
$this
->
extractResumeToken
(
$document
->
bsonSerialize
());
$this
->
extractResumeToken
(
$document
->
bsonSerialize
());
return
;
}
if
(
isset
(
$document
->
_id
))
{
$this
->
resumeToken
=
is_array
(
$document
)
?
$document
[
'_id'
]
:
$document
->
_id
;
...
...
src/GridFS/Bucket.php
View file @
8a73c759
...
...
@@ -17,6 +17,7 @@
namespace
MongoDB\GridFS
;
use
MongoDB\Collection
;
use
MongoDB\Driver\Cursor
;
use
MongoDB\Driver\Manager
;
use
MongoDB\Driver\ReadConcern
;
...
...
src/GridFS/ReadableStream.php
View file @
8a73c759
...
...
@@ -132,7 +132,7 @@ class ReadableStream
*
* Note: this method may return a string smaller than the requested length
* if data is not available to be read.
*
*
* @param integer $length Number of bytes to read
* @return string
* @throws InvalidArgumentException if $length is negative
...
...
@@ -175,7 +175,7 @@ class ReadableStream
public
function
seek
(
$offset
)
{
if
(
$offset
<
0
||
$offset
>
$this
->
file
->
length
)
{
throw
new
InvalidArgumentException
(
sprintf
(
'$offset must be >= 0 and <= %d; given: %d'
,
$length
,
$offset
));
throw
new
InvalidArgumentException
(
sprintf
(
'$offset must be >= 0 and <= %d; given: %d'
,
$
this
->
file
->
length
,
$offset
));
}
/* Compute the offsets for the chunk and buffer (i.e. chunk data) from
...
...
src/GridFS/StreamWrapper.php
View file @
8a73c759
...
...
@@ -19,6 +19,7 @@ namespace MongoDB\GridFS;
use
MongoDB\BSON\UTCDateTime
;
use
Exception
;
use
stdClass
;
/**
* Stream wrapper for reading and writing a GridFS file.
...
...
@@ -117,7 +118,7 @@ class StreamWrapper
*
* Note: this method may return a string smaller than the requested length
* if data is not available to be read.
*
*
* @see http://php.net/manual/en/streamwrapper.stream-read.php
* @param integer $length Number of bytes to read
* @return string
...
...
src/GridFS/WritableStream.php
View file @
8a73c759
...
...
@@ -22,6 +22,7 @@ use MongoDB\BSON\ObjectId;
use
MongoDB\BSON\UTCDateTime
;
use
MongoDB\Driver\Exception\RuntimeException
as
DriverRuntimeException
;
use
MongoDB\Exception\InvalidArgumentException
;
use
stdClass
;
/**
* WritableStream abstracts the process of writing a GridFS file.
...
...
@@ -48,7 +49,7 @@ class WritableStream
*
* * _id (mixed): File document identifier. Defaults to a new ObjectId.
*
* * aliases (array of strings): DEPRECATED An array of aliases.
* * aliases (array of strings): DEPRECATED An array of aliases.
* Applications wishing to store aliases should add an aliases field to
* the metadata document instead.
*
...
...
src/MapReduceResult.php
View file @
8a73c759
...
...
@@ -19,6 +19,7 @@ namespace MongoDB;
use
IteratorAggregate
;
use
stdClass
;
use
Traversable
;
/**
* Result class for mapReduce command results.
...
...
src/Operation/BulkWrite.php
View file @
8a73c759
...
...
@@ -243,7 +243,7 @@ class BulkWrite implements Executable
$this
->
isArrayFiltersUsed
=
true
;
if
(
!
is_array
(
$args
[
2
][
'arrayFilters'
]))
{
throw
InvalidArgumentException
::
I
nvalidType
(
sprintf
(
'$operations[%d]["%s"][2]["arrayFilters"]'
,
$i
,
$type
),
$args
[
2
][
'arrayFilters'
],
'array'
);
throw
InvalidArgumentException
::
i
nvalidType
(
sprintf
(
'$operations[%d]["%s"][2]["arrayFilters"]'
,
$i
,
$type
),
$args
[
2
][
'arrayFilters'
],
'array'
);
}
}
...
...
src/Operation/ChangeStream.php
View file @
8a73c759
...
...
@@ -18,6 +18,7 @@
namespace
MongoDB\Operation
;
use
MongoDB\ChangeStream
as
ChangeStreamResult
;
use
MongoDB\Driver\Command
;
use
MongoDB\Driver\Manager
;
use
MongoDB\Driver\ReadConcern
;
use
MongoDB\Driver\ReadPreference
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment