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
6cd2b405
Commit
6cd2b405
authored
Jun 07, 2016
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-197: Support non-ObjectID identifiers for GridFS files
parent
5ffd0503
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
Bucket.php
src/GridFS/Bucket.php
+10
-10
No files found.
src/GridFS/Bucket.php
View file @
6cd2b405
...
...
@@ -85,10 +85,10 @@ class Bucket
* If the files collection document is not found, this method will still
* attempt to delete orphaned chunks.
*
* @param
ObjectId $id ObjectId of the file
* @param
mixed $id File ID
* @throws FileNotFoundException
*/
public
function
delete
(
ObjectId
$id
)
public
function
delete
(
$id
)
{
$file
=
$this
->
collectionWrapper
->
findFileById
(
$id
);
$this
->
collectionWrapper
->
deleteFileAndChunksById
(
$id
);
...
...
@@ -101,11 +101,11 @@ class Bucket
/**
* Writes the contents of a GridFS file to a writable stream.
*
* @param
ObjectId $id ObjectId of the file
* @param
mixed $id File ID
* @param resource $destination Writable Stream
* @throws FileNotFoundException
*/
public
function
downloadToStream
(
ObjectId
$id
,
$destination
)
public
function
downloadToStream
(
$id
,
$destination
)
{
$file
=
$this
->
collectionWrapper
->
findFileById
(
$id
);
...
...
@@ -208,11 +208,11 @@ class Bucket
/**
* Opens a readable stream for reading a GridFS file.
*
* @param
ObjectId $id ObjectId of the file
* @param
mixed $id File ID
* @return resource
* @throws FileNotFoundException
*/
public
function
openDownloadStream
(
ObjectId
$id
)
public
function
openDownloadStream
(
$id
)
{
$file
=
$this
->
collectionWrapper
->
findFileById
(
$id
);
...
...
@@ -291,11 +291,11 @@ class Bucket
/**
* Renames the GridFS file with the specified ID.
*
* @param
ObjectId $id ID of the file to rename
* @param string
$newFilename New file name
* @param
mixed $id File ID
* @param string $newFilename New file name
* @throws FileNotFoundException
*/
public
function
rename
(
ObjectId
$id
,
$newFilename
)
public
function
rename
(
$id
,
$newFilename
)
{
$updateResult
=
$this
->
collectionWrapper
->
updateFilenameForId
(
$id
,
$newFilename
);
...
...
@@ -328,7 +328,7 @@ class Bucket
* @param string $filename File name
* @param resource $source Readable stream
* @param array $options Stream options
* @return ObjectId
* @return ObjectId
ID of the newly created GridFS file
* @throws InvalidArgumentException
*/
public
function
uploadFromStream
(
$filename
,
$source
,
array
$options
=
[])
...
...
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