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
6e84d2ff
Commit
6e84d2ff
authored
Jan 06, 2016
by
Will Banfield
Committed by
Jeremy Mikola
Mar 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stream registering is now totally transparent to the user
parent
2a99015a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
Bucket.php
src/GridFS/Bucket.php
+10
-0
FunctionalTestCase.php
tests/GridFS/FunctionalTestCase.php
+0
-2
No files found.
src/GridFS/Bucket.php
View file @
6e84d2ff
...
@@ -21,6 +21,7 @@ class Bucket
...
@@ -21,6 +21,7 @@ class Bucket
private
$databaseName
;
private
$databaseName
;
private
$collectionsWrapper
;
private
$collectionsWrapper
;
private
$options
;
private
$options
;
private
static
$streamWrapper
;
/**
/**
* Constructs a GridFS bucket.
* Constructs a GridFS bucket.
*
*
...
@@ -50,6 +51,7 @@ class Bucket
...
@@ -50,6 +51,7 @@ class Bucket
$this
->
databaseName
=
(
string
)
$databaseName
;
$this
->
databaseName
=
(
string
)
$databaseName
;
$this
->
options
=
$options
;
$this
->
options
=
$options
;
$this
->
collectionsWrapper
=
new
GridFSCollectionsWrapper
(
$manager
,
$databaseName
,
$options
);
$this
->
collectionsWrapper
=
new
GridFSCollectionsWrapper
(
$manager
,
$databaseName
,
$options
);
$this
->
registerStreamWrapper
(
$manager
);
}
}
/**
/**
...
@@ -206,4 +208,12 @@ class Bucket
...
@@ -206,4 +208,12 @@ class Bucket
}
}
return
$file
;
return
$file
;
}
}
private
function
registerStreamWrapper
(
$manager
)
{
if
(
isset
(
Bucket
::
$streamWrapper
)){
return
;
}
Bucket
::
$streamWrapper
=
new
\MongoDB\GridFS\StreamWrapper
();
Bucket
::
$streamWrapper
->
register
(
$manager
);
}
}
}
tests/GridFS/FunctionalTestCase.php
View file @
6e84d2ff
...
@@ -21,8 +21,6 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
...
@@ -21,8 +21,6 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
$col
=
new
Collection
(
$this
->
manager
,
sprintf
(
"%s.%s"
,
$this
->
getDatabaseName
(),
$collection
));
$col
=
new
Collection
(
$this
->
manager
,
sprintf
(
"%s.%s"
,
$this
->
getDatabaseName
(),
$collection
));
$col
->
drop
();
$col
->
drop
();
}
}
$streamWrapper
=
new
\MongoDB\GridFS\StreamWrapper
();
$streamWrapper
->
register
(
$this
->
manager
);
$this
->
bucket
=
new
\MongoDB\GridFS\Bucket
(
$this
->
manager
,
$this
->
getDatabaseName
());
$this
->
bucket
=
new
\MongoDB\GridFS\Bucket
(
$this
->
manager
,
$this
->
getDatabaseName
());
$this
->
collectionsWrapper
=
$this
->
bucket
->
getCollectionsWrapper
();
$this
->
collectionsWrapper
=
$this
->
bucket
->
getCollectionsWrapper
();
}
}
...
...
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