Commit 8fe879af authored by Will Banfield's avatar Will Banfield Committed by Jeremy Mikola

removed all of the unused 'use' files

parent 9d9965b6
...@@ -2,19 +2,11 @@ ...@@ -2,19 +2,11 @@
namespace MongoDB\GridFS; namespace MongoDB\GridFS;
use MongoDB\Collection; use MongoDB\Collection;
use MongoDB\Database;
use MongoDB\BSON\ObjectId; use MongoDB\BSON\ObjectId;
use MongoDB\Driver\ReadPreference;
use MongoDB\Driver\WriteConcern;
use MongoDB\Driver\Manager; use MongoDB\Driver\Manager;
use MongoDB\Exception\InvalidArgumentException;
use MongoDB\Exception\InvalidArgumentTypeException;
use MongoDB\Exception\RuntimeException;
use MongoDB\Exception\UnexpectedValueException;
/** /**
* Bucket abstracts the GridFS files and chunks collections.
*
* @api * @api
* Bucket abstracts the GridFS files and chunks collections.
*/ */
class Bucket class Bucket
{ {
......
...@@ -2,21 +2,14 @@ ...@@ -2,21 +2,14 @@
namespace MongoDB\GridFS; namespace MongoDB\GridFS;
use MongoDB\Collection; use MongoDB\Collection;
use MongoDB\Database;
use MongoDB\BSON\ObjectId;
use MongoDB\Driver\ReadPreference; use MongoDB\Driver\ReadPreference;
use MongoDB\Driver\WriteConcern; use MongoDB\Driver\WriteConcern;
use MongoDB\Driver\Manager; use MongoDB\Driver\Manager;
use MongoDB\Exception\InvalidArgumentException;
use MongoDB\Exception\InvalidArgumentTypeException; use MongoDB\Exception\InvalidArgumentTypeException;
use MongoDB\Exception\RuntimeException;
use MongoDB\Exception\UnexpectedValueException;
/** /**
* Bucket abstracts the GridFS files and chunks collections. * @internal
* * GridFSCollectionsWrapper abstracts the GridFS files and chunks collections.
*/ */
//rename to context options
class GridFSCollectionsWrapper class GridFSCollectionsWrapper
{ {
private $filesCollection; private $filesCollection;
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
namespace MongoDB\GridFS; namespace MongoDB\GridFS;
use MongoDB\Collection; use MongoDB\Collection;
use MongoDB\Exception\RuntimeException; use \MongoDB\Exception\GridFSCorruptFileException;
use MongoDB\BSON\ObjectId; use \MongoDB\Exception\InvalidArgumentTypeException;
/** /**
* @internal
* GridFSDownload abstracts the processes of downloading from a GridFSBucket * GridFSDownload abstracts the processes of downloading from a GridFSBucket
*
*/ */
class GridFsDownload class GridFsDownload
{ {
...@@ -27,7 +28,7 @@ class GridFsDownload ...@@ -27,7 +28,7 @@ class GridFsDownload
* *
* @param GridFSCollectionsWrapper $collectionsWrapper File options * @param GridFSCollectionsWrapper $collectionsWrapper File options
* @param \stdClass $file GridFS file to use * @param \stdClass $file GridFS file to use
* @throws GridFSCorruptFileException * @throws GridFSCorruptFileException, InvalidArgumentTypeException
*/ */
public function __construct( public function __construct(
GridFSCollectionsWrapper $collectionsWrapper, GridFSCollectionsWrapper $collectionsWrapper,
...@@ -52,19 +53,12 @@ class GridFsDownload ...@@ -52,19 +53,12 @@ class GridFsDownload
} }
$this->buffer = fopen('php://temp', 'w+'); $this->buffer = fopen('php://temp', 'w+');
} }
/**
* Reads data from a stream into GridFS
*
* @param Stream $source Source Stream
* @return ObjectId
*/
public function downloadToStream($destination) public function downloadToStream($destination)
{ {
while($this->advanceChunks()) { while($this->advanceChunks()) {
fwrite($destination, $this->chunksIterator->current()->data->getData()); fwrite($destination, $this->chunksIterator->current()->data->getData());
} }
} }
public function downloadNumBytes($numToRead) { public function downloadNumBytes($numToRead) {
$output = ""; $output = "";
if ($this->bufferFresh) { if ($this->bufferFresh) {
......
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
namespace MongoDB\GridFS; namespace MongoDB\GridFS;
use MongoDB\Collection; use MongoDB\Collection;
use MongoDB\Exception\RuntimeException; use MongoDB\Exception\InvalidArgumentTypeException;
use MongoDB\Exception\UnexpectedTypeException;
use MongoDB\Exception\InvalidArgumentException;
use MongoDB\BSON; use MongoDB\BSON;
/** /**
* @internal
* GridFsupload abstracts the processes of inserting into a GridFSBucket * GridFsupload abstracts the processes of inserting into a GridFSBucket
*
*/ */
class GridFsUpload class GridFsUpload
{ {
...@@ -44,7 +42,7 @@ class GridFsUpload ...@@ -44,7 +42,7 @@ class GridFsUpload
* @param GridFSCollectionsWrapper $collectionsWrapper Files Collection * @param GridFSCollectionsWrapper $collectionsWrapper Files Collection
* @param string $filename Filename to insert * @param string $filename Filename to insert
* @param array $options File options * @param array $options File options
* @throws InvalidArgumentException * @throws InvalidArgumentTypeException
*/ */
public function __construct( public function __construct(
GridFsCollectionsWrapper $collectionsWrapper, GridFsCollectionsWrapper $collectionsWrapper,
......
<?php <?php
namespace MongoDB\GridFS; namespace MongoDB\GridFS;
use MongoDB\Driver\Server;
use MongoDB\Collection; use MongoDB\Collection;
use MongoDB\Exception\InvalidArgumentException;
use MongoDB\Exception\InvalidArgumentTypeException;
use MongoDB\Exception\RuntimeException;
use MongoDB\Exception\UnexpectedValueException;
/** /**
* Stream wrapper for reading and writing a GridFS file. * Stream wrapper for reading and writing a GridFS file.
* *
* @internal * @internal
* @see MongoDB\GridFS\Bucket::openUploadStream() * @see MongoDB\GridFS\Bucket::openUploadStream(), MongoDB\GridFS\Bucket::openDownloadStream()
*/ */
class StreamWrapper class StreamWrapper
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment