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
a329df89
Commit
a329df89
authored
Sep 15, 2017
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-272: Implement chunkSizeBytes accessor for Bucket class
parent
43e3732d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
0 deletions
+52
-0
MongoDBGridFSBucket.txt
docs/reference/class/MongoDBGridFSBucket.txt
+1
-0
MongoDBGridFSBucket-getChunkSizeBytes.txt
...eference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
+29
-0
Bucket.php
src/GridFS/Bucket.php
+10
-0
BucketFunctionalTest.php
tests/GridFS/BucketFunctionalTest.php
+12
-0
No files found.
docs/reference/class/MongoDBGridFSBucket.txt
View file @
a329df89
...
@@ -42,6 +42,7 @@ Methods
...
@@ -42,6 +42,7 @@ Methods
/reference/method/MongoDBGridFSBucket-find
/reference/method/MongoDBGridFSBucket-find
/reference/method/MongoDBGridFSBucket-findOne
/reference/method/MongoDBGridFSBucket-findOne
/reference/method/MongoDBGridFSBucket-getBucketName
/reference/method/MongoDBGridFSBucket-getBucketName
/reference/method/MongoDBGridFSBucket-getChunkSizeBytes
/reference/method/MongoDBGridFSBucket-getDatabaseName
/reference/method/MongoDBGridFSBucket-getDatabaseName
/reference/method/MongoDBGridFSBucket-getFileDocumentForStream
/reference/method/MongoDBGridFSBucket-getFileDocumentForStream
/reference/method/MongoDBGridFSBucket-getFileIdForStream
/reference/method/MongoDBGridFSBucket-getFileIdForStream
...
...
docs/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
0 → 100644
View file @
a329df89
============================================
MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
============================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
Returns the chunk size of this bucket in bytes.
.. code-block:: php
function getChunkSizeBytes(): integer
Return Values
-------------
The chunk size of this bucket in bytes.
.. todo: add examples
src/GridFS/Bucket.php
View file @
a329df89
...
@@ -278,6 +278,16 @@ class Bucket
...
@@ -278,6 +278,16 @@ class Bucket
return
$this
->
bucketName
;
return
$this
->
bucketName
;
}
}
/**
* Return the chunk size in bytes.
*
* @return integer
*/
public
function
getChunkSizeBytes
()
{
return
$this
->
chunkSizeBytes
;
}
/**
/**
* Return the database name.
* Return the database name.
*
*
...
...
tests/GridFS/BucketFunctionalTest.php
View file @
a329df89
...
@@ -363,6 +363,18 @@ class BucketFunctionalTest extends FunctionalTestCase
...
@@ -363,6 +363,18 @@ class BucketFunctionalTest extends FunctionalTestCase
$this
->
assertEquals
(
'fs'
,
$this
->
bucket
->
getBucketName
());
$this
->
assertEquals
(
'fs'
,
$this
->
bucket
->
getBucketName
());
}
}
public
function
testGetChunkSizeBytesWithCustomValue
()
{
$bucket
=
new
Bucket
(
$this
->
manager
,
$this
->
getDatabaseName
(),
[
'chunkSizeBytes'
=>
8192
]);
$this
->
assertEquals
(
8192
,
$bucket
->
getChunkSizeBytes
());
}
public
function
testGetChunkSizeBytesWithDefaultValue
()
{
$this
->
assertEquals
(
261120
,
$this
->
bucket
->
getChunkSizeBytes
());
}
public
function
testGetDatabaseName
()
public
function
testGetDatabaseName
()
{
{
$this
->
assertEquals
(
$this
->
getDatabaseName
(),
$this
->
bucket
->
getDatabaseName
());
$this
->
assertEquals
(
$this
->
getDatabaseName
(),
$this
->
bucket
->
getDatabaseName
());
...
...
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