From 34577a77d32ab49a520d50e000267d1b0ca19177 Mon Sep 17 00:00:00 2001 From: gerome canals <gerome.canals@univ-lorraine.fr> Date: Fri, 11 Dec 2020 16:21:58 +0100 Subject: [PATCH] php:8.0 et php:8.0-cli added --- .gitignore | 1 + boilerplate/{test => demo}/docker-compose.yml | 67 +- boilerplate/{test => demo}/html/index.html | 0 boilerplate/{test => demo}/src/composer.json | 4 +- boilerplate/demo/src/composer.lock | 356 +++++ boilerplate/{test => demo}/src/sample.php | 0 boilerplate/{test => demo}/web/index-cli.php | 0 boilerplate/{test => demo}/web/index.html | 0 boilerplate/{test => demo}/web/index.php | 0 boilerplate/{test => demo}/web/info.php | 0 boilerplate/{test => demo}/web/mail.php | 0 boilerplate/{test => demo}/web/mongo.php | 0 boilerplate/{test => demo}/web/mysql.php | 0 ...-compose.yml => sample.docker-compose.yml} | 2 +- boilerplate/test/src/composer.lock | 130 -- boilerplate/test/src/vendor/autoload.php | 7 - .../test/src/vendor/composer/ClassLoader.php | 445 ------ boilerplate/test/src/vendor/composer/LICENSE | 21 - .../src/vendor/composer/autoload_classmap.php | 9 - .../src/vendor/composer/autoload_files.php | 11 - .../vendor/composer/autoload_namespaces.php | 9 - .../src/vendor/composer/autoload_psr4.php | 11 - .../src/vendor/composer/autoload_real.php | 70 - .../src/vendor/composer/autoload_static.php | 44 - .../test/src/vendor/composer/installed.json | 118 -- .../src/vendor/mongodb/mongodb/.gitignore | 8 - .../src/vendor/mongodb/mongodb/.travis.yml | 63 - .../vendor/mongodb/mongodb/CONTRIBUTING.md | 185 --- .../test/src/vendor/mongodb/mongodb/LICENSE | 202 --- .../test/src/vendor/mongodb/mongodb/Makefile | 17 - .../test/src/vendor/mongodb/mongodb/README.md | 45 - .../src/vendor/mongodb/mongodb/composer.json | 26 - .../mongodb/mongodb/docs/.static/.mongodb | 0 .../mongodb/docs/images/save-flowchart.png | Bin 47851 -> 0 bytes ...Client-method-construct-driverOptions.yaml | 115 -- ...-MongoDBClient-method-construct-param.yaml | 51 - ...goDBClient-method-dropDatabase-option.yaml | 19 - ...ngoDBClient-method-dropDatabase-param.yaml | 10 - ...piargs-MongoDBClient-method-get-param.yaml | 6 - ...oDBClient-method-listDatabases-option.yaml | 4 - ...goDBClient-method-listDatabases-param.yaml | 4 - ...Client-method-selectCollection-option.yaml | 27 - ...BClient-method-selectCollection-param.yaml | 16 - ...DBClient-method-selectDatabase-option.yaml | 27 - ...oDBClient-method-selectDatabase-param.yaml | 10 - ...iargs-MongoDBCollection-common-option.yaml | 82 -- ...piargs-MongoDBCollection-common-param.yaml | 31 - ...oDBCollection-method-aggregate-option.yaml | 77 - ...goDBCollection-method-aggregate-param.yaml | 14 - ...oDBCollection-method-bulkWrite-option.yaml | 23 - ...goDBCollection-method-bulkWrite-param.yaml | 37 - ...oDBCollection-method-construct-option.yaml | 25 - ...goDBCollection-method-construct-param.yaml | 16 - ...MongoDBCollection-method-count-option.yaml | 44 - ...-MongoDBCollection-method-count-param.yaml | 11 - ...BCollection-method-createIndex-option.yaml | 84 -- ...DBCollection-method-createIndex-param.yaml | 20 - ...ollection-method-createIndexes-option.yaml | 7 - ...Collection-method-createIndexes-param.yaml | 23 - ...DBCollection-method-deleteMany-option.yaml | 8 - ...oDBCollection-method-deleteMany-param.yaml | 11 - ...oDBCollection-method-deleteOne-option.yaml | 8 - ...goDBCollection-method-deleteOne-param.yaml | 11 - ...goDBCollection-method-distinct-option.yaml | 16 - ...ngoDBCollection-method-distinct-param.yaml | 20 - ...-MongoDBCollection-method-drop-option.yaml | 13 - ...s-MongoDBCollection-method-drop-param.yaml | 4 - ...oDBCollection-method-dropIndex-option.yaml | 13 - ...goDBCollection-method-dropIndex-param.yaml | 15 - ...BCollection-method-dropIndexes-option.yaml | 13 - ...DBCollection-method-dropIndexes-param.yaml | 4 - ...-MongoDBCollection-method-find-option.yaml | 146 -- ...s-MongoDBCollection-method-find-param.yaml | 11 - ...ngoDBCollection-method-findOne-option.yaml | 42 - ...ongoDBCollection-method-findOne-param.yaml | 11 - ...ection-method-findOneAndDelete-option.yaml | 29 - ...lection-method-findOneAndDelete-param.yaml | 11 - ...ction-method-findOneAndReplace-option.yaml | 50 - ...ection-method-findOneAndReplace-param.yaml | 15 - ...ection-method-findOneAndUpdate-option.yaml | 50 - ...lection-method-findOneAndUpdate-param.yaml | 15 - ...DBCollection-method-insertMany-option.yaml | 12 - ...oDBCollection-method-insertMany-param.yaml | 13 - ...oDBCollection-method-insertOne-option.yaml | 8 - ...goDBCollection-method-insertOne-param.yaml | 13 - ...BCollection-method-listIndexes-option.yaml | 4 - ...DBCollection-method-listIndexes-param.yaml | 4 - ...DBCollection-method-replaceOne-option.yaml | 16 - ...oDBCollection-method-replaceOne-param.yaml | 15 - ...DBCollection-method-updateMany-option.yaml | 16 - ...oDBCollection-method-updateMany-param.yaml | 15 - ...oDBCollection-method-updateOne-option.yaml | 16 - ...goDBCollection-method-updateOne-param.yaml | 15 - ...BCollection-method-withOptions-option.yaml | 27 - ...DBCollection-method-withOptions-param.yaml | 4 - ...apiargs-MongoDBDatabase-common-option.yaml | 16 - ...MongoDBDatabase-method-command-option.yaml | 11 - ...-MongoDBDatabase-method-command-param.yaml | 13 - ...ngoDBDatabase-method-construct-option.yaml | 25 - ...ongoDBDatabase-method-construct-param.yaml | 12 - ...tabase-method-createCollection-option.yaml | 230 --- ...atabase-method-createCollection-param.yaml | 10 - ...gs-MongoDBDatabase-method-drop-option.yaml | 13 - ...rgs-MongoDBDatabase-method-drop-param.yaml | 4 - ...Database-method-dropCollection-option.yaml | 13 - ...BDatabase-method-dropCollection-param.yaml | 10 - ...args-MongoDBDatabase-method-get-param.yaml | 6 - ...atabase-method-listCollections-option.yaml | 15 - ...Database-method-listCollections-param.yaml | 4 - ...tabase-method-selectCollection-option.yaml | 27 - ...atabase-method-selectCollection-param.yaml | 10 - ...base-method-selectGridFSBucket-option.yaml | 46 - ...abase-method-selectGridFSBucket-param.yaml | 4 - ...oDBDatabase-method-withOptions-option.yaml | 27 - ...goDBDatabase-method-withOptions-param.yaml | 4 - ...rgs-MongoDBGridFSBucket-common-option.yaml | 50 - ...args-MongoDBGridFSBucket-common-param.yaml | 39 - ...BGridFSBucket-method-construct-option.yaml | 44 - ...DBGridFSBucket-method-construct-param.yaml | 12 - ...ngoDBGridFSBucket-method-delete-param.yaml | 6 - ...SBucket-method-downloadToStream-param.yaml | 10 - ...-method-downloadToStreamByName-option.yaml | 4 - ...t-method-downloadToStreamByName-param.yaml | 14 - ...ongoDBGridFSBucket-method-find-option.yaml | 72 - ...oDBGridFSBucket-method-findOne-option.yaml | 42 - ...method-getFileDocumentForStream-param.yaml | 4 - ...ucket-method-getFileIdForStream-param.yaml | 4 - ...ucket-method-openDownloadStream-param.yaml | 6 - ...ethod-openDownloadStreamByName-option.yaml | 4 - ...method-openDownloadStreamByName-param.yaml | 10 - ...Bucket-method-openUploadStream-option.yaml | 12 - ...SBucket-method-openUploadStream-param.yaml | 10 - ...ngoDBGridFSBucket-method-rename-param.yaml | 15 - ...Bucket-method-uploadFromStream-option.yaml | 12 - ...SBucket-method-uploadFromStream-param.yaml | 19 - .../docs/includes/apiargs-common-option.yaml | 64 - .../docs/includes/apiargs-common-param.yaml | 41 - .../includes/extracts-bulkwriteexception.yaml | 21 - .../mongodb/docs/includes/extracts-error.yaml | 52 - .../mongodb/docs/includes/extracts-note.yaml | 12 - .../src/vendor/mongodb/mongodb/docs/index.txt | 61 - .../src/vendor/mongodb/mongodb/docs/pretty.js | 4 - .../vendor/mongodb/mongodb/docs/reference.txt | 17 - .../mongodb/mongodb/docs/reference/bson.txt | 246 ---- .../docs/reference/class/MongoDBClient.txt | 37 - .../reference/class/MongoDBCollection.txt | 89 -- .../docs/reference/class/MongoDBDatabase.txt | 58 - .../reference/class/MongoDBGridFSBucket.txt | 52 - .../docs/reference/enumeration-classes.txt | 161 --- .../docs/reference/exception-classes.txt | 140 -- ...MongoDBBulkWriteResult-getDeletedCount.txt | 42 - ...ongoDBBulkWriteResult-getInsertedCount.txt | 42 - .../MongoDBBulkWriteResult-getInsertedIds.txt | 38 - ...MongoDBBulkWriteResult-getMatchedCount.txt | 51 - ...ongoDBBulkWriteResult-getModifiedCount.txt | 54 - ...ongoDBBulkWriteResult-getUpsertedCount.txt | 42 - .../MongoDBBulkWriteResult-getUpsertedIds.txt | 46 - .../MongoDBBulkWriteResult-isAcknowledged.txt | 34 - .../method/MongoDBClient-dropDatabase.txt | 78 - .../method/MongoDBClient-getManager.txt | 35 - .../method/MongoDBClient-listDatabases.txt | 84 -- .../method/MongoDBClient-selectCollection.txt | 83 -- .../method/MongoDBClient-selectDatabase.txt | 82 -- .../method/MongoDBClient__construct.txt | 143 -- .../reference/method/MongoDBClient__get.txt | 69 - .../method/MongoDBCollection-aggregate.txt | 69 - .../method/MongoDBCollection-bulkWrite.txt | 64 - .../method/MongoDBCollection-count.txt | 56 - .../method/MongoDBCollection-createIndex.txt | 109 -- .../MongoDBCollection-createIndexes.txt | 100 -- .../method/MongoDBCollection-deleteMany.txt | 82 -- .../method/MongoDBCollection-deleteOne.txt | 84 -- .../method/MongoDBCollection-distinct.txt | 262 ---- .../method/MongoDBCollection-drop.txt | 81 -- .../method/MongoDBCollection-dropIndex.txt | 81 -- .../method/MongoDBCollection-dropIndexes.txt | 84 -- .../method/MongoDBCollection-find.txt | 168 --- .../method/MongoDBCollection-findOne.txt | 103 -- .../MongoDBCollection-findOneAndDelete.txt | 98 -- .../MongoDBCollection-findOneAndReplace.txt | 145 -- .../MongoDBCollection-findOneAndUpdate.txt | 109 -- .../MongoDBCollection-getCollectionName.txt | 51 - .../MongoDBCollection-getDatabaseName.txt | 52 - .../method/MongoDBCollection-getManager.txt | 35 - .../method/MongoDBCollection-getNamespace.txt | 52 - .../method/MongoDBCollection-insertMany.txt | 107 -- .../method/MongoDBCollection-insertOne.txt | 91 -- .../method/MongoDBCollection-listIndexes.txt | 111 -- .../method/MongoDBCollection-replaceOne.txt | 93 -- .../method/MongoDBCollection-updateMany.txt | 83 -- .../method/MongoDBCollection-updateOne.txt | 85 -- .../method/MongoDBCollection-withOptions.txt | 61 - .../method/MongoDBCollection__construct.txt | 54 - .../method/MongoDBDatabase-command.txt | 155 -- .../MongoDBDatabase-createCollection.txt | 99 -- .../reference/method/MongoDBDatabase-drop.txt | 78 - .../method/MongoDBDatabase-dropCollection.txt | 80 -- .../MongoDBDatabase-getDatabaseName.txt | 44 - .../method/MongoDBDatabase-getManager.txt | 35 - .../MongoDBDatabase-listCollections.txt | 121 -- .../MongoDBDatabase-selectCollection.txt | 83 -- .../MongoDBDatabase-selectGridFSBucket.txt | 80 -- .../method/MongoDBDatabase-withOptions.txt | 61 - .../method/MongoDBDatabase__construct.txt | 50 - .../reference/method/MongoDBDatabase__get.txt | 69 - .../MongoDBDeleteResult-getDeletedCount.txt | 40 - .../MongoDBDeleteResult-isAcknowledged.txt | 34 - .../method/MongoDBGridFSBucket-delete.txt | 40 - .../MongoDBGridFSBucket-downloadToStream.txt | 43 - ...oDBGridFSBucket-downloadToStreamByName.txt | 47 - .../method/MongoDBGridFSBucket-drop.txt | 29 - .../method/MongoDBGridFSBucket-find.txt | 55 - .../method/MongoDBGridFSBucket-findOne.txt | 58 - .../MongoDBGridFSBucket-getBucketName.txt | 29 - .../MongoDBGridFSBucket-getDatabaseName.txt | 29 - ...BGridFSBucket-getFileDocumentForStream.txt | 45 - ...MongoDBGridFSBucket-getFileIdForStream.txt | 46 - ...MongoDBGridFSBucket-openDownloadStream.txt | 46 - ...BGridFSBucket-openDownloadStreamByName.txt | 50 - .../MongoDBGridFSBucket-openUploadStream.txt | 48 - .../method/MongoDBGridFSBucket-rename.txt | 34 - .../MongoDBGridFSBucket-uploadFromStream.txt | 51 - .../method/MongoDBGridFSBucket__construct.txt | 50 - ...ngoDBInsertManyResult-getInsertedCount.txt | 40 - ...MongoDBInsertManyResult-getInsertedIds.txt | 36 - ...MongoDBInsertManyResult-isAcknowledged.txt | 34 - ...ongoDBInsertOneResult-getInsertedCount.txt | 41 - .../MongoDBInsertOneResult-getInsertedId.txt | 35 - .../MongoDBInsertOneResult-isAcknowledged.txt | 34 - ...ongoDBModelCollectionInfo-getCappedMax.txt | 39 - ...ngoDBModelCollectionInfo-getCappedSize.txt | 40 - .../MongoDBModelCollectionInfo-getName.txt | 34 - .../MongoDBModelCollectionInfo-getOptions.txt | 36 - .../MongoDBModelCollectionInfo-isCapped.txt | 37 - .../MongoDBModelDatabaseInfo-getName.txt | 34 - ...MongoDBModelDatabaseInfo-getSizeOnDisk.txt | 33 - .../MongoDBModelDatabaseInfo-isEmpty.txt | 33 - .../method/MongoDBModelIndexInfo-getKey.txt | 36 - .../method/MongoDBModelIndexInfo-getName.txt | 37 - .../MongoDBModelIndexInfo-getNamespace.txt | 36 - .../MongoDBModelIndexInfo-getVersion.txt | 34 - .../method/MongoDBModelIndexInfo-isSparse.txt | 37 - .../method/MongoDBModelIndexInfo-isTtl.txt | 37 - .../method/MongoDBModelIndexInfo-isUnique.txt | 37 - .../MongoDBUpdateResult-getMatchedCount.txt | 49 - .../MongoDBUpdateResult-getModifiedCount.txt | 52 - .../MongoDBUpdateResult-getUpsertedCount.txt | 42 - .../MongoDBUpdateResult-getUpsertedId.txt | 44 - .../MongoDBUpdateResult-isAcknowledged.txt | 34 - .../docs/reference/write-result-classes.txt | 143 -- .../vendor/mongodb/mongodb/docs/tutorial.txt | 14 - .../mongodb/docs/tutorial/collation.txt | 373 ----- .../mongodb/docs/tutorial/commands.txt | 325 ----- .../mongodb/mongodb/docs/tutorial/crud.txt | 727 ---------- .../mongodb/docs/tutorial/decimal128.txt | 124 -- .../mongodb/docs/tutorial/example-data.txt | 42 - .../mongodb/mongodb/docs/tutorial/gridfs.txt | 214 --- .../mongodb/mongodb/docs/tutorial/indexes.txt | 133 -- .../docs/tutorial/install-php-library.txt | 58 - .../vendor/mongodb/mongodb/docs/upgrade.txt | 260 ---- .../vendor/mongodb/mongodb/phpunit.xml.dist | 28 - .../mongodb/mongodb/src/BulkWriteResult.php | 189 --- .../src/vendor/mongodb/mongodb/src/Client.php | 215 --- .../vendor/mongodb/mongodb/src/Collection.php | 864 ------------ .../vendor/mongodb/mongodb/src/Database.php | 361 ----- .../mongodb/mongodb/src/DeleteResult.php | 72 - .../src/Exception/BadMethodCallException.php | 43 - .../mongodb/src/Exception/Exception.php | 22 - .../Exception/InvalidArgumentException.php | 34 - .../src/Exception/RuntimeException.php | 22 - .../Exception/UnexpectedValueException.php | 22 - .../src/Exception/UnsupportedException.php | 51 - .../mongodb/mongodb/src/GridFS/Bucket.php | 588 -------- .../mongodb/src/GridFS/CollectionWrapper.php | 318 ----- .../GridFS/Exception/CorruptFileException.php | 58 - .../Exception/FileNotFoundException.php | 50 - .../mongodb/src/GridFS/ReadableStream.php | 235 ---- .../mongodb/src/GridFS/StreamWrapper.php | 262 ---- .../mongodb/src/GridFS/WritableStream.php | 252 ---- .../mongodb/mongodb/src/InsertManyResult.php | 91 -- .../mongodb/mongodb/src/InsertOneResult.php | 93 -- .../mongodb/mongodb/src/Model/BSONArray.php | 89 -- .../mongodb/src/Model/BSONDocument.php | 96 -- .../mongodb/src/Model/CollectionInfo.php | 105 -- .../Model/CollectionInfoCommandIterator.php | 46 - .../src/Model/CollectionInfoIterator.php | 38 - .../Model/CollectionInfoLegacyIterator.php | 110 -- .../mongodb/src/Model/DatabaseInfo.php | 84 -- .../src/Model/DatabaseInfoIterator.php | 38 - .../src/Model/DatabaseInfoLegacyIterator.php | 97 -- .../mongodb/mongodb/src/Model/IndexInfo.php | 186 --- .../mongodb/src/Model/IndexInfoIterator.php | 38 - .../src/Model/IndexInfoIteratorIterator.php | 48 - .../mongodb/mongodb/src/Model/IndexInput.php | 99 -- .../src/Model/TypeMapArrayIterator.php | 59 - .../mongodb/src/Operation/Aggregate.php | 291 ---- .../mongodb/src/Operation/BulkWrite.php | 329 ----- .../mongodb/mongodb/src/Operation/Count.php | 188 --- .../src/Operation/CreateCollection.php | 220 --- .../mongodb/src/Operation/CreateIndexes.php | 173 --- .../mongodb/src/Operation/DatabaseCommand.php | 95 -- .../mongodb/mongodb/src/Operation/Delete.php | 121 -- .../mongodb/src/Operation/DeleteMany.php | 73 - .../mongodb/src/Operation/DeleteOne.php | 73 - .../mongodb/src/Operation/Distinct.php | 165 --- .../mongodb/src/Operation/DropCollection.php | 128 -- .../mongodb/src/Operation/DropDatabase.php | 112 -- .../mongodb/src/Operation/DropIndexes.php | 126 -- .../mongodb/src/Operation/Executable.php | 39 - .../mongodb/mongodb/src/Operation/Find.php | 265 ---- .../mongodb/src/Operation/FindAndModify.php | 248 ---- .../mongodb/mongodb/src/Operation/FindOne.php | 110 -- .../src/Operation/FindOneAndDelete.php | 104 -- .../src/Operation/FindOneAndReplace.php | 144 -- .../src/Operation/FindOneAndUpdate.php | 144 -- .../mongodb/src/Operation/InsertMany.php | 137 -- .../mongodb/src/Operation/InsertOne.php | 107 -- .../mongodb/src/Operation/ListCollections.php | 143 -- .../mongodb/src/Operation/ListDatabases.php | 92 -- .../mongodb/src/Operation/ListIndexes.php | 141 -- .../mongodb/src/Operation/ReplaceOne.php | 94 -- .../mongodb/mongodb/src/Operation/Update.php | 162 --- .../mongodb/src/Operation/UpdateMany.php | 94 -- .../mongodb/src/Operation/UpdateOne.php | 94 -- .../mongodb/mongodb/src/UpdateResult.php | 140 -- .../vendor/mongodb/mongodb/src/functions.php | 228 --- .../mongodb/tests/ClientFunctionalTest.php | 100 -- .../mongodb/mongodb/tests/ClientTest.php | 163 --- .../Collection/CollectionFunctionalTest.php | 203 --- .../Collection/CrudSpecFunctionalTest.php | 353 ----- .../tests/Collection/FunctionalTestCase.php | 34 - .../spec-tests/read/aggregate-collation.json | 38 - .../spec-tests/read/aggregate-out.json | 70 - .../Collection/spec-tests/read/aggregate.json | 53 - .../spec-tests/read/count-collation.json | 29 - .../Collection/spec-tests/read/count.json | 60 - .../spec-tests/read/distinct-collation.json | 33 - .../Collection/spec-tests/read/distinct.json | 55 - .../spec-tests/read/find-collation.json | 34 - .../Collection/spec-tests/read/find.json | 105 -- .../write/deleteMany-collation.json | 47 - .../spec-tests/write/deleteMany.json | 76 - .../spec-tests/write/deleteOne-collation.json | 51 - .../spec-tests/write/deleteOne.json | 96 -- .../write/findOneAndDelete-collation.json | 59 - .../spec-tests/write/findOneAndDelete.json | 127 -- .../write/findOneAndReplace-collation.json | 58 - .../write/findOneAndReplace-upsert.json | 201 --- .../findOneAndReplace-upsert_pre_2.6.json | 161 --- .../spec-tests/write/findOneAndReplace.json | 273 ---- .../write/findOneAndUpdate-collation.json | 67 - .../spec-tests/write/findOneAndUpdate.json | 379 ----- .../spec-tests/write/insertMany.json | 52 - .../spec-tests/write/insertOne.json | 39 - .../write/replaceOne-collation.json | 53 - .../spec-tests/write/replaceOne-pre_2.6.json | 179 --- .../spec-tests/write/replaceOne-upsert.json | 104 -- .../spec-tests/write/replaceOne.json | 205 --- .../write/updateMany-collation.json | 62 - .../spec-tests/write/updateMany-pre_2.6.json | 179 --- .../spec-tests/write/updateMany.json | 183 --- .../spec-tests/write/updateOne-collation.json | 54 - .../spec-tests/write/updateOne-pre_2.6.json | 163 --- .../spec-tests/write/updateOne.json | 167 --- .../CollectionManagementFunctionalTest.php | 117 -- .../tests/Database/DatabaseFunctionalTest.php | 297 ---- .../tests/Database/FunctionalTestCase.php | 22 - .../mongodb/tests/FunctionalTestCase.php | 141 -- .../mongodb/mongodb/tests/FunctionsTest.php | 164 --- .../tests/GridFS/BucketFunctionalTest.php | 741 ---------- .../tests/GridFS/FunctionalTestCase.php | 58 - .../GridFS/ReadableStreamFunctionalTest.php | 180 --- .../tests/GridFS/SpecFunctionalTest.php | 359 ----- .../GridFS/StreamWrapperFunctionalTest.php | 135 -- .../GridFS/WritableStreamFunctionalTest.php | 108 -- .../tests/GridFS/spec-tests/delete.json | 316 ----- .../tests/GridFS/spec-tests/download.json | 445 ------ .../GridFS/spec-tests/download_by_name.json | 255 ---- .../tests/GridFS/spec-tests/upload.json | 391 ------ .../mongodb/tests/Model/BSONArrayTest.php | 50 - .../mongodb/tests/Model/BSONDocumentTest.php | 58 - .../tests/Model/CollectionInfoTest.php | 53 - .../mongodb/tests/Model/DatabaseInfoTest.php | 42 - .../mongodb/tests/Model/IndexInfoTest.php | 145 -- .../mongodb/tests/Model/IndexInputTest.php | 100 -- .../Operation/AggregateFunctionalTest.php | 89 -- .../mongodb/tests/Operation/AggregateTest.php | 110 -- .../Operation/BulkWriteFunctionalTest.php | 308 ---- .../mongodb/tests/Operation/BulkWriteTest.php | 432 ------ .../mongodb/tests/Operation/CountTest.php | 66 - .../tests/Operation/CreateCollectionTest.php | 80 -- .../Operation/CreateIndexesFunctionalTest.php | 195 --- .../tests/Operation/CreateIndexesTest.php | 60 - .../tests/Operation/DatabaseCommandTest.php | 41 - .../tests/Operation/DeleteFunctionalTest.php | 94 -- .../mongodb/tests/Operation/DeleteTest.php | 56 - .../mongodb/tests/Operation/DistinctTest.php | 49 - .../DropCollectionFunctionalTest.php | 58 - .../tests/Operation/DropCollectionTest.php | 32 - .../Operation/DropDatabaseFunctionalTest.php | 64 - .../tests/Operation/DropDatabaseTest.php | 32 - .../Operation/DropIndexesFunctionalTest.php | 101 -- .../tests/Operation/DropIndexesTest.php | 40 - .../Operation/FindAndModifyFunctionalTest.php | 77 - .../tests/Operation/FindAndModifyTest.php | 81 -- .../tests/Operation/FindFunctionalTest.php | 73 - .../tests/Operation/FindOneAndDeleteTest.php | 37 - .../tests/Operation/FindOneAndReplaceTest.php | 73 - .../tests/Operation/FindOneAndUpdateTest.php | 73 - .../tests/Operation/FindOneFunctionalTest.php | 61 - .../mongodb/tests/Operation/FindTest.php | 107 -- .../tests/Operation/FunctionalTestCase.php | 32 - .../Operation/InsertManyFunctionalTest.php | 73 - .../tests/Operation/InsertManyTest.php | 64 - .../Operation/InsertOneFunctionalTest.php | 88 -- .../mongodb/tests/Operation/InsertOneTest.php | 41 - .../ListCollectionsFunctionalTest.php | 46 - .../tests/Operation/ListDatabasesTest.php | 28 - .../Operation/ListIndexesFunctionalTest.php | 46 - .../tests/Operation/ListIndexesTest.php | 28 - .../tests/Operation/ReplaceOneTest.php | 63 - .../mongodb/tests/Operation/TestCase.php | 12 - .../tests/Operation/UpdateFunctionalTest.php | 199 --- .../tests/Operation/UpdateManyTest.php | 63 - .../mongodb/tests/Operation/UpdateOneTest.php | 63 - .../mongodb/tests/Operation/UpdateTest.php | 64 - .../mongodb/mongodb/tests/PedantryTest.php | 79 -- .../vendor/mongodb/mongodb/tests/TestCase.php | 150 -- .../mongodb/mongodb/tests/bootstrap.php | 11 - .../swiftmailer/swiftmailer/.gitattributes | 9 - .../swiftmailer/.github/ISSUE_TEMPLATE.md | 19 - .../.github/PULL_REQUEST_TEMPLATE.md | 14 - .../vendor/swiftmailer/swiftmailer/.gitignore | 8 - .../swiftmailer/swiftmailer/.php_cs.dist | 15 - .../swiftmailer/swiftmailer/.travis.yml | 31 - .../vendor/swiftmailer/swiftmailer/CHANGES | 272 ---- .../vendor/swiftmailer/swiftmailer/LICENSE | 19 - .../src/vendor/swiftmailer/swiftmailer/README | 15 - .../vendor/swiftmailer/swiftmailer/VERSION | 1 - .../swiftmailer/swiftmailer/composer.json | 37 - .../swiftmailer/swiftmailer/doc/headers.rst | 739 ---------- .../swiftmailer/doc/help-resources.rst | 44 - .../swiftmailer/doc/including-the-files.rst | 46 - .../swiftmailer/swiftmailer/doc/index.rst | 16 - .../swiftmailer/doc/installing.rst | 89 -- .../swiftmailer/doc/introduction.rst | 135 -- .../swiftmailer/swiftmailer/doc/japanese.rst | 22 - .../swiftmailer/swiftmailer/doc/messages.rst | 1058 -------------- .../swiftmailer/swiftmailer/doc/overview.rst | 159 --- .../swiftmailer/swiftmailer/doc/plugins.rst | 385 ----- .../swiftmailer/swiftmailer/doc/sending.rst | 571 -------- .../swiftmailer/doc/uml/Encoders.graffle | Bin 3503 -> 0 bytes .../swiftmailer/doc/uml/Mime.graffle | Bin 5575 -> 0 bytes .../swiftmailer/doc/uml/Transports.graffle | Bin 3061 -> 0 bytes .../swiftmailer/lib/classes/Swift.php | 80 -- .../lib/classes/Swift/Attachment.php | 71 - .../AbstractFilterableInputStream.php | 181 --- .../Swift/ByteStream/ArrayByteStream.php | 182 --- .../Swift/ByteStream/FileByteStream.php | 231 --- .../ByteStream/TemporaryFileByteStream.php | 42 - .../lib/classes/Swift/CharacterReader.php | 67 - .../GenericFixedWidthReader.php | 97 -- .../Swift/CharacterReader/UsAsciiReader.php | 84 -- .../Swift/CharacterReader/Utf8Reader.php | 176 --- .../classes/Swift/CharacterReaderFactory.php | 26 - .../SimpleCharacterReaderFactory.php | 124 -- .../lib/classes/Swift/CharacterStream.php | 89 -- .../CharacterStream/ArrayCharacterStream.php | 293 ---- .../CharacterStream/NgCharacterStream.php | 267 ---- .../lib/classes/Swift/ConfigurableSpool.php | 63 - .../lib/classes/Swift/DependencyContainer.php | 373 ----- .../lib/classes/Swift/DependencyException.php | 27 - .../lib/classes/Swift/EmbeddedFile.php | 69 - .../swiftmailer/lib/classes/Swift/Encoder.php | 28 - .../classes/Swift/Encoder/Base64Encoder.php | 58 - .../lib/classes/Swift/Encoder/QpEncoder.php | 300 ---- .../classes/Swift/Encoder/Rfc2231Encoder.php | 92 -- .../lib/classes/Swift/Encoding.php | 62 - .../lib/classes/Swift/Events/CommandEvent.php | 65 - .../classes/Swift/Events/CommandListener.php | 24 - .../lib/classes/Swift/Events/Event.php | 38 - .../classes/Swift/Events/EventDispatcher.php | 83 -- .../classes/Swift/Events/EventListener.php | 18 - .../lib/classes/Swift/Events/EventObject.php | 63 - .../classes/Swift/Events/ResponseEvent.php | 65 - .../classes/Swift/Events/ResponseListener.php | 24 - .../lib/classes/Swift/Events/SendEvent.php | 129 -- .../lib/classes/Swift/Events/SendListener.php | 31 - .../Swift/Events/SimpleEventDispatcher.php | 156 -- .../Swift/Events/TransportChangeEvent.php | 27 - .../Swift/Events/TransportChangeListener.php | 45 - .../Swift/Events/TransportExceptionEvent.php | 46 - .../Events/TransportExceptionListener.php | 24 - .../lib/classes/Swift/FailoverTransport.php | 45 - .../lib/classes/Swift/FileSpool.php | 208 --- .../lib/classes/Swift/FileStream.php | 24 - .../lib/classes/Swift/Filterable.php | 32 - .../swiftmailer/lib/classes/Swift/Image.php | 57 - .../lib/classes/Swift/InputByteStream.php | 75 - .../lib/classes/Swift/IoException.php | 29 - .../lib/classes/Swift/KeyCache.php | 105 -- .../classes/Swift/KeyCache/ArrayKeyCache.php | 206 --- .../classes/Swift/KeyCache/DiskKeyCache.php | 321 ----- .../Swift/KeyCache/KeyCacheInputStream.php | 51 - .../classes/Swift/KeyCache/NullKeyCache.php | 115 -- .../KeyCache/SimpleKeyCacheInputStream.php | 127 -- .../classes/Swift/LoadBalancedTransport.php | 45 - .../lib/classes/Swift/MailTransport.php | 47 - .../swiftmailer/lib/classes/Swift/Mailer.php | 114 -- .../Swift/Mailer/ArrayRecipientIterator.php | 55 - .../Swift/Mailer/RecipientIterator.php | 32 - .../lib/classes/Swift/MemorySpool.php | 110 -- .../swiftmailer/lib/classes/Swift/Message.php | 289 ---- .../lib/classes/Swift/Mime/Attachment.php | 149 -- .../classes/Swift/Mime/CharsetObserver.php | 24 - .../lib/classes/Swift/Mime/ContentEncoder.php | 34 - .../ContentEncoder/Base64ContentEncoder.php | 104 -- .../ContentEncoder/NativeQpContentEncoder.php | 123 -- .../ContentEncoder/PlainContentEncoder.php | 162 --- .../Mime/ContentEncoder/QpContentEncoder.php | 134 -- .../ContentEncoder/QpContentEncoderProxy.php | 98 -- .../Mime/ContentEncoder/RawContentEncoder.php | 64 - .../lib/classes/Swift/Mime/EmbeddedFile.php | 45 - .../classes/Swift/Mime/EncodingObserver.php | 24 - .../lib/classes/Swift/Mime/Grammar.php | 176 --- .../lib/classes/Swift/Mime/Header.php | 93 -- .../lib/classes/Swift/Mime/HeaderEncoder.php | 24 - .../HeaderEncoder/Base64HeaderEncoder.php | 55 - .../Mime/HeaderEncoder/QpHeaderEncoder.php | 65 - .../lib/classes/Swift/Mime/HeaderFactory.php | 78 - .../lib/classes/Swift/Mime/HeaderSet.php | 169 --- .../Swift/Mime/Headers/AbstractHeader.php | 501 ------- .../classes/Swift/Mime/Headers/DateHeader.php | 125 -- .../Mime/Headers/IdentificationHeader.php | 180 --- .../Swift/Mime/Headers/MailboxHeader.php | 351 ----- .../Swift/Mime/Headers/OpenDKIMHeader.php | 133 -- .../Mime/Headers/ParameterizedHeader.php | 258 ---- .../classes/Swift/Mime/Headers/PathHeader.php | 143 -- .../Swift/Mime/Headers/UnstructuredHeader.php | 112 -- .../lib/classes/Swift/Mime/Message.php | 223 --- .../lib/classes/Swift/Mime/MimeEntity.php | 117 -- .../lib/classes/Swift/Mime/MimePart.php | 212 --- .../Swift/Mime/ParameterizedHeader.php | 34 - .../Swift/Mime/SimpleHeaderFactory.php | 193 --- .../classes/Swift/Mime/SimpleHeaderSet.php | 414 ------ .../lib/classes/Swift/Mime/SimpleMessage.php | 655 --------- .../classes/Swift/Mime/SimpleMimeEntity.php | 846 ----------- .../lib/classes/Swift/MimePart.php | 59 - .../lib/classes/Swift/NullTransport.php | 36 - .../lib/classes/Swift/OutputByteStream.php | 46 - .../classes/Swift/Plugins/AntiFloodPlugin.php | 141 -- .../Swift/Plugins/BandwidthMonitorPlugin.php | 164 --- .../Swift/Plugins/Decorator/Replacements.php | 31 - .../classes/Swift/Plugins/DecoratorPlugin.php | 204 --- .../Swift/Plugins/ImpersonatePlugin.php | 69 - .../lib/classes/Swift/Plugins/Logger.php | 36 - .../classes/Swift/Plugins/LoggerPlugin.php | 142 -- .../Swift/Plugins/Loggers/ArrayLogger.php | 72 - .../Swift/Plugins/Loggers/EchoLogger.php | 58 - .../classes/Swift/Plugins/MessageLogger.php | 74 - .../Swift/Plugins/Pop/Pop3Connection.php | 31 - .../Swift/Plugins/Pop/Pop3Exception.php | 27 - .../Swift/Plugins/PopBeforeSmtpPlugin.php | 273 ---- .../Swift/Plugins/RedirectingPlugin.php | 213 --- .../lib/classes/Swift/Plugins/Reporter.php | 32 - .../classes/Swift/Plugins/ReporterPlugin.php | 61 - .../Swift/Plugins/Reporters/HitReporter.php | 59 - .../Swift/Plugins/Reporters/HtmlReporter.php | 39 - .../lib/classes/Swift/Plugins/Sleeper.php | 24 - .../classes/Swift/Plugins/ThrottlerPlugin.php | 200 --- .../lib/classes/Swift/Plugins/Timer.php | 24 - .../lib/classes/Swift/Preferences.php | 100 -- .../Swift/ReplacementFilterFactory.php | 27 - .../classes/Swift/RfcComplianceException.php | 27 - .../lib/classes/Swift/SendmailTransport.php | 45 - .../lib/classes/Swift/SignedMessage.php | 23 - .../swiftmailer/lib/classes/Swift/Signer.php | 20 - .../lib/classes/Swift/Signers/BodySigner.php | 33 - .../lib/classes/Swift/Signers/DKIMSigner.php | 712 ---------- .../classes/Swift/Signers/DomainKeySigner.php | 524 ------- .../classes/Swift/Signers/HeaderSigner.php | 65 - .../classes/Swift/Signers/OpenDKIMSigner.php | 190 --- .../lib/classes/Swift/Signers/SMimeSigner.php | 436 ------ .../lib/classes/Swift/SmtpTransport.php | 58 - .../swiftmailer/lib/classes/Swift/Spool.php | 53 - .../lib/classes/Swift/SpoolTransport.php | 47 - .../lib/classes/Swift/StreamFilter.php | 35 - .../ByteArrayReplacementFilter.php | 170 --- .../StreamFilters/StringReplacementFilter.php | 70 - .../StringReplacementFilterFactory.php | 45 - .../lib/classes/Swift/SwiftException.php | 29 - .../lib/classes/Swift/Transport.php | 54 - .../Swift/Transport/AbstractSmtpTransport.php | 499 ------- .../Esmtp/Auth/CramMd5Authenticator.php | 81 -- .../Esmtp/Auth/LoginAuthenticator.php | 51 - .../Esmtp/Auth/NTLMAuthenticator.php | 725 ---------- .../Esmtp/Auth/PlainAuthenticator.php | 50 - .../Esmtp/Auth/XOAuth2Authenticator.php | 70 - .../Swift/Transport/Esmtp/AuthHandler.php | 263 ---- .../Swift/Transport/Esmtp/Authenticator.php | 35 - .../classes/Swift/Transport/EsmtpHandler.php | 86 -- .../Swift/Transport/EsmtpTransport.php | 411 ------ .../Swift/Transport/FailoverTransport.php | 88 -- .../lib/classes/Swift/Transport/IoBuffer.php | 67 - .../Swift/Transport/LoadBalancedTransport.php | 183 --- .../classes/Swift/Transport/MailInvoker.php | 32 - .../classes/Swift/Transport/MailTransport.php | 297 ---- .../classes/Swift/Transport/NullTransport.php | 93 -- .../Swift/Transport/SendmailTransport.php | 160 --- .../Swift/Transport/SimpleMailInvoker.php | 39 - .../lib/classes/Swift/Transport/SmtpAgent.php | 36 - .../Swift/Transport/SpoolTransport.php | 117 -- .../classes/Swift/Transport/StreamBuffer.php | 325 ----- .../lib/classes/Swift/TransportException.php | 29 - .../lib/classes/Swift/Validate.php | 43 - .../lib/dependency_maps/cache_deps.php | 23 - .../lib/dependency_maps/message_deps.php | 9 - .../lib/dependency_maps/mime_deps.php | 123 -- .../lib/dependency_maps/transport_deps.php | 76 - .../swiftmailer/lib/mime_types.php | 1007 ------------- .../swiftmailer/lib/preferences.php | 25 - .../swiftmailer/lib/swift_init.php | 28 - .../swiftmailer/lib/swift_required.php | 30 - .../swiftmailer/lib/swift_required_pear.php | 30 - .../lib/swiftmailer_generate_mimes_config.php | 193 --- .../swiftmailer/swiftmailer/phpunit.xml.dist | 39 - .../tests/IdenticalBinaryConstraint.php | 62 - .../swiftmailer/tests/StreamCollector.php | 11 - .../tests/SwiftMailerSmokeTestCase.php | 46 - .../swiftmailer/tests/SwiftMailerTestCase.php | 34 - .../_samples/charsets/iso-2022-jp/one.txt | 11 - .../_samples/charsets/iso-8859-1/one.txt | 19 - .../tests/_samples/charsets/utf-8/one.txt | 22 - .../tests/_samples/charsets/utf-8/three.txt | 45 - .../tests/_samples/charsets/utf-8/two.txt | 3 - .../tests/_samples/dkim/dkim.test.priv | 15 - .../tests/_samples/dkim/dkim.test.pub | 6 - .../swiftmailer/tests/_samples/files/data.txt | 1 - .../tests/_samples/files/swiftmailer.png | Bin 3194 -> 0 bytes .../tests/_samples/files/textfile.zip | Bin 202 -> 0 bytes .../swiftmailer/tests/_samples/smime/CA.srl | 1 - .../swiftmailer/tests/_samples/smime/ca.crt | 21 - .../swiftmailer/tests/_samples/smime/ca.key | 27 - .../tests/_samples/smime/create-cert.sh | 40 - .../tests/_samples/smime/encrypt.crt | 19 - .../tests/_samples/smime/encrypt.key | 27 - .../tests/_samples/smime/encrypt2.crt | 19 - .../tests/_samples/smime/encrypt2.key | 27 - .../tests/_samples/smime/intermediate.crt | 19 - .../tests/_samples/smime/intermediate.key | 27 - .../swiftmailer/tests/_samples/smime/sign.crt | 19 - .../swiftmailer/tests/_samples/smime/sign.key | 27 - .../tests/_samples/smime/sign2.crt | 19 - .../tests/_samples/smime/sign2.key | 27 - .../tests/acceptance.conf.php.default | 37 - .../Swift/AttachmentAcceptanceTest.php | 12 - .../FileByteStreamAcceptanceTest.php | 162 --- ...leCharacterReaderFactoryAcceptanceTest.php | 179 --- .../DependencyContainerAcceptanceTest.php | 24 - .../Swift/EmbeddedFileAcceptanceTest.php | 12 - .../Encoder/Base64EncoderAcceptanceTest.php | 45 - .../Swift/Encoder/QpEncoderAcceptanceTest.php | 54 - .../Encoder/Rfc2231EncoderAcceptanceTest.php | 50 - .../Swift/EncodingAcceptanceTest.php | 30 - .../KeyCache/ArrayKeyCacheAcceptanceTest.php | 173 --- .../KeyCache/DiskKeyCacheAcceptanceTest.php | 173 --- .../Swift/MessageAcceptanceTest.php | 55 - .../Swift/Mime/AttachmentAcceptanceTest.php | 123 -- .../Base64ContentEncoderAcceptanceTest.php | 56 - .../NativeQpContentEncoderAcceptanceTest.php | 88 -- .../PlainContentEncoderAcceptanceTest.php | 88 -- .../QpContentEncoderAcceptanceTest.php | 160 --- .../Swift/Mime/EmbeddedFileAcceptanceTest.php | 136 -- .../Base64HeaderEncoderAcceptanceTest.php | 32 - .../Swift/Mime/MimePartAcceptanceTest.php | 127 -- .../Mime/SimpleMessageAcceptanceTest.php | 1249 ----------------- .../Swift/MimePartAcceptanceTest.php | 15 - .../AbstractStreamBufferAcceptanceTest.php | 131 -- .../BasicSocketAcceptanceTest.php | 33 - .../StreamBuffer/ProcessAcceptanceTest.php | 26 - .../StreamBuffer/SocketTimeoutTest.php | 67 - .../StreamBuffer/SslSocketAcceptanceTest.php | 40 - .../StreamBuffer/TlsSocketAcceptanceTest.php | 39 - .../swiftmailer/tests/bootstrap.php | 21 - .../tests/bug/Swift/Bug111Test.php | 42 - .../tests/bug/Swift/Bug118Test.php | 20 - .../tests/bug/Swift/Bug206Test.php | 38 - .../tests/bug/Swift/Bug274Test.php | 21 - .../swiftmailer/tests/bug/Swift/Bug34Test.php | 75 - .../swiftmailer/tests/bug/Swift/Bug35Test.php | 73 - .../swiftmailer/tests/bug/Swift/Bug38Test.php | 192 --- .../tests/bug/Swift/Bug518Test.php | 38 - .../swiftmailer/tests/bug/Swift/Bug51Test.php | 110 -- .../tests/bug/Swift/Bug534Test.php | 38 - .../tests/bug/Swift/Bug650Test.php | 36 - .../swiftmailer/tests/bug/Swift/Bug71Test.php | 20 - .../swiftmailer/tests/bug/Swift/Bug76Test.php | 71 - ...FileByteStreamConsecutiveReadCallsTest.php | 19 - .../tests/fixtures/MimeEntityFixture.php | 67 - .../swiftmailer/tests/smoke.conf.php.default | 63 - .../smoke/Swift/Smoke/AttachmentSmokeTest.php | 33 - .../smoke/Swift/Smoke/BasicSmokeTest.php | 23 - .../Smoke/HtmlWithAttachmentSmokeTest.php | 31 - .../Swift/Smoke/InternationalSmokeTest.php | 40 - .../Swift/ByteStream/ArrayByteStreamTest.php | 201 --- .../GenericFixedWidthReaderTest.php | 43 - .../CharacterReader/UsAsciiReaderTest.php | 52 - .../Swift/CharacterReader/Utf8ReaderTest.php | 65 - .../ArrayCharacterStreamTest.php | 358 ----- .../unit/Swift/DependencyContainerTest.php | 176 --- .../unit/Swift/Encoder/Base64EncoderTest.php | 173 --- .../unit/Swift/Encoder/QpEncoderTest.php | 400 ------ .../unit/Swift/Encoder/Rfc2231EncoderTest.php | 141 -- .../unit/Swift/Events/CommandEventTest.php | 34 - .../unit/Swift/Events/EventObjectTest.php | 32 - .../unit/Swift/Events/ResponseEventTest.php | 38 - .../tests/unit/Swift/Events/SendEventTest.php | 97 -- .../Events/SimpleEventDispatcherTest.php | 142 -- .../Swift/Events/TransportChangeEventTest.php | 30 - .../Events/TransportExceptionEventTest.php | 41 - .../unit/Swift/KeyCache/ArrayKeyCacheTest.php | 240 ---- .../SimpleKeyCacheInputStreamTest.php | 73 - .../Mailer/ArrayRecipientIteratorTest.php | 42 - .../tests/unit/Swift/MailerTest.php | 145 -- .../tests/unit/Swift/MessageTest.php | 129 -- .../Swift/Mime/AbstractMimeEntityTest.php | 1092 -------------- .../tests/unit/Swift/Mime/AttachmentTest.php | 318 ----- .../Base64ContentEncoderTest.php | 323 ----- .../PlainContentEncoderTest.php | 171 --- .../ContentEncoder/QpContentEncoderTest.php | 516 ------- .../unit/Swift/Mime/EmbeddedFileTest.php | 55 - .../HeaderEncoder/Base64HeaderEncoderTest.php | 13 - .../HeaderEncoder/QpHeaderEncoderTest.php | 221 --- .../Swift/Mime/Headers/DateHeaderTest.php | 69 - .../Mime/Headers/IdentificationHeaderTest.php | 189 --- .../Swift/Mime/Headers/MailboxHeaderTest.php | 327 ----- .../Mime/Headers/ParameterizedHeaderTest.php | 398 ------ .../Swift/Mime/Headers/PathHeaderTest.php | 77 - .../Mime/Headers/UnstructuredHeaderTest.php | 355 ----- .../tests/unit/Swift/Mime/MimePartTest.php | 231 --- .../Swift/Mime/SimpleHeaderFactoryTest.php | 166 --- .../unit/Swift/Mime/SimpleHeaderSetTest.php | 737 ---------- .../unit/Swift/Mime/SimpleMessageTest.php | 827 ----------- .../unit/Swift/Mime/SimpleMimeEntityTest.php | 9 - .../Swift/Plugins/AntiFloodPluginTest.php | 93 -- .../Plugins/BandwidthMonitorPluginTest.php | 128 -- .../Swift/Plugins/DecoratorPluginTest.php | 267 ---- .../unit/Swift/Plugins/LoggerPluginTest.php | 188 --- .../Swift/Plugins/Loggers/ArrayLoggerTest.php | 65 - .../Swift/Plugins/Loggers/EchoLoggerTest.php | 24 - .../Swift/Plugins/PopBeforeSmtpPluginTest.php | 101 -- .../Swift/Plugins/RedirectingPluginTest.php | 183 --- .../unit/Swift/Plugins/ReporterPluginTest.php | 86 -- .../Plugins/Reporters/HitReporterTest.php | 64 - .../Plugins/Reporters/HtmlReporterTest.php | 54 - .../Swift/Plugins/ThrottlerPluginTest.php | 102 -- .../unit/Swift/Signers/DKIMSignerTest.php | 225 --- .../unit/Swift/Signers/OpenDKIMSignerTest.php | 45 - .../unit/Swift/Signers/SMimeSignerTest.php | 554 -------- .../ByteArrayReplacementFilterTest.php | 129 -- .../StringReplacementFilterFactoryTest.php | 36 - .../StringReplacementFilterTest.php | 59 - .../AbstractSmtpEventSupportTest.php | 558 -------- .../unit/Swift/Transport/AbstractSmtpTest.php | 1249 ----------------- .../Esmtp/Auth/CramMd5AuthenticatorTest.php | 64 - .../Esmtp/Auth/LoginAuthenticatorTest.php | 64 - .../Esmtp/Auth/NTLMAuthenticatorTest.php | 213 --- .../Esmtp/Auth/PlainAuthenticatorTest.php | 67 - .../Swift/Transport/Esmtp/AuthHandlerTest.php | 165 --- .../EsmtpTransport/ExtensionSupportTest.php | 529 ------- .../Swift/Transport/EsmtpTransportTest.php | 297 ---- .../Swift/Transport/FailoverTransportTest.php | 518 ------- .../Transport/LoadBalancedTransportTest.php | 749 ---------- .../Swift/Transport/MailTransportTest.php | 533 ------- .../Swift/Transport/SendmailTransportTest.php | 151 -- .../unit/Swift/Transport/StreamBufferTest.php | 43 - php/7.4-cli/Dockerfile | 2 +- php/8.0-cli/Dockerfile | 46 + php/8.0-cli/README.md | 5 + php/8.0-cli/php.ini | 1089 ++++++++++++++ php/8.0/Dockerfile | 49 + php/8.0/README.md | 5 + php/8.0/config-vhost | 18 + php/8.0/create_vhost | 159 +++ php/8.0/php.ini | 1084 ++++++++++++++ php/8.0/start | 6 + 786 files changed, 2855 insertions(+), 82760 deletions(-) rename boilerplate/{test => demo}/docker-compose.yml (74%) rename boilerplate/{test => demo}/html/index.html (100%) rename boilerplate/{test => demo}/src/composer.json (79%) create mode 100644 boilerplate/demo/src/composer.lock rename boilerplate/{test => demo}/src/sample.php (100%) rename boilerplate/{test => demo}/web/index-cli.php (100%) rename boilerplate/{test => demo}/web/index.html (100%) rename boilerplate/{test => demo}/web/index.php (100%) rename boilerplate/{test => demo}/web/info.php (100%) rename boilerplate/{test => demo}/web/mail.php (100%) rename boilerplate/{test => demo}/web/mongo.php (100%) rename boilerplate/{test => demo}/web/mysql.php (100%) rename boilerplate/{docker-compose.yml => sample.docker-compose.yml} (98%) delete mode 100644 boilerplate/test/src/composer.lock delete mode 100644 boilerplate/test/src/vendor/autoload.php delete mode 100644 boilerplate/test/src/vendor/composer/ClassLoader.php delete mode 100644 boilerplate/test/src/vendor/composer/LICENSE delete mode 100644 boilerplate/test/src/vendor/composer/autoload_classmap.php delete mode 100644 boilerplate/test/src/vendor/composer/autoload_files.php delete mode 100644 boilerplate/test/src/vendor/composer/autoload_namespaces.php delete mode 100644 boilerplate/test/src/vendor/composer/autoload_psr4.php delete mode 100644 boilerplate/test/src/vendor/composer/autoload_real.php delete mode 100644 boilerplate/test/src/vendor/composer/autoload_static.php delete mode 100644 boilerplate/test/src/vendor/composer/installed.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/.gitignore delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/.travis.yml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/CONTRIBUTING.md delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/LICENSE delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/Makefile delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/README.md delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/composer.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/.static/.mongodb delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/images/save-flowchart.png delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-construct-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-get-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-common-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-common-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-construct-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-construct-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-count-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-count-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-distinct-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-distinct-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-drop-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-drop-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-find-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-find-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOne-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOne-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-common-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-command-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-command-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-construct-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-construct-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-drop-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-drop-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-get-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-common-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-common-option.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-common-param.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-bulkwriteexception.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-error.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-note.yaml delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/index.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/pretty.js delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/bson.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBClient.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBCollection.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBDatabase.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBGridFSBucket.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/enumeration-classes.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/exception-classes.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-dropDatabase.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-getManager.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-listDatabases.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-selectCollection.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-selectDatabase.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient__construct.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient__get.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-aggregate.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-bulkWrite.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-count.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-createIndex.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-createIndexes.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-deleteMany.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-deleteOne.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-distinct.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-drop.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-dropIndex.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-dropIndexes.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-find.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOne.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndDelete.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndReplace.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndUpdate.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getCollectionName.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getDatabaseName.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getManager.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getNamespace.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-insertMany.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-insertOne.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-listIndexes.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-replaceOne.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-updateMany.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-updateOne.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-withOptions.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection__construct.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-command.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-createCollection.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-drop.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-dropCollection.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-getDatabaseName.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-getManager.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-listCollections.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-selectCollection.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-selectGridFSBucket.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-withOptions.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase__construct.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase__get.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDeleteResult-getDeletedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDeleteResult-isAcknowledged.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-delete.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-downloadToStream.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-drop.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-find.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-findOne.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getBucketName.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getDatabaseName.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openDownloadStream.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openUploadStream.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-rename.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-uploadFromStream.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket__construct.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-getInsertedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-getInsertedIds.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-isAcknowledged.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-getInsertedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-getInsertedId.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-isAcknowledged.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getName.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getOptions.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-isCapped.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-getName.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getKey.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getName.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getNamespace.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getVersion.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isSparse.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isTtl.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isUnique.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getMatchedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getModifiedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getUpsertedCount.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getUpsertedId.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-isAcknowledged.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/write-result-classes.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/collation.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/commands.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/crud.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/decimal128.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/example-data.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/gridfs.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/indexes.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/install-php-library.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/docs/upgrade.txt delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/phpunit.xml.dist delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/BulkWriteResult.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Client.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Collection.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Database.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/DeleteResult.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/BadMethodCallException.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/Exception.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/InvalidArgumentException.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/RuntimeException.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/UnexpectedValueException.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/UnsupportedException.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Bucket.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/CollectionWrapper.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Exception/CorruptFileException.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Exception/FileNotFoundException.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/ReadableStream.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/StreamWrapper.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/WritableStream.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/InsertManyResult.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/InsertOneResult.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/BSONArray.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/BSONDocument.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfo.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoCommandIterator.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoIterator.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoLegacyIterator.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfo.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfoIterator.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfoLegacyIterator.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfo.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfoIterator.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfoIteratorIterator.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInput.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Model/TypeMapArrayIterator.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Aggregate.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/BulkWrite.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Count.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/CreateCollection.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/CreateIndexes.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DatabaseCommand.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Delete.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DeleteMany.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DeleteOne.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Distinct.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropCollection.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropDatabase.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropIndexes.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Executable.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Find.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindAndModify.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOne.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndDelete.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndReplace.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndUpdate.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/InsertMany.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/InsertOne.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListCollections.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListDatabases.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListIndexes.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ReplaceOne.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Update.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/UpdateMany.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/UpdateOne.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/UpdateResult.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/src/functions.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/ClientFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/ClientTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/CollectionFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/CrudSpecFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/FunctionalTestCase.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate-out.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/count-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/count.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/distinct-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/distinct.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/find-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/find.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteMany-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteMany.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteOne-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteOne.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndDelete-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndDelete.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-upsert.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-upsert_pre_2.6.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndUpdate-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndUpdate.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/insertMany.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/insertOne.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-pre_2.6.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-upsert.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany-pre_2.6.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne-collation.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne-pre_2.6.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/CollectionManagementFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/DatabaseFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/FunctionalTestCase.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/FunctionalTestCase.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/FunctionsTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/BucketFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/FunctionalTestCase.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/ReadableStreamFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/SpecFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/StreamWrapperFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/WritableStreamFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/delete.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/download.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/download_by_name.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/upload.json delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/BSONArrayTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/BSONDocumentTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/CollectionInfoTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/DatabaseInfoTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/IndexInfoTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/IndexInputTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/AggregateFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/AggregateTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/BulkWriteFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/BulkWriteTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CountTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateCollectionTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateIndexesFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateIndexesTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DatabaseCommandTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DeleteFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DeleteTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DistinctTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropCollectionFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropCollectionTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropDatabaseFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropDatabaseTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropIndexesFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropIndexesTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindAndModifyFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindAndModifyTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndDeleteTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndReplaceTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndUpdateTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FunctionalTestCase.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertManyFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertManyTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertOneFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertOneTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListCollectionsFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListDatabasesTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListIndexesFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListIndexesTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ReplaceOneTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/TestCase.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateFunctionalTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateManyTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateOneTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/PedantryTest.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/TestCase.php delete mode 100644 boilerplate/test/src/vendor/mongodb/mongodb/tests/bootstrap.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/.gitattributes delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/.github/ISSUE_TEMPLATE.md delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/.gitignore delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/.php_cs.dist delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/.travis.yml delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/CHANGES delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/LICENSE delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/README delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/VERSION delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/composer.json delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/headers.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/help-resources.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/including-the-files.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/index.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/installing.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/introduction.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/japanese.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/messages.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/overview.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/plugins.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/sending.rst delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/uml/Encoders.graffle delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/uml/Mime.graffle delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/uml/Transports.graffle delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/EmbeddedFile.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Base64Encoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoding.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/Event.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventListener.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventObject.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendEvent.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionEvent.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FailoverTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Filterable.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Image.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/IoException.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/NullKeyCache.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MailTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Grammar.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Header.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderFactory.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderSet.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Message.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimeEntity.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ParameterizedHeader.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/AntiFloodPlugin.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/DecoratorPlugin.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Exception.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Preferences.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/RfcComplianceException.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SendmailTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SignedMessage.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signer.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpHandler.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/LoadBalancedTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailInvoker.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SimpleMailInvoker.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SpoolTransport.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Validate.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/cache_deps.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/mime_types.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/preferences.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_init.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_required.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_required_pear.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/phpunit.xml.dist delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/IdenticalBinaryConstraint.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/StreamCollector.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/SwiftMailerSmokeTestCase.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/SwiftMailerTestCase.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-2022-jp/one.txt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-8859-1/one.txt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/one.txt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/three.txt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/two.txt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/dkim/dkim.test.priv delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/dkim/dkim.test.pub delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/files/data.txt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/files/swiftmailer.png delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/files/textfile.zip delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/CA.srl delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.crt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.key delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/create-cert.sh delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.crt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.key delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.crt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.key delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.crt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.key delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.crt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.key delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.crt delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.key delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance.conf.php.default delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/AttachmentAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/ByteStream/FileByteStreamAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Base64EncoderAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EncodingAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bootstrap.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug518Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug534Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug650Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/fixtures/MimeEntityFixture.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MessageTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/AntiFloodPluginTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/DKIMSignerTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/OpenDKIMSignerTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/SMimeSignerTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/MailTransportTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php delete mode 100644 boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php create mode 100644 php/8.0-cli/Dockerfile create mode 100644 php/8.0-cli/README.md create mode 100644 php/8.0-cli/php.ini create mode 100644 php/8.0/Dockerfile create mode 100644 php/8.0/README.md create mode 100755 php/8.0/config-vhost create mode 100755 php/8.0/create_vhost create mode 100644 php/8.0/php.ini create mode 100755 php/8.0/start diff --git a/.gitignore b/.gitignore index f3412c6..8d9f273 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ crashlytics.properties crashlytics-build.properties fabric.properties +/boilerplate/demo/src/vendor/ diff --git a/boilerplate/test/docker-compose.yml b/boilerplate/demo/docker-compose.yml similarity index 74% rename from boilerplate/test/docker-compose.yml rename to boilerplate/demo/docker-compose.yml index 0ac57bf..3342e49 100644 --- a/boilerplate/test/docker-compose.yml +++ b/boilerplate/demo/docker-compose.yml @@ -6,13 +6,13 @@ networks: services: web: - image: canals/php:7.4 + image: canals/php:8.0 environment: - VHOST_HOSTNAME=web.test.local - VHOST_DOCROOT=/var/www/web ports: - - "5080:80" - - "5543:443" + - "5180:80" + - "5443:443" volumes : - ./web:/var/www/web - ./src:/var/www/src @@ -21,14 +21,14 @@ services: working_dir: /var/www/src links : - mysql:db - - postgres:pg - - mongo:mongo - - mail:mail +# - postgres:pg +# - mongo:mongo +# - mail:mail networks: - local_network php: - image: canals/php:7.4-cli + image: canals/php:8.0-cli expose: - "8000" ports: @@ -52,7 +52,6 @@ services: mysql: #image: mysql:5.6 image: mariadb:latest - container_name: mysql_test environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_USER=user @@ -74,31 +73,31 @@ services: ################################## # postgres + adminer ################################### - postgres: - image: postgres - environment : - - POSTGRES_PASSWORD=pgroot - - POSTGRES_USER=pguser - ports: - - "5432:5432" - networks: - - local_network +# postgres: +# image: postgres +# environment : +# - POSTGRES_PASSWORD=pgroot +# - POSTGRES_USER=pguser +# ports: +# - "5432:5432" +# networks: +# - local_network - adminer-pg: - image: adminer - ports: - - "8088:8080" - links: - - postgres:db - networks: - - local_network +# adminer-pg: +# image: adminer +# ports: +# - "8088:8080" +# links: +# - postgres:db +# networks: +# - local_network ################################################ # mongodb & mongo-express ############################################### mongo: - image: mongo:3.4 + image: mongo:latest ports: - 27017:27017 networks: @@ -116,17 +115,17 @@ services: ############################################## # mailcatcher : so useful ! ############################################## - mail: - image: schickling/mailcatcher - container_name: mail_test - ports: - - "1080:1080" - networks: - - local_network +# mail: +# image: schickling/mailcatcher +# container_name: mail_test +# ports: +# - "1080:1080" +# networks: +# - local_network ######################################## # shared storage : useful for, e.g. sharing # uploaded documents (img, others) between multiple services ######################################## volumes: - data: \ No newline at end of file + data: diff --git a/boilerplate/test/html/index.html b/boilerplate/demo/html/index.html similarity index 100% rename from boilerplate/test/html/index.html rename to boilerplate/demo/html/index.html diff --git a/boilerplate/test/src/composer.json b/boilerplate/demo/src/composer.json similarity index 79% rename from boilerplate/test/src/composer.json rename to boilerplate/demo/src/composer.json index 980d9f0..f7d3e9d 100644 --- a/boilerplate/test/src/composer.json +++ b/boilerplate/demo/src/composer.json @@ -1,6 +1,6 @@ { "require" : { - "mongodb/mongodb" : "1.1.*", + "mongodb/mongodb" : "^1.8", "swiftmailer/swiftmailer": "5.4.*" }, @@ -10,4 +10,4 @@ } } -} \ No newline at end of file +} diff --git a/boilerplate/demo/src/composer.lock b/boilerplate/demo/src/composer.lock new file mode 100644 index 0000000..e94aa77 --- /dev/null +++ b/boilerplate/demo/src/composer.lock @@ -0,0 +1,356 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "36a2b35c58a5b49561f22d67c89c7c85", + "packages": [ + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.1", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-11-11T10:22:58+00:00" + }, + { + "name": "jean85/pretty-package-versions", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "a917488320c20057da87f67d0d40543dd9427f7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/a917488320c20057da87f67d0d40543dd9427f7a", + "reference": "a917488320c20057da87f67d0d40543dd9427f7a", + "shasum": "" + }, + "require": { + "composer/package-versions-deprecated": "^1.8.0", + "php": "^7.0|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^8.5|^9.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "support": { + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/1.5.1" + }, + "time": "2020-09-14T08:43:34+00:00" + }, + { + "name": "mongodb/mongodb", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/mongodb/mongo-php-library.git", + "reference": "953dbc19443aa9314c44b7217a16873347e6840d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/953dbc19443aa9314c44b7217a16873347e6840d", + "reference": "953dbc19443aa9314c44b7217a16873347e6840d", + "shasum": "" + }, + "require": { + "ext-hash": "*", + "ext-json": "*", + "ext-mongodb": "^1.8.1", + "jean85/pretty-package-versions": "^1.2", + "php": "^7.0 || ^8.0", + "symfony/polyfill-php80": "^1.19" + }, + "require-dev": { + "squizlabs/php_codesniffer": "^3.5, <3.5.5", + "symfony/phpunit-bridge": "5.x-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-4": { + "MongoDB\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Andreas Braun", + "email": "andreas.braun@mongodb.com" + }, + { + "name": "Jeremy Mikola", + "email": "jmikola@gmail.com" + } + ], + "description": "MongoDB driver library", + "homepage": "https://jira.mongodb.org/browse/PHPLIB", + "keywords": [ + "database", + "driver", + "mongodb", + "persistence" + ], + "support": { + "issues": "https://github.com/mongodb/mongo-php-library/issues", + "source": "https://github.com/mongodb/mongo-php-library/tree/1.8.0" + }, + "time": "2020-11-25T12:26:02+00:00" + }, + { + "name": "swiftmailer/swiftmailer", + "version": "v5.4.12", + "source": { + "type": "git", + "url": "https://github.com/swiftmailer/swiftmailer.git", + "reference": "181b89f18a90f8925ef805f950d47a7190e9b950" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/181b89f18a90f8925ef805f950d47a7190e9b950", + "reference": "181b89f18a90f8925ef805f950d47a7190e9b950", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "mockery/mockery": "~0.9.1", + "symfony/phpunit-bridge": "~3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.4-dev" + } + }, + "autoload": { + "files": [ + "lib/swift_required.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Corbyn" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Swiftmailer, free feature-rich PHP mailer", + "homepage": "https://swiftmailer.symfony.com", + "keywords": [ + "email", + "mail", + "mailer" + ], + "support": { + "issues": "https://github.com/swiftmailer/swiftmailer/issues", + "source": "https://github.com/swiftmailer/swiftmailer/tree/v5.4.12" + }, + "time": "2018-07-31T09:26:32+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de", + "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/boilerplate/test/src/sample.php b/boilerplate/demo/src/sample.php similarity index 100% rename from boilerplate/test/src/sample.php rename to boilerplate/demo/src/sample.php diff --git a/boilerplate/test/web/index-cli.php b/boilerplate/demo/web/index-cli.php similarity index 100% rename from boilerplate/test/web/index-cli.php rename to boilerplate/demo/web/index-cli.php diff --git a/boilerplate/test/web/index.html b/boilerplate/demo/web/index.html similarity index 100% rename from boilerplate/test/web/index.html rename to boilerplate/demo/web/index.html diff --git a/boilerplate/test/web/index.php b/boilerplate/demo/web/index.php similarity index 100% rename from boilerplate/test/web/index.php rename to boilerplate/demo/web/index.php diff --git a/boilerplate/test/web/info.php b/boilerplate/demo/web/info.php similarity index 100% rename from boilerplate/test/web/info.php rename to boilerplate/demo/web/info.php diff --git a/boilerplate/test/web/mail.php b/boilerplate/demo/web/mail.php similarity index 100% rename from boilerplate/test/web/mail.php rename to boilerplate/demo/web/mail.php diff --git a/boilerplate/test/web/mongo.php b/boilerplate/demo/web/mongo.php similarity index 100% rename from boilerplate/test/web/mongo.php rename to boilerplate/demo/web/mongo.php diff --git a/boilerplate/test/web/mysql.php b/boilerplate/demo/web/mysql.php similarity index 100% rename from boilerplate/test/web/mysql.php rename to boilerplate/demo/web/mysql.php diff --git a/boilerplate/docker-compose.yml b/boilerplate/sample.docker-compose.yml similarity index 98% rename from boilerplate/docker-compose.yml rename to boilerplate/sample.docker-compose.yml index f3d3971..e1ba096 100644 --- a/boilerplate/docker-compose.yml +++ b/boilerplate/sample.docker-compose.yml @@ -28,7 +28,7 @@ services: # - postgres:pg php: - image: canals/php7.3-cli + image: canals/php:8.0-cli expose: - "8000" ports: diff --git a/boilerplate/test/src/composer.lock b/boilerplate/test/src/composer.lock deleted file mode 100644 index 0fb58b5..0000000 --- a/boilerplate/test/src/composer.lock +++ /dev/null @@ -1,130 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "0044c44b9ff99937efd64386a4a1d53d", - "packages": [ - { - "name": "mongodb/mongodb", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "a307dd60e71e1291c60927ea4f3a1905146063f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/a307dd60e71e1291c60927ea4f3a1905146063f5", - "reference": "a307dd60e71e1291c60927ea4f3a1905146063f5", - "shasum": "" - }, - "require": { - "ext-mongodb": "^1.2.0", - "php": ">=5.4" - }, - "require-dev": { - "phpunit/phpunit": "^4.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "MongoDB\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Jeremy Mikola", - "email": "jmikola@gmail.com" - }, - { - "name": "Hannes Magnusson", - "email": "bjori@mongodb.com" - }, - { - "name": "Derick Rethans", - "email": "github@derickrethans.nl" - } - ], - "description": "MongoDB driver library", - "homepage": "https://jira.mongodb.org/browse/PHPLIB", - "keywords": [ - "database", - "driver", - "mongodb", - "persistence" - ], - "time": "2017-02-16T18:40:32+00:00" - }, - { - "name": "swiftmailer/swiftmailer", - "version": "v5.4.9", - "source": { - "type": "git", - "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "7ffc1ea296ed14bf8260b6ef11b80208dbadba91" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/7ffc1ea296ed14bf8260b6ef11b80208dbadba91", - "reference": "7ffc1ea296ed14bf8260b6ef11b80208dbadba91", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "mockery/mockery": "~0.9.1", - "symfony/phpunit-bridge": "~3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "files": [ - "lib/swift_required.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Corbyn" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "https://swiftmailer.symfony.com", - "keywords": [ - "email", - "mail", - "mailer" - ], - "time": "2018-01-23T07:37:21+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} diff --git a/boilerplate/test/src/vendor/autoload.php b/boilerplate/test/src/vendor/autoload.php deleted file mode 100644 index f1761c5..0000000 --- a/boilerplate/test/src/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -// autoload.php @generated by Composer - -require_once __DIR__ . '/composer/autoload_real.php'; - -return ComposerAutoloaderInit3699d1e5addcaee78662800cf92c71ce::getLoader(); diff --git a/boilerplate/test/src/vendor/composer/ClassLoader.php b/boilerplate/test/src/vendor/composer/ClassLoader.php deleted file mode 100644 index dc02dfb..0000000 --- a/boilerplate/test/src/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,445 +0,0 @@ -<?php - -/* - * This file is part of Composer. - * - * (c) Nils Adermann <naderman@naderman.de> - * Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier <fabien@symfony.com> - * @author Jordi Boggiano <j.boggiano@seld.be> - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - private $classMapAuthoritative = false; - private $missingClasses = array(); - private $apcuPrefix; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath.'\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/boilerplate/test/src/vendor/composer/LICENSE b/boilerplate/test/src/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/boilerplate/test/src/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/boilerplate/test/src/vendor/composer/autoload_classmap.php b/boilerplate/test/src/vendor/composer/autoload_classmap.php deleted file mode 100644 index 7a91153..0000000 --- a/boilerplate/test/src/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -// autoload_classmap.php @generated by Composer - -$vendorDir = dirname(dirname(__FILE__)); -$baseDir = dirname($vendorDir); - -return array( -); diff --git a/boilerplate/test/src/vendor/composer/autoload_files.php b/boilerplate/test/src/vendor/composer/autoload_files.php deleted file mode 100644 index 9375651..0000000 --- a/boilerplate/test/src/vendor/composer/autoload_files.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -// autoload_files.php @generated by Composer - -$vendorDir = dirname(dirname(__FILE__)); -$baseDir = dirname($vendorDir); - -return array( - '3a37ebac017bc098e9a86b35401e7a68' => $vendorDir . '/mongodb/mongodb/src/functions.php', - '2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php', -); diff --git a/boilerplate/test/src/vendor/composer/autoload_namespaces.php b/boilerplate/test/src/vendor/composer/autoload_namespaces.php deleted file mode 100644 index b7fc012..0000000 --- a/boilerplate/test/src/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -// autoload_namespaces.php @generated by Composer - -$vendorDir = dirname(dirname(__FILE__)); -$baseDir = dirname($vendorDir); - -return array( -); diff --git a/boilerplate/test/src/vendor/composer/autoload_psr4.php b/boilerplate/test/src/vendor/composer/autoload_psr4.php deleted file mode 100644 index b52243c..0000000 --- a/boilerplate/test/src/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -// autoload_psr4.php @generated by Composer - -$vendorDir = dirname(dirname(__FILE__)); -$baseDir = dirname($vendorDir); - -return array( - 'test\\' => array($baseDir . '/'), - 'MongoDB\\' => array($vendorDir . '/mongodb/mongodb/src'), -); diff --git a/boilerplate/test/src/vendor/composer/autoload_real.php b/boilerplate/test/src/vendor/composer/autoload_real.php deleted file mode 100644 index 36f5b30..0000000 --- a/boilerplate/test/src/vendor/composer/autoload_real.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -// autoload_real.php @generated by Composer - -class ComposerAutoloaderInit3699d1e5addcaee78662800cf92c71ce -{ - private static $loader; - - public static function loadClassLoader($class) - { - if ('Composer\Autoload\ClassLoader' === $class) { - require __DIR__ . '/ClassLoader.php'; - } - } - - public static function getLoader() - { - if (null !== self::$loader) { - return self::$loader; - } - - spl_autoload_register(array('ComposerAutoloaderInit3699d1e5addcaee78662800cf92c71ce', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit3699d1e5addcaee78662800cf92c71ce', 'loadClassLoader')); - - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit3699d1e5addcaee78662800cf92c71ce::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit3699d1e5addcaee78662800cf92c71ce::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire3699d1e5addcaee78662800cf92c71ce($fileIdentifier, $file); - } - - return $loader; - } -} - -function composerRequire3699d1e5addcaee78662800cf92c71ce($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/boilerplate/test/src/vendor/composer/autoload_static.php b/boilerplate/test/src/vendor/composer/autoload_static.php deleted file mode 100644 index 4ba6315..0000000 --- a/boilerplate/test/src/vendor/composer/autoload_static.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -// autoload_static.php @generated by Composer - -namespace Composer\Autoload; - -class ComposerStaticInit3699d1e5addcaee78662800cf92c71ce -{ - public static $files = array ( - '3a37ebac017bc098e9a86b35401e7a68' => __DIR__ . '/..', - '2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..', - ); - - public static $prefixLengthsPsr4 = array ( - 't' => - array ( - 'test\\' => 5, - ), - 'M' => - array ( - 'MongoDB\\' => 8, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'test\\' => - array ( - 0 => __DIR__ . '/../..', - ), - 'MongoDB\\' => - array ( - 0 => __DIR__ . '/..', - ), - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit3699d1e5addcaee78662800cf92c71ce::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit3699d1e5addcaee78662800cf92c71ce::$prefixDirsPsr4; - - }, null, ClassLoader::class); - } -} diff --git a/boilerplate/test/src/vendor/composer/installed.json b/boilerplate/test/src/vendor/composer/installed.json deleted file mode 100644 index 9f5862e..0000000 --- a/boilerplate/test/src/vendor/composer/installed.json +++ /dev/null @@ -1,118 +0,0 @@ -[ - { - "name": "mongodb/mongodb", - "version": "1.1.2", - "version_normalized": "1.1.2.0", - "source": { - "type": "git", - "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "a307dd60e71e1291c60927ea4f3a1905146063f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/a307dd60e71e1291c60927ea4f3a1905146063f5", - "reference": "a307dd60e71e1291c60927ea4f3a1905146063f5", - "shasum": "" - }, - "require": { - "ext-mongodb": "^1.2.0", - "php": ">=5.4" - }, - "require-dev": { - "phpunit/phpunit": "^4.8" - }, - "time": "2017-02-16T18:40:32+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "MongoDB\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Jeremy Mikola", - "email": "jmikola@gmail.com" - }, - { - "name": "Hannes Magnusson", - "email": "bjori@mongodb.com" - }, - { - "name": "Derick Rethans", - "email": "github@derickrethans.nl" - } - ], - "description": "MongoDB driver library", - "homepage": "https://jira.mongodb.org/browse/PHPLIB", - "keywords": [ - "database", - "driver", - "mongodb", - "persistence" - ] - }, - { - "name": "swiftmailer/swiftmailer", - "version": "v5.4.9", - "version_normalized": "5.4.9.0", - "source": { - "type": "git", - "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "7ffc1ea296ed14bf8260b6ef11b80208dbadba91" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/7ffc1ea296ed14bf8260b6ef11b80208dbadba91", - "reference": "7ffc1ea296ed14bf8260b6ef11b80208dbadba91", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "mockery/mockery": "~0.9.1", - "symfony/phpunit-bridge": "~3.2" - }, - "time": "2018-01-23T07:37:21+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "lib/swift_required.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Corbyn" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "https://swiftmailer.symfony.com", - "keywords": [ - "email", - "mail", - "mailer" - ] - } -] diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/.gitignore b/boilerplate/test/src/vendor/mongodb/mongodb/.gitignore deleted file mode 100644 index ef23673..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Composer -composer.phar -composer.lock -vendor/ - -# PHPUnit -phpunit.phar -phpunit.xml diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/.travis.yml b/boilerplate/test/src/vendor/mongodb/mongodb/.travis.yml deleted file mode 100644 index 6dde68e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - -env: - global: - - KEY_SERVER="hkp://keyserver.ubuntu.com:80" - - MONGO_REPO_URI="http://repo.mongodb.com/apt/ubuntu" - - MONGO_REPO_TYPE="precise/mongodb-enterprise/" - - SOURCES_LOC="/etc/apt/sources.list.d/mongodb.list" - matrix: - - DRIVER_VERSION=1.2.0 SERVER_VERSION=2.6 - - DRIVER_VERSION=1.2.0 SERVER_VERSION=3.0 - - DRIVER_VERSION=1.2.0 SERVER_VERSION=3.2 - -matrix: - fast_finish: true - include: - - php: 7.0 - env: DRIVER_VERSION=1.2.0 SERVER_VERSION=2.4 - - php: 7.0 - env: DRIVER_VERSION=devel SERVER_VERSION=3.2 - exclude: - - php: 5.4 - env: DRIVER_VERSION=stable SERVER_VERSION=2.6 - - php: 5.4 - env: DRIVER_VERSION=stable SERVER_VERSION=3.0 - - php: 5.5 - env: DRIVER_VERSION=stable SERVER_VERSION=2.6 - - php: 5.5 - env: DRIVER_VERSION=stable SERVER_VERSION=3.0 - -before_install: - - sudo apt-key adv --keyserver ${KEY_SERVER} --recv 7F0CEB10 - - sudo apt-key adv --keyserver ${KEY_SERVER} --recv EA312927 - - echo "deb ${MONGO_REPO_URI} ${MONGO_REPO_TYPE}${SERVER_VERSION} multiverse" | sudo tee ${SOURCES_LOC} - - sudo apt-get update -qq - -install: - - if dpkg --compare-versions ${SERVER_VERSION} le "2.4"; then export SERVER_PACKAGE=mongodb-10gen-enterprise; else export SERVER_PACKAGE=mongodb-enterprise; fi - - sudo apt-get install ${SERVER_PACKAGE} - - sudo apt-get -y install gdb - -before_script: - - phpenv config-rm xdebug.ini - - if dpkg --compare-versions ${SERVER_VERSION} le "2.4"; then export SERVER_SERVICE=mongodb; else export SERVER_SERVICE=mongod; fi - - if ! nc -z localhost 27017; then sudo service ${SERVER_SERVICE} start; fi - - mongod --version - - pecl install -f mongodb-${DRIVER_VERSION} - - if [ "$(php -v | grep 'PHP 5.4')" ]; then echo 'extension = mongodb.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi - - php --ri mongodb - - composer install --dev --no-interaction --prefer-source - - ulimit -c - - ulimit -c unlimited -S - -script: - - ./vendor/bin/phpunit --debug || RESULT=$? - - for i in $(find ./ -maxdepth 1 -name 'core*' -print); do gdb `php -r 'echo PHP_BINARY;'` core* -ex "thread apply all bt" -ex "set pagination 0" -batch; done; - - if [[ ${RESULT} != 0 ]]; then exit $RESULT ; fi; diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/CONTRIBUTING.md b/boilerplate/test/src/vendor/mongodb/mongodb/CONTRIBUTING.md deleted file mode 100644 index d833208..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/CONTRIBUTING.md +++ /dev/null @@ -1,185 +0,0 @@ -# Contributing to the PHP Library for MongoDB - -## Initializing the Repository - -Developers who would like to contribute to the library will need to clone it and -initialize the project dependencies with [Composer](https://getcomposer.org/): - -``` -$ git clone https://github.com/mongodb/mongo-php-library.git -$ cd mongo-php-library -$ composer update -``` - -In addition to installing project dependencies, Composer will check that the -required extension version is installed. Directions for installing the extension -may be found [here](http://php.net/manual/en/mongodb.installation.php). - -Installation directions for Composer may be found in its -[Getting Started](https://getcomposer.org/doc/00-intro.md) guide. - -## Testing - -The library's test suite uses [PHPUnit](https://phpunit.de/), which should be -installed as a development dependency by Composer. - -The test suite may be executed with: - -``` -$ vendor/bin/phpunit -``` - -The `phpunit.xml.dist` file is used as the default configuration file for the -test suite. In addition to various PHPUnit options, it defines required -`MONGODB_URI` and `MONGODB_DATABASE` environment variables. You may customize -this configuration by creating your own `phpunit.xml` file based on the -`phpunit.xml.dist` file we provide. - -### Testing on HHVM - -By default, the PHPUnit script relies on the `php` interpreter for your shell -(i.e. `#!/usr/bin/env php`). You can run the test suite with HHVM like so: - -``` -$ hhvm vendor/bin/phpunit -``` - -## Documentation - -Documentation for the library lives in the `docs/` directory and is built with -tools in the related -[mongodb/docs-php-library](https://github.com/mongodb/docs-php-library) -repository. The tools repository is already configured to reference our sources. - -That said, any changes to the documentation should be tested locally before -committing. Follow the following steps to build the docs locally with the tools -repository: - - * Clone the - [mongodb/docs-php-library](https://github.com/mongodb/docs-php-library) tools - repository. - * Install [giza](https://pypi.python.org/pypi/giza/), as noted in the tools - README. - * Sync your working copy of the documentation to the `source/` directory with - `rsync -a --delete /path/to/mongo-php-library/docs/ source/`. - * Build the documentation with `giza make publish`. You can suppress - informational log messages with the `--level warning` option. - * Generated documentation may be found in the `build/master/html` directory. - -## Releasing - -The follow steps outline the release process for a maintenance branch (e.g. -releasing the `vX.Y` branch as X.Y.Z). - -### Ensure PHP version compatibility - -Ensure that the library test suite completes on supported versions of PHP and -HHVM. - -### Transition JIRA issues and version - -All issues associated with the release version should be in the "Closed" state -and have a resolution of "Fixed". Issues with other resolutions (e.g. -"Duplicate", "Works as Designed") should be removed from the release version so -that they do not appear in the release notes. - -Check the corresponding ".x" fix version to see if it contains any issues that -are resolved as "Fixed" and should be included in this release version. - -Update the version's release date and status from the -[Manage Versions](https://jira.mongodb.org/plugins/servlet/project-config/PHPLIB/versions) -page. - -### Update version info - -The PHP library uses [semantic versioning](http://semver.org/). Do not break -backwards compatibility in a non-major release or your users will kill you. - -Before proceeding, ensure that the `master` branch is up-to-date with all code -changes in this maintenance branch. This is important because we will later -merge the ensuing release commits up to master with `--strategy=ours`, which -will ignore changes from the merged commits. - -A version constant may be added at a later date (see: -[PHPLIB-131](https://jira.mongodb.org/browse/PHPLIB-131)). For now, there is -nothing to update. - -### Tag release - -The maintenance branch's HEAD will be the target for our release tag: - -``` -$ git tag -a -m "Release X.Y.Z" X.Y.Z -``` - -### Push tags - -``` -$ git push --tags -``` - -### Merge the maintenance branch up to master - -``` -$ git checkout master -$ git merge vX.Y --strategy=ours -$ git push -``` - -The `--strategy=ours` option ensures that all changes from the merged commits -will be ignored. - -### Publish release notes - -The following template should be used for creating GitHub release notes via -[this form](https://github.com/mongodb/mongo-php-library/releases/new). - -``` -The PHP team is happy to announce that version X.Y.Z of our MongoDB PHP library is now available. This library is a high-level abstraction for the PHP 5, PHP 7, and HHVM drivers (i.e. [`mongodb`](http://php.net/mongodb) extension). - -**Release Highlights** - -<one or more paragraphs describing important changes in this release> - -A complete list of resolved issues in this release may be found at: -$JIRA_URL - -**Documentation** - -Documentation for this library may be found at: -https://docs.mongodb.com/php-library/ - -**Feedback** - -If you encounter any bugs or issues with this library, please report them via this form: -https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12483&issuetype=1 - -**Installation** - -This library may be installed or upgraded with: - - composer require mongodb/mongodb - -Installation instructions for the PHP and HHVM driver may be found in the [PHP.net documentation](http://php.net/manual/en/mongodb.installation.php). -``` - -The URL for the list of resolved JIRA issues will need to be updated with each -release. You may obtain the list from -[this form](https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483). - -If commits from community contributors were included in this release, append the -following section: - -``` -**Thanks** - -Thanks for our community contributors for this release: - - * [$CONTRIBUTOR_NAME](https://github.com/$GITHUB_USERNAME) -``` - -Release announcements should also be sent to the `mongodb-user@googlegroups.com` -and `mongodb-announce@googlegroups.com` mailing lists. - -Consider announcing each release on Twitter. Significant releases should also be -announced via [@MongoDB](http://twitter.com/mongodb) as well. diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/LICENSE b/boilerplate/test/src/vendor/mongodb/mongodb/LICENSE deleted file mode 100644 index d645695..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/Makefile b/boilerplate/test/src/vendor/mongodb/mongodb/Makefile deleted file mode 100644 index a1d31b6..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -.PHONY: composer test - -COMPOSER_ARGS=update --no-interaction --prefer-source - -composer: - @command -v composer >/dev/null 2>&1; \ - if test $$? -eq 0; then \ - composer $(COMPOSER_ARGS); \ - elif test -r composer.phar; then \ - php composer.phar $(COMPOSER_ARGS); \ - else \ - echo >&2 "Cannot find composer; aborting."; \ - false; \ - fi - -test: composer - vendor/bin/phpunit diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/README.md b/boilerplate/test/src/vendor/mongodb/mongodb/README.md deleted file mode 100644 index 90bd8d8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/README.md +++ /dev/null @@ -1,45 +0,0 @@ -MongoDB library for PHP -======================= - -This library provides a high-level abstraction around the lower-level drivers for -[PHP](https://github.com/mongodb/mongo-php-driver) and -[HHVM](https://github.com/mongodb/mongo-hhvm-driver) (i.e. the `mongodb` -extension). - -While the extension provides a limited API for executing commands, queries, and -write operations, this library implements an API similar to that of the -[legacy PHP driver](http://php.net/manual/en/book.mongo.php). It contains -abstractions for client, database, and collection objects, and provides methods -for CRUD operations and common commands (e.g. index and collection management). - -If you are developing an application with MongoDB, you should consider using -this library, or another high-level abstraction, instead of the extension alone. - -For further information about the architecture of this library and the `mongodb` -extension, see: - - - http://www.mongodb.com/blog/post/call-feedback-new-php-and-hhvm-drivers - -## Documentation - - - https://docs.mongodb.com/php-library/ - -# Installation - -As a high-level abstraction for the driver, this library naturally requires that -the [`mongodb` extension be installed](http://php.net/manual/en/mongodb.installation.php): - - $ pecl install mongodb - $ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` - -The preferred method of installing this library is with -[Composer](https://getcomposer.org/) by running the following from your project -root: - - $ composer require mongodb/mongodb - -## Reporting Issues - -Please use the following form to report any issues: - - - https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12483&issuetype=1 diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/composer.json b/boilerplate/test/src/vendor/mongodb/mongodb/composer.json deleted file mode 100644 index 4e426b2..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "mongodb/mongodb", - "description": "MongoDB driver library", - "keywords": ["database", "driver", "mongodb", "persistence"], - "homepage": "https://jira.mongodb.org/browse/PHPLIB", - "license": "Apache-2.0", - "authors": [ - { "name": "Hannes Magnusson", "email": "bjori@mongodb.com" }, - { "name": "Jeremy Mikola", "email": "jmikola@gmail.com" }, - { "name": "Derick Rethans", "email": "github@derickrethans.nl" } - ], - "require": { - "php": ">=5.4", - "ext-mongodb": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8" - }, - "autoload": { - "psr-4": { "MongoDB\\": "src/" }, - "files": [ "src/functions.php" ] - }, - "autoload-dev": { - "psr-4": { "MongoDB\\Tests\\": "tests/" } - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/.static/.mongodb b/boilerplate/test/src/vendor/mongodb/mongodb/docs/.static/.mongodb deleted file mode 100644 index e69de29..0000000 diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/images/save-flowchart.png b/boilerplate/test/src/vendor/mongodb/mongodb/docs/images/save-flowchart.png deleted file mode 100644 index 45e7b764bd4a5635b3606be97df1cbecf225e5df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 47851 zcmeAS@N?(olHy`uVBq!ia0y~yU_Q;j!1#xQje&vTnV{`t1_lPUByV>Y1~B;Pyt|%( zfq}EYBeIx*fm;}a85w5Hkzin8U@!6Xb!C6R$SY_ez!auBoq>Ttvcxr_#5q4VH#M(> z!MP|ku_QG`p**uBL&4qCHz2%`Pn>~4fx*+oF{I+wo4e&DqF3)7`}p2YwY5cM%7xt~ zFJ+~<I+S9n1RW>#EoxY#w7%nMm8cE}#|;K<B{30E7Lk{(0xXV8JUJCiTP97I7yRw_ z@squ72fC#c8=r3u6MJ%Ij-~PbnKx%XKXXPdd9AC<ll2D2OxRa39xY&ZXXFcY)zk9- z#rc5cgYkwFQLn=TU0hsL-1|yJr@21yXL}+bv+h6h?b#1bn6|jdDqH;5Y;vCbQDgau zqxTeS4=z!0nLJOz_0`Jg1D4G7$4+0n6|B|Q(b1uy(|zJ7*Qv9GJLfMAc*=Um>Q}at z(w<daPqgCgugy`G&S(F;=<BljWlbF&9UX@@b^O`f>lzSYE3;00XZ5+utJ<Da$(P9X zUH`n!w>y4G5=@aXZ>#nW<#iM6?$|!}40Zn0^WC~%LAh|_*R(xLL5fbyUwW>><w<|@ zCd1GIw(_8WX*SQ--P9M5sa$KgY+{$9l9CeFX{AYr*S1uPER|j#qNw7(s^qk}#PiEq zEf7b0^cfzzqM%_i<5_?G`YexmS27;xeG=_4J$47~iYHUVTEu_4rcSWYUFE{V=guwa z<l^EYGR;*beMfV4z@BGnqE4T-2wl%PwnJ;RfRd8Zq76DqmWN-jb;{US0g_S*eYEl4 zEVzy53U&!;MwvRcPOw?)a@R%X+~H#q+hK0~^!;b;(~rM<xD+eronL%<gR6^+OJbx8 z1kjtI*ZcBqT=G5V?Q_e2yqcbExb>!5*uD_+<95bn*%JBN=Nw=5{Ztk!D6%wkx;vie z#q+%D`PzCh?ap=auf^ThJk)lbivIKCqj8Fg^;RX27euDHx)inlm=WOjPR8ftt^D{& z=l4IossAxm<nio4-K|C-HB2#DjU6!)pYdk9-s!tnVSMUQ!4d(Pue!bLd!3ff_Gc)l zskWQeE9X)aWBg~{A_;db$A{7@ul`NVDz`q;#D2Tz$MN(P_jfCQt$O?aY{~zl7tj8G z_-kSAifbP^qV04K`Wv@ToL0emZ5IdEZI7#bk29{AtG%{89rvbTYr$XT>`iAMPj|j8 z^u1WVW}eUv=k38ePOaHIE&1Yp>EepN4tp}EGU_X`hFyL!uQOzys$TXS-}h5fU#B~J z`e!v96cE`q^VQsAsb|YQTBg@r?6%mqn7{6QxJ68uG$@E-UY4Xqx~#J~eeBBf7tfw^ zbjP_K6>HXv`kZ>{@%rSm+UL`HKYu-OQAIA-d7)Q+@WP)7T%k3+UzSwm%>2p1z{{q0 z(BjgK%_hHZ-neYI{o%RoomsN|8_HcBukHV+m#G=55mjumRI2yLd+y}Z?C&?!`h8sU zT}39xHKXzA6YUo#t8x!E=URTdY~13Ox9m-6zktxznTu!7Kld#%o_GJ$zo+jXc-gl+ z=drp*RISoW&fW;qZ@G0p?d%zLi@9$8xc6nnrBgwh&SiL+%C+h%&+>i0-|@}04Qnz* z*YA~xuW~ip6YB}~W5+q2?h{jAe7Sc^;_<_4_4{2zT0<E2Nlra5^YGP%1F0A5{Oi1~ z$hg1ej8EH_ExWnOZF0d1aR%2_O9iC1PMLCJ+JV^&GBL8QRgX+X)_t>KkY4tMrCy}> zSNXDMvh0i&o9lHq|2m&~`OLnM?Ef+wqYr;r5~957%=DYjKECK<Y;mda{vLTgW#6V* z{M9WJO1Au7|2Rjo%lbb5mp_jluDQN%{;sKK<!g@oy1qMb*+Y}MitX0d<PZ5Ce)o9Q zwBw9FK0cN(^O=2Uo8?uFsK?a|uS##9e7F9u%)JW?Z0|0)DM3mSrSMrw;rS1q-246W z&Axt){(o&rTdx&7UVL9rXrola3a*u3=H2IS*sIM|R8br0C$HiE>gBJ7$vr9Rj)`_% zSLgVj>AJRNe$Y%e=JJg%4~sR--(@S#IH72j;JOQQL$Ye8Y%y;9X0~F%^b04xE>Sh% zV|i10ltKL`m+aYD`|o;lJwC7Dn{rh0=Cj=)dt2Ykk>@yV{Y>oe^uS4nM3<*aFMrr@ zH|KYb`AKythRYt^>%9Z^t&Mb)Tu`>%`O3R%R=0mEom%>^V4jlg${l6`f`WpAt*L@L zh3<a%AZ8Tw{_%(J<r52bsB^ae+FboGlPhF~*K$pHrVSrHs>$3l;E8vuG|1fHT+V36 z@W+nXVe-S*H}?Nx`5k`OYjNXli`oUM2L)Ga-u}VEa816|d@YOdt@`?JJ~K=hCi%B8 zKR7pin(2!#jU5gf&edDpj#fJTw@SX~(Zv%7ECkih&D-)@<(jy}yYFs7bMoJ}iXNNU zrLP<VNlS+|b;PWk)gQ&a=JAz-33W4WO;|j;x~S;;;x#k(%zSXdgl}E#%m*EzS9aA} zl)k&wu6^VD@>;f{s{iZHTkvsx7L0q7J?T+i>ia{HDJs_&mppdg+-5D)X>r&r;ORBa z^xA#*AF?Yfs<2^r+4*yGo9HgB4^dH02Xo$gT1id)`u{^xqr<$yWgl){KBv*6Z6UBm zcAd+fc}(fOo1eVQ?p#;c5Ea{(vNx?(a7WYQt%acMy`ouPaHr7OUD+D%?|d_?TfZ>j zWl5CH=2>0adzl}cd6;x0Z%yOYymh;N>PmgN-K}jQkTdzQ6zicC*He5~pDF$PVd?a= zzt**d7L#|Ty;!v-@gS?&BhR%SE8E(4q`la-W`6DcvIh^!8~YA=ncMOG@UV_Gd0iWR zw}dPGgPagw+IyQfC)$=p{$GFXpT@Zb%5!ejM{g^<=D)JXe6P^LRx?I{s03q4P175D zpIi^vo1ABu6z22nz$v!K^>cq%ioEVtuz0irk|^dzicQoGEcu%6`D2;5e3`WK#aEv{ zRL08u-6+nNZgbTt_rZ^TSIa+(=kN9Y_4s_n^qwsOeR(gs%-3=;d}MdpRJCs3w|(<( z8kX~WZj9yVpXVIX*|X;S%G-}^_szX9>*#r(g#}k%wzwTD&bghtWKM?nM=NDUjTqIb z3pSipIewMV?o?I&$zPLyq@HC-E0c46xQg4uqQ<ndeRq0v-y>7?!i>ifX(bgilde9S zG%cdxu{HZc9xJ!Q)pm>v{Q76Ek-9$bs{Y<n^VZ)#WKk>gyO81Bg7}P@_m9?O=KfkC zmaya1vaPoqKs5}w9CkS?ciZD-cH3i5?X&;#;~zZOm0q}O(u&&S45v(dmN@>m6<PmT zW!{xfZ|2xf{i{9ynC!m()z*9r39sMWy17g|vdHeil9a!!H{;gdQkzy){{5I_O~;M- za>@5sZLA1dx5%a0J=6H#>iGNdS%#UMy&jfN&sD8`TCA;Ed-iaOO8A2Zw>B<0VzxA; zxjub%-Rh0;!Ow0b{;)Y}@!@W_%zeWt6IQ&>`1Im#<agij%-T7-Y=1xEu{`!re%_-C z-xn9O$vwFBn>}zzl-IQ_esA|NmY-O+CT=&Vp|GytSk!8*juShjIhI$muZ@%O=-k!0 z>X^NTo!XR}%+CYYy!-s;^-@>y|DXF=K4zY8owDXP)7oQowUO5<Zk;XO@UQDyRKJ;p zprGJR0jteAN<}MOLp_!TEY&=c`+n-%x)<H4KkIKj=CL}Yd%kw@R8Zpz)Y6$$y=Aru z_j2QztcRoHubj8traEVG^{;@}ed?R6jD$fYP3Z?!rAgWrG1KN1zu);{e)O6!p}%5V zuW^Bjp`Ujj&h%0M6|azX6PN`umg<bk*@nkYbnpi$s`z_bKR)!ZXY;kH5FSB6!N3Ty ziTlsL_ka51os(9}lg!`K#MxelDuPl<Vx&t^o8fGW+661P6f2|N^d%*jtw1#K-p9J$ zIrlo0<K*SO+?{;$)8}%50tM9KR9>?+{;{W?UyaX-Rf?5iuTHKykd9~oeq84NaJG8& zN`Xo0XW!jt-v8e?J9iVT1vn{r%~oSi8?kef{>QA&@|d^jUGJ(nb^(`v8L6$1P=bV# zrTmQAd%G=u#4=C&^IIy^`BTf+{IJB^&$mbKUp^IVP<`vhYpb}FiV}I-v@^t5PrqAw z_)32$@5!xp`?m`(|8BM|&fi<q8Pbk@^2kK$+=A*2-x8I&bQf2=HJ!4*&VK1S-+<I7 zlYTz^{YNG$yh~Yno%+X&*gyZyuQ~sD6PGfiJ}fGf=1b<eAe?^T?2o@+56HI_sxkS6 zK0p7dJ;6}IeO1=S@Cf?{M_%6QP|p=LI32ZGKOYvVt`&SthZq)T{mI<haH!#2%Rf`i zYqw0MI=Z;H6wUHh6_~jHbkuCdlodkt^9<D_IW}LL7i0?3Tg3mhO&6Rtz|Cwhizdm1 z0+T^~4zPCWGj`7RRuvH3`J=}$oOx>lo5K>rWzruuZ!O!r3KS!gxcjcJ*}AH!<HS+^ z)Ang?Pw(GKU%Pg}D^UFuQ?-jH+U3cm3SN)@ceCHG)&aSY>$H+m_@?s>OYZ-XW3O4T z38WCzl#kiCW^3VrUHA8toQT>TJQb9Q10%!)cV6;k7UGQQ`@8EDD4|cP232|!y>D_z z3-kYI(7JX@cooP5k9P~)-8(yCqO=<yah(F$v$Ol0PIpJltF{{w+qYg@>;+QwL~d7l zq|1{_txu$T4)2v~&)#deY^oMW^`!2;tDrLa$)ffr0W$9jcQ|`p`f=~1$hrw<!u$CZ zl}~o-Cr70D-vp@z#eGq$$u397+7CbFmxnC&+#<7A>GlE9^QJ0kM-%?+%e?k{_L8hl zNN=wr=3ehwL(_s?$A!Zx`0v_PeCBumx8!}Sip(Cl*R?02c86UBl~`cE{*j7W{@ZfS zyVol&RvPjCdb@Xl`P&)MJ@4;JHK|*&?SHRW%Af|#jzyIw8;)%`{!qsK%hmjgd6$~@ zn@nU?o>iD~I3VWS@*KBg)vLe(b7)hCM;!0Tr3Gxg>KgT0vg&?nYg~@qpZB7@oJZ+v zie$~b#A~<at^!8`NbSAMkh$mF3wFF)@JM%Z#-|hgmR29%-&=8{Z>RHt?RTm!%@5fM zD)zy>s`BKlGrkrvk2`g?PtXgt|L1Q1=JW4cMOo$ke?X@GT(u7r=pa+`xKBQ`xcj)E z)us6HhLcmW%RVit`OrBdU|(GdhvZ4M&o|E;-(m*JYany=YMEaZeLZd^xAcwa<cyDJ zR(Tr<pFVa)J?&<~hrQXg`@*+`!Ik<R&h*Lc$(H%qoxA*Y&-S9DKDD>L`#s{n*YTBa z^R;ysql6%(t>Dgz-es5nGM#(CcIA~-XVu<s&sWX7ZMk0K^>V&rlYep7op-)=t7NSq zDA~293QnwFx6x#o@Uf3Zu37s$cXP%+e>F4KVv}b3HU5JyfApU{Q4yZ)4{}6eq>IXO z=b}iE6S&kazuel{BJ%0k%$fgJ9N)WS&WeWf#%H2-`(_72)joM|KEdz#Vu|o{t?hHp z@bdqiqAs3vcuQB#-y8$G^I5My_gsn+g}V4>Ht%A?vxe&mMRc||_ywoOigBBk7f3%U z`*!So^@%9!@N94&Ju%YdiIa1Y%Y&IGe{vNZcAmVl;PK1TS&aT~xzi4QP)t$TWjz0E zjZ1bc%n5&b7hbj$m~&X8_O41^?XORDUoL%m{(4jXO@Tl6zOOxR?w1`8RjN|0oZ++g zOuAbBvfDl7>sPe?UsGT1C!5jt)h=ai?9#QMk`pvi!1B1H|EO%x?5J|TCFf+>*Pl>& z^Gj>i`#AX?^|v0+HqQ*+nhHt?pz)fiH$F&S7JV$?eo;y|^Y<yGP?iXbPilN?<(nQ_ zzW%yzF?6g3)DE{)-0Aepc(Q--@iUzkF<A`t?;p!Cd)ftRe!h7oIuulqgY(QBY3t?1 zDt!yKh2)veeBGWG?E3FO+xB%yuiqT}VUxY~ym1gKEK*OeooM__tS4Kh^;Eszan1QF zmFf@OQC!=3`=b8mn`eqcU}m2Dt!T-$yqam<27_7sb9`2|ajrTQKcPmY<Gj3t)3KQo z&ZHa52Z2VgK%Q68H_P#RzW0HQ*G@Izoj*I@hfI{&kd>4BO-HKf{_lxje;!)}YHNTB zjY;8BCdsdoK^bOa=eo;R7k{>Yc$x98hed&O-TCHgw?ws|!PN2O*|9S(>m<uPe6#MG zPP}!uWaS6@%>SF5*2vgP<VVG%t-pCvs|#AbJXz*;W=5XG@zWyfjVIRc{nM*eB&b`r ziSze$zJrPJ8{*za!;OvkH6cduv6OqoL*Y9gAG(A-5&E?wy<Vt4wilFJ@&aKI`XtCC z#_#!Ki{}5XPp?hhk@tZwR7LzpVwL5#8Y7YTUsbO^|C!GPDhfe`x%ldXM$1wk%seS- zxAgJs`Ky(7UJ!TAe|%(H^@e}#YqmzYLrbhr{B2L1Ebcz$I3@4(IdHN@pm|{E$)lJ2 zcKvv>kKMykv<sA~{<^xtVrx#$k~!xTE#@$5+)fcXJO4+V=t<|W{?#YfwKi|OcYe+J z?@e$g)Nd~|dL}jJ-Nz^TTie#<pAT^TwBbBk$<r(U%x20q=!U}mb-q2tobUPR9iL)d z57$jzdF|hdRYj6Fwp(?DCbvKE?L7Xx@<i0^1&ct@aA;G<iB=O2M@QR_zve9rY4*JH zt?8UYT;IORUsinUB$@VcUVC003{P91O<j(K9DOO}p0Uum<o^rP&?j6UJlF42ky$zQ zCgTl$coh8ECRoI7&wOrKNWS$<x8|~yO5qdE%1=!@eMYh3(zb~C&jm$6x$jd>gxN6( z1&`Fp-Djg_uhWW2>+LuEf9Ro<`$4bwmp^XR51pue<4=43(-+Sc&ODzsZ)sCZ+3zZj z1^LgOCVh^`{;Sp8@h3U)rbIAHM!WG2#%tF(+C2}y*I%~jr0dfHx#Q1udkz;0oH47J z$9nA+tCr6^+XB5d;|v?e#A(s-Gkhj`X|C#G_;66x+0!yo<MX9Ad$l~~-8~-tplJKC zS*If6MP=SO|FBIBmE5`GIN!S3AGNH7R{M`n-X}RDf359;LmeJ{Evb)7`j3d#F#qH_ z7O?4HR@arD#YvkdYt4)iTF%ENyn7`B`?a{UC+}|c@L$n){`VHAV!7;sIp^39+?>sI zR_*eejlHWn=A@oolJ(|S7RSCXmDiqE`>~!3R@^D+_x*B<NXJ5lnX*&%=4q>D%~xCH zv}%>|beA)ym}Kt9&1inTPWh{gW{u?THR^v0McrKf6-AgGV|iGjue9ormet;mE4@^9 zUOLa+_2KZDvL$mnw$J+#sO7QFzGI)<V=4ELms3kBtCwjh{lEPDd&!d&pXX;bpSiz6 zVP}ne`7U|IB?+uqTmR3RWm^~MsuKRIC?on&*}bmwm#;-huW#x&F`w)7u^9<XpUy75 zX#05QuDga)-HZ16|N5r#^M>8*iAIq}PfS&`lxQ!OdAGsHM9N_1s@$Yd(VYqH=58Bu zz6clz1slyjyJq$5qQ`Y|QkClOJ}kRq_&GGxxoB^4^r4@>HZK3Lq~zk~d#+E;x27)t z&7LP^88bcFd)}wa{qI!%Ov<R8mmb;^b7cn$>(^t?>zjgl)h-r&DGGJ@w`uAByfgc* zHXr=I>+8=i85{3xnQz_9Hc@{U+ud}(P*auj7Q(O7uFaK?-oL%6OHoN&WLocK+gU=T zk21eb(kq|5=lNbf|B3THG;RH6E&5o<T<ciK@t1P`5fAs4{C?mY>QZz@eQ(voiY1D6 z@13vR`l@w8_5OA3$6S?D?c#aEO;yfE{>n-Iwth|WUdiSV9zjca_h<5ZRu`~d4GoxP zvpQ>ae*qhBsG{D-gPSk^m3epJ<ds+7mNk8{Kk?o){7F&yT)Vl)nvV%g`G5b|%XtYs zg&D~^TIL))ta1HGvZ&LiCC?UL6P&WX!*E$+m!eX=#I(X4RRWQ9&8HMA!xmT99eb#g z+_Q3y^1|~omK~GG?)mx0=CJ%38M$?jnhlrjE!_1@DAu&~9(UWt1@ZT)-kk3#%QxD3 zbJ_hre-3P!9sc><{xpO1g5xowe&PEf`uTVFp8Qq&xaX5k?zYaO{;~D0IXPFYWtUyQ zb6g|xyTGxH_a!d>HM%o@l~i(2ui@%m!)G#wWoI7tlSuB0T~w*lv(fxQ&XPV^mG@d9 znX-E2{Gv`S|15N*-I-V2`L*_xVr7)eNl}N*GV`+7lh4R%y{qJ(;Vl*ZLA^!nmDBU> zyD#Tm`m^V@l$C$Lj!O|-;ZoiQxgK|Fd=&f<D|7#wiv0br5$k52Z+>kxd1BD7uKPdo zstXPOPT!)u=Ed1#Pv=b!j-T?B?b@xm2lh9<Zv1`D@Ko*0!|%3Vi(7ThVzzKx%FHOo zlb2t8{Us*zHH1UZQhvJOvDU(CVehX`dfw`KT(EvY8K1u?<BXJ^$fUKs!4vC+r_4Rq zUdZ}&K~lG;iR3=Z_xcmG8~cJc*<U*~`=6Bj{jVyX8)GAXy%Cz#AGO?c{^>72GK^lw ztv&VaXTEg#2c_4Z|G%ehO3`PGZ7@7GW9PM7%?!t87#)yEn6~v>P#jZi?*xrfHm%C& zi&7_l{0%%dBjazc_{8G2)CC%T*Bz%ieX5Jls}b^Pl$rO+BSFSM^2N9I$kQ{rX0mVe zZTNE_D&fh~Yl0IEpQ-g^%dl$eEV_K9ZhASl<eTM3gY`c?W!AOawUK*+p0SJdjPD8Q zes6cn#=B+8oC|)UZ`N<N-bXdw(f``->AiUe8uQ;DpIl{nY>7}<hURtt`3^JNIvI|v z(K&D{ylwKd3ljV7dCEW3afQ!yoc-~+owNPozb==~nJ^|~ZT1b>lgc2tl(|v$Wr|^1 z$qa|8q~sn?)%c05TcoTft`L%BIC8vY(}$D4J-Tu`zq&r+y61j!SAN0i7f&neY)$vo ztM|T_Kl8lVN@966dmSiCt^f2%DKfkE*bKV^ZVyTq_&!@;-k?%feC(z~vHk~!07eU@ zJ)C<IjH^GG9CKk7ZV+=|*&tkTGwS!h_<4@$1%Xc7c~|A-PJX^~@VLi!5oVETu1|FM z6hvh5raFDvv*1I?2k|oxSLU(LW6U!@R`N&Q@n`h{E(4w&(j1IoQpr+rYKoR;b~N2n zvH0I?Qu`&)%J=V!t{dyRu6d|w<S1u$mTrpsz2rK_qq07QH5al@-T%Nbap}GXXCB6# zdH4JE-Xq@gvro)(U7tK><&>Re7Ot!N)qjQvPqX{0m6;yHu%_x`<)z8112!GZShuT^ z<K2h5GI#&zXveRrK3BQ&emT#<iQ0v1@0Y%t8@uvmW%RWT!nfT8M5?9)@w!i3|G{Ze z-@TKU)Za5P$u^y>EU@Wxw+`HJhv(FN3!d^He&5#19$z%kSATZt)sJ8GGmQ7yFJ!Hj z4F7QE%!C=!nLqm<$aoNcY{s@@GuAn1Cp@U1Z<*Uu$yC7`!Lo&QS=zQp{l95J@{FYo zjt<!g+y;jwiVxqPv0FpNQS#Se<>`m#Z$GecL&u4mF<Ol${(n)rAX#x%V)LP>>Q^$4 zZRY)C-~O_`T{`(0^KK*lviy^m-G%hR?Pb;pPRX(8oOXWgu1DJ#(m!xs5?+6F_Pd1J za~`Q2EnDa?bNdUUzx&Vsi9IXc{HXKxPl?m<E1WM2&i<KtHeik;`^#VNm?P6?U*EH< zJ9mEFiB0KI7qZ@5uLyc25Ljfj-F80<L;f$fwC~ovhaXx$uL;SnpW^#o^`Y@glNbBh z8<=N`>$QmfY|4}0H^K6m(7oKy=|>*(Hg1pnb>?e|irKP?xq<sFv-h@1$|_mz_{f;> zGxh7!W3ij(rynim?Tp-b!(#5`HRsJW`SmXrJE$kvH0nRNxAj`x%$vtV6binczJ2Z1 ze>>g>(#bwt2G=Bv4@OmY9Qb=yKQi0?bj^J(ru2(@vhKOMxSaFvzbo)le$Cdn1^NLT z6;Evz-{q+Jds`uQtuJ#Lv-z{D?sp`Tvn1QAITMe*zLbCQZFow+xob&Qy6o4lu*yuy zpZM44z8f?1{`o(4GD7BI)Yp9AlF{?NB`Kbn9&_dOPWJZK5+B*6m<8t4+j6%5GFp83 zbB*N|Swn5^i*NrH-uduhn!RnlVCts$ckg+Avc5jef8gW{w}$y_wP7h|L8b^U4SRH2 z<M_EsSN+|krI#Pyzx;f5oXZs5Y?*gkkIi`fDdYEJ#$OCi8SFni$Y+b6FS)?p_}Gqr zznRal&vCfCM&JK|Ve%RGV>9kK1ZKZguF~7v(Q!il^32qU+|~(yFG_s2`OsqcEM~gA zILo=Ko^d(?Qz{*1Pg>rz>GEHjcNf~OyfOpzO5-m|H<<60;JeN#qt~sj%GB^;mHMXM z;6-^#$5I}g=6L?(oyUQKXCC=!Ti(}x`(ng2o&El&`Nt!E2IUL&Z+~*bU)S>6<kYuI zzM8!Gp1*3V{jcTE3@uE)mS<n+|2q53&wdt}nx6-DW)|$xXMnB+*#E|2r?pja^xi)u zwZCh()otvMzbBbF2h^zJkIpv!6!ClWMTugjh~%}tKh7?2n)!d;dhuUEGyj*dyD^jt zyr@1Xl{}5%@0zXqSG0<Q$2EWMp2un>^ui|n)%&)&Z0El2x%|js)mF3fEUC#p>OGHB zxx(uw^9jrEdvyKRMBkquRj#X<WVtF#dB$CGPIUX`f-v`32KH;N3AqC69#kCiW{vCD zux#GcD>hFyhnuBMeD%~LZ;jQMC;xoeZ1g7T(wxh`**86$D;SdfKcP>z`S9G1LY2V9 zfA>C@iQAZZCUq}gc1g!lxAs6CiHkjprR&Wc9sO_j^t_yYaMIEAf47-$)b>4WH#+=H zl4*OF&AglYozx$AGRcZ>3%>l1{ZCx;;nYwL!HL?F^$v^ebeNgG_*Y8Xqs0Bvdzf~d zl?eV|zR+0Z^MaC6InI-*J%|5l{^Z*FcwJ=dOM{QuvKrOA+Q)1<zP1M}I;hStWzReI z1Do;-SLZy=t6FZ#(5juk$mg)j9mU-q-Rn=8I&V+?J0*YL{JY+4g%!!VWx8EyQQi47 z%ykUr&a$mr_&NH$(42bNe_tNeUwIKzIc4C|@9Bfk!N`tqGLvp-(H?%2Dfe+yz2 zYi+jGB})DkD_2?aq4e0(f43xxOXcDhZEav*k+b&hhx_tO(-Z8uMa++hm>-idJoe>8 z&hc*%+3_r5%&A3B?abdFH1o+f?#(pUPrh|_b>;S}>@|ifv^AIO-D{JoSLxt?FLCfv z`nvrpr8BDQ!<U)eKJxMHPlg+Y+a)gF-aGMYwV&Vb^--qV%<}J>&CWb~-FWZWXe%#) ziKi!?)9L=R^T3{i5}%Deym-&ndyePW>0ZO+hMqGHu`DlUy>8xg`KQLZ1$rU7N<YQ# zivPALV&^>%JNb(AXZn0LnSo2@?BMf{3O&?a@38r}8B@UTZ-;Z{+s?kc|I5?I)^|mA zWhsAbU#C`AU+<(8UU0cXo>3#PUWk2PZL6g0v7j}#Y-+AKzVYAtVM&~8=dR?HHQqAW z@i*Py`1gM}`k=-|#QMm~zgIo%i<twTE}LVoy<7NW+LY&?8EscysyfN48~r&@`{#pi zXOHMqcK)cn%%Q(?dJD5@$NhT!g{{v8LKVMuMO`ni`C#?>-kKBNEb}FnS1<iqIq$^c zw-*bO&sZ>}_k3pbZk%+Wz9IO4S$1xlVH&%^JqcmHH>^?uFGPROjM?g-x%^Jet?#Or zg!5EXl1y1o?QJfs^014WzhiE{;qLt8U1wz+17^IJpFh3%boWG&YIfH3QPrMVf<X^7 z9DiPaa7sSnTI~H8Z?~k!^(nXNL(hEry>Z_kk)6L>KZ#l`Q)U6pGYB>;Z}`R{C;at( z^R>IjX1s2E-l*B2T5#<-TlU-UJIz$2FY`Q>@;}JM{lcX5f#}|_zxxi&x$*Zzef?nz z|3`d3TOXCmEkFB%_2#j+zwSvqyH`KuGQ0JJiZ6OH?;;j??RS3tasRy7onLQW)v2uF zXgA|Y`CooMS>`26`(Kx>eaxHQG3NiPSB|hP<WR4dJJI=;)!<#S%hc+*eCzjD-}|Xk zepqJP`JIiEtJ#G&YxO-Ut^YUww3x`V#aFqTBmdn=@H_V9*^_x1GLFYPw9H%0gzxQC zx?cXc`rCyc^Vnw??^s)CQJ(mh|Nr*sFKwO~KG0}9?qtg`heeE`|NpalZ*FtiF#q#Z zkg}L@vv2Q&)zeb$F@K*huRwX}D|@%q8~5+6eduf_ePizA-SVjq|8HITc8R{;@3)_? zrH6m^kDWRt`0}=W98JpCFTT6#UmBsHG+moH<cR1myIQe3tBXA5ZL9N2-Bx$$e3h+k zXwQGiNy-Jgjz2sV-XJYE%coV^f3;T8QLCNyEv@}Lin<qD^&dNCzYP?9TE9hc-2;Bj z^2b55?B^NBv(39He`rlzH)n6e>ACay?X!27-#vJ|+}1Z`W$6}4`}w?=wKiowQx{qN zQ{{L$&%s~Ln)Qzh^6Fk$Ps7qaov^mQQUBfE<{!+mAD6J}xt6!TTa>c+`i`e7OKZ$G zTG`kBtGl+tF;V)Z>3VyC9W6hP%zO94c4@(m#~oU>v-$G(d~W}4dOVLe`Q?k>o}Jl^ zU!NZr6>?trYyIU%GaVA<mVGu_bn2Xf=C?GPmEnSs&vKm(`3di?Re2k~cV4J|`NNPi z>$m?C(fF(uyKKK>jgJQR{5}0kZcK}aS6TO<cFLOHY}<R{=9#|xKdWqFmZr@8dHt!2 z*(b_e=h?qp<Jd&6fFEvIrS&s!-Q}CR)n@l}k+h$iyEp9(d$x<+!#1)h`1iYI4mW4c zxl=8FY@*NU^j$$~;*>tiy*ab8cKhSg8oh@ryZ#(~cJbNNm682dt5+XQ0=ZOopV7*X z=7~M3@dxuWjB=D#tMRD)e6lv-Z;Pw`qQ_IjIXh46JU(yl^>3_~CePb&ZQb>Gx=Q<( zS5I?Yx1~8|d9ecDcPp>h@66@(ALUt7cRmu;n(o%`AHT?H^ZG(oT?4=82BJ@uqRsc3 zU6Xf9*}3$&%sZ}c#n09K|2?yO$as9ay;sQ0nJ!c3p1b;X+r}?D+ulTeu{t)>Yi4$P z@RnZ{ll)B+UtV56sZ6cF^zL)!DxvS67q^H<y6v1Tx1?fj{p0UXA5Ra}FRZDy(<;B? z{8P=Dp<|s@n^n0z>w)F9Y(l&L8Xn?WxA;#lzd+z8W51(3k0#%Hem`!{OTK+lhBK!; z&ebTndV9*=kB)Z~*>CQzvbo>4exm8Umw%ZH+H=)+owD${a;olS`C_}`PMzOY3|DX6 zb-lZ9^M`8QVmTTAM;HA>bj+JSne!c%-8cDf_VJAwDVKBJ|6iQRTw_~g(&>IXV8x}| zAsKcvoJ8Z5ZCA=gr_KBQt>qH$<CWFv;d2~+b9Tn~-L>8ww7mL(ndtuI0?YZoDExXg zT{9w&ZRtAS2b1HJJ8oMxZE#wxS$|mBW!kSM<MwL9-S20-`MmReUDILy%M}jgT%ogE zf@0Lg><p#bt*8Dfzwdi7YyAX~+pVq2x3k&>Cw99|PwbA-RJ=K(O5(c3r|CC*woBd( z6`XiK^H=@sj9>M&Gw$whFWj;Jc$NI7YwLm%^_sQ_H!kONnQHZC`Mv4uPsmv9|C)XN z+5H}=F5?#pvG;2gUaxsNE4+N;+spis-+Z{EdjHOv(qhyi{=Y--^8FK4_a`kE?uh&- zW&J$-;jxFaHKM+Xe_Pvhq3QUF+TV$MYq}qNY24Q$KF@hO|NrWrzoP8qXB_Lid-#TB zzFO$*Ie&j_eY$x4(aAyWmwM$NZhOvL%afv#|DgG{cX3X3ZGtw#y9a+u{wI`NlYF)F zd-z||Irjw4^UEJ)3|RTpt}Dbl@#AFk2@`M3cvR~4_ZfGK>6sS-ClB`WGo0Rh@4x%y zzJAW5?@#)7&U&0-`*8nu#Wl%c=QD)(zFMW9bynJA@?wAc+RerVJA^YY)capE$Zpn% z{I43-$5->Of3w#lk=w0IsrMG0{&L;ucobT<gV}w_LhDV(R#qN&yq9Ij(Ei%w?mc;S zhr7G^KYYtApClB`{UgS@7qkS^;~Y!s@@k!f54WzoSu0ao{bJ`TrTQhGxA5QidR1v( z^<TlqJg*w>f1a?_EVT6}yXD+EhCTP}%a2Ak8qMDPPky&4kH1%`l9$i%hnphPC%yi9 z=Ww5XpJ4q0!w;tA=c@Fw|Li?|swgX7Qi#ulv!<@<f~9@>^E*}v&6**pp4UnkPnkv@ z?Y!H+A>EUC)i%rDmDiUiy<)JN)fY4IYgE9D{(GO_pD~Loc=F8tYsad|hP@2-yua3* zFtZn28dg*j9b9%!dzR?E{~5OeMT1`2?w4n%4i|ay;n$`)b^-IQT>i?aE_w2t{oRF8 zTd(b3H@P|c6%*g7?LV|`TlBKk9sScT_xQ+p-i8A|4*o1p`G5GSmx6}QZ{>?J=TvI$ z{kfG0UPJk>&cke(_A$f0MW$+(zD<3&s^bLfsykYJr`FC(dU#^C#g>2SkBe;6_ueZH znNjbNaZ#B;MOJsJ=)Ai3%lS_QY&pl-74rM*&adY##J_j8+i5LiFvs%JY{|FP^S{>R zyO}V|zNdY9TBPzxk35bag>3JS%L@Gvx>!ChX2wJb&I674>V}K|-aLHyyvzL0wflNB zWX>J=U)jI*^4u@WUp@7O_6640SnRZx>e#y=Q@>^pXS+Gi;pu^LK2q;4#5ybxsGI-u z@@u1A*VfN}?%Bz)C+w@swnDEfzDH*8)JQ(u|L<VYvN@)@?aI#9?ckK)*Zzb{;=0A5 zt~t;8X1@J*MUq?aXXxpR+6|&Lcaj$r?x;@Kdw9*(=+GH5VcW0!zloi5=;dGE#>(e1 z&wqbcdpKjF+xzvq<`!2}taK>ogSPrjZFV>)NuKnpn_(&0+^)6uci`i`w<0=o&z%x~ z{qb}7*>l$Qjt?6%#n=CqXgw`!lU=d!)yC(X2Rnb%{ycBx{QK^aS3l<3t=nDyJbu-5 zSnpt`b^6*HM$ej-Z7y`H<XeYzMOXdZ{d?n@KeN6P+rGJA8{aj)HQfhpDa0K7c<YC& ziurCMs~?}LefxTpr|11W(aN5>yjW%3gqbmSzX?~>{OM}ilo5Z1@vhwrr@QagKjxd8 zGUwezEf2nKt%;5m8~Z)Icg$ShcE9S{2mjySj!utjTT!(6ymhY;uW(`e8ztR+TGx5* zPWu|X?`K_^zT}aIy<2Z=-of#&C&*>muQ}4~`HK=>mN4|?XV0k&5xK$sXPv`_(um2D zcH0wrrcariy4m;k>(UROAN}sQ9r<I<XOYM<;Rh)<i+wl6o%Sf(RQs>~#`ZnOTjkfz zJdpb8n*5CUOsVEce;+PUYfqUy|FL~|^7l)1JMM^^-M!Iky5ZW{Q1kt+&2`m<tn7B` zmg@rhws5Mh|IN7JP4peD+plNe%j9)<cxv{RkKG=5(>AA1vwwYm`sC{N3nf={Lw5ai zSr>6gpRN4Z?3fO{_dYux6sDC_$;DT3R-NDfd(oN4ucl{jOukpLYRkLRy@%JYv6s<~ zUvvCm>GtC1Z~k9?_ru(Ili~J+n8z9=SD%;6G4c@o$-QiQwJ5t@)w#XTyQ05wXKJr6 z`TF}<!2b6J&-gNP=d6?Xv#)*4*7y|$mP?LK4xafvAeJw;VxFXIlyF>%ZQcCIOLn|I z>5=2(aYgBt@2@BP%L5nvQ{k)m&1G!WvovCB<&QPZH|AG8^xWGeRC+vU<I%!vK3&Qm z3*4vK>}`M0q0*O=b!w*aT!s(J+F1@&-#id`VexHi!~cQi|EmfO?~BhrIJ5ch&mZRm zxWa$Un=;weV&7-G9^*!-*l+WS>+<S8MW>bBJ9O}?|L3C%u5;)Y%~))|_3(2|zopT7 zf8Nit{(R=!r|0jNMw~rrBENMKf8KqcGn1xw+&Az2Fsa(pBB1%l-|s?E6?}oBdT-=@ zE18xR{BXCgp8n<d{EvE)nTj%ZFNo$xi84ImZ%HYg@-6(zzP|>y)6YNqqF?*-ho5=t zx?3K97Ow8Re}Ddj6QXxa9=YfKP?|J5_Fwum|9>_D^VR?4_bdPJfs7qTwf=}!+_|8T zb+5O_6NWr#+ZlbqcEO=f<TJHZ7u;RKdgtRk*%q-^DKQ7<OC(=ud)jg+H0b4*R|;HV zGaB^wYAjEB_w>uZ#)x=}qgi&&+rP{Io*#bd&aXFFT6auX_HQ@%y}x>%^L_i)!!td$ z_A#%xo^9`#Xt(a)b%O%64f$6s%FfO2P+!Yo&a<1j{j<u){Z|+l<UBTR5&t{mi*awq zU7;VJ-h6vGStF#-=A`<pP5Dn*lFIM6?^}_-v+&4X7ZKa?1tqM%cRsam=G5NOF?sj< z#Q(3Re^}}syz;4n6z`qVgIiZ#uC;Ycw4YG1MB3eKtD43c_toNT!g6~jOg7wWxgkj? zy>E;9syiZ9{?-4Qmfv3RU#{zVrI3GCW!bs;r~Xa#f6RCP_*GeUh7F}<Z};zw+r7`c z%_)4Z+ojIgpjK8o-*)v?U#v^&qW@-ec)YVe$ENj&t9HH}_q)HhgHQLSPrJV>Rq>&# zc$#h11E*sbXFlytPka9Sgomd4{Ppkt+`b%Tztkw&{$={!dDH3zbhsn4{o~B6H(a*l znDae&-N}@^x<}Tgne~^a)};M(y5(hgd)3CRH#cV()V<ev{dsT6%`LjeM7CU;XZ5}y z{6qVc-G!QG<^RV?H$KUHzqPjU%M$f9TVIFr2>#q#zpZ)w&hO=_dExb5*Xlc!XTLu> zKaj2cw*{-V&+@~s_s4me=0|8hD*JM5cA!|ha_fT?`I$B^rsgzOzxx|&xpBF5oxi5c zJBvkL=a(IpexFi%`cK{QjS}us4-~$BIlJR<{ej6b(y#fSo_RRWC->T9#?$BCtx39d zHv63QIq~LQMOw?m>-<gDUAP;P@vCT?!S1J*h5ncnOJsIlPgvW%U_)=nTZ2Bg+W$L} zd-dD5slIz|_rpfDpgnJS!PLm~-p`lWQ*V4aDR4>XbyBXx!Nlkl7jlHI^Z(wOJk$3* z#+vxR_1Ek6&5oEm->!as*LI!-H&5_B=Vi{{8sQUiQ*z1Ca5d9^YCRjDX#e2#ZSzgJ z+Hz23{vOda^EbS3Et&HvDXf3qN5h3WHJ|JzB}FIIPTbM-J#f=I={rVMKi9M0*A){E z{Z@PFT#W0jm$Nrq^9}e{YVzi{P55@}V?E!5J*|az^k-*n_Dw&VeNOg^EA!k2#|HTo z<&rWd%#OU2a(7wTTQaw9`m9a+6Rt1HxVHBnhh+LXW*e8Owcpni?s>`g%=X62;NN-2 zrw2;4e-`=KeRlC#?cmL^vv&Mg`Py<%A;Y{YS_wj&+FP2^`u96+jPgA5uH1ZiQrq0C z|9rCd^{ptn{NmHMD`&o~<v*J3r&9LXVUMJ0A&cyin91TB;?&vqOSh@-)p_@Tc}ljG z+UuQ57*4yHKRB@c`(w|&QprJ_+FPc)ZudX&%ICS$t%vqm>`(hmE1$T}vN3A#XTOs- z=bi5lP#u0+zge~VwnVV(43?U_wYDp!>MALP&#M1tl=E8q#Kg1BnwKkVdfCg=OtN$f zt=%_0ySl28d9UGD%UwS$4=oB0+;}vh>srmsFF#&Kd_J`~^74-@=N*!^+q*>^ES<9d zBcqa6-LaK39BVFBM{GOqWm#){?@LBkn7s4EQ^hN)zsFk4Q9l`8p;!9;P1U)d*7q&$ zU0H1@db#<<smmIHuOn;jd6enSaj5ap5U7xQ_{;pBs_s%Q*X+J!A&V#es7=iI`9OBt zdCj_eRXP<LbdT3nwOu%IcFNv&f=-Lfic3CUPG^1kHGjXqTUKP(H7W0vZT=5Fvu=ER zdi#&Eny+h^|MtH3Jw7>X+N4sq;8h<rY9ue_RQ=~o+TQkeWob#({l6^j^2<Ipyc1bv z(z#@ZpH5AZ8DF{9*Z2EoFS;71sJV@s+kG1=lWg4?T+<cx=5HN$H2DWE57*Z+sb}yH z;x*eNyTgBV-F-tA_jN}k_e|eaUbZytd9I~|TCd@<&4y`=8<=M>Twy!)?Bj%-p3AoL z9(?#8P=DZa$=rYIW^LU6z-P_utI79OlsB3k&EDg&aaXd3#T`EXpu;(jYcFN96k59r zgk_jM&97)V5foqWtUy2QyX@!efVxj?-`37)Ib1sH(sdiJi&>LB?JhRC`u}_Ge|GYH z;j<U#vjr{ux%tY@&Fp-S71M4;@U4+_e3^YLc)fpl!IF*TA0_s@Y}{7;vY7Yg<`<<s z##4>1^DWQ#`cY+m)}c$w<IjG3bM^mKzIcyl&H6Q`uS9N<_-e3lBELlVg^*;QxO%ZS zp$@JOSQDBJ(^?IewHvCrXh*xatP}bFXYt}SrGf9-3{B*>@-=L_zUR#GTC0MTWZ?w$ z<=?Lzli=U}@Auj@e46mhACFo6<X?DKJhUwN{h{^D%5_gaH)hVcVcRqJb6U_=-v<+U z*~ES2YNv3S&pY?)&)N6C3s}`JEcidK_+0$oIK$^M$D?-qYph;z>6Zlqx4YV>)3-kU z`Qe$GC-qTT8flYAWB#4<Z{km{`B!|?WV8O&TlVGW&Rg$FW>6Hof2sDG@yzvWo*kA` zRFQo<&-C21^S>F}qUT9Dtjrc>uqZ7Mo&WuBlkMrYg1;N8e?GkXE~1{poOgHs>L|8n zACLDZ-!RDKy8SFfIsV@i?)zL$<rh+aWiwpa^H?E&t3<=$QmfZRXLgm#KX`llor>x< zu@9Es^Epel1?@SfajR$ke9NhbzGA)c+uV}s`kH6?zh`VU7BKr0=e+fs`^_(LLUxnu z?tT4yo$2X+#>E^q>PC;so11$K*FV3z<;@GPPAmNjua>^d+V`(*>iPR!`ipI@-uilG zS5)%#MQ7JYd``V)VSi4`Gbl%#Yf7bd_Wy>fHHI4VcFgVH_@~v%M0Vp$XKD6Fd^gX| zoo_d#bm{3m?0;qMU!1Ny`_uoG+cv$~n!NMlMR^8`Plt1ow%hx4vi*PfY&p~P8^?2J zA3Rv9zcD?~B=q)?Pp4-sv}oqL^z|<LrgJ6hD@(<1+x?x8dVb4-t2fr`uaLEix7Mil zyE)r0@Y}L__I(aN%Vrxs^Zt}~UxC%=KkvyunobY6kDK=z=0E1S^h-=ou=S}-;Krxl z*8F#$;(gd+^2chX`+nj(tC-cl-#efFz1F4Ti@C_^t!>isfBPnMTxEDOCz?ISpmmkb z$+BfjVkU>qx$&2ydYZ|Ctl16;#Vl{ni%t2@m;Rw~%>tf)1&{RqY!bU9%*?)DbGg(* zuDhN~ueoo2ro95Tx5n<dNx8mekNskkiK6K#)qBA^YW`<O_*n<{FX+hM++^f%@Y2gC z-EmHzHs1cY%o=?|jaY@u;d0^C@gFv^J-<KEcEU~}4zAmC-<q}?bIv#4@J2mZim^`W zOXS4dxh_+pPJYbwy=l2V<C?g{!HGAQzvZ*;+^RRpZ`Zloil^>xm-@kz!9C|^Y{ECj z_-7aYUhO>mQYG(u>6^Gsn%BQ@PY_p?S=W5H(&%<B@6`Ox<hM)Y8Ppk|({LX{w|zI0 z`XTyRzN$yq-u!{j8#5bCQ;mQ$uWfzpw|r(C|2a?ex4YKeU$6f?;^DTb-;%O6-kPzf zjZJT@pVhSaH`aPq1g#PdOtRvee)g95Yoz}ESJthECl&YQaz4MYO}fA;{LyE9mOYgv zo_Rm-zJEFM^d_Cnyl<C-DjKfSmWq2K+`fsgIXeI6ngh~u_nh2b)yn+)rzgbsUFBgw zeVM+EZzEUmOOvP0MncMr79ZZKq;0XUzV$MF(Pq|Na~>6>*&DwuxqT**e~#*ge;Ru- zRcBoMCo^~Uj4j1}pT9IZWN@FFZ+pRgTK8$YMfyVFCvMISV0~`wI;nJWiG{>|^GOeC zs*6)1dq2O~e1XsXSmp8W%iNjx_SGa@wQQe%N0v8b-dppRH|@I}WcNz`zj0G6`)yXj zRzo$87aVuEL(cP@t;>GfWV7ddU1rbD&Z+17A1~(@znpoiJ?q#%rv2(dkF9=pn}&bj z{PWV4@xv09Z`WU}y19RfMxeQ1veAdsmg1UfmV|<*r)TQFJmfupul_FOOXoMwcV%ib zcCRvCT>F0W_scymxbxao)6eYO&s=DofBcvHwrh1$r;8tzFgE+Vf8znh2cb;g_0*Xp z!Z#e+1lmO#FVg7Ee7*2hf`PqH?um<MZ7p~H4!q`b&nMv7X4dZOwLOQPo_m+DB;e}} zZ=>^k?n>u2@P_OxJ#>@(5#N8y`@t_(9hkXjOH0$uIDadtue(1~vE@fC+`M1HLz73X zcLmo<i<r&|Th?<@=_fB=7m9t%P&Zlf-QRQf&&F6-T>5u!({5qIK9#I3_T~JqM5B*A zX*+u=YBpmHPfbpbCSwWXx^u6s*KRFi4Y+S{xBr9R>C7qlc9zlY{zZ(s@dY-Lo$2qB z?fg~#_x2zB$&~AV=iH&lxv7p1t_fr}7qA`=UQ%O}@NrqneR2OkGN+!+{JQeaH}?~N znlzMedIrqk=eT2>`}Y3sKGQuR3G<Y^&MnAU-1`6gy;^toP`wzLe{(fCCkRBn*xPwY zS;5SKk#VPos32oz(!$Dv_o{aXg?#7|dAUF%bcaUht}k&*R2nZ#njmn=`0d|+9PuVi zUYv~+{;oM1b>_^>qHkwr8e6~D6u<K>Uc)iJ#4Pgv)3q`&CIaiLXMU_)eP5;ctL@A5 zGcz)JI4{rEQBvA@@$3ERSz+G~`s93-wd;3%xGB@5zFapnYUz7z>H0-1p;7M+ZL(20 zKIQqjgVo0WDs9Z_qOZ+=!F=%l2cCPMwg0T1`|P~E%l1cpE1hPt9XH;)ZbRwY&L3YN zE!SIhM@4M+|HN~yDf|9DnfBYrzU)F+%*XEqHO`GaualJjc=qLW#V1s0o{G+3U-x8| zOw_;Mf8NIjG+hW?Y`JTfT_yLj{!Qw0^rja6{>aN(usme%tM6+9ey){>SJ3pVG&);- zCI71BmPPt}&!5(?)JDX7zNnjg#xwbh_^}!3dDB|2SKK}PVaF}uU3*N8t?b?Jc)oS1 zI640z*X$3K+#4S?v(5C{VEysC^3v)1s-+V+qQ509`<*v`#=h0gA9QbXuA0zge7{a; z@vM|t&#oJO7u=R6Qt1Bq@rl_i2l79Ar{CH4b2VGIE&o#~l?P{vCtTSPZLHfaI=ihn z<EQbQ8&SWF<UfAe&(6B9Hiv=zS?Te)myTE5&A)GQU;o&i)Sk-EyTnuHyU+I&6x^A& z?*ECRi&C#Gwl7gP-d*GJQHuLxmCT%5H-%^0_Pvtb9<a`lX|}hYs@)^beXpmrKUg)} zvrp6QO5?wXZ^c(?e!Mq#-F8#hqibJ#rT_c|Uq8Gzb}RdrH_Kb_(+!bpwby2)zVB20 zaqZ+2U4i2-_pbG@`z)aPdf%_<-?d}&MUG#qKla5>Ua;o%e~a=*W<q`?XH9&+ZWF#? zwNlgjzNGubSN9)$_*_s`Zr-!qVCw8W91eGnFWa2vVtuXdmuh?ctcKL@MOEqcZ|aU` z{P<$j73!b%`^(}vmKWy#WY*1@HvNV3-Hkcn`&U+7z8-G;c%p2J-v22(Hhg69P|k9I ztp%87cWCEg(@yUCS$htCHs-rh<{5i)X2bE&i97#R1+4vAw5r@<<<U=@>MqE!%Wc$I zEo=W}hU3Op!kN}t6DR##e*S~B_RNnb@(zX79r_cz_~Uu`<1b_Pe*9VY-*3(56P(}9 z&O3WEx%S7p*^`x~ZWk*5WA^CKd<Fl;P?O3`b%v!*`yRd6r9b0ZqJ-<}^Xgw?0?)}v zxa>RBz4Gq|&pCCkJ8!*Cef@>sVqdP+$@Ffa@-^(!{@w{a@4m8XvBj=;#mlzIyLG<e z{wO6qad-72zm+~KCnQe)8ZrG-tmgjcFG<CIxza6X|IPZiW4Y#p?1ZoNdFn}zl}l#N ztz&CtWwsLD`99Rjcjx3osh2lBHU0BZB!B10f2^uEO#bD{{i)D6x=MZXr^CNw;;j0L z%I&>R^M}P>Og>k+h~Lnit?>S9{uG(w<U4<(fBb*!vgC8ZO`(tccf4n|O<s5OrHZSI z-s|TVOY2#`@82|aQ~ACI>#aHuU)w1rJ^p<|w)0BmmiS}K`ulz4TqkNNds-FCC$6?v zE~>BpBpT!Xc>275$D3VP?;G*XUoMc&$NTKVrlfG2v-9uXQk!&J{(bA+{}vN>$1CQX zHMnzfs%Gea*IPY*Ue{iYs@pJYQ@LHc_DUf^>9&b7mGVnp@1MN0<GY31-F15lf6RaO z<(#?2zMr`|)m+<cugtEVf1A}|>$Sj^FE5&H&u9AORChm~9e;e@ca3u1ingSym%mr9 zx%p64rm|0H?|aond^WBJi;7Q#m%I$!pI*lpC-)~sq0zNoO>K*~dw8$XzZ7e(FbVJF zALZk(C5P@Px0|LsYlbp2XKZkE_Y=|S&wd_zzSil?!5W_&+a_IME$ylGKX}Y*s~IY} z)~fwFuvzB*AF)dAT=o2isWX?owt1@D74lENGkuoezA}}M>bC+nym7Ir{p@tiME732 z_s-q(k3QD&Jkpjp=jU4a#-q<aUik1u`QH6&-%OUi+Rt>4!7rzJdduYhi;^ar7g(&X z6Q3mZe*My*$&Np44z~RNWq90tf9u(K4qy5H?%13DBh~iW)EfS0ZoBI=j!xMoFSvCv z&#~x}6_-M$te@J^JGVe}dZ@tlg9la1AA0@xo3ND8RcOQSxkuie_+`Jy@^h~Gj#mav ztN9ieEY;`K*vAq6NmnM$YTD8B+po-4RJuNyHRRyLa;d%lzi)XoK_>U|jp!SnYvUgm zK7TcJb!w#P25UEg0Gla#m-k&`cUI{>^X_(c@o}jKUwI6V<(#^D-<a?J%#e&dP0QBj z?o0DG+IyLO$0Y3w)rIB`%BOE;{yV_u^0szzS^T}pAK8DroNKoz>h;Gf@2gYU#s99J z`1HUd`wL%hpQ+EV->W_0sD54Z_1H;a@3)^UDVwmy?CC;(5APb~?fRFMiVFE$6^e=t zkG)}yisIXUuP6T-bE<UTvZw9)H6$l$Z+Y~$t!1qoM@{aYclFv6atyZK6<>19+$w&> zw&16Yb&}h2=LhsBOS3=lUETDwXOYKM&n@z{){npKxUlEXpR{@*<>;h6tOY;X1Fcec z`2QUK{@~Wbt(JQpMcS;qy3um6M*Z{FXs@|<=FK-fJYPlgS6$7!MK}KT1%26ea*O28 z-|zG%Rx?F>e8@0q@$BT9pM_62m-_5opYbp6m!{!y^JxErM!^*opJv#Lp8WSEI?}%O zpLJc&*-sD7lu!B*{MK-v!Y7t@Oa2Mx7d|-t>`0q^+egtO`U%qCc`D2=XR3(vyf`!S zaO}sOrxS|Zf;YU$xz#^&Mq$<NFUQR+KDSRSSfqR`T4MKqMXmehO~>?eQ_Joj@8p%8 z6gP`~&EkNa>ov>2d*z(l(X&Wq*De8RyZXi}#k?PXG8O!47p{4I#m6$HS7@uSX8rqu zJ{|eP(=^v=6kjio(r|fFwLz0<;_NLZ)iJ_``)19#QN$g5Ywzj&|Cg6-Rhs_z#<M?X zUVPC?T>bvw^L^(lVi${gnXSD3T=@_8nq%+kTPEbqU3oP#|5)zBY<q<jSA@K-)$_Lh zFI@C}-?>?dr43)0o6i3K?jht?x}>0WWk`+<OZo%GL*_jRFIRv6`}A|}?3l*C-TRJh zT5v{oebA0aC5Nupbr|lK-)Lla>ExvF<C6-0DRPC*@w>Tu-f{i^c7AUw=I``hE?<3Q za$537@5P>dS<Vwr-4EFJaev{nPKBDc9@l!;R7OfJnUm`nbx8Nh+h06WXY;D*uC#i+ ze}-Gl6Wc3Q6&#^aUye@=X^uZ`H@k4Ye3iZDlYQYF8ha*o_0Csa@kJ)ddH%!SanAp~ z-0=16T<hH1K5wz#^}Gl(@%CwTUNuW5TUY5XaQL~NVa2^|){3=hg~x;UU;KL8-{{@` zXZG@wr-k%h`f9(VXtSdQGk;;$@!xCynW&t$WB$H(59jG=UO^!pVjO}y<4iW`6d8-B zB?mSBo0fX_^sb4@H;mIw=N`+J_nug9w7y<FiLdm?bIGippOK9zn_s>4+gR(R6sO($ z%U|YPN%YDI{S_ZBt1`&k-O;J4|KI7!zF!CY!uC}2uWM<WvgY?Mc{j`J##?I{mA2V& z|0%lo{C94mf6lg$f2K7G2d`e@5BhmoJH6vaX~i*<)pi-J)?dT4%<H?Bt^fO9ZFlyJ zTZ;0A?Z1S@t@?E*=O3RNGkp{9{N-1VpJpsj%}qR}oNBpux!i{5n~EwP+`X<DXf0@Q zXl3qekG|T5>iN~Zr+kwbEw=tupLG6Sv0b;qIk~sa2_I^9o%!=WX?NpJ|7AtbE(q}H z%sIC<_fr4VgbyDd9M@0DNs_Jql<idivr9HO>(Y<bw>iJfq#9P~9yVI`Q@Ok-w#m!? z+zfaBTVZM6ZM)A-EB$S9TZV16GMj&tpss*Y(cX-dNR{#_&$b?Wysvpjvigh*MM|sf zS1u26(M$Tf;+0R$2k#`lojuoMon3#jg)Bb&{<r7!e2M<Ea_!fr$~VloV9g-^wR*jh z>Ai^`^;ew9+Ov*JCL-d`qW+me@#6az^h&x)E;w4Py-_Fp*wY`Aw<m8t{%4`aa_zF) z{|)vzl-0!d-ng)<Vfyd5*r|oP;~S>Ob?>^EdFaXM->uKe-_!)!)!&qCKU=7_ScCb- z+)fGqUwh;u0>pdlU03OzH+e5AwU+UXOkAA(<2t|p$uqqQ0#?rWA~a{p^GR{D>;L)A zvA);7Qr7<2@q@XXv9T?Bm)%liT0&f&s4bkBI`K}(ti9_dPD?%e<in?lGWRd_h`sMW z_2qGZiuvztuM;MnXL<bfi^(yWFa`4!2R7Bqz5Md=fBm2DOGFuR{``0|tNWh$vw%Q_ zPfGE9tOY;jo{b5UWt(mM?0fo0kputQPyg3n;89gss><@HRP;!izk>gS=c}GyPV?V) zVrqSDf^oPLBSYUh>7!T5#P7`$i~pi8e|*!W@9AdGF0lp5RlFAstH0IVvSQktdv_;Y z-pwoRmb=LDe))=f??R^SIe&7a-=23$KiJ=0X^(RWndYie&9&KZdE>fisaq5O9XQDn zKHF{gMeZp*Polc#=bt<&+x($&zVWda4o;Rc&(3T}^<I*;yL<k_#a^c`bjRhFABim~ zj-S8$fV`ZwT==8b<rY3R!ZrI$jth#<YdAk!K75kx<(;SM|1M&)+dX|Zy9@)5UHr44 zSDxHEUR8eQ_OZX4c5*^E$2x(+gKu54T+$-Xsb;BvI&tOVfsC^A8pjVl^|h4#rxLBU z&*f`bWU;^=-o>vPPdfh-y8ZQ_*u>Y{q5@fzc5XA#H;MbMdql3tXyw=EIa1Z9eT|E` z*-Fyx{Jq`T`{Df5{C7{b#eecWy;E{}c)ir29ly7y|1#hAQcca~gYjkS{ioN-d&Pc` zu-{)LKlz{O)Q@McE%U$r@^QD{^vQ4M1@@iHwR`wwUDC1Fnu{0J9RBO_F)=arS}fPp z`&}PdCrz5tZq5Gw><{s;(WQKAUvwX?{P_E)_?-^zhkAXv=jIpQ?c#rT;K!%b7(T6? zqVu<NXxr^jzFd1=CZjjidy(7pW)Y43vKuykYIc*{zI)P}H_>0@68GD%HKckUnj2$v zIeE#Pwe?pELo;`BpZ+vKCfM%so@#gpZ@S#xr{3{_KlIN0e{gA0PyW7^R%bbu1=o^~ zzc5J@`uEfPk+=3t)%@Bg^B9!sYQ;{=`QMGZCF<m|PP$j8`^mRUZ~UqcZ(4KvhH19N z!_|GCPki~WHFb8#z6Y#Nv`YjS)*qk0rKL#a_?D#0Gmh;Dt_oi7F2Ud(zqdbG+HKPM z2S%sNesoRQameLu{j9Ue%Y-NF_g;4S%9D`$-(NW&>a?n`b?!Bc{`zo-;O<SvjQy*X zihqAy5cT@$^pg3@)~`=Hrfkg-`%kkl@iC`PZA-CxwvhNglgj4j!5c0eEw|=;Y1dgg z|8Mux{Jw=LbMp(-pQ^ud`0w*u$Gqxi`m?WZ{a&2<U!eCWo2f~;!|p=QlpSd-;gWs_ zgY;(Y-P!kYZkgc5m$}buKgTn5&wX&^-L{Imsw;mTIL+`xbIYtJFUtO0_^rWs@ZlWG zD^mVqQ_h_7O}ZIVr1eqI|3mC{8<z09K1Dtozx>=VfAO=!)9dO|p8pJd6>nEJOK9t~ zi%*u`H*ekdv@yf1M$YZYyXP~_4dfkF`-;u>SY>|v9<<@mjnj2^GdZ^#d_Vc6IP>=& zz8KA;o_%?3=Yv~<c;lAEG_&aPC@tEgqjY_}f%Inij9kk<a_KdjEvM{EHd$*IwJ;^m zh*f*t!}$M^(_ZfKO-|qNdUxlWf8TgteSN`vpmT0*;Sc#GpSMgmHdDQ8RjPk`-^|0` z-row``E-ZO?1P`SzgMgI>yR+z<1Y5s&V|gY3*Og!JG+1S3{Y!ZxYqOgNA3@w9;h?_ zeA?W2q~)8^vjWGQy5*V?i8{G<vwuwgzI&^$O6T(58_EwB%iRBCXLdZY>-vwT6@UNM z$Jcr7%=q_g@){}2jvI&l3!Wt~`29EVx>h^YOj&&S|5cy9e>_ml9QpNQLK2_t(V5Ma zg-<LUu1-5&aD4L1`W0D5DI%-eo~pjP@pw-6hl%<>)VV_c%nY`^xBJx@xtTUyKmVRD z_?D3_<X6fZEyLJ)?c##}8BJZg^?w$=D!c3Q<Xx`HoHtG9AG4?2%ir<xwEo6#-Hu28 zd{asPCVHr7-m-+&^%?)KE;(Iy_T3YKb247`wo_7fZnRwdk^6@8QMbvZ2Mh#v-qTsY z)wk#Ji@*Dqi?%<>n0@Ttp?U9rOZD$wdT2+NKI`dEhu_KcDf_!h*%;2ceQVyiLgS4I z4(UqY_j)Z=W472<$Z&6qR>V1tu8_Gdzb|e!UUu7dv5a-yi+=5WjCT0~)Bfr(9@MV* zaQM7tgl6l@x%bsf-{n>5<+L8YKfQ4O%(?fKEce;f*4J?~OqIX({KYQD9l?2rHwAHM zY-*~G`|&2<-DT0Yr^!#-&rcAkwYMuT)QRS*Ym8obx74C^mkfJ?)8|wX9sAxZKTa)~ zm)m6M_vcgo636-d|G(AFyz|X_Pv+7WpNrWQYK`CA|M#7DsnnhV$4IsrR~Oqq@B6O2 z<oDq#@2gvG)>aD!ywO-|7d6wcSNr6-C+*jSLS9wx@{ykS*iKk5n|o8%4~I)a=jPrw zxAgP=9a`gW@h3fK;YY4n`?f`9dh|iN1&1XzdnR_An4dX6Rq*5yiN{8A*A*@a*(Dra zv3<tf<?elRXMWf!FA$Q&srq_<+u{Ef7pvpb&u*}iOf7wE{`ljvDa((%l@DBbGNH*! zN5yax_vw4@`5aE}>i$sKwJFWT<5==BcPme;+f$fSFS$<&tGUo{*n9t>P0It`trORX zOIGpR*c<Wj+w>*J{(rq@ZNK-IBIoj30ZU$)hh$kzPzwF$9rft#n_2(dmc2aJX4`z& ze%dbE>Y$Y`H}4S6-t=_#^vx#AgA`x7^V#jxt+liEoiSyl2J@dUN$dud8ez$yeZOVS zRIf7jzW1|f$_~S0uV1cSq@$#yG~H=-V)u#osn2*1#7?`LZy+4yvnXk@e(@cRAgrxF zzJDQ-?e!*G<!Wt{<700ecw+X|!!lT2;&`oouHu{Nm*?EODdcf~ed*)p-xKyYhU9JI zXh?p|p8UOg!RICEC&MjjjgNngmrHriZyfnEuUJmz+hx}E+IlAXcI9<mSEU?ZpRcp2 zf9sa^RpZpo$F|1x-p}uPPtR07AJ3J1t+DdR{1=_)lM{<)=$u?x@YI-LiJI8Xikmgd zj4!gsEeqJWe&_$Gb2it%-!;+Haz~1Q-FchGrPr?ofsQfJI;}LRbm`64zYc9$GqYu_ z)WI#eXEXj?%kaA5cScZupIiI=)3ra_KHhj!SP}cuefQq-7kTewZ}HAQo^+jmX~(_b zc{@5*Rb1*y{O)b<zv67-iTD~r&gHisd;MbB&!8W;f9s){`TC0e@~TDt4DX&uu}q!S zb2ib)ZBqXG!Wn-*`w5qCQ7lM|)Qiw;jqCo!RFD#y=$E5){^nv)Ps?cj4e3^Id+Hni z&V2Wpr{kamd#7RF>09g{y>x58+AZSW<F$}0{^N%u8!aEzmaE?Ux$wL~P%`&}uO)`Z zTCzRG1O+E*Yo2D?{dmfv33Kkh`jE7FZkWJzg{b63jdIgcZBHChOxCP={e8>tqIbOi z4>6xs`~Ol(zW&bNl(PGAb9mo(eiS{j>F7i84dOX@KMudl(lUuXac<?_NaHn(U#s4z zsID_?)$V6fcox8TK<QtK{<3YaOAmgoj&c3}Y3tuVQObTfl1<k`1=obkspMyR$$Ino z-@iX~wRJE5)j9L?__<woGZyiQ`0GFWsc&=Y>&Lf$Kb+ogcU<IYt8;W=)pcWu_r=F% z$Zz=)rya(_XWw5mVb1@+G8bky$Bq;6Q=eMIXigPveNu5Uo$I0Tt*A%0rae1)AnEkG znr_dv?!~9~yA^+LV74qutCP9XcjH33W<Va#R_pVRubE9`@X7mZdhAE4Pr3X2fN!<? z=dakSd*j1>CW-lzt?phr|64Lb?Jq-|<I?3p|N6Mkv%ZRd@reD$Evv0cg3@h|<+rrm z>fhsV_g$jJpV~hcetVv4Yfq^b3#@*}x*(_dt@xd1#nTr%ynJf@=l9N9ugbD>QXPfw z4eb0Yb=O{>b$)_Ow1=ff-*eB^9CJbils<*0{?swkX7!(?d--CVYmrpBlfbbS&5j(6 zvvJ?8L2c>-djw^o%V)W#_na#<7Ob~oIX&%+^5p&JcD#FWOu=U5_J=2gXJy`EN);EB zzQw)Xy2Hj%dgUDzv4$dEp@L_Y9$9zR-m(1gUD?I`9cRMH?D+vJ9{IO?u_!xO?4Gx_ z)6h@Le73{ief#JCHqrdm_eJi}#!b5IYbR?9)^FmjW1PKnZ~70`?c0BEV*S~5?}l=R z{g+qne>z`1KR<I%tapalhh2vY)Srh7O#1xO#-XQ3U}E>Q)a0J?MHb383|5Kt&bz<T zL*=-YaFq1?^o30)mL1AD<G7&r>4*2nemwiES^0ZK_q=H@+(ZTTOn+kh_Q%5K##2`9 z@A@IEYPol_d_v-$N+aLs)vx{6)Rc2*7Jd)hl=p0L==4?QU5j7arDy$4oU&q{!1|4X zJ9n$Un{sLjmt@(+=Xznq_UdK7EH?e&tXb!|Bj|HMmUp_%%Bu_=*0a<fCnQE{>a7th zp6_%2$*muMJT1c~PPy?cB8+S6?mhJfzibrzr&IS)n8`bD!QmM*&F@t2cyqSea#tcl zgmUk7TL<sdZMP2YOlEHU+2vHUCU>%S!k)O~9=B<(PZnMJUirC7OrUhZv_}(U&WgtK zMJ!X;w9};e(z4_|Q#)=2wrS?tCp}+t$?{R_b~&^51woT7$~Q6pe&+Y+%Q<z;uv{zG z)wPZ4Yn6_h{kO{sd-_k}6U*PORPV?49QUVG&A~M~r)L$!9q_;N@RT*b)!t3%l8G?s z`*1b?F%Qq<ZG3+jZW!-AXFBuw6XRUV;un?YWUA)f*syQO(d!Bd6^h^g?0)U)e!!Nq zEa<WHM5*G_ykGCNuG2d*<y(Hio9nxN*zopVHx2Vn+V-0@+$%7~v&>b|@>=KG?T^2{ z<hN7$G+ih8Qh#Q`%{T2YEmlgmo?fOYcCt{6@2B|1-=Cz*Z=L3PY*n`~;+pIYS!IoY zJnp$_K0!*8o<6g^+B)Mx*bf`$UPEos6Qwct-kuZJ3|S~3d%SkJiHf__{WsM;>$e%I zxh8g;IQpl~B=m80uV{W*h{`18qcS-i$G<LY+Oe<4aCXn}TKz)7_L&!ww7l<Ut_V@_ zUh``SpKx@as@j(|A9p#2Ov!I}diV7|{^xzy4^B=CmYVeVkHrexX|*%DHg)`&+cPnh z;q*)MISY#Hta|6K%TPH!<5C(+rssOeWHXH(=@+MuZt6<d%&(r`Saaw1Cyi649sycK zHy<g_{geM8VN&wvIra_VElxWZPWzl?@yTb|_eaa8wmq4%$YzIb;BPI7^~?JY2~70X zJIxR_@4!NqX*|mw?}+Sj&#Rbxi$^{Fz+^SOPaTJLB-Z<EKk`h%apJ1tjQ{s<db#M` zY;s)NdFwmNvF~#X)7CNVbe#Tik*JrDxaD-c%j~g}nJ;&yEIsNREmXQ;gQs^5r~#5X zJ(c0~yBf*e_1vrMKJb3G+3jw4lK1H3wB&~q_~!8L7WRLoeQbs<mnwVB%^P#qCl_y7 z7WMk#9ovlgLKF9IDJ@d{R%b7;zIt)t^1X{3iVl3rjokiV`g3C@@Ape@?!F(qVT$+4 z6TGRXe`vjlzQDe|dUxUSJ<A+io^+l5^iwom_sze*8_(QjnHtxo952*(aQVSJk=ZHQ z?Pr~fViYe4aZjq)C6(zJdhpDl=Ra>qJPvfQe8pax`lfH<6K=c1i;edOC>1rn-}PNt zbJMM#zU#_0C&+B;xjol;;~Uw+C%uX*Zpi)le0=iq0v@~d!7n|&eR3+w;k-2IkEg{w zp5(U&W}DrU*c^DX<3#B6r}lq#=(6464>|f!yv6XS$m|sTXr*cATaVYu+~8be@c+xf zsnUB*$`7W=`>ouyxT4_3c`uhAKerx}xo^R7`rF2jJJd8L$n33&c2Hix$CqBY;ilm} zC$DElKWkVIh8#`1zs6u)!(G8%ZB<4Ko;4Rg^0_>jH6``rCVBqFjjYFJsCqd+`BU`p zi*(=F^=jMgzo~AOvtH&>w6NK``_t<ej1@sjA9uA&Bu^6U;)s}bm7(IO#A4&A9UUul z?qAW~v&TVX!x@Roj-4GTQFgBq%X<{+U&fZqTOxS$PRcpq*iPG9JdY)_dLq|4fQBYq z@>HzMlfJ#+_|f1tEtOT1Z{mH)<ZV*@yE#9qe>YlqlxN!h+U-F*Pp<uE($cA`Uhpkr z%g3FsS8H^4bab35diPaCfQ5xgDpG7`MCP|$#~u{l_x*9J%IEb5Ho<Iet*Ntpa$4+- zt?bV~T)Otdj$2aet7kX~3JOk?o@#b@-!;bQu*d}N5C7TSZm0BQu1InDSGF^=?X2M> zrKxpG{$9VYJ#qGdrpDZkTlcviOK0^&E^u)9_pv%)c4Bu&OuAI$zHhrG+O7KY|5W6( zP|uAWe@v6l6g@7zuBK)(v6H{<>@C5qQ@r@LraGmnZIkmnvvAL`=W7>%+ntuJZqwG6 z9++0jvEtM6)%T5$?O9pkqL(STs^P9-lTGX6${(`>f3Q|e_2T;&`+d1b*P4=lb52%^ zcAQA9{hpZ;>GH(t@`+DdV=s!bmCgNME@Q#+hSA2${mCVX<U_s3?@nB@qSYtUyuI~* z-qMh~0??qx<Jo^5g08qdF5Dgx2x>LS+<b1bX-@9ZN}dmk4bvuG64=?5dh+Fed7X5Q zQaMTA6OY}ep5T3Q;LxKSDRTk;Q-*uqEj%{Eq*bZt=zeLFO*%?Nb1g+0JD#W<oBM51 zYNTS$e5<Cz-rp}&t~z(NMtR2F<<`%Yq~_j#QZ<(e6xeh8W+!%goYOvYEXQ2#``;t( z@6rx2-{17+Z1vPrrJFu2uJXySoVerh@!sQi16)BzT!l<?by-&qiqA)%O&;7>Upn*B zKi<AIT5Cc!d0yF9<MaB9Qlj?khsCxTd)A#70Ue8U$7hS=wvH!n4(0eTeP~II{Qmj$ zZ{-`dkJWG0|D8K&XIq`jg}xQd{SQC$TrHGvadCN)wsc~u;Lb>|&t8v9+XaNHrgiEb z-}Gv-m6vLF?yp@^lcVY#uQ=}hxNG%FP)a*-)<^lYQc>~LwDrI3K~0wvn*`_Fxz@yP z|94K)(-^O3T4!HfoBv~lk;M7Q$7V2dfe!S^E0c;8n>c&DfwXX<&AW3dZfBFq=FilT zx#PAnX5sv}ykkF}6?^u?W!JpBrUg2`4m4^o>9hCen#W&5)Qalk)VBWY0Z*8DZ^^Io zT(;$J!{pnilJ{(v=+Eu~r{Oy;px(>b_*r}3UDr9i>fpNfZbd0S1$UkK5w-G9@6EmP z&+mNP{h_K&BDpS9K}ktzk~Apo6uBpwrLF(CBWglXnzHb$^Ut1#zYo@`-}I=N%_qZf z<__V9#~$zVhDSq@cV^j6wTGX>p8uE@J>$|lTRt6~d9R%<_i9hboExW>6PjG}?%A=| zzntca2nq_Gd<%|-eTQ;<q%Pdww5B@Z_fL**=c0X=f4p3rD)E`UMB&$g!xHz4kIk6> z<t6C!Ezji>Qw2|+U0ON!<4$QI@v^2)UG<Hh7FX>|dv?8lU$5ud{ZGy~uK!q>y#f>u z9VyEurV0jTeyg(Itn)hhP@Uw-mAYp$KfV-a3HREWnf~MUx@Hf%V4n5MryD+-V8;kL zu}b{XiA^0G2|bp%Hkq-WU2~7^S*~VWpKyD2o|^dH4-AiI>nm86?fkeyJ_wXG1Op?* z1b1G!wCBW+JKF`SPaHgQE&jvn8LKSomX+0ow`ua%`dm2|B$3bh*mL&6@+eSJdY@^W zBRH{pYFhcN+0#<*p4zu_zTm!J68-0X<oC^)_`dr4qdOm~B+dsUpGn)h8RVkrZpx>X zl<Grg^jap^WUlqF-8}8%*=L_Fd;1oj>5l(*Zmv&;Veb#&_MY>1J-`v+k{aovlI^|u zv?=T3-L1m6wT+hEWq%VN@TjeJqq{kq;oi&HGO_jIcIC;BOKVq_2Y_7l3G6Cw%`?Y# zG&)X8y?b<5pz;m#dgi%mK06o2J(;uIy6~IFlTKC_*jfPgnt2P4%}}kn4obZ1=D1CB zb<taIl5b%5J@!azyWzs4DPgr29_-q`B7XmhgGbo+KYBAU<Z<bBaDgJYvq}mSZj&y( z`P#Qh=XG@78adA++tO@4oYUyK?sMvz_`}Z;XI>f3cw*f8v1*rOveVadpd+_d=yZ3) z+&`4#V{+l{rZr(YGDdxeLenljTwQtd)01xS&@}T$(9ramOS{2`L2d=5uM=0NKbzlk zJ$CMnfWu3!#c%p|I(q$0q=DQ;$6jkfI`~Do87Yx2DyzLVTfdb(y(z6A;U34K>n@*e zY+t<j3+KM~SEsiKZ~ai!CY8KRvk+8NWxIo-CNgqHuVsqOyY_<lu_u3|aYy_)#2o&2 z!RdRu+BtR8gzAg>Kkj%R3{Ng6XD+qW&9yof-Z<IX%kb&K{+rgzzogoq*!Z<|#<hpO zeYrbi=l}M5Tw1#}#nr{dWm9`<PaxM#!7Zu1jCCf*bb_RmcIN%eZ@BwYlGQ7J+2tdi z(@U0D`rA7Byx9MtvP~j6Ov80z%;(yV1|LKwh-<LQuqZVu9-9%Ns-iThcFXxq9VblF zdT#RENxu2^@5~EHQljrAT`zApiz|7w^>B7^#!ZKsd6vgsuUq`ZrD*OahvWnA|2*w- z5W3)fv7;kJzgH(c`~s+;`trW%(2cqCA5OQ||GwX<>(bXpj2^w^2Fvd&1SK<{mp|}& z#U-JWQ|}9^HpV)9kY6`1rRU|^5*L?E(?JPk)5V`>HRQMJtY+<w|EGU&>hnkPGfs5M zo=@0wUNSjNTXka0U)jP_o7UVt@b~$8D{h}4BPAuR(@IJ^pR#`xTCnWtmwMUx>l;2+ zYH5fHTE5R-ASb}0BApzjDI_R3HC1rpozPi#Gv7x~OV#8Q{Ml^zoZC1fB+}){u8S)d zySS_?PrP<e*+u1Zd6V=E{yEHPT7rTTUpp(G24yw#c_$rMlh4GtDuPF4m6XgGPj5QK z__cA-lKD)U^MiIO{okzfTJ>mw>!U^&g+mgbyB`UFtP~X7IZt(`Y?*txOx@Fy!4=x) z_Q?HdUi5L<(?F|9d*$7t<ANSJeW<dTcGiw_ce0k;b@5{}GFp|vo>H0=t9rA~_<RLZ zlkAl@CcU@%U)ek?dR(CDoA9;%oyw!@Pp2JzU;MbxH$X$F$n&+iY`EI(I*%S$T2Lwy zUVHz~#+&>?mmWvvy_a0)@}$k|^~ZNhj=nY4{CHo3NARb*mDIM5j*ghjz;oSaH_qO7 z`qoMf@4gQwreywjzW;L3vs&-Oj*e5H6Fy_4%l32L`TvN4Rnc;_f&YJfMptIt)2~(- zxPZzO7ne;_o_?rqYIqQ#WxIe`&GX#lS9fnlZ1Wds=>TQT4iB;Isnyl9_L|2!di05e zC{BH_>VD+3tL`x4Q+)lmt+C!{t=pu%RD<{A#;&V(y6^hWPU?o(o-*^cW<cWNqzN)_ z-!=Z;m}7Q&(<f~na1kpwarN_pu%i#x2d3_n6k%%;ZHC%-?N7~#_%}U86J*ZoKREF7 zkPbBB!cWc+s)*rZRkWOEzE&k6TmUK#I%{wfXfTfsj7iczY{I7bC_@sjl9IUTzMEBP zWp%F?Z3i_^3%}>5U+g}cKjXS}euDb5FR#CEzr5z(`L}1@d<s1Fl$F`a_}#y^N8Em- z$FK7>|KvQsZs)ttTk0J-)watzU)fg^wF4R{D!W1B-*M#+?)wRE+$g;6$tJGXRu(&+ z=*4jIinc()2~>KfFt;lSfEu%xuB{Zk`R%NX*Oi*~8HZyFmWLjB*0adtsN@#;&$-7+ zxZ7<!zWj@;h<Up4=A@7MJNnwr*Z5scOE+2;X|TXJov-}pbG_!XlD-EwZO*h$Q!;C3 zOo(bvjMx@(!0pt{Gz;eK5B*j(e|)O?&xQZk-TTdT+Rl0vy}`F@9kXhb8IIlEKUa(Y z&pypB-#EWwj-}`IbDuqZKL4A#;U?8%(G2bN5=)(reK^p*|4*)7cKh{bAG*>%E(tsS ztY^`mx$^M_XWvOaz47(0LXfbNff~dAhS-o@^&;PSZcaAzeKL<Btj40@$%|(a@pUql zPMX2*wP)?$E#`4QWnaQfO&gm^pJTPpY%aFXQ2zUJ`zAXE;aU2N6Mn8-a_p{?SB$XE z=?UvU2ubn&Y%-nCtD?D#RYIQ8b^4{mH}xlkpX_{6>0kdQbIGxAwXZqCJ%x{^*DLe> zsyUOJ>u<dK{o^BTe2fYI8cId9zLze$uBB8o71Rh;QZnCmqE=t9=C#PKnqqm?tbV0m z5BAUeoD$9uRu|GAY;C8o;DyvG6M2u1QHMRdchCMhfB*c#|MIvNLm1imf4Z4gaj7e4 z&oOtA-Klnp{pH8g`W53pFgfii-S;AUHFXw*q>9~E3s3mJX#GYVjpF00Mb=r&{jgO& zsmC}t@ZOiRCNY{%HRGx!Ql<7ZUVnZ3pS=2pycAvrn@lsY{U)=XtS}Q<`G@zZ^ndB} zc^rqX_oduDF>CtQe{*=H8|oi$N_~6nHF4EqkDhlY&gY*w_RMGDy~q8*dwxAvakD#f ze!X4E&ChjaZzN^@ZM^dK=43D5`A6qQOxC@>hv$IoUh#khf5I6;@^8<bV7Gb8h7OM~ zP{XaG<IWAH?*9(6Cw4RbxW3$b=Ff=Ob8X)aPyQyG-hbubraN0I(wSJbmojX4^0oNL z{1to$F7`UkvAxxP;K9$5nLkhdbiZ@pj(V_VaRvvwnBQ~I2x){x#+OIkAz3wMk9U^) ze17!7-u<sSU;LM?q50)qZ-a$CMrDfo1ZzD}mitq3^5^x9*j9g7<+|xv)%Sn($&GL5 zSbLsnf6SMkb<sD3XX{R_=au&;*!tz?-<MO3UH(|vB+rU1{>>!DzvpVdQTbeE1+ygH z;@@W;e>mlM$M{KR-OmqtcTSdS-u_S-Rl7%qA^eh9noZEO%hj(KtM&d~Pr3Kk#^&dK zhAUMjO`K<cCl=3HdU}f>LyJw_l>DetWy?)w2H!V5yF0O5KXzHKO}%DMB>OYL`bFw? z{jN8wAK&<vYr+s3-4?i}YLl3l;7Kn~BTaDPo0NZrT)*en%@bL<&Fu11r>EN=d=^W3 zzFkzK?6z1>p~3S1+t0i*Y`8kV?ZS_v@s$;iA{h8|R&XDiuXJ_VWU2QjeuOW)D0Sf6 z!>3>C|A#&ipSMyYeyx<OS^A&-HHRy5zFF*9_lMy~%RR;)EACf^F1s!ol4cqg&dR5w zQ+M&WPv`pX_zTB+7V%tow0CO6H0{SlS%2RCU|oA!;}k>d>17kwzbLxXx&5){W<lvF z@ef7!SFbi&_L2L;rR+d+E8iJ4k)L1AudiQrdfH=|I>vUR|Btq)Kl&Q;Z_jV>6Mt@; zYmn$EoFK87QC@K8voEfo)5>oi-xT!Wr(T_xYI)JGuYCWf_*@s)5d6NpXc~h<QAwSY z?SA2KuX?|ncjtBr+gg<W;pF>UGtFu0v5SRod}26R87y|?i3Hz{{V^x=qpPv#t~DYN z-_9$~wfk4U;LzkSh7BJdZ_d`Mx<A9&webY^|0@r48xHFiFWhd)W0rpAeRu`;gA>BV zi7U^FdoL=SRB=dt{b~iXYNum%N5a3(yQMF4aqG>Pddt60&+JZJnp(H+bA8Uo9VQQ; zt%xGwjn>Hp%ct#mk;}RKvj2XOfInyEuhXCMvM8v;kb!GjC+mWjucaG%kGTEVoEyXJ z_x6S3nT6t!_Eqe4jW3VxN;#p;65g@nfo1oVjy-yoH|B6gY;(!lR{d+y_V7%}s*itU z3M(#k#T4v4AN+v-si~a*tJcd)RN0%SdL8uAyfK&a$DW^ssy9D!e@OHB{94@f!_B>S zY#%TreE6ADueFQudhR_}mrcJ{M+tUxba-t0sK14^yl5>qpOUEjy!IW*Z#U!=UU@yU z^8WqH)w5G~)tGG&E!#gCl!znmvKw!_TK>aEto8J=i+}EJ4auCkZ+*_6PN5Lk5{P-= z<rdFB-uRIlS-*&%<^N&rZ%o(h|IGQ6`1i6&eb9<OVLkd2rYy0U85a&;fgb-Pyg+$f z%WjKpmi5O<we5B=KR*5aw~1qP;nDktKl1Jue{qAOe$wLEkHmK{H!wZj&RiB&cR?dr zDtyx1+U|SGZ>Ar=<h@;&v%Kh~&-wX9+x~^tv#l$+r!TelDf59JI=V4RldeL_{F~4F z=1u<j^zyYgzYAp^zMlSIzCBZUk>I4{Sr0x>S>UpEyK!#`lZyNH=eyr|imcku`hxka zM{mB%%&M2}E_zYPvd^b|NlBaDuMwB57}wt%Y+aqS`FP;o$6}{UJrasft~}yybFlpG zCxMt!<CBI*JFG6qpRVhh#V`N!w^5qEg61!|XSTIX*ADOB|6r@*FOQY*rP`moPc3}; zdiBhYC-|JE*L%g>s9^Gze|YEOtRt=VzV{ydlw{Zby?MgB$r0ag?vMEQOv3BhPqy-) ze_twp9=1Du^|oKa>m|!{YSU$0SJyWmK7aV--Ma?&4u#}>QerrJFXs3czug@-zL<TU z_fx;|s9!-=dGwxllR|10Y;W7NhE0~a+b3Touc}}%$GAP}v8Q(B)%lIubH8^N&bwdq zV0!=jWiD$|O)4{&ix~-?)Pfd4!8=n$%6VV7?K@;YQR;fbjt_Mz^D|rH?{R3ENu6<y z*V*yF&Nct<lqs9HTJEZoSa;;rl-wUo{CvM98-B;%^tx#se_(FZv=6281vY-HebeXi z%H~#o5$~n$E6S7I1DBlgm~`%r`;AxUJMP?{U&DI+;*X`vIkn#XyM0}{=Cn!8Jf}I9 zCNmD7?usp$#r6H%@gf)D;uM92*;(;HeE1eP|9|>7FIU)euKVwV;$y`%pMSf^*Gzh3 zy6?o6^F<#0$yeUql5YQ>>G!^-`SI-g$2Ki5xb3`m=l7kl3>JTCZ9d#{VCvFQeRd(Z zW&K}~{HVZH+iKdZ=h<*LOjcZcBD{jL@VMObC*Q6YKIvRkadu+(U&$SpD)-OW6>I)b zd_!-`<XDTHd$)=i2%hwsX6UAw;(lS8Dcg^W5}Q3TJ32i2;+9*&XY_y0vbzXv5Nesp zd3-LvrdfHiC|K@S%a$YNJ%+PI+B*Ks1ohfL9ewZ+EST|c9^VI5B_$>EWmUF^R$Nzh zaqQ?g@pZw(RM7F<g5ZuAgf*2WB0D8#W_*Y`<yiDjKk>Qcfu#!2#_+m%*K7N(+<3(0 zRJ3Qy5-o=%P0$Y7Nv?Je-&4yaRNRYIZ*E+pk$gt8RT0_&6AdeT7ZH3^!Sa^A{9V?4 z9IP-2)gD84!#9bSZ$wXNdlFH&aO;O%>6#qS9?6==rL|`pTlb2#Jn?w#c1^)>*ABz9 zm4{&V86BJ9TX8pfru_%SrHYp44$fzL{MBY9%$=L|8SD;@Q#U)4^zO3k)V3!Q!MEx< zj$b`1A-ojU*;*Hv=vOs;^Fr5|m){H4$jz;e%!^rV&ztzDd9kPWkL`xfHZTcJtbY{1 zqNJo$6xw?8an-S+A79gwR<nw%GH4bmEid?f;IEh4y4@?Bf8MZpm-nbYO!aAw<DPfl zj?FOUa&ysZ#TZynDiU7*e%^t1*ZGpYn9b(=JoI5_m)6YF&yM`~lyviv=uy!PmP&=o zuN+CUXV_<8^Um_vjH@7n+QG>~<+McdG3Lj*r#CSkTryXiBjfX%)8X6|LJ~_f)^$jC z7{!$@S_BQ8ofEw_^LJSN_t%@88tLe;$ncr@Qbnbr+7}G*pl-Mltj9D68H?!EdnB@h zI%&40NMlDw$BEv9o7ONq5L+M>aADIL0fmba#U3v~b1a~lk0)XIO#X~=2l#XtgLF>s zIxZo+u)@V<Q@`0^G0@FQg@0InG$=VZDoAt$28uzFx8TXGJ%-wiQ|x1=vh@T)2Vj(x zcHW(0|Hoc%#$pc_XjxFSThigl&;R*G$6T}_12BSu6JyRwY?kg|oYcVS<pRx_E|>m( z|MT7?w@Fv2Xzq(EfuM*spC@_1FS#dB1Qy{;3B@-3sjKrMr+xk-xXIN;W%vFrQMmWE zO}kszvS_>7<zJT{{t%Z)vHWu^dYb4G__&gb%es0`z23X|DwW+kGK?2#v!33`P*HPl zw@&qIxxTy`DV8#adygCYWp;L?@b~I~LMG<?qMYsgM;~r)&^jxA`EPror0dWBruFHv zwbO0998N|}JG=AJrZoaf)s!aj-al`Z=VHd18=2f7-)q=CrLCi*BVyWBiPMHnhn`Nq zT=?gV_pZy|UOv5PS*&nx%iCkG>jE{qI#%ec2HAAt?5EiZ@@CID=2UtWTyMA-l3V#~ zll+t8_1jg7%IkaHTPC03_X-7tRVrvsqv+jx#`eYhZQ&Z13q*A7BWgqWr%lR8&bxn5 z<v3d+XzKW(R|G=!rS}a{5q*MB^vfpbUEcgnA$GO<wI?SgIsS+#?!Eqd<0Ub{lTua( zri0SSR-IF2&)qFP*ZFx|U%zRO2D6FWruKW?^A`m?bvXU(PG)47@lrjdNv!wpOGTbr zw!jpW-Y4C@_V?|^o9+Q$wiRxX-D(j%&m<?;@fweGhq|TQ`sxnDXLIgx3Qp8s{2Aoc zj+9(az3!(Hj`x%_OMW~GWb)d%>Fr7Fd(!SltM8}3yj@<H^LPEUyZ>f>tlEEVw~|uP zPtY)JM~6q4XzK32tTJ`QE3OqO-mRCIxYqS&zg$H%bM5pJ)eTp2r=8t-YSWtAU*C0f z#5^nCWp?=7vIScuw{>)!IJ;-we*W3XDy&*M&mI<T&RZeA{qgNhZ)VwXl)ut@Tx!3* z+#4QP>%RW7wJ&?l@#hok<%|;=r_4L|CdR*6^gOB{>-d7t&(r2DE%%2j-c)z@U4c#G z#=Q<dt=&NlP|HWIziq_sm&v;n`3Ux;cNnULyk7zuJ_8S+r5v@|%Qr1q<)`<XrKhiO zS{A8Y>tA&)|G#w0`LByVR@q<Kt);YR(;85iDuwT}+iq=t@Ll};3GVKJ%d0E;<}cjo zU#6nA=JC(KXG^QvU0p(^g-&yIad}d7?Xm2}9A%BLY@S^E-!GTV+9@2}9P#g;f{mwV z#a-uK!;MwP5vt!`yZ>~fjPi+ai_Wt6dOrup_rBJfPv74?`GYC*!QV?iR_(vETVHAC z+;f{j17SrQ7v*f<-*GozY`dLB|M7j&g~8&f4Qcs*yzZ;s<<ts3TV!!PV%k-Q`AmW* zufAsN)kzNqjQ|S@p45E(W?4j^pvbxp_EvqT=Pr-9Wx3kKdO6>rxx4u1Ket>g-vb(S z0}b3N?JSFxZMkd7<i5}8j&+I2RH^xAzb@3NTga-ujrY)xID=y~tNlAcLsg(q^vH|y zzx~#~sg@)4y_{?J_Uqac?SFo|=%{i`<Y+~kR5G8ofZ$19nJ&=9c}2ON+t%C$`8Ga_ zJ$6}Hs8apIi}~&w|DBGu+>x;<b-TV<-22~Lt}c1MN?Y8fZO%<y18Sm7l+L`HQ_gpI z=5oHRyZV%#Y)tlgB6PNPneE1Q`Gep+9-fV$NCgjT-jR9z<XptIha&4OyV~vISGlY^ z@G`bhr#f9=or`(g_5Hnu=^~(f-VJvAxft>ABSk$b@eeoK7^RBv)z1&w>7{)y+u_D5 z#|P5cd+uH2a&gI1vpNqNaJ}=#^=4i@tNXl}cfMWtZu9N#bFEX6OI}LPe!2TgVbiJ5 zO)_=TI;XQ%1h_m|7FnK=VmZ6%+KEk|mR7`nv*SfQOA3xwmdIE~cg8sXel|VjbBkj| z5Z_#T^UdxH5zdczeb?#bb05AF{+Gku1D74NTsq0Ou4<#?@$GzvURK;)veY+N0UlH4 zhpevW)w8`}UU4DA<m|m4p`9`6#&WVASw5V5Kr=qgT;PHqR7gGfwI*9Sshmf-e&yPd zc{ZM%cNom-e%8OaTV4_3di%h``#GM9io8zkEEAGm#JY5OOjL5+CGxV%gmGf{6X%-H z9DxZ3xRn%qUvhCUUE1C7<(`w1zlT%RZKM10(#?Va0bZwy<Hf}{RDYY2e$LYR{JA+Z zH_eH%=E#}7MKyH}iwlS1$xRbdA~_UWDvIuJRO4CJIU~k9aOZ6kt<pVefhSYyWG>8F z!5zCHx;=C4bx(&Dfk`^tp3_<doH~yG{`*Vnl)*fut4$R@yUz+u^wIg$BmMfGyie91 z-so2bYfE>qxFQ+9<^JkagIP?4XN%|RbuagH*)-wp{3{9-zZKqWyLl^Zwi2VDQ%ac8 z`Aq^&9EzL57Uh`q9erZe{VDgk_o6whSL^>X?5(Sm<=>xlD&gMhDOGVzN-Za*+&90p z=}!xjuI_0k4#gw;|LW!T9Te#}Z`_?>T|3o9McQJck$w9<*&bCzmfg86*Q{Kdlv*aF zL{3UoY!Ps>xlx{B*W)+2uqfQ*cZyc!DK(FfO*6l~-+N*!bF-n8-IbLqKdUG>ad=Ks zjT8f!A75K9)$42^@jGCVqrg}9|7wCKpNZ`^YdGTZe+%OQKS=0!Z_;TIaO&u}Kl}V* zpT-KYyRPk)+^R~JC-$wM|M1JIgEw@nx1Kd}V?uJsKK-dh#}ejr+&nvf)!rtJ`)WRm zCONN_yD}*{J??m(^t!G8Jdu<urPqa9S?=vS`;W0To8{xD<<Y82O(z7z&Gs12cw!M8 zb^Xn2p(#4i;@=o%B^0e{+BV&Fb;OpvJ6zms0@)s`Zg}n{c`nJ<mL=y()N!v(IwwKl zJuz~>GPA)frjt*ly`H~c?(K3Uc3W*&t9LYe@^-x|X3+~+RJvmyyM6vGamKXZoUHG^ zqThvO-Rj{BJ$Ss9Z4~wYkz#VAbMKt#ODfEj{H`mho)g}kx_?{bF>jdpH?=OxC!1V< zdh?p&m8!>0E-rtT%Ks`;)Y_tW%PJ;&Z!puOm#_D`8t$y=U4Gv&Ztg}WB_*ThwNKA} zJJJ$zaMq>w=l6!IL{5VwQ>pvi>lg3{pZxx&CdxNfSx}Jw%^j=wy18~7-k*5iOnVsh z+J)0=*`8y24R@|teD}`5iYMDWTwIokl^&fL`gi}KS$9IRWtC5EQUNEK%RlUNIxc1! z>Fr!=GFQMw?te;W*AI8IJ@Ngkf3q!?SikmKzN*5^S61H-CfswJAHU1f#ATY%?vqMy zrbX?yKdy70lS8pZ;L*vD1--`-CC+4Petc9F7yWOk%Be^3nZHi*{mOaO5WP?8RKmR# zQ&uTBo>V#GXT0L>|5(nJ6Gf}OOLks-`TG8UZEzeY%H>a56B3(hAb((Wh2yV3mu9p5 zx6}y~?DtvzK0RpZ>5?<+;x!ll4CXu$y#L<q$4{nuI8;mSj7hPbY889*sCKC4RlWl% zf`XuQn!L(ncankM5zF$#dC~^6E}hLwUCA7AZ@2t*{k>n8FZMc^v9GaupRb9Gar>Us zNk&Ka&5Mg|_`CVo#W$NDKH)B~Ic&ZAqS~EL>z92l58m|mWZ2qrgR52i>0ckDoyy?y zn?1X7X-uns<HeQcOJ|>%=Fp+Dx@7WIndn>65sKh^*i!MObJNKy+|3^?T(jmaJ^qS+ zQ_P}2?)Q!^pSb-B%O^Wy!TkM}Gh){X6mQkfZmV}b5_#QcWB>EImA+XqYh~&mZRLt` zfBtiB;n~}Ml4nj&337d!Rnv5RZxHK6kp)%ryM=fsriQ*R7W8#o8seA<$(f7S=uAJJ zF|Q?h-{+EF`)apYte90B9`NSpZOORbnFZN-^CXT>>#x38c<}#{C&q%?omQ4an@yZ6 ztW}u!m@Cyp@3PtL=|VHq7YX^TOIPJlI$d03?Ov4S3NGh3K4u7|F0QmmyMAj*zPah` z?K*pfwsh^(jS?<jY+Lragh%c87bR)?HAlDp{ku_ZI@_8Z74H{4lMdFn`@`?_uWKK# za^AHS@V>NJV`@wEJl!jjmNSz~A2DoLCh=q8dxl5T?XP&i)&d-!oxJ@=l0p09dHJ$y zm(})mw|`w%8+ma#d*H#t3=yUU=J$^7TlRO4BtypAGn4cdcW~EB796wuUYGSv-hbw^ zhcD;H+iqYM6yKGwUF2ZGzSi)IqFZKu%>8AU8d`ea((7*dug!bn-BS(ZK{2>GW@Ue9 zU5xEx6_9t!x|M&H*}ZJj1(jU&(^a&uMoIdLf7F%sKR>_y=?uLYJGtK-$@~25M0p*< z8tI!Y6LO6WW-b1>`fL3Yee>2SGiJS+W6*w@y@+|k)5%gXH!NgReHKN$o%lrGyt8G+ zt{h48-X{_6%EwNb{}!s=%U$Vpc3H|}#tN}m$1_*&t*PAo-1ht8wDngje)+O1EC@AU z^(AiBzqmtZ`&86L7AIW&Sn=CmU3Hz<{&PPR{{DTs_m^<lE89CY-vamC3$Wq(?-25V zVcJ)jX}PCX{x$c`v`J$*H?Mi>$;@d%r<~W_I)03IadA(JV@hS(bPI*)TXeWV`E|b9 zNmoNF)<?6{JGTYzdJv{z>dt!Lsx4E)jMtS70(mmhO_tXccdeJ1xbIA3zF)zU-$&of zzt@>$npRkOUZBS>{Dnce#?BfYhBq_I`X-+i-}rTZZ-!Z-E$76k20Q00{dz_I(zT)q z^7nm?&3XOJ_WR-&+!tk{-em05yZR;Q7ehP)+wy>2deS{7Z}J^jbp6xhg3Zbd3xC_} zki8}Seb4F_TV8zL;{WF9@qZ^>=ExtLX?j0!TWZ8M4ekBE0>7;IA8%G0(0*a>@2MwE z0;AX7KN0%pgyhECD*FW@=U-DhpaRZ-M-HoYL}`{rYEJzv_de9GdVlJ+{^pB6_|%rm zYh111y*rKl*$$VV=l#~}HRx_Nu>1Ggcu(Bo`;}+(o_ltz@VmijuG9In;Ph_UX3xno z*-DnzT&}(oH<*zpB>PHY!Rfo@_S256I+JTSTmE-x`u{mXTjp-;nAZ4O-frRdU%Iw| zYz1HU^ju3@)EsNMd6!W}`ll&3=j_uzxl!%U>vt?YF*jmtZ%++g%wK-_`Sf!;MAt0f zdA8PTrB>vNdyf}Qv06N(E6D5V{_{rjm)&iib>ePRN4<aDPf(#I7Z>=z`@vb6AIXl) zJj)zxymJ=(HUC@mC31qqYmbOezwRo%Yg1?NlM^gwKP%I@tx~A+o^ZgCxc4WUuGzki zIydVTx5MrA&o`%KFa;{+cI+_d>EJ$Wx$%k6zpr*nAO2>S`xM@Lgy+Axgv@!x<!ahN zk7a(#?6U4)UHkrDj@O#}ZMwVtxStjLu(t2h`{g8g)_u!aBcsjlH(j%e)VwNvgVTrA z>d(ttYk2lBpSckAUuk=$q6)ZRn%5?=V1H27%4=2Le4dl;8qQ)a{QBi->q6y^^@c{r z=d*G?)L+oEUE}&kuJmhS1u6?SR=$rqH*c2s<j=Zyx-Ho3K56V>*gs49UDUaow?FPX zxFpjw*K)(0)75({H-2HwoAb{7!!`ZNx`M^ke4oDhTkN#n7QW$B^^>pri?08!Jk^@| z`qS!5rc<<H-9KI4pmr*O$Mv>*#@gxWpIR#WgS0p#R!zzJ{5$57m!`0R^o}{x47fj@ zzqwZHH2;V19UkU6pp5dcmN$lBU!d2{zrK@RuADM!#T2eEFIDZOeVR*mrLJ_jnewXp zV9A7}^RmltpW;^yWV^<b?U&`GYSX22JmC_{mVJ#EUs?q!>ZeEK{XcUlBG~KUtmg(t zvyLQ|S-KaMM9z~gGWzTPu}yK#eVc}Cc5Nnu?MHL=z5ZdxaCF{&-_IxQA3omBlKWZZ zkKJc0=_!j>Z{4<<-L5TtmYlPucIU)8$#2KAObf~`N8hoUZ0<hgsrKZ$g|Am_+wnAe zCC@YYsX<4Lf6Dc<H8p0|ORUMU2#|cSa;u-m?(Zf6UT=fER5h0>O$jod8WdN*!(4Jo zki7O%J<X*-m)-@+FIT;1d47HHsgGy7+u#2(Uj48x%{=b>B0hP6J%@j9%q@TYWBLCZ z&R<H^#Y*LlPWyk&vp)CW>iLG-kN%lcwR-wAP}}m+LsiDTjj{)pADHl4<&@unumk)O z)58wtvg-tRRc5bkHY%O8CPa0L=7c+}{ueVHm&-)o`klV@@q;@m3_2_GmfTtAP?RHk zW@q2WPdluqo@f$n+EMi(SZvEokH&_pD#t5@>(Ut9me0OYku1s3x{6hB*KcjHEi)Y& z8%%F(Y25I5eX^&P=Rz%EhJy3k`)@1$jr>=oGEbFnvdql>72dW5C->UdR;{!*UcOZ* z|MweTu8<ope*@kBf7{`8t^bk3LDnO2FHcWer}sp+wBg8!nwI&M+^IbaYkqfIF6)WC z`*zQ^6r<hywa)MS+CAmsj-cB)^HYz-UX4=MTKbD=b|e3kpx_4nhLcgR=Vo4i*L^_$ zfY<`t2i!gET3SovE<{B)e!u)KR=J`0Kyl`26~_5bZoIy0`(J2JmyGBC{iau^{+KP= zvHxn<+<1|tE_?Ug{B~n~j<!QhM0$<ayQ%9d!S!)ReQ@I4rBh~c@%X&%+xuFsyOePi zgZ|%zyT3&(onrlAV^G$%YgUHAYNy;jKc5l1I&fpKKxjPw$&0PEzb_rIZZvdBF51;t z{_+3Cls8T`e<okPpKX?CEA6IU{5Zqjss1lhs>gw&)#|4Ac@C`)(_!$nyLa?iVe`&k z(e+Mse|b_p4&Hog!I=Ad>G7Rsdm`7!Bq)EY(q6Rwi<9J|lTSDI?mE2ePPx2x`Az>D zADxfHzHhnvibbY&LGo)0{f^Ll*8=M;%!TH=niQqX-`~Abk*y{7Q`d6cn%6wGj&m30 ze{%l+?Nox@G&A$h%X}*S-&{3i7AFr|7W2Z)lkeZ#9lrQ`>C$VrCQWmYXXRU}dcM2S z>VV+dukRN(<%fHzG6`D#syZM0!Q!mipGt$h@{xa{m<r8z6;?PJt}5BDbH8a4q~=?{ zmwgLMn)XtyyN~}?Ioz<Fm;I0L_ye2JhPyMhJi}gvPEnjtBbs(0tLR+aw~c@2<Ttd> zj$85aNA7`b`(vIhEv#;^{l0##<?T%SbhEzn0C}Iru8({6E%R@?{wpV|<a*KCWxCAM zmj1t=aB0ijpSB<N#+<AF@aoLdmN$1#^qptdoE#jU18Sh(o|&WX&UChMmP78^(xO|Y zbEH=^CJQ+IZO^-Uyiwa>@s^ZI;}5MtS?n8xBIe($-feSt&B>#I|8CViH@ud7n!E7N z?nIU2w(Zx{=G@^6+UBcZTFuV9p(=qrZ*Fb#p49*DPk!#Zp>uCWtbWj%G6CM>Z+5@m zW>y!`{hIw(f@hW37H+oX*%iO_7ryOreR*1D-uvU7@@*4@;$>S8oqWsjG>+Hj|3zJ^ z8&i3c?<?7@(Y*Dn^W;yV*41YgeEd;;e}3KEpuWfUdMpn<&09a?`X`0;>vvx6+E?Vj zzNjhwc;3gOPpak#@u~&oKY94&`}V%|elOlNMogOLx>DuNr<{f7PMrMymUpu231e{Y z!+y%QoCNy?CLb=^ihX3vyZ89(eRjW3XIwlt%{Q76K0(`Gd)Jx__ths~FKuz{dlqlq zCZ}zGaQ(YFo@cSAGR}l7zMsAJ@uj+w&I?iUKQ7n0Grnh<X8%`{OT;TWkEu`aZ|tRi zwLzMtR%^M-&!zg7J^%A;&&&G0`uLvtZCjL{75SghOJ8y0=EYStg}eEGr=L-^+{p7& zyJxw_*^4)F^JISii}qWqHDjOM?z6KyHrHx?{^SwmU)vdDSIv3PXlnfODZ8J4EBDv( zKd~)SVou)U_~*7=*W?;+J{1y7zn^-1df&=(=W@S1eekC;V$xrYm`WShtlopuUY&l} zYRqB%u<h=uh_ByN9_8)n>i^HwbzQpc=3gGgYUZ03yAIlJkKXl`wd=YpPecAq|CM(h zH(MKeR!v*+;Q9w$+ioXO`(tTepWJCX>B4S(Ea1i`PhP#8IekWIfor~be40Mn#VI6q zThDB_qMT`YbEZN{<NKiz=F3alW!UEYzkGXpVadclo9}A}&0Ms5v60mMqc5)XUGiQ2 z>ClJAL93kp9Q6LbUHr!BP1mb6n=9R;uD`i&^il5klE1cs?%bbj?_ZC~mT4BPTRY`c z_u{ElIvZj%r`o^W`E1VfYcv0Ec>DN&${x>EA#-fY0yqDE{_^v*|7M%5Z|q%hbGxjl zm9^XCe%_m>FYQ}x`6o7?DeC{fJKGzRO!qA~w_!3vNsK}7&a<zI60`N^Nf(vBpL>Ek zwXn$AX*uiS!lKPf*OuFRSG`sHQ&RfCp#52y<L%fL_HT5(%y`)!yqJ_wH`{db<kd_Y z^h?!D*NL%e_b+_9WNT*jy~9mr^I|M5rc{5e`=~j~>EEX5JGThO)aC`Pe7x1Z<|3%j z30Sr>Ia=E7cwyyxl|DUf-@k$GJNKk>xGmQ%nPEL8#;)(U`8OZy<0qeX-}rUk?fZ*s zdf?vb#O5BBS&Z?2UVeS+puaTauzl&#cU(t4E;v8cZk<Zx$~KK)1v}NcXIJy@O-K@X zq+c@QyRQ56oF^|1`A@l66LeeWu<_%(thI|T&+}imYHQtd{_E9w37i`^EaqSP`)kUz zU%qQgSq$PepECO}-D!Lw6M0Uq_4&l*PZ)E;lmo?I3CZ8%)8Bt{%m1>pwx>divyzHz zomW0HzZC61w`R?bs(0#^%dW|Hw?sJ`+vPoeQ#;|vhw1Nk{=L7vx0~0vxMrukV0yP; zu`0uc<n1#UJ^I!)1+No+*=gjk)GvJHm6etZ-n)3&--Nv1YU_M@o%=-DmiajcW}5!g zy#49m@-}0u_GRj)819{qdG;yJqw};cq_zA(!-T)tb9w&ytnb`&;wmS<xDeF<9$;|s zTe`I`)N3!}pFhjDi#^ULj9WHEiaq9tp;Vc5!j5ZJPc>Cf%1NA^T=4D7qt=IqH3Hvn zo3coN|G>lvJxO;@sGUmKGt12U^CX`g%NIA!pAw|qP}v}Oyua${<#(P8(uF<CYK3pG ziX1a^|D3kAw4_fr+5G-zlV2acKPhAP-hH&tI)%ahTfcwxKKr-F^1mON71P1GmjBLU zz3TJ__RWU>)*bwG=9$G7+wZp9<qNM(<xO^*C~{L~?O6#Q^Ma2SO+ixb->Wu6+ZLWH z{eSV*TFrS4jq}^y?Roxt;`7>_pDixjH<mEwbICM$y+z-idE#?hM%OoA=jmkJ{rs-h z^Xu7D%bUR=aAdLPjO&_9pE0ig|8T3w(hz5v%ig_=HVu~@!q<KcmJINe?EPyvqdoA+ zPlZ`Mx0O}ZkJw*$b2`2uKH^U02BR6fmzAE~H=*;LyS?_(y7yswS&o+k>}TTLaxML` z*l(5%jJA#cAH0~iSL^NlN9DT9ebP^6>kCvSYOssHSsL}-yN~6PK>NkF=BG?%)?812 z!}fb_{p~xQ``)#LFTC>Qx{l}1fMYAF^YRbRxTxZ4x}@OhMwXHr&GBm^-h>@}bFBBh z%KBv%Yo_gfUUSc8o!P#p&W1A{2eeh3+P?35@wf9Pymcub3-upK95}uB1Jj?ZydAG= z)8FgZ9+(dC_u){dtMPlT8?Sxz^Z4~e4d$2r*_e8*T-9eenOk<@<tDwLNssou32QyL zL{)%)!RJQ`-+Z)B@7(%%%EcXiw{zs}AN~$}zP}=$dBa2fd)pt+2(R2D@+AJm)8vIe zx*uEa{}=72Q{A3*mwlOPBfBR@w%<glaLpiVwc4MqbMGBb@M~~fUcdkECi4x6zlwKX zJh)E9&Gf+0-}lz;)7%(ZaO!V#+w+?3wQ;t(`NcK=cT~wMeydVHmw(QC<#d_k_&IU0 z4G-Q1d-nVi$lu?5<o*k<peAnpedPwVwyW986rM%pp4wLP|K9a|CqMRVdHC;sak*xg zGT-LYmXj8r{&Z);fiKq&`|bF6`uF_Du{E_}^Rm1rfttihvxD6}v&^}x9k}tei`H^p z7v*=kUk~uL%$4$eomqN9e8P#BS6Oe^XUm+mllI%!aKwGryE7S27nDT^f4cLv=GlGO z;N3sZKMXceb)RQ^p5Ny1XJ+<ISq{;uCi4&F$*u#PBC>fh+v2{0-2YZWi)U?2EMcD2 zci(O5^=F%_i;B(umaA2sK6m)4@vPbE@oI*TM7hG`=05y<y>HL)Q;hR=RJ0a<j^N)? zwk&CP<o7$%ZoXB~G%SrYUSnye>eOK&d|>V7`~^IoH*)kCLh9aHm$7Y2yFUH$jtzBY zr!pQtyI3bNS1<VWS>KAEOFz^eS7yooH|d4<<^uhii8C&Ia%tbwnSC#`Vyefk=iB!F zky(4d+;8uxTjgiB{CITmnS_3bZpVeY@f#PMW#M93b8s1Ni)_8DcaSGn=*$UIyW^Ji z34w;gvnQ<yVNW%PQ;c_zu&tBQ?EJ)B@Nr*b@H^WXMb=Rf=l%xGzOo~#KlSd+z$Z8V z-Ozbgr1Xb*?ehN~-JO36zrI}R<Hvo;ZHCxQ*ROVy1KU*A$;mi=DOEqUjc0LI|2&Dg z>xIhx*y_EV)1bOhrFGSQ@6(>IjcT@KoaOJ>b!F=6-^UmCXokGGVO`7e)_%3^5AGP- zvf|G_H2l`iIr>&xKk(Pn@`7)79KC!}8BUq-FZcR>Pa-z2=<Nme7+V9j#n~EL+4&UW z9hCg?%x2Zvag^WZbz%FiQc^9j@p|;*r}mS}HrwrfZ}{tK*HPR5LP1H{LS=6bRy&*i ztPody#eXdCtoMoa^9#QoV3+7AWZCj|y50NYu)lJpJyQDf99mP^K1{w=wbsR%L-9!R zzjK<6My!)gKR27Zf3{L=*8kSf=37E_MLEmzc<ZL5ncr)u{>NJqCGo@IwD;*xdvkxT zV4GgX!}i-JceC$Vx9?(?<9#)kPLb;I?-bfH+t%NYX{X($E%Lv<seO7B2^kwpS?+Q( zL#FrSQ&BJT*<N!M)r(6E4*BianEJ;-DBslSc5!kM=Q5A2FHL^E*JDWAyG2xgKkJe9 zy)CLMRpuRi_TW*O_1@KA&UL=+<SOft*^~7kZ%=ov@9#?E4!*L~!#B2f@Mm{zt4u1| z=kid?IK!qc`q#Gqd3S#@331v_?OywseL}%&*EiGtXgCY`y<=Z_BUNdtRqWp9hO#jM zbDWFo7Q84{=CHmu^~#YVi5|lW@%i2>+jd+0`KuB1Xmz5&JvINCH@D2(rSx|*Xt44t zbL|EdTkcz|&6iF0{GEQG?AW3$wfCC0?G~zDYkhyujk$Hvs~I-DY_^KAzQOMuBpFb+ z<LS+F-S6vN8@oQfd~Ij5TWb1u-XqgK@tl(Jn-^4UoMXK_^G7{<gPhLmtIjjeRBwoE z&t6-9md)MFNAoJ<@h?I4Hfsg{wpIi!k=`cY#4%BJQp!>(?dG2rcB-*2w&pqX`A=D^ z$#$)GmRC}R_opdyn&bCwH{2bgm~vgE%wKE%zB_Lx)Xli-_b^&*f|Ka?v<UaJajQRm zna$_musSc~<zA89p&MVl^*nO7LR9`gtH^qDp3T1{oxZVcDlBQ{ng4%vDf1e6+j%>r zbx#Io@u^DjDV;a|udKRH>-fIk`}f=KTg`rK((*4x^IqR)6kosBWuE-We>dYFzun$B zE5Afx`uV)PxiV)LR{mpnGcRP`gxt#p7I%;BKUXcX)|P4WX;r0j`%d@i%X$`0mAh*o zp?q>`xoPOGvI3P;$?*>^^(pWyyDd`tF7^|<kE-G#LFwalQxfZ)%4(b37shKu{H^sl z7rwK!h{swz<kUy;wD$bxpYJT_FF5tL{#3@SMN>|_;tf5|Y})Yh0PoT(PD?|QcQSXs z@rs%@Uq*bv)}U2WT0rCd%Bcp|4jjFFru#krB9C4PPL2(^HMu&SQ#GSr%f|i7F=klF zx&LGB@kMuR0(mVM8*W;*=-u!4f4^#9Rl?0Lr6RS8vz)v083R_mRQ<%NvMKWo_mX2* z7bQG3+%o6O@5Q0j5f_e4)@E;Kx_!z1fB5S@zOtivCw&)kHJZ%-6MSp+?}%G>r_Wfu z{{P#Ll_EbHr#1FDF455}wzSx8y7N=c^QjA_GW-ykckI{y?DJohpRV{-#W7L*)T1Y5 zEq>f?kDolNNV76aL9}hJ#_>Np;Uum0Tw>MtQlI9MuL<>M^q#-mRa5b+a82cHzaKB} z#n{)R&%5CiYUexKkJIV<+vn5&=P17kDSeR9XD`kibzfn@*WYX8uTEIKKQ_SYEYqXS zFD{CB|GsVf_We2s<E2wrkMH>;{`A>rc5q+SQ$ZzCtp2_10_*+!KlMP9f?95i8B?d+ zOR5(Ujgj1NG2zR%FW2YX$@vm<+w^eJxq0q#uV%hG@nBZN+*f<IO_r%%F84Grh5ezr zbU~VL-KlLnzi*dTPxV;z{FWU<%$;|KxBjiW!>8+a>1|fS#49YxRYBGId98j+|6Av4 z9_Lrt`Dvba{aN$1-CImG%cGXoT5gzg!@&6X^xuMo+awIbnHa3gx_{2Q-N9>|?5WdV zzHz2x-{PlFOb^WBIXx}ATH){gx~)lu5{ox3eKt+_WB(MUr3Vujs>@dMYaNI@72&Z- z=bzx(QkK5w)}Uei;{m+ky^;1+T9w}GmYnSowX{>%7NXB{%p%5SP5ocz=ARFveyoAC z@$OakT{-c2pTiC2wbh4zm+t&_+aPD<QAgF}GFx^Fp_JWk*H6|=zrLhe#`{(6^nQ!i zr`ik`dvxXWT}$IxCcUFV#!>U^-?|h0_D>l#e0Jvj&yBg${jc(avGu1N^AE2KW&N4^ zO<~Q+gBj78YqzR$-%o$V7}|JaOL3|3hu&+yrf>Pq?%fEPV&<5*GGnbdljxL-7PIna z`=0;ETqAk5@J8;=_gM@7mU>yfag#pJZ}YkTTDHOQg*+dp<o|tUd%u2J<_G4r&mS~B zin(bmnBG4(<c-CoQ+M?ei?(gv6JDR!9#Z+_;|+r}6VE_i&6rXhM%ix<!nMVAhZ^qw z_;<ef*>D@i3lYM5-+S%puL<wHwBAGf_5RI^!ugZdT|1U0JI$Bv$1QFVcC`l*53~ch zB2&^ob<YQtXLBc|&Ca#C_GI0he=C{0ckk)FJIh%9|Hm)ZJQ6p5dEWhUJxI7`PSkI~ z>D%^xdtj=XTFzp&_V$|X_Z_#~ox6lZ95NL8<0iwo{Fluq|0KNTwT_Tmdv;1qrrFis zF-M-fx#4$c?JS1=J$HhVRzH~X+kBR9M1TC+2!?I7akB1*Ps(pk_5Q!Vz24|q%<@kD z_45;B_n*r+uyn4YOS_l(>)$s&dGe;2&vgH?RUmikm2+yHMh8^ZmZq-#>f|}ab=gOW z{m+-Ag4O_>$m866?VyA7(h&A%Cb7N;y@E3ZcPP5EK3uwS_s?~A4cEPqKYohw|6$wv zrg<{?t!INK1oi&^eBia=?&Fq1r_bM8;?U}ABD1;qy|tWT#pmfR@v~a1A9f#UnWk>_ z#5d;ix<jj7E-|k)kN<f&#yacyqi6eW1V5iN>&>Cw`&J3Qddv<bE4X*o$i<e&Zocgq zl=Ny-T10V;SBpTQT0?aDeFw=&8*awD`(u&Nqx>*THf&#I?=#`)fh$gxIF<V+Cf?@! z!L~-p^4Rna<K~l3H}`eDT`#;TRBwm<uF5lWedYO-RL?ctz2uQyt3CT}w9d^{d;Hex z9rzddIOE&R5A5^YYY(oTpXjaWa(=6=+-bYBSv&ak|3_|_|M@I)ecJUSU321$`;E?4 z2j@R|C{ud&?T<xT;onM^yzcsM(|6VTG<XudcJi~-TY1{2&OY9Erv9mSpN`(FWWIY( za+ZH|Z!S2!dE$xB`2w3>d*^8Go04VKFzfGm+YeP*<v05$-&TCIuKdxjhtDi_-pu&+ zQ{hgnxq#%I$rs)_9*N8Eo&MkF*4bZg8m~w1eb34jCfBXH(jxs@o%4yl!Wnn<Kjz%7 zW0({1F=Kh`Dm+cIr(d3anikh__m%IFpNcUzru3`Hzh89Yv-8GfVoy%p<8+zxw!Qk_ z)ICNY_ZPMPJ-MneH`4e`_M}D6vZAxTznP|y?hToq)#Y>%D@%>H4ic8XT|WC#l=lSC zN{}2s%}~))t|OZ-7+Rf~tt=?`Nbsid*T{2!Z8&D9HgAh8`qIzgwesMPDH@KuZ+_l% zgm1mnm1!R)CuiEO?c1W09(aH2@0Ker^;K(M|MIy0+xh-ImpB{kyBk18%Q$4$a%3#% zIri^N-lmR4=h-i&+>z_-5%_=TkzTWB&x!W4w}P{4<Cs24tdYCX*ulM5BO;M2QT<o4 zuWrx5mt6l!?cJk$V}6!OOcSv`b8g`e^B+^#7WXZwFMB$BZYN)Ex9U+t`z<%W%Cu(x z>pv#{CfRkqoC_;|vC3KI^2f1nvTvQA-3S_~3KP$3-*!Arv*n_u%=<;BGk%|K;`zN5 zeb6t>BLv%spU7&#>53=!Zb;R*_Jo1wS;3!q)f?_<+VfVnMyFRNZWcN8rmAaC>a=@X z&m7~=F3hd3UvqLPqqg3?-79_`6Y(<Nclq(d4>k6Fe+*it{CK4y;+N;H@jXi+G@k$A zb<L+1{~kNd%e>Ps?*4z;znPV5mn9x>`F=H@!C?1AwLO2tCdkCjTJqwT#?q5dKXaG1 z`zAhr;;7<c#+ZBjY`Jo7dfh}jXUCEa+S14Nxz<DkZ#gSG`Lill_)N#gA8#`pSLkSe z_Q&Dkb2ovqJ;EzHMGYk;ot#>3tGkcui1Pkc*0swg$h?-A{%E#1|NX7&`x{CQgI38D z1zpP7eD+A*%A;3puSVP`(>Z9pM^($oX317%Y2(!wvxF9#Wv_lJ>N!Q;c=yri(#L-X zFM4=9<lQeRwp7K6*DOxodltPYp1k7LYHo>1J9oScUZdIf=h^YPyE{w2#oqaxdvyQ5 z+ahcJD3(R*>An9m=|k|&6*sd@=ha<i<jA<%tF>2_^ZBQF&7BtZOy>7xe_WUEazAM5 z5+iY}|L^-PF;SD}scQW&t?@p;DBx)S#z<Ss?TJPg53XxSZrIK(y?k+xr^ssCNq?TI zO%w>7uKRe|((~u*GUnMYzh2iH6tLu3Mom|}`-ycQGyYy*%<}KgH|;w%|Kek8`yYJ& zW4)t7_TjOKg_6@E%{Or>-cCy}aeo~C`u~aeJT6T`)0>uweAD?Y*q&K$zc{`5^YcW{ zZ;K0_eiT`0$`-v!zg_&C!kd=cV)GX+VqlOG_jGX#ah`hqtv7RF*?zaRb+IRcwK{%8 zuiy0We^`Qndf-}j{!i>Rt~C+WW<7OB1LuVuUA0|Zu>5go%^&fAJ@*XGyi4b}DShJD zMP8#dzh5<OtoXTp`7>$R6VYW{9~0-^uvsR|aJ8zwYx8ryo^#?WFKuNOy=D7JQUO{6 zWO8o4w$VX;X^8W-8k0`tfA*hWnR}}mIsNHf?9E+VaxfuBbNNNH`rNIzR5kpcEK5DK z{u|4yz118IuiL`}%3jrSh5qlDZdcG_Quq1^)4DgmCvi*HYTh>LIWi+@hj@(7?@HrK z*Ed(j@EpAT|M<+UsVmGs8MKR8M@4#@?seJM;F2d-tp2Ua+=feM>E%NwGw0trzQ}Li zk@j%Lecrd_R~UccJ!Qhro^beuh2HzQM=qu=U1|SHWBPZVgD*;2`HI_@@n6}Ve#_EN zFaF52|7MGBwtSrv``L=k*+^H7PbpvW_<@Gk_q!jQS}*+HNX*>t`{AR>=CRZM-FsRu z-W^x0_|I*+^=ZW9|G!&klm8ic;#=;v{yKbbQA+UfLYY{hGx?j-ii$!Rb{5(H$at=H z{qmOi-|ZQ+O7<Ok<M!8JM&9MjL<NS>surW?PuHomg|gJ8oUVU8K`OkvY3lI{MVD@E z+4?5YQQCi<j0{(fcl>tugG;x}`=!h<)haeM?)0@I?N?dFgf9GIYkz(`Iao8~ef7h_ zIaQay>&u?pSyI`(En2JC8q_p8n-ZSD+Sw)WedC&Nf4;iUa+)9iFV|gpc+0g(8up$` zXU*~Zzx|@FRKp?B_dM6qOG-=f`}V)guzb7gi}0?R|E!7XcWwxa9GLY`zxZ>7H^UlD zzwdXBeUv}FaO=z(QM2@ly{9Mnzu5O_uJ!FAK41SSjC<zq<Z<wd$vfn?Bhgc*J^J2T z37=U{B7{$FR9jWHzu{oX<QD<Q8<IRXPA&X&WBNP|W|N;8+FncVnX^4Ne|~gcl*oCd z+s1q1mb{vKlMiVTf=)1e5dxn>QHkiBqPZUaQ|kTQe&^))9sbU56LQnyx!v4{|4)fD zPmVrzPmC?u#%%TC9Hr)Lrm|JvZ_SgN|0F_K&b2JT`|I;Fv;LG%da5LOJ=efBVf${I zm6!dZz{?ir%rm*26R)v!T0vT@!u0Q^%f4QZfA}nQ@(GT{$2ZTP-p$T@dF$Cv+gP4x z7V1}(doRDK{B+-G`FZb;Z(O?A({}~q4MVH;gt9`Ft=oRzxwob;j^W9<`rrEBk0zYi zq3^ai`AEuIUYB{_SwuEouimtv^!)Da6JO0Pd;Imtlak;5oePd7^zC_Hmfv2*@L-Dd z<L5Si-`ljylpnslvB&*L?ELU&9$U_S+;{g?XYso3{v|n6KEB&zDDiIom*`*{MrM27 zyOrm^E1&=UXp;HCiEFJ=WBP*@Y^@4fJ{LUT*y4~a%e5ugYwxK=W!f4cm1<|z|LIH= zv<!P;$6r=!IAh8Wl{eF>qF!rodWlV(mGI<3d2nEa#^pWyPp#)4TAsmWy>G>-o2B~q zz8CvteqMFFHC5*H!xxthxy;i)!ksVw>-Um<9m%qCt>O>DKfn9=cJ5x;_tL%>BZ5EO z`MU4!tIGSO&oy6W1p4=VJo%yO5AS;G+xh~pI~;TF?Y=%2w4Pz@mLoQNtDn9z)Hds1 z-JAb2;EmQ>c81*_{k03(oj>i@l5e);OYK-*^V<CV&ws|g&761R6^!S2UE+-ft+1>2 znN@$GY_`35U!~FZr!IVFKTls_<5sqMl0u4;_Wi8m%MAZ38@`gx^?j+>StM4R7;N`u zrRxWsPs(52<c=+0v6$8BPs-XYJSPh8N=~uWRV?|l-{<mVjns$FI@u(zm1kAvJC*eu zKKb^2^&OGbg6%h-%ACBITA6p^<QMy+(rpEGpBdK4u6f}xYwx#-QsLIM2Xq^B=U;KT zU3|CvuIg*|#FBjuXQnQbjNAY3_T0a`8MVxdFPAQIiaWRA%)gmSH!hoU$h1HCNM87R z<t1v<p8t7f?fLcPRaTCBc2h6NUM>9ERsN@-U~|B)-{Ie@l03D(u0MVJ_Irg}@BD(A zyxSyN=kq@JGtF+s8UD%VZUx$G`@I6XhUwjsn`x3ur>r`%u(ff{{gN&}?lkWZxs9^% zAx}^3>nn-<DF5JGi00APyo)Zj?|%Pt=KblK-~I&5s@wE<;=A)tZSTGL_exi2@v8-I z<7UiRH(~jeq$rkkM-nbsF7g4*a9)1RmbCrfn%rrhiYBE6o;Tr2_rIX~Xx-M-&pWs+ zs*e=^EnrSszn`nY^ytSkt1Z{6R^Cp}4_a_Y?Nz^3SM|ZxBeCxfUV5kbM6+_j?de*A z^{aV*o~r$H;5MGoP6mgmdBrzvce2hter`d+Qp*UTBH_AcYxmcrNiHbZs-X9N=9%)h zcB=U|=XdV>rc-!*S4zaPgjR)ha(||<=BfoLB$%Eoyw@^cvf<)OHPd?$Yz|Ma?@LZk z$S$k3?B#x)zPQIMPws8|#g|4~@7)1aG<@~qUPoqbk1+K}3^2=^`@YTS$p6=$GA+{B z@0Z&+eR!tdxzB|A`yug8PF??!6SH?bi){_>RJrlDVdo}GzU-{Rx;NM78l5#4zVPkW zVw<Uu%2VLG-;AwxtKLqV?y;kA%1z&Cn=*4^J5MQ>fSb(Sc30Bx>=7<JwU_<-p8jo1 zjSWwondZMw$#9e4zNPz@R_uLfQ7!lI*~g7K?@bNdryPHz=WOvc*nQ2(yIaqG+Bj!H z<c!I)d()$Nn3H*?m$4P4y%o_p`LiN1BAw@$$0GgkGL@d#Z;zjpb?kUOcSqe0O9t8J ztPg{exC$Tk?%a|r^f9qlGvJ?cl>gs{joa@(c^o@sg}uaXQ+>t#b;qtU%O@Bd6TGlZ zJ~W=6aY4>$1Fh0`y$5AZUuBjrejQW)Y5MF>)6eTLoBT~-cbzZonB~N|?#*0>qzGoN z@c#yfjn1mASsw8=@rDj7$KS8qhy3{u9(^7DYTs?<{ZV~+w^C=d2QRJ8@6j{gS@wc? zot#ATMbjy_nAs=jANa^q^mE%{gPko!udiqvI=`nee53q{r@KE+oZ`RvJp03UyBkkD znAeiWuk@`dd(WTrOL^DQ`M2u*7Y|$Lv%O=FMaP4=qViu?F4=Oe$dOaAMc~nTZ62?k z$tLWNrktKG-sX4o|51<5Q~STf?)LZa{j&VJ)$u=T`7dqyvm;09H`DYow!js~Jfdng zYX1Goy1ve>sHAq6-umfwtbS#i-_2bXV{as}JGbRpRp*=;|6kb|O3W8h%`mT?=i;1_ zY5(P|?~|jOVWpFIwk-dba4*w@&&wx&h}+T_p00Op8vE{#hofTbFR*)G+Pomvz#{hW z?Rw7Kbe&TZu87s<u_PY1o;WK)uvu|tOy%{<k5)U_e2SiN`;oQ6%z4?rQzE|K5&LXl zb)O+xZ&I?X?$`T!DrTfheLuW-#bfr4A19b}GK^<V*%75N)n#3c{pFlPB73-&-n+_M z{q+Ff9joip4_)2&<kv*=jmyOjC-5C#e#GXMPyDofcR$bm{OR?Ua*xinybgKy=O3Km z6qJ%%weEGx>T;8v+_m0s4@$Z(Fa2ue|LN_rBeCVD%1(az_`bXF#qY)&!Ts5@w|2xl zb?UI6oOi<sv|nJxlFHfJmWDn2c9dgZ?k`@@2xb`jj_ROFr)|E6ACyS{w|XDA<r~Kt zz3CkmzxAy5t(lZ~b2a<1M^E?9o0VUpkbhJ2NPB70=NWzs6{69tsvEhM*X=R3IQQ^p zU4)Q!(1t_)A+P^xo||WFU=_c_>pEXZM!8Y#&W_;41x0%uCrTxsm|D*K(R|mY)ST_V z#k<b7zjkK}Tysq&>uY}d>g#cNb0yEt%S>f-7k@oB-cQ|hoz~C!yh{?U_Iq@#^Lg|2 z+{@Q1jNh=#-9LMhoq*7Rr_4J$_g-UC-_HC*fBuBErz#`Q+sXVWV_C`hKGXY^bx|s} z;yc$UQ2T-7;|I^pXU!Znx3+wiX5Lw}z;La)@4>YJS<~z{Ag1guyYK7ey?K68+-^?$ zSXqlX`_^D<+XZd?Ze`XZb#CSSS%Md?8Cu->*{f?fBQNm%-T1<y&4m?pHfB?uzU~ue z;JEufVtw?!sU=ZgDsP3E8E=mieRL?Bq4?cr?l#W<;&w|P&ZuShVQW57b?>c$zX`Dq zc%tpHdUT&kGDVdxK4;(_B)2Qye)hfi>iZTkH)gfR#``$mj$LsvJ!YF_p?QDxya~3= zjqA6ZHHui5qSyjyOjLZ~+<Yy(fzNB@HJx`GJN`U<cHz_Nt&zVLMEOSZ>8P8XIrH&p zoy#0uw=+{24)oofRA?vMue99w&;5k119@LrWiB6o^68$}pRZyEa^8fw-Z?9_<7xEg z?U&D2h}@q4@W0#i(>H>+|2|Ehms$1d-1EPa1CO!15j)<o-!MEYp=8&@c^b?=u67+g zT5LY;$fNSLr)MQ4TyI&w;pW{Hf5Yy(+wOW3Tv*v}ZoN;&#Vf|7>~?X~Yl)pr^4!vF zi$f17Z2BiYXA@Hxc(oYE$Nb69LJw%An)IjVojy4wU)trXo%rS_2VLfrrXHRVsN!no zo^8x_nK#C!Z^4u{`?F6oi%#8`v`!?WHhm_OXt>~>T&wCPCXc?-!+E+ME2r20x?NjP z=6mW#)28L;nXB#Ju?GE*(YkTjE_r)ZvccVbuZ`KBd+c!EwCCr3{RB^)<C}Hk&x>__ zI%RGpAbCe<cj=C6Rhwfr_J=ZU6Y=M4KJh8%<jzJHs7o^@rOi&=612+Z_%t7-ir1`G zdVj1=%N}VnT<qDE<?(P;GUtm8?E9lO-dNjpvsc>w%dS`d)9n>^=N0_C?sh|Gr{Qxe z$F1+C&--CGGv<(ouSW6p*WX0uSL@BMSgo-_Bu=7G$9w*S-AvjAb&nO^T$_3;ZKX>1 z3t>UGAfG&tOM--om>(J)m=4;0BNuyU%~#G`-&~(RXaAnb+A@cC@$2-pTtPXabBg}E zZRUJ^`ML7lZ<VDo{p(h?dk4*ZTOszV^T>%d6?fAEt8cvO;g)!_qCMuh{lm~N3T4@h zW&T>_>Psyjx&?hH{vNaMWx98!_1~j9)k4eEB!2F@e0xsxb+POs_1w)hTH()xi$$_8 z84IyZd>T2~i|III9qp0D{<GFz%fGmdE9UQ7ozKy=Cw7+Zi%dFxHc#ENclE(piDz#L ziyU~>_;%-(Qkzo~TFyTEbm6u3)g;qxQ<5@vvxio%KR-iz_Tvr9#GW6oyKCGt>+cHF ze-*-M(~IZ)tW>h+%{=<+yVRzC_Wzx4+cNx)J)Qq=0qg5~f9GiL-m~dW=k~M+<7eCd zHMV>(y_HoNnk}mo{#ba=yRG{gx4D0~{brI7@5I!<X1i6)vRkhGYJ=vV7}4h{x!$r4 zUUyi^e1A<5t&KnZ#X7e7gZPfBH_x7Z44e~X*?l`aZqb+1?;pI`**s;&DgM3tykyrW zmh5ZUeBG?;YRBmh^Zs+M4p<iL5+~#G;ape$+ZjIR%3kfWl}P_C+%i|@=v8L<2aig5 z#Lv%7@Yt38^T=&gkG{3uPFsqnS>EJ3|2;YHwEoW0Q_;8A)<wO3TEuFnYW7;@+}}$< zOp2S<6z|{DwCx;QKvXto2RO>DQ%(2|C%kg}D8Br{1N-*kBaZU1Q8WHtu3zNRyuIRO zbNu{Mb~1Cqn?4AizwqO+?~FO`x2T-2tdu;r)BjTG%^f<jk5ljd7AW6rWA?gW?bpPe zmy8Z>%`1v>T5JA1_}$fPA>N5gW#VI|G~X|~x>9p4bVt?XwJzGB0*f!F#1utmS}Ate z{5yH`lf!qP+G(rVUkS=zV`<)W>GAS&5<dRRFKt!VXqarTbL8%K_fM=j$I?s-UY8gP zEuIyyFxMY6eC~a$;_?k~j=R<ZS5$Jn=W2$BFWYsl)?h~Yh3C`rK-Qnh+r+VZ>9lKB zVc-P`PBv>#ebJWaY5Xy5uKVhh*_-Y%=KbDdBwjbO>tIduCt3Hv&E+40@6O+<EM5Hi z%Ik>9-ON&(Uwd|4pYOPLV&r<&Z;#64%lxG}Oh1~Lo&IoNd#lpr*vI!~%&A-Un!ov9 zSze*yylqD`jJ<dH9Gvy*ll=3<>EQiK0{-ira!u-cF2+nxk7f^i-ODW`_;GsJzKfkF z9!$Ud%;%mK<H;|a#fClSj86oAVpzNUuZE!D%uA~pb33`#HJa|6f6eOfVrJ-a&dl%? z%m!AzO5yXoOa9fhxwza({r!9@$2}u~-L*TnMedu>kg_rRPKI3f$(3B^<N}{)Z=W9{ z_p#!a`=YIrUUaDcX<gj8YX-Y_O<vx-Ri0jJ%&%Q>zLoa##k_9lE;gUQ_QIl9ooDT) z9WrgI_!*pODk31A_UyT$vqw*nr}Tl>T`a1rpJ{0EU*J%GzUoF!s-tW2_S19DJUVG4 zq2F|uIn|=q^ee{(&urPs`=6n~p0bE*t1(-#LRz@}s&8D2YGxaBdhu<oDkwhW|J4<= zKz%9qdVxnL>(xEMBOM(+GfeFJjaVPW=9s@t)1T1sM1lSJ)CW&CIo{Cuy+!q@Ehzm$ zBDBLkJf!ECV#1rl#=K1{?0=bedYElr5^XPZ=+u(Zopx%Bf=(V_GdT+PpXv(wDN}4* zEs^mnPyo91kN5rc$FKf5YJA<fZP~eL4II!#{4Et9mh7}VCDM`q^5~X%+k%uP@y@wF zXZqe?wnSep@7czYbsTVmKlW?sr#&xBsOc=yT^{s#?Pj5gI<MOI#ddJzwru0O9QA$z z!q^|%MJ1M=N-$xabox8n-2L;l1W!6`tBsrK9nF@!UH_8VX%-}}xyMc{EPK~>^p~OQ zD%Ovm#AmB2&5XDrntqL6-leF=*zB~y+OMXZT>?(fpg0~nGw@W)K@-8r*_v73<{sL- zHqR@>Xy(=CD51Jt>9^*bTn*XU*b2)0^I|T=aHr1dDc`tv%WT_trAeHB%yz3B59eXI z9hd7_84uZg2<nJG$_&lxId)K@=dVVfeaEl&@)J62RK0iYb##j8++sP|-wU!sR1q|j z`j)FNXrIJfwTDmg7JY1Ye4?)(EM%)G?PmVq)ILXv9{KF-S20LFJTu*7e-C)~rgx@w z?6b7GIp_Y(>939FKQ^mGHTT?;6eQoBiFs&fUEg42wy>mIVV-=2o6@I_wJ&b>&bUx@ zW6j|$*LJId_ichbx5;a%`^q2*-^LwJI3I64YGnR-@rK8rv*z44;`maN>pfQmkt`;L zYTKVX7rQaSerdr~g;}*b1C>7UyUZzlI^D3@voA2SSnYI4ENDY0#NZlM4^8J=ch01) zyjQICG;Xh2V5P%qwyjE!a?Iacdl>cFR7e2UoD#UHpSiB{q7CQyL+lyf-^O&Fh`(XK z*<^VbpUdsC4DVC_A)7}*yOW$!zH?2y_(M#BE#Ob<N|Qec^Ie|!i<L_|)I=C=Dcy1H z*A~dGT~Nfi_^lMtoXWn~QegR=of#HsT&=5)JpHj?P5pYs@bCPG68;242R}a<3Epc8 ziaw?1YG-`|mU;e|7UTF@(*DT_1<+zI=FMzLzI+GMBo}V=n`-O~+OrEXyv0GX_kD6n zp6APF!4-7@=U!IrSyW!0w9cmgtd&#tUiWh>aNj8<yLzsiq;Xm0&S$p^l^3Vv)NY8j zTX}HlTjoZ~Thpvuz2ZTJLTW~V`spU+PLgUt8$O9d`TS9hmc4T}`CZPh0)dr<*S1(r z&iCx(h8xTuS7<a#J*jM^!_jq)A@6EbPs?9e)tI}ZbeZxkJE!cueqIsqZ2BX8s`}DZ z3w;_ZMD4tO?=0T*#PQ9{uxZ8F?1`ImE}5OS&<s^<f$Vh_cyuvjQO_~+gBC4G=h-h- z+_|T-`Ehr=w8x{hO*hsY-g@o%5|vhXUUH9~7<5WIH!saUt|Fc5-_~TKx98T?ZWlD? z<2{y86CWKc=Jk>j?&N;!%)AyO)=Ars_;2}H6}jxzPSBF|lz$32C!cSKa?4no8<gY( z3Jy>hADO&5LbCV&!3S5`F6sL(J$FIazqUQ>%S+EQPo*+r*M0ZoL>TP9yl81i;S^1Q z?|U|G`S(ma=I&en8ue{8G2PzQY)r;mbxT)G=@NhyaT6maJ^R+TbEfv+ez8XBc_-Y~ z%bz>Dt)G3e$n>7OMlsp4imHm>-Q1wOnzHZIw2OaK-JYKcd1W+JE7n>5c3arquUgyB zZF9cep1s!G;|U@-&cr?pTE%rrq$7Rd<B}QQGoGj26Bapeb3S|0_I20IPP+@`!h=~U zJ9JOav406NeerJ<q-uBkj$dC;IQ^iC+mB_u4@w=CbPz5$dun=+oW$A28AX+!4}DlU zWkvb#h2fjtA@{>wLg8_JLeKMaH)xUZzt<ICXD{XdvhZ<tcTvVehc_$Lx2l%5xCDZg zKKg%qdvX}pVg{ZA?|<%Fts<PdMRLkPwbX6FWty{HjkFfOoOVZ}{-FPXB!iiMn7Si( zdgX;5FWNlw>fZC4=Na$4{QH_EgTcJiHM#wlOUgEFxq157#n1D_^UJ<ps*jbm-B~wD zrePxwgTcMlHB*jG@iR9ro_}+n&G|2XK79Z1uf$frpWU<SYjuIDE<>^;L&7Du&tYDd z&mKBedhMHhQFYOb_5Xgq$p19Eg`p>vq2Z)%#@j2Av(hXNA9P*&)lZ4xm=Obmr<dmD ht=ITH8UFOkpZxG|#)Gmh0R{#J22WQ%mvv4FO#trNflB}Y diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml deleted file mode 100644 index 318d9d5..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml +++ /dev/null @@ -1,115 +0,0 @@ -arg_name: option -name: typeMap -type: array -description: | - Default :php:`type map - <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>` - to apply to cursors, which determines how BSON documents are converted to PHP - values. The |php-library| uses the following type map by default: - - .. code-block:: php - - [ - 'array' => 'MongoDB\Model\BSONArray', - 'document' => 'MongoDB\Model\BSONDocument', - 'root' => 'MongoDB\Model\BSONDocument', - ] -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: allow_invalid_hostname -type: boolean -description: | - Disables hostname validation if ``true``. Defaults to ``false``. - - Allowing invalid hostnames may expose the driver to a `man-in-the-middle - attack <https://en.wikipedia.org/wiki/Man-in-the-middle_attack>`_. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: ca_dir -type: string -description: | - Path to a correctly hashed certificate directory. The system certificate store - will be used by default. - - Falls back to the deprecated ``capath`` SSL context option if not specified. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: ca_file -type: string -description: | - Path to a certificate authority file. The system certificate store will be - used by default. - - Falls back to the deprecated ``cafile`` SSL context option if not specified. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: crl_file -type: string -description: | - Path to a certificate revocation list file. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: pem_file -type: string -description: | - Path to a PEM encoded certificate to use for client authentication. - - Falls back to the deprecated ``local_cert`` SSL context option if not - specified. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: pem_pwd -type: string -description: | - Passphrase for the PEM encoded certificate (if applicable). - - Falls back to the deprecated ``passphrase`` SSL context option if not - specified. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: weak_cert_validation -type: boolean -description: | - Disables certificate validation ``true``. Defaults to ``false``. - - Falls back to the deprecated ``allow_self_signed`` SSL context option if not - specified. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: context -type: resource -description: | - :php:`SSL context options <manual/en/context.ssl.php>` to be used as fallbacks - for other driver options (as specified). Note that the driver does not consult - the default stream context. - - This option is supported for backwards compatibility, but should be considered - deprecated. -interface: phpmethod -operation: ~ -optional: true -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-construct-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-construct-param.yaml deleted file mode 100644 index 4b6ff42..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-construct-param.yaml +++ /dev/null @@ -1,51 +0,0 @@ -arg_name: param -name: $uri -type: string -description: | - The URI of the standalone, replica set, or sharded cluster to which to - connect. Refer to :manual:`Connection String URI Format - </reference/connection-string>` in the MongoDB manual for more information. - - Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified. - - Any special characters in the URI components need to be encoded according to - `RFC 3986 <http://www.faqs.org/rfcs/rfc3986.html>`_. This is particularly - relevant to the username and password, which can often include special - characters such as ``@``, ``:``, or ``%``. When connecting via a Unix domain - socket, the socket path may contain special characters such as slashes and - must be encoded. The :php:`rawurlencode() <rawurlencode>` function may be used - to encode constituent parts of the URI. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: param -name: $uriOptions -type: array -description: | - Specifies additional URI options, such as authentication credentials or query - string parameters. The options specified in ``$uriOptions`` take precedence - over any analogous options present in the ``$uri`` string and do not need to - be encoded according to `RFC 3986 <http://www.faqs.org/rfcs/rfc3986.html>`_. - - Refer to the :php:`MongoDB\\Driver\\Manager::__construct() - <mongodb-driver-manager.construct>` extension reference and :manual:`MongoDB - connection string </reference/connection-string>` documentation for accepted - options. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: param -name: $driverOptions -type: array -description: | - Specify driver-specific options, such as SSL options. In addition to any - options supported by the :php:`extension <mongodb-driver-manager>`, the - |php-library| allows you to specify a default :php:`type map - <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>` - to apply to the cursors it creates. -interface: phpmethod -operation: ~ -optional: true -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml deleted file mode 100644 index 22141f1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml +++ /dev/null @@ -1,19 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: typeMap -post: | - This will be used for the returned command result document. ---- -arg_name: option -name: writeConcern -type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>` -description: | - :manual:`Write concern </reference/write-concern>` to use for the operation. - Defaults to the client's write concern. - - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. -interface: phpmethod -operation: ~ -optional: true -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml deleted file mode 100644 index 07b7683..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml +++ /dev/null @@ -1,10 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $databaseName -replacement: - action: " to drop" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-get-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-get-param.yaml deleted file mode 100644 index e9d3ccc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-get-param.yaml +++ /dev/null @@ -1,6 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $databaseName -replacement: - action: " to select" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml deleted file mode 100644 index 4eb407f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: maxTimeMS -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml deleted file mode 100644 index 73ad04d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml deleted file mode 100644 index d81d318..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml +++ /dev/null @@ -1,27 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: readConcern -replacement: - resource: "collection" - parent: "client" ---- -source: - file: apiargs-common-option.yaml - ref: readPreference -replacement: - resource: "collection" - parent: "client" ---- -source: - file: apiargs-common-option.yaml - ref: typeMap -replacement: - parent: "client" ---- -source: - file: apiargs-common-option.yaml - ref: writeConcern -replacement: - resource: "collection" - parent: "client" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml deleted file mode 100644 index 99c7644..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml +++ /dev/null @@ -1,16 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $databaseName -replacement: - action: " containing the collection to select" ---- -source: - file: apiargs-common-param.yaml - ref: $collectionName -replacement: - action: " to select" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml deleted file mode 100644 index e4ffd3c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml +++ /dev/null @@ -1,27 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: readConcern -replacement: - resource: "database" - parent: "client" ---- -source: - file: apiargs-common-option.yaml - ref: readPreference -replacement: - resource: "database" - parent: "client" ---- -source: - file: apiargs-common-option.yaml - ref: typeMap -replacement: - parent: "client" ---- -source: - file: apiargs-common-option.yaml - ref: writeConcern -replacement: - resource: "database" - parent: "client" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml deleted file mode 100644 index 8e5f9d4..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml +++ /dev/null @@ -1,10 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $databaseName -replacement: - action: " to select" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-common-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-common-option.yaml deleted file mode 100644 index 2884467..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-common-option.yaml +++ /dev/null @@ -1,82 +0,0 @@ -arg_name: option -name: bypassDocumentValidation -type: boolean -description: | - If ``true``, allows the write operation to circumvent document level - validation. Defaults to ``false``. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: collation -type: array|object -description: | - :manual:`Collation </reference/collation>` allows users to specify - language-specific rules for string comparison, such as rules for lettercase - and accent marks. When specifying collation, the ``locale`` field is - mandatory; all other collation fields are optional. For descriptions of the - fields, see :manual:`Collation Document - </reference/collation/#collation-document>`. - - If the collation is unspecified but the collection has a default collation, - the operation uses the collation specified for the collection. If no - collation is specified for the collection or for the operation, MongoDB uses - the simple binary comparison used in prior versions for string comparisons. - - This option is available in MongoDB 3.4+ and will result in an exception at - execution time if specified for an older server version. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: readConcern -type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>` -description: | - :manual:`Read concern </reference/read-concern>` to use for the operation. - Defaults to the collection's read concern. - - This is not supported for server versions prior to 3.2 and will result in an - exception at execution time if used. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: readPreference -type: :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>` -description: | - :manual:`Read preference </reference/read-preference>` to use for the - operation. Defaults to the collection's read preference. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-common-option.yaml - ref: typeMap -replacement: - parent: "collection" ---- -arg_name: option -name: writeConcern -type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>` -description: | - :manual:`Write concern </reference/write-concern>` to use for the operation. - Defaults to the collection's write concern. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: upsert -type: boolean -description: | - If set to ``true``, creates a new document when no document matches the query - criteria. The default value is ``false``, which does not insert a new - document when no match is found. -interface: phpmethod -operation: ~ -optional: true -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-common-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-common-param.yaml deleted file mode 100644 index 73c18fa..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-common-param.yaml +++ /dev/null @@ -1,31 +0,0 @@ -arg_name: param -name: $filter -type: array|object -description: | - The filter criteria that specifies the documents{{action}}. -interface: phpmethod -operation: ~ -optional: false -replacement: - action: "" ---- -arg_name: param -name: $replacement -type: array|object -description: | - The replacement document. -interface: phpmethod -operation: ~ -optional: false ---- -arg_name: param -name: $update -type: array|object -description: | - Specifies the field and value combinations to update and any relevant update - operators. ``$update`` uses MongoDB's :method:`update operators - </reference/operator/update>`. -interface: phpmethod -operation: ~ -optional: false -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml deleted file mode 100644 index 4d353bf..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml +++ /dev/null @@ -1,77 +0,0 @@ -arg_name: option -name: allowDiskUse -type: boolean -description: | - Enables writing to temporary files. When set to ``true``, aggregation stages - can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory. The - default is ``false``. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: batchSize -type: integer -description: | - Specifies the initial batch size for the cursor. A batchSize of ``0`` means an - empty first batch and is useful for quickly returning a cursor or failure - message without doing significant server-side work. - - .. note:: - - This is not supported for inline aggregation results (i.e. ``useCursor`` - option is ``false`` or the server version is < 2.6). -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: bypassDocumentValidation -post: | - This only applies when using the :ref:`$out <agg-out>` stage. - - Document validation requires MongoDB 3.2 or later: if you are using an earlier - version of MongoDB, this option will be ignored. ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: readConcern ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: readPreference ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: typeMap ---- -arg_name: option -name: useCursor -type: boolean -description: | - Indicates whether the command will request that the server provide results - using a cursor. The default is ``true``. - - For MongoDB version 2.6 or later, ``useCursor`` allows users to turn off - cursors if necessary to aid in replica set or shard cluster upgrades. - - ``useCursor`` is ignored for MongoDB versions prior to 2.6 as aggregation - cursors are not available. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -post: | - This only applies when the :ref:`$out <agg-out>` stage is specified. - - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml deleted file mode 100644 index cbad3b4..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml +++ /dev/null @@ -1,14 +0,0 @@ -arg_name: param -name: $pipeline -type: array -description: | - Specifies an :manual:`aggregation pipeline </core/aggregation-pipeline>` - operation. -interface: phpmethod -operation: ~ -optional: false ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml deleted file mode 100644 index bb663bf..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml +++ /dev/null @@ -1,23 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: bypassDocumentValidation ---- -arg_name: option -name: ordered -type: boolean -description: | - If ``true``: when a single write fails, the operation will stop without - performing the remaining writes and throw an exception. - - If ``false``: when a single write fails, the operation will continue with the - remaining writes, if any, and throw an exception. - - The default is ``true``. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml deleted file mode 100644 index 79423a6..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml +++ /dev/null @@ -1,37 +0,0 @@ -arg_name: param -name: $operations -type: array -description: | - An array containing the write operations to perform. - :phpmethod:`MongoDB\\Collection::bulkWrite()` supports - :phpmethod:`deleteMany() <MongoDB\\Collection::deleteMany>`, - :phpmethod:`deleteOne() <MongoDB\\Collection::deleteOne>`, - :phpmethod:`insertOne() <MongoDB\\Collection::insertOne>`, - :phpmethod:`replaceOne() <MongoDB\\Collection::replaceOne>`, - :phpmethod:`updateMany() <MongoDB\\Collection::updateMany>`, and - :phpmethod:`updateOne() <MongoDB\\Collection::updateOne>` operations in the - following array structure: - - .. code-block:: php - - [ - [ 'deleteMany' => [ $filter ] ], - [ 'deleteOne' => [ $filter ] ], - [ 'insertOne' => [ $document ] ], - [ 'replaceOne' => [ $filter, $replacement, $options ] ], - [ 'updateMany' => [ $filter, $update, $options ] ], - [ 'updateOne' => [ $filter, $update, $options ] ], - ] - - Arguments correspond to the respective operation methods. However, the - ``writeConcern`` option is specified as a top-level option to - :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual - operation. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-construct-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-construct-option.yaml deleted file mode 100644 index 7d422ca..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-construct-option.yaml +++ /dev/null @@ -1,25 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: readConcern -replacement: - resource: "collection" - parent: "manager" ---- -source: - file: apiargs-common-option.yaml - ref: readPreference -replacement: - resource: "collection" - parent: "manager" ---- -source: - file: apiargs-MongoDBClient-method-construct-driverOptions.yaml - ref: typeMap ---- -source: - file: apiargs-common-option.yaml - ref: writeConcern -replacement: - resource: "collection" - parent: "manager" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-construct-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-construct-param.yaml deleted file mode 100644 index 0827800..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-construct-param.yaml +++ /dev/null @@ -1,16 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $manager ---- -source: - file: apiargs-common-param.yaml - ref: $databaseName ---- -source: - file: apiargs-common-param.yaml - ref: $collectionName ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-count-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-count-option.yaml deleted file mode 100644 index a3598c5..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-count-option.yaml +++ /dev/null @@ -1,44 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -arg_name: option -name: hint -type: string|array|object -description: | - The index to use. If you specify a document, it is interpreted as an index - specification from which a name will be derived. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: limit -type: integer -description: | - The maximum number of matching documents to return. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: readConcern ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: readPreference ---- -arg_name: option -name: skip -type: integer -description: | - The number of matching documents to skip before returning results. -interface: phpmethod -operation: ~ -optional: true -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-count-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-count-param.yaml deleted file mode 100644 index e18c616..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-count-param.yaml +++ /dev/null @@ -1,11 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: true -replacement: - action: " to count" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml deleted file mode 100644 index a7364a6..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml +++ /dev/null @@ -1,84 +0,0 @@ -arg_name: option -name: unique -type: boolean -description: | - Creates a :manual:`unique </core/index-unique>` index. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation -pre: | - Specifies the :manual:`collation - </reference/bson-type-comparison-order/#collation>` for the index. ---- -arg_name: option -name: partialFilterExpression -type: array|object -description: | - Creates a :manual:`partial </core/index-partial>` index. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: sparse -type: boolean -description: | - Creates a :manual:`sparse </core/index-sparse>` index. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: expireAfterSeconds -type: integer -description: | - Creates a :manual:`TTL </core/index-ttl>` index. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: name -type: string -description: | - A name that uniquely identifies the index. By default, MongoDB creates index - names based on the key. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: background -type: string -description: | - Instructs MongoDB to build the index :manual:`as a background - </core/index-creation>` process. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: 2dsphereIndexVersion -type: integer -description: | - Specifies the :manual:`version of a 2dsphere </core/2dsphere>` index to - create. - - MongoDB 2.6 introduced version 2 of 2dsphere indexes. Version 2 is the default - version of 2dsphere indexes created in MongoDB 2.6 and later versions. - ``2dsphereIndexVersion`` enables you to override the default version 2. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml deleted file mode 100644 index c2979d9..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml +++ /dev/null @@ -1,20 +0,0 @@ -arg_name: param -name: $key -type: array|object -description: | - Specifies the field or fields to index and the index order. - - For example, the following specifies a descending index on the ``username`` - field: - - .. code-block:: php - - [ 'username' => -1 ] -interface: phpmethod -operation: ~ -optional: false ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml deleted file mode 100644 index 2be24cb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml +++ /dev/null @@ -1,7 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml deleted file mode 100644 index e98d9aa..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml +++ /dev/null @@ -1,23 +0,0 @@ -arg_name: param -name: $indexes -type: array -description: | - The indexes to create on the collection. - - For example, the following specifies a unique index on the ``username`` field - and a compound index on the ``email`` and ``createdAt`` fields: - - .. code-block:: php - - [ - [ 'key' => [ 'username' => -1 ], 'unique' => true ], - [ 'key' => [ 'email' => 1, 'createdAt' => 1 ] ], - ] -interface: phpmethod -operation: ~ -optional: false ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml deleted file mode 100644 index 8c775dd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml +++ /dev/null @@ -1,8 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml deleted file mode 100644 index 92797eb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml +++ /dev/null @@ -1,11 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: false -replacement: - action: " to delete" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml deleted file mode 100644 index 8c775dd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml +++ /dev/null @@ -1,8 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml deleted file mode 100644 index 92797eb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml +++ /dev/null @@ -1,11 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: false -replacement: - action: " to delete" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-distinct-option.yaml deleted file mode 100644 index e8608b3..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-distinct-option.yaml +++ /dev/null @@ -1,16 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: readConcern ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: readPreference -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-distinct-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-distinct-param.yaml deleted file mode 100644 index 37cd9b5..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-distinct-param.yaml +++ /dev/null @@ -1,20 +0,0 @@ -arg_name: param -name: $fieldName -type: string -description: | - The field for which to return distinct values. -interface: phpmethod -operation: ~ -optional: false ---- -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: true -replacement: - action: " from which to retrieve the distinct values" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-drop-option.yaml deleted file mode 100644 index 6460329..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-drop-option.yaml +++ /dev/null @@ -1,13 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: typeMap -post: | - This will be used for the returned command result document. ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-drop-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-drop-param.yaml deleted file mode 100644 index 73ad04d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-drop-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml deleted file mode 100644 index 6460329..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml +++ /dev/null @@ -1,13 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: typeMap -post: | - This will be used for the returned command result document. ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml deleted file mode 100644 index 53061d1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml +++ /dev/null @@ -1,15 +0,0 @@ -arg_name: param -name: $indexName -type: string -description: | - The name of the index to drop. View the existing indexes on the collection - using the :phpmethod:`listIndexes() <MongoDB\\Collection::listIndexes>` - method. -interface: phpmethod -operation: ~ -optional: false ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml deleted file mode 100644 index 6460329..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml +++ /dev/null @@ -1,13 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: typeMap -post: | - This will be used for the returned command result document. ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml deleted file mode 100644 index 73ad04d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-find-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-find-option.yaml deleted file mode 100644 index b5ffe9c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-find-option.yaml +++ /dev/null @@ -1,146 +0,0 @@ -arg_name: option -name: projection -type: array|object -description: | - The :ref:`projection specification <projections>` to determine which fields to - include in the returned documents. See :manual:`Project Fields to Return from - Query </tutorial/project-fields-from-query-results>` and - :manual:`Projection Operators </reference/operator/projection>` in the MongoDB - manual. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: sort -type: array|object -description: | - The sort specification for the ordering of the results. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: skip -type: integer -description: | - Number of documents to skip. Defaults to ``0``. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: limit -type: integer -description: | - The maximum number of documents to return. If unspecified, then defaults to no - limit. A limit of ``0`` is equivalent to setting no limit. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: batchSize -type: integer -description: | - The number of documents to return in the first batch. Defaults to ``101``. A - batchSize of ``0`` means that the cursor will be established, but no documents - will be returned in the first batch. - - Unlike the previous wire protocol version, a batchSize of ``1`` for the - :dbcommand:`find` command does not close the cursor. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -arg_name: option -name: comment -type: string -description: | - A comment to attach to the query to help interpret and trace query - :dbcommand:`profile` data. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: cursorType -type: integer -description: | - Indicates the type of cursor to use. ``cursorType`` supports the following - values: - - - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*) - - ``MongoDB\Operation\Find::TAILABLE`` -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: readConcern ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: readPreference ---- -arg_name: option -name: oplogReplay -type: boolean -description: | - Internal use for replica sets. To use ``oplogReplay``, you must include the - following condition in the filter: - - .. code-block:: javascript - - { ts: { $gte: <timestamp> } } - - The :php:`MongoDB\\BSON\\Timestamp <class.mongodb-bson-timestamp>` class - reference describes how to represent MongoDB's BSON timestamp type with PHP. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: noCursorTimeout -type: boolean -description: | - Prevents the server from timing out idle cursors after an inactivity period - (10 minutes). -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: allowPartialResults -type: boolean -description: | - For queries against a sharded collection, returns partial results from the - :program:`mongos` if some shards are unavailable instead of throwing an error. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: typeMap ---- -arg_name: option -name: modifiers -type: array|object -description: | - Meta-operators that modify the output or behavior of a query. :manual:`Cursor - Methods </reference/method/js-cursor`> describes the query modification - methods available in MongoDB. -interface: phpmethod -operation: ~ -optional: true -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-find-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-find-param.yaml deleted file mode 100644 index 5683a7b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-find-param.yaml +++ /dev/null @@ -1,11 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: true -replacement: - action: " to query" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOne-option.yaml deleted file mode 100644 index 4e3793e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOne-option.yaml +++ /dev/null @@ -1,42 +0,0 @@ -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: projection ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: sort ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: skip ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: comment ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: readConcern ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: readPreference ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: typeMap -post: | - This will be used for the returned result document. ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: modifiers -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOne-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOne-param.yaml deleted file mode 100644 index 5683a7b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOne-param.yaml +++ /dev/null @@ -1,11 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: true -replacement: - action: " to query" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml deleted file mode 100644 index b7d4dea..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml +++ /dev/null @@ -1,29 +0,0 @@ -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: projection ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: sort ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: typeMap -post: | - This will be used for the returned result document. ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.2 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml deleted file mode 100644 index 92797eb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml +++ /dev/null @@ -1,11 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: false -replacement: - action: " to delete" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml deleted file mode 100644 index 24743d2..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml +++ /dev/null @@ -1,50 +0,0 @@ -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: projection ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: sort ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: bypassDocumentValidation ---- -arg_name: option -name: returnDocument -type: integer -description: | - Specifies whether to return the document before the replacement is applied, or - after. ``returnDocument`` supports the following values: - - - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*) - - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER`` -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: typeMap -post: | - This will be used for the returned result document. ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: upsert ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.2 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml deleted file mode 100644 index 32ed6b3..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml +++ /dev/null @@ -1,15 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: false -replacement: - action: " to replace" ---- -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $replacement ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml deleted file mode 100644 index dcec8aa..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml +++ /dev/null @@ -1,50 +0,0 @@ -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: projection ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: sort ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: bypassDocumentValidation ---- -arg_name: option -name: returnDocument -type: integer -description: | - Specifies whether to return the document before the update is applied, or - after. ``returnDocument`` supports the following values: - - - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*) - - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER`` -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: typeMap -post: | - This will be used for the returned result document. ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: upsert ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.2 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml deleted file mode 100644 index a335678..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml +++ /dev/null @@ -1,15 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: false -replacement: - action: " to update" ---- -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $update ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml deleted file mode 100644 index 1b32b97..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml +++ /dev/null @@ -1,12 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: bypassDocumentValidation ---- -source: - file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml - ref: ordered ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml deleted file mode 100644 index 78246d3..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml +++ /dev/null @@ -1,13 +0,0 @@ -arg_name: param -name: $documents -type: array -description: | - The documents to insert into the collection. -interface: phpmethod -operation: ~ -optional: false ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml deleted file mode 100644 index ee47d57..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml +++ /dev/null @@ -1,8 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: bypassDocumentValidation ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml deleted file mode 100644 index 5dc231d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml +++ /dev/null @@ -1,13 +0,0 @@ -arg_name: param -name: $document -type: array|object -description: | - The document to insert into the collection. -interface: phpmethod -operation: ~ -optional: false ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml deleted file mode 100644 index 4eb407f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: maxTimeMS -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml deleted file mode 100644 index 73ad04d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml deleted file mode 100644 index 4fec2f0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml +++ /dev/null @@ -1,16 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: upsert ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: bypassDocumentValidation ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml deleted file mode 100644 index 32ed6b3..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml +++ /dev/null @@ -1,15 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: false -replacement: - action: " to replace" ---- -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $replacement ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml deleted file mode 100644 index 4fec2f0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml +++ /dev/null @@ -1,16 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: upsert ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: bypassDocumentValidation ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml deleted file mode 100644 index a335678..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml +++ /dev/null @@ -1,15 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: false -replacement: - action: " to update" ---- -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $update ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml deleted file mode 100644 index 4fec2f0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml +++ /dev/null @@ -1,16 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: upsert ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: bypassDocumentValidation ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: writeConcern -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml deleted file mode 100644 index a335678..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml +++ /dev/null @@ -1,15 +0,0 @@ -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $filter -optional: false -replacement: - action: " to update" ---- -source: - file: apiargs-MongoDBCollection-common-param.yaml - ref: $update ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml deleted file mode 100644 index 681144f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml +++ /dev/null @@ -1,27 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: readConcern -replacement: - resource: "collection" - parent: "original collection" ---- -source: - file: apiargs-common-option.yaml - ref: readPreference -replacement: - resource: "collection" - parent: "original collection" ---- -source: - file: apiargs-common-option.yaml - ref: typeMap -replacement: - parent: "original collection" ---- -source: - file: apiargs-common-option.yaml - ref: writeConcern -replacement: - resource: "collection" - parent: "original collection" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml deleted file mode 100644 index 73ad04d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-common-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-common-option.yaml deleted file mode 100644 index c18bd67..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-common-option.yaml +++ /dev/null @@ -1,16 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: typeMap -replacement: - parent: "database" ---- -arg_name: option -name: writeConcern -type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>` -description: | - :manual:`Write concern </reference/write-concern>` to use for the operation. - Defaults to the database's write concern. -interface: phpmethod -operation: ~ -optional: true -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-command-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-command-option.yaml deleted file mode 100644 index 7dc5b5a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-command-option.yaml +++ /dev/null @@ -1,11 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: readPreference -description: | - :manual:`Read preference </reference/read-preference>` to use for the - operation. Defaults to the database's read preference. ---- -source: - file: apiargs-MongoDBDatabase-common-option.yaml - ref: typeMap -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-command-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-command-param.yaml deleted file mode 100644 index 5a4b03d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-command-param.yaml +++ /dev/null @@ -1,13 +0,0 @@ -arg_name: param -name: $command -type: array|object -description: | - The :manual:`database command </reference/command>` document. -interface: phpmethod -operation: ~ -optional: false ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-construct-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-construct-option.yaml deleted file mode 100644 index d398069..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-construct-option.yaml +++ /dev/null @@ -1,25 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: readConcern -replacement: - resource: "database" - parent: "manager" ---- -source: - file: apiargs-common-option.yaml - ref: readPreference -replacement: - resource: "database" - parent: "manager" ---- -source: - file: apiargs-MongoDBClient-method-construct-driverOptions.yaml - ref: typeMap ---- -source: - file: apiargs-common-option.yaml - ref: writeConcern -replacement: - resource: "database" - parent: "manager" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-construct-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-construct-param.yaml deleted file mode 100644 index 5ef826c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-construct-param.yaml +++ /dev/null @@ -1,12 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $manager ---- -source: - file: apiargs-common-param.yaml - ref: $databaseName ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml deleted file mode 100644 index d70a905..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ /dev/null @@ -1,230 +0,0 @@ -arg_name: option -name: autoIndexId -type: boolean -description: | - Specify ``false`` to disable the automatic creation of an index on the ``_id`` - field. - - .. important:: - - For replica sets, do not set ``autoIndexId`` to ``false``. - - .. deprecated:: 3.2. The ``autoIndexId`` option will be removed in MongoDB 3.4. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: capped -type: boolean -description: | - To create a capped collection, specify ``true``. If you specify ``true``, you - must also set a maximum size in the ``size`` option. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation -pre: | - Specifies the :manual:`collation - </reference/bson-type-comparison-order/#collation>` for the collection. ---- -arg_name: option -name: flags -type: integer -description: | - Available for the MMAPv1 storage engine only to set the ``usePowerOf2Sizes`` - and ``noPadding`` flags. - - The |php-library| provides constants that you can combine with a :php:`bitwise - OR operator <language.operators.bitwise>` to set the flag values: - - - ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1`` - - ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2`` - - Defaults to ``1``. - - .. note:: - - MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See - :manual:`collMod </reference/command/collMod>` and - :manual:`db.createCollection() - </reference/method/db.createCollection>` for more information. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: indexOptionDefaults -type: array|object -description: | - Allows users to specify a default configuration for indexes when creating a - collection. - - The ``indexOptionDefaults`` option accepts a ``storageEngine`` document, - which should take the following form:: - - { <storage-engine-name>: <options> } - - Storage engine configurations specified when creating indexes are validated - and logged to the :term:`oplog` during replication to support replica sets - with members that use different storage engines. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: max -type: integer -description: | - The maximum number of documents allowed in the capped collection. The ``size`` - option takes precedence over this limit. If a capped collection reaches the - ``size`` limit before it reaches the maximum number of documents, MongoDB - removes old documents. If you prefer to use the ``max`` limit, ensure that the - ``size`` limit, which is required for a capped collection, is sufficient to - contain the maximum number of documents. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS ---- -arg_name: option -name: size -type: integer -description: | - Specify a maximum size in bytes for a capped collection. Once a capped - collection reaches its maximum size, MongoDB removes the older documents to - make space for the new documents. The ``size`` option is required for capped - collections and ignored for other collections. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: storageEngine -type: array|object -description: | - Available for the WiredTiger storage engine only. - - Allows users to specify configuration to the storage engine on a - per-collection basis when creating a collection. The value of the - ``storageEngine`` option should take the following form:: - - { <storage-engine-name>: <options> } - - Storage engine configurations specified when creating collections are - validated and logged to the :term:`oplog` during replication to support - replica sets with members that use different storage engines. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBDatabase-common-option.yaml - ref: typeMap -post: | - This will be used for the returned command result document. ---- -arg_name: option -name: validator -type: array -description: | - Allows users to specify :manual:`validation rules or expressions - </core/document-validation>` for the collection. For more information, see - :manual:`Document Validation </core/document-validation>` in the MongoDB - manual. - - The ``validator`` option takes an array that specifies the validation rules or - expressions. You can specify the expressions using the same operators as - MongoDB's :manual:`query operators </reference/operator/query>` with the - exception of :query:`$geoNear`, :query:`$near`, :query:`$nearSphere`, - :query:`$text`, and :query:`$where`. - - .. note:: - - - Validation occurs during updates and inserts. Existing documents do not - undergo validation checks until modification. - - - You cannot specify a validator for collections in the ``admin``, - ``local``, and ``config`` databases. - - - You cannot specify a validator for ``system.*`` collections. -operation: ~ -interface: phpmethod -optional: true ---- -arg_name: option -name: validationAction -type: string -description: | - Determines whether to ``error`` on invalid documents or just ``warn`` about - the violations but allow invalid documents to be inserted. - - .. important:: - - Validation of documents only applies to those documents as determined by - the ``validationLevel``. - - .. list-table:: - :header-rows: 1 - - * - ``validationAction`` - - - Description - - * - ``"error"`` - - - **Default**. Documents must pass validation before the write occurs. - Otherwise, the write operation fails. - - * - ``"warn"`` - - - Documents do not have to pass validation. If the document fails - validation, the write operation logs the validation failure. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: validationLevel -type: string -description: | - Determines how strictly MongoDB applies the validation rules to existing - documents during an update. - - .. list-table:: - :header-rows: 1 - - * - ``validationLevel`` - - - Description - - * - ``"off"`` - - - No validation for inserts or updates. - - * - ``"strict"`` - - - **Default**. Apply validation rules to all inserts and all updates. - - * - ``"moderate"`` - - - Apply validation rules to inserts and to updates on existing *valid* - documents. Do not apply rules to updates on existing *invalid* - documents. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-MongoDBDatabase-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml deleted file mode 100644 index b6bb2dc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml +++ /dev/null @@ -1,10 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $collectionName -replacement: - action: " to create" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-drop-option.yaml deleted file mode 100644 index 630c1bd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-drop-option.yaml +++ /dev/null @@ -1,13 +0,0 @@ -source: - file: apiargs-MongoDBDatabase-common-option.yaml - ref: typeMap -post: | - This will be used for the returned command result document. ---- -source: - file: apiargs-MongoDBDatabase-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-drop-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-drop-param.yaml deleted file mode 100644 index 73ad04d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-drop-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml deleted file mode 100644 index 630c1bd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml +++ /dev/null @@ -1,13 +0,0 @@ -source: - file: apiargs-MongoDBDatabase-common-option.yaml - ref: typeMap -post: | - This will be used for the returned command result document. ---- -source: - file: apiargs-MongoDBDatabase-common-option.yaml - ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml deleted file mode 100644 index c8e0a61..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml +++ /dev/null @@ -1,10 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $collectionName -replacement: - action: " to drop" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-get-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-get-param.yaml deleted file mode 100644 index 651c85f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-get-param.yaml +++ /dev/null @@ -1,6 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $collectionName -replacement: - action: " to select" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml deleted file mode 100644 index c8bcc2c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml +++ /dev/null @@ -1,15 +0,0 @@ -arg_name: option -name: filter -type: array|object -description: | - A query expression to filter the list of collections. - - You can specify a query expression on the collection ``name`` and ``options``. -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml deleted file mode 100644 index 73ad04d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml deleted file mode 100644 index 932c1b1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml +++ /dev/null @@ -1,27 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: readConcern -replacement: - resource: "collection" - parent: "database" ---- -source: - file: apiargs-common-option.yaml - ref: readPreference -replacement: - resource: "collection" - parent: "database" ---- -source: - file: apiargs-common-option.yaml - ref: typeMap -replacement: - parent: "database" ---- -source: - file: apiargs-common-option.yaml - ref: writeConcern -replacement: - resource: "collection" - parent: "database" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml deleted file mode 100644 index 46d4e72..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml +++ /dev/null @@ -1,10 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $collectionName -replacement: - action: " to select" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml deleted file mode 100644 index 294bf6b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml +++ /dev/null @@ -1,46 +0,0 @@ -arg_name: option -name: bucketName -type: string -description: | - The bucket name, which will be used as a prefix for the files and chunks - collections. Defaults to ``"fs"``. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: chunkSizeBytes -type: integer -description: | - The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB). -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-common-option.yaml - ref: readConcern -replacement: - resource: "bucket" - parent: "database" ---- -source: - file: apiargs-common-option.yaml - ref: readPreference -replacement: - resource: "bucket" - parent: "database" ---- -source: - file: apiargs-common-option.yaml - ref: typeMap -replacement: - parent: "database" ---- -source: - file: apiargs-common-option.yaml - ref: writeConcern -replacement: - resource: "bucket" - parent: "database" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml deleted file mode 100644 index 73ad04d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml deleted file mode 100644 index c048182..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml +++ /dev/null @@ -1,27 +0,0 @@ -source: - file: apiargs-common-option.yaml - ref: readConcern -replacement: - resource: "database" - parent: "original database" ---- -source: - file: apiargs-common-option.yaml - ref: readPreference -replacement: - resource: "database" - parent: "original database" ---- -source: - file: apiargs-common-option.yaml - ref: typeMap -replacement: - parent: "original database" ---- -source: - file: apiargs-common-option.yaml - ref: writeConcern -replacement: - resource: "database" - parent: "original database" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml deleted file mode 100644 index 73ad04d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml deleted file mode 100644 index 8c6470d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml +++ /dev/null @@ -1,50 +0,0 @@ -arg_name: option -name: _id -type: mixed -description: | - Value to use as the file document identifier. Defaults to a new - :php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: chunkSizeBytes -type: integer -description: | - The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: metadata -type: array|object -description: | - User data for the ``metadata`` field of the file document. If not specified, - the ``metadata`` field will not be set on the file document. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: revision -type: integer -description: | - The revision of the file to retrieve. Files with the name ``filename`` will be - differentiated by their ``uploadDate`` field. - - Revision numbers are defined as follows: - - - 0 = the original stored file - - 1 = the first revision - - 2 = the second revision - - etc... - - -2 = the second most recent revision - - -1 = the most recent revision - - Defaults to -1 (i.e. the most recent revision). -interface: phpmethod -operation: ~ -optional: true -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-common-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-common-param.yaml deleted file mode 100644 index f1d6b13..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-common-param.yaml +++ /dev/null @@ -1,39 +0,0 @@ -arg_name: param -name: $filename -type: string -description: | - The ``filename`` of the file{{action}}. -interface: phpmethod -operation: ~ -optional: false -replacement: - action: "" ---- -arg_name: param -name: $id -type: mixed -description: | - The ``_id`` of the file{{action}}. -interface: phpmethod -operation: ~ -optional: false -replacement: - action: "" ---- -arg_name: param -name: $stream -type: resource -description: | - The GridFS stream resource. -interface: phpmethod -operation: ~ ---- -arg_name: param -name: $destination -type: resource -description: | - Writable stream, to which the GridFS file's contents will be written. -interface: phpmethod -operation: ~ -optional: false -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml deleted file mode 100644 index 30be1b5..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml +++ /dev/null @@ -1,44 +0,0 @@ -arg_name: option -name: bucketName -type: string -description: | - The bucket name, which will be used as a prefix for the files and chunks - collections. Defaults to ``"fs"``. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: chunkSizeBytes -type: integer -description: | - The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB). -interface: phpmethod -operation: ~ -optional: true ---- -source: - file: apiargs-common-option.yaml - ref: readConcern -replacement: - resource: "bucket" - parent: "database" ---- -source: - file: apiargs-common-option.yaml - ref: readPreference -replacement: - resource: "bucket" - parent: "database" ---- -source: - file: apiargs-MongoDBClient-method-construct-driverOptions.yaml - ref: typeMap ---- -source: - file: apiargs-common-option.yaml - ref: writeConcern -replacement: - resource: "bucket" - parent: "database" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml deleted file mode 100644 index 5ef826c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml +++ /dev/null @@ -1,12 +0,0 @@ -source: - file: apiargs-common-param.yaml - ref: $manager ---- -source: - file: apiargs-common-param.yaml - ref: $databaseName ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml deleted file mode 100644 index 7e8baa2..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml +++ /dev/null @@ -1,6 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $id -replacement: - resource: " to delete" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml deleted file mode 100644 index 39d48dc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml +++ /dev/null @@ -1,10 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $id -replacement: - resource: " to download" ---- -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $destination -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml deleted file mode 100644 index 9dc941d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-option.yaml - ref: revision -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml deleted file mode 100644 index 2704877..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml +++ /dev/null @@ -1,14 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $filename -replacement: - resource: " to download" ---- -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $destination ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml deleted file mode 100644 index 84bab2c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml +++ /dev/null @@ -1,72 +0,0 @@ -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: projection ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: sort ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: skip ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: limit ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: batchSize ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: collation ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: comment ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: cursorType ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: maxTimeMS ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: readConcern -description: | - :manual:`Read concern </reference/read-concern>` to use for the operation. - Defaults to the bucket's read concern. ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: readPreference -description: | - :manual:`Read preference </reference/read-preference>` to use for the - operation. Defaults to the bucket's read preference. ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: oplogReplay ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: noCursorTimeout ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: allowPartialResults ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: typeMap -replacement: - parent: "bucket" ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: modifiers -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml deleted file mode 100644 index 25a9dc1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml +++ /dev/null @@ -1,42 +0,0 @@ -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: projection ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: sort ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: skip ---- -source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: collation ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: comment ---- -source: - file: apiargs-common-option.yaml - ref: maxTimeMS ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: readConcern ---- -source: - file: apiargs-MongoDBGridFSBucket-method-find-option.yaml - ref: readPreference ---- -source: - file: apiargs-MongoDBGridFSBucket-method-find-option.yaml - ref: typeMap -post: | - This will be used for the returned result document. ---- -source: - file: apiargs-MongoDBCollection-method-find-option.yaml - ref: modifiers -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml deleted file mode 100644 index 0801cb2..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $stream -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml deleted file mode 100644 index 0801cb2..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $stream -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml deleted file mode 100644 index 54e7c8c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml +++ /dev/null @@ -1,6 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $id -replacement: - resource: " to download" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml deleted file mode 100644 index 9dc941d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml +++ /dev/null @@ -1,4 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-option.yaml - ref: revision -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml deleted file mode 100644 index eb8ec93..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml +++ /dev/null @@ -1,10 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $filename -replacement: - resource: " to download" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml deleted file mode 100644 index 6c4d2ff..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml +++ /dev/null @@ -1,12 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-option.yaml - ref: _id ---- -source: - file: apiargs-MongoDBGridFSBucket-common-option.yaml - ref: chunkSizeBytes ---- -source: - file: apiargs-MongoDBGridFSBucket-common-option.yaml - ref: metadata -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml deleted file mode 100644 index 6b8efb3..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml +++ /dev/null @@ -1,10 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $filename -replacement: - resource: " to create" ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml deleted file mode 100644 index e1b140a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml +++ /dev/null @@ -1,15 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $id -replacement: - resource: " to rename" ---- -arg_name: param -name: $newFilename -type: string -description: | - The new ``filename`` value. -interface: phpmethod -operation: ~ -optional: false -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml deleted file mode 100644 index 6c4d2ff..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml +++ /dev/null @@ -1,12 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-option.yaml - ref: _id ---- -source: - file: apiargs-MongoDBGridFSBucket-common-option.yaml - ref: chunkSizeBytes ---- -source: - file: apiargs-MongoDBGridFSBucket-common-option.yaml - ref: metadata -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml deleted file mode 100644 index 48fa2db..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml +++ /dev/null @@ -1,19 +0,0 @@ -source: - file: apiargs-MongoDBGridFSBucket-common-param.yaml - ref: $filename -replacement: - resource: " to create" ---- -arg_name: param -name: $source -type: resource -description: | - Readable stream, from which the new GridFS file's contents will be read. -interface: phpmethod -operation: ~ -optional: false ---- -source: - file: apiargs-common-param.yaml - ref: $options -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-common-option.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-common-option.yaml deleted file mode 100644 index 54d6bd8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-common-option.yaml +++ /dev/null @@ -1,64 +0,0 @@ -arg_name: option -name: maxTimeMS -type: integer -description: | - The cumulative time limit in milliseconds for processing operations on the - cursor. MongoDB aborts the operation at the earliest following - :term:`interrupt point`. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: readConcern -type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>` -description: | - The default read concern to use for {{resource}} operations. Defaults to the - {{parent}}'s read concern. -interface: phpmethod -operation: selectCollection -optional: true -replacement: - resource: "collection" - parent: "client" ---- -arg_name: option -name: readPreference -type: :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>` -description: | - The default read preference to use for {{resource}} operations. Defaults to - the {{parent}}'s read preference. -interface: phpmethod -operation: ~ -optional: true -replacement: - resource: "collection" - parent: "client" ---- -arg_name: option -name: typeMap -type: array -description: | - The :php:`type map - <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>` - to apply to cursors, which determines how BSON documents are converted to PHP - values. Defaults to the {{parent}}'s type map. -interface: phpmethod -operation: ~ -optional: true -replacement: - parent: "client" ---- -arg_name: option -name: writeConcern -type: :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>` -description: | - The default write concern to use for {{resource}} operations. Defaults - to the {{parent}}'s write concern. -interface: phpmethod -operation: ~ -optional: true -replacement: - resource: "collection" - parent: "client" -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-common-param.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-common-param.yaml deleted file mode 100644 index 0f152c8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/apiargs-common-param.yaml +++ /dev/null @@ -1,41 +0,0 @@ -arg_name: param -name: $manager -type: :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` -description: | - The :php:`Manager <mongodb-driver-manager>` instance from the driver. The - manager maintains connections between the driver and your MongoDB instances. -interface: phpmethod -operation: ~ -optional: false ---- -arg_name: param -name: $databaseName -type: string -description: | - The name of the database{{action}}. -interface: phpmethod -operation: ~ -optional: false -replacement: - action: "" ---- -arg_name: param -name: $collectionName -type: string -description: | - The name of the collection{{action}}. -interface: phpmethod -operation: ~ -optional: false -replacement: - action: "" ---- -arg_name: param -name: $options -type: array -description: | - An array specifying the desired options. -interface: phpmethod -operation: ~ -optional: true -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-bulkwriteexception.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-bulkwriteexception.yaml deleted file mode 100644 index f002063..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-bulkwriteexception.yaml +++ /dev/null @@ -1,21 +0,0 @@ -ref: bulkwriteexception-result -content: | - If a :php:`MongoDB\\Driver\\Exception\\BulkWriteException - <mongodb-driver-exception-bulkwriteexception>` is thrown, users should call - :php:`getWriteResult() <mongodb-driver-writeexception.getwriteresult>` and - inspect the returned :php:`MongoDB\\Driver\\WriteResult - <mongodb-driver-writeresult>` object to determine the nature of the error. - - For example, a write operation may have been successfully applied to the - primary server but failed to satisfy the write concern (e.g. replication took - too long). Alternatively, a write operation may have failed outright (e.g. - unique key violation). ---- -ref: bulkwriteexception-ordered -content: | - In the case of a bulk write, the result may indicate multiple successful write - operations and/or errors. If the ``ordered`` option is ``true``, some - operations may have succeeded before the first error was encountered and the - exception thrown. If the ``ordered`` option is ``false``, multiple errors may - have been encountered. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-error.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-error.yaml deleted file mode 100644 index cfada04..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-error.yaml +++ /dev/null @@ -1,52 +0,0 @@ -ref: error-driver-bulkwriteexception -content: | - :php:`MongoDB\\Driver\\Exception\\BulkWriteException - <mongodb-driver-exception-bulkwriteexception>` for errors related to the write - operation. Users should inspect the value returned by :php:`getWriteResult() - <mongodb-driver-writeexception.getwriteresult>` to determine the nature of the - error. ---- -ref: error-driver-invalidargumentexception -content: | - :php:`MongoDB\\Driver\\Exception\\InvalidArgumentException - <mongodb-driver-exception-invalidargumentexception>` for errors related to the - parsing of parameters or options at the driver level. ---- -ref: error-driver-runtimeexception -content: | - :php:`MongoDB\\Driver\\Exception\\RuntimeException - <mongodb-driver-exception-runtimeexception>` for other errors at the driver - level (e.g. connection errors). ---- -ref: error-badmethodcallexception-write-result -content: | - :phpclass:`MongoDB\\Exception\\BadMethodCallException` if this method is - called and the write operation used an unacknowledged :manual:`write concern - </reference/write-concern>`. ---- -ref: error-invalidargumentexception -content: | - :phpclass:`MongoDB\\Exception\\InvalidArgumentException` for errors related to - the parsing of parameters or options. ---- -ref: error-unexpectedvalueexception -content: | - :phpclass:`MongoDB\\Exception\\UnexpectedValueException` if the command - response from the server was malformed. ---- -ref: error-unsupportedexception -content: | - :phpclass:`MongoDB\\Exception\\UnsupportedException` if options are used and - not supported by the selected server (e.g. ``collation``, ``readConcern``, - ``writeConcern``). ---- -ref: error-gridfs-filenotfoundexception -content: | - :phpclass:`MongoDB\\GridFS\\Exception\\FileNotFoundException` if no file was - found for the selection criteria. ---- -ref: error-gridfs-corruptfileexception -content: | - :phpclass:`MongoDB\\GridFS\\Exception\\CorruptFileException` if the file's - metadata or chunk documents contain unexpected or invalid data. -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-note.yaml b/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-note.yaml deleted file mode 100644 index 05caf35..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/includes/extracts-note.yaml +++ /dev/null @@ -1,12 +0,0 @@ -ref: note-bson-comparison -content: | - When evaluating query criteria, MongoDB compares types and values according to - its own :manual:`comparison rules for BSON types - </reference/bson-type-comparison-order>`, which differs from PHP's - :php:`comparison <manual/en/types.comparisons.php>` and :php:`type juggling - <manual/en/language.types.type-juggling.php>` rules. When matching a special - BSON type the query criteria should use the respective :php:`BSON class - <manual/en/book.bson.php>` in the driver (e.g. use - :php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` to match an - :manual:`ObjectId </reference/object-id/>`). -... diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/index.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/index.txt deleted file mode 100644 index 6c3a974..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/index.txt +++ /dev/null @@ -1,61 +0,0 @@ -=================== -MongoDB PHP Library -=================== - -.. default-domain:: mongodb - -The |php-library| provides a high-level abstraction around the lower-level -`PHP driver <https://php.net/mongodb>`_, also known as the ``mongodb`` -extension. - -While the ``mongodb`` extension provides a limited API for executing commands, -queries, and write operations, the |php-library| implements an API similar to -that of the `legacy PHP driver <http://php.net/manual/en/book.mongo.php>`_. The -library contains abstractions for client, database, and collection objects, and -provides methods for CRUD operations and common commands such as index and -collection management. - -If you are developing a PHP application with MongoDB, you should consider using -this library, or another high-level abstraction, instead of the extension alone. - -For additional information about this library and the ``mongodb`` extension, see -the `Architecture Overview <http://php.net/manual/en/mongodb.overview.php>`_ -article in the extension documentation. `Derick Rethans -<http://derickrethans.nl/>`_ has also written a series of blog posts entitled -*New MongoDB Drivers for PHP and HHVM*: - -- `Part One: History <https://derickrethans.nl/new-drivers.html>`_ - -- `Part Two: Architecture - <https://derickrethans.nl/new-drivers-part2.html>`_ - -- `Part Three: Cursor Behaviour - <https://derickrethans.nl/new-drivers-part3-cursor.html>`_ - -New to MongoDB? ---------------- - -If you are a new MongoDB user, these links should help you become more familiar -with MongoDB and introduce some of the concepts and terms you will encounter in -this documentation: - -- :manual:`Introduction to CRUD operations in MongoDB </core/crud>` - -- :manual:`What is a MongoDB document? </core/document>` - -- :manual:`Dot notation for accessing document properties - </core/document/#dot-notation>` - -- :manual:`ObjectId: MongoDB's document identifier </reference/object-id/>` - -.. class:: hidden - - .. toctree:: - :titlesonly: - - Installation </tutorial/install-php-library> - /tutorial - /upgrade - /reference - -.. /getting-started diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/pretty.js b/boilerplate/test/src/vendor/mongodb/mongodb/docs/pretty.js deleted file mode 100644 index cd0aa1e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/pretty.js +++ /dev/null @@ -1,4 +0,0 @@ -$(document).ready(function() { - $('pre code').parent().addClass('prettyprint well'); - prettyPrint(); -}); diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference.txt deleted file mode 100644 index b0606bd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference.txt +++ /dev/null @@ -1,17 +0,0 @@ -========= -Reference -========= - -.. default-domain:: mongodb - -.. toctree:: - :titlesonly: - - /reference/bson - /reference/class/MongoDBClient - /reference/class/MongoDBDatabase - /reference/class/MongoDBCollection - /reference/class/MongoDBGridFSBucket - /reference/write-result-classes - /reference/enumeration-classes - /reference/exception-classes diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/bson.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/bson.txt deleted file mode 100644 index 789bcbc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/bson.txt +++ /dev/null @@ -1,246 +0,0 @@ -==== -BSON -==== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Overview --------- - -MongoDB stores data records as BSON documents. BSON is a binary representation -of :term:`JSON` documents, though it contains more data types than JSON. For the -BSON spec, see `bsonspec.org <http://bsonspec.org/>`_. - -By default, the |php-library| returns BSON documents as -:phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as -:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. - -BSON Classes ------------- - -.. phpclass:: MongoDB\\Model\\BSONArray - - This class extends PHP's :php:`ArrayObject <arrayobject>` class. It also - implements PHP's :php:`JsonSerializable <jsonserializable>` interface and the - driver's :php:`MongoDB\\BSON\\Serializable <mongodb-bson-serializable>` and - :php:`MongoDB\\BSON\\Unserializable <mongodb-bson-unserializable>` - interfaces. - - By default, the library will deserialize BSON arrays as instances of this - class. During BSON and JSON serialization, instances of this class will - serialize as an array type (:php:`array_values() <array_values>` is used - internally to numerically reindex the array). - -.. phpclass:: MongoDB\\Model\\BSONDocument - - This class extends PHP's :php:`ArrayObject <arrayobject>` class. It also - implements PHP's :php:`JsonSerializable <jsonserializable>` interface and the - driver's :php:`MongoDB\\BSON\\Serializable <mongodb-bson-serializable>` and - :php:`MongoDB\\BSON\\Unserializable <mongodb-bson-unserializable>` - interfaces. - - By default, the library will deserialize BSON documents as instances of this - class. During BSON and JSON serialization, instances of this class will - serialize as a document type (:php:`object casting - <types.type-juggling#language.types.typecasting>` is used internally). - -Type Maps ---------- - -Most methods that read data from MongoDB support a ``typeMap`` option, which -allows control over how BSON is converted to PHP. Additionally, -the :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and -:phpclass:`MongoDB\\Collection` classes accept a ``typeMap`` option, which can -be used to specify a default type map to apply to any supporting methods and -selected classes (e.g. :phpmethod:`MongoDB\\Client::selectDatabase()`). - -The :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and -:phpclass:`MongoDB\\Collection` classes use the following type map by -default: - -.. code-block:: php - - [ - 'array' => 'MongoDB\Model\BSONArray', - 'document' => 'MongoDB\Model\BSONDocument', - 'root' => 'MongoDB\Model\BSONDocument', - ] - -``Persistable`` Classes ------------------------ - -The driver's :php:`persistence specification <mongodb.persistence>` outlines how -classes implementing its :php:`MongoDB\\BSON\\Persistable -<mongodb-bson-persistable>` interface are serialized to and deserialized from -BSON. The :php:`Persistable <mongodb-bson-persistable>` interface is analogous -to PHP's :php:`Serializable interface <class.serializable>`. - -The driver automatically handles serialization and deserialization for classes -implementing the :php:`Persistable <mongodb-bson-persistable>` interface without -requiring the use of the ``typeMap`` option. This is done by encoding the name -of the PHP class in a special property within the BSON document. - -.. note:: - - When deserializing a PHP variable from BSON, the encoded class name of a - :php:`Persistable <mongodb-bson-persistable>` object will override any class - specified in the type map, but it will not override ``"array"`` and - ``"stdClass"`` or ``"object"``. This is discussed in the - :php:`persistence specification <mongodb.persistence>` but it bears - repeating. - -Consider the following class definition: - -.. code-block:: php - - <?php - - class Person implements MongoDB\BSON\Persistable - { - private $id; - private $name; - private $createdAt; - - public function __construct($name) - { - $this->id = new MongoDB\BSON\ObjectID; - $this->name = (string) $name; - $this->createdAt = new MongoDB\BSON\UTCDateTime; - } - - function bsonSerialize() - { - return [ - '_id' => $this->id, - 'name' => $this->name, - 'createdAt' => $this->createdAt, - ]; - } - - function bsonUnserialize(array $data) - { - $this->id = $data['_id']; - $this->name = $data['name']; - $this->createdAt = $data['createdAt']; - } - } - -The following example constructs a ``Person`` object, inserts it into the -database, and reads it back as an object of the same type: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->persons; - - $result = $collection->insertOne(new Person('Bob')); - - $person = $collection->findOne(['_id' => $result->getInsertedId()]); - - var_dump($person); - -The output would then resemble: - -.. code-block:: none - - object(Person)#18 (3) { - ["id":"Person":private]=> - object(MongoDB\BSON\ObjectID)#15 (1) { - ["oid"]=> - string(24) "56fad2c36118fd2e9820cfc1" - } - ["name":"Person":private]=> - string(3) "Bob" - ["createdAt":"Person":private]=> - object(MongoDB\BSON\UTCDateTime)#17 (1) { - ["milliseconds"]=> - int(1459278531218) - } - } - -The same document in the MongoDB shell might display as: - -.. code-block:: js - - { - "_id" : ObjectId("56fad2c36118fd2e9820cfc1"), - "__pclass" : BinData(128,"UGVyc29u"), - "name" : "Bob", - "createdAt" : ISODate("2016-03-29T19:08:51.218Z") - } - -.. note:: - - :php:`MongoDB\\BSON\\Persistable <mongodb-bson-persistable>` may only be used - for root and embedded BSON documents. It may not be used for BSON arrays. - -Emulating the Legacy Driver ---------------------------- - -The legacy :php:`mongo extension <mongo>` returned both BSON documents and -arrays as PHP arrays. While PHP arrays are convenient to work with, this -behavior was problematic: - -- Different BSON types could deserialize to the same PHP value (e.g. - ``{"0": "foo"}`` and ``["foo"]``), which made it impossible to infer the - original BSON type. - -- Numerically-indexed PHP arrays would be serialized as BSON documents if there - was a gap in their key sequence. Such gaps were easily caused by unsetting a - key to remove an element and forgetting to numerically reindex the array. - -The |php-library|'s :phpclass:`BSONDocument <MongoDB\\Model\\BSONDocument>` and -:phpclass:`BSONArray <MongoDB\\Model\\BSONArray>` classes address these concerns -by preserving the BSON type information during serialization and -deserialization; however, some users may still prefer the legacy behavior. If -desired, you can use the ``typeMap`` option to have the library return -everything as a PHP array: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client( - 'mongodb://127.0.0.1/', - [], - [ - 'typeMap' => [ - 'array' => 'array', - 'document' => 'array', - 'root' => 'array', - ], - ] - ); - - $document = $client->demo->zips->findOne(['_id' => '94301']); - - var_dump($document); - -The above example would output something similar to: - -.. code-block:: php - - array(5) { - ["_id"]=> - string(5) "94301" - ["city"]=> - string(9) "PALO ALTO" - ["loc"]=> - array(2) { - [0]=> - float(-122.149685) - [1]=> - float(37.444324) - } - ["pop"]=> - int(15965) - ["state"]=> - string(2) "CA" - } diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBClient.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBClient.txt deleted file mode 100644 index d549070..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBClient.txt +++ /dev/null @@ -1,37 +0,0 @@ -===================== -MongoDB\\Client Class -===================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpclass:: MongoDB\\Client - - This class serves as an entry point for the |php-library|. It is the - preferred class for connecting to a MongoDB server or cluster of servers and - acts as a gateway for accessing individual databases and collections. - :phpclass:`MongoDB\\Client` is analogous to the driver's - :php:`MongoDB\\Driver\\Manager <mongodb-driver-manager>` class, which it - `composes <https://en.wikipedia.org/wiki/Object_composition>`_. - -Methods -------- - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBClient__construct - /reference/method/MongoDBClient__get - /reference/method/MongoDBClient-dropDatabase - /reference/method/MongoDBClient-getManager - /reference/method/MongoDBClient-listDatabases - /reference/method/MongoDBClient-selectCollection - /reference/method/MongoDBClient-selectDatabase diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBCollection.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBCollection.txt deleted file mode 100644 index 109fa1b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBCollection.txt +++ /dev/null @@ -1,89 +0,0 @@ -========================= -MongoDB\\Collection Class -========================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpclass:: MongoDB\\Collection - - Provides methods for common operations on collections and documents, - including CRUD operations and index management. - - You can construct collections directly using the driver's - :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class or - select a collection from the library's :phpclass:`MongoDB\\Client` or - :phpclass:`MongoDB\\Database` classes. A collection may also be cloned from - an existing :phpclass:`MongoDB\\Collection` object via the - :phpmethod:`withOptions() <MongoDB\\Collection::withOptions>` method. - - :phpclass:`MongoDB\\Collection` supports the :php:`readConcern - <mongodb-driver-readconcern>`, :php:`readPreference - <mongodb-driver-readpreference>`, :php:`typeMap - <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`, - and :php:`writeConcern <mongodb-driver-writeconcern>` options. If you omit an - option, the collection inherits the value from the :php:`Manager - <mongodb-driver-manager>` constructor argument or the :phpclass:`Client - <MongoDB\\Client>` or :phpclass:`Database <MongoDB\\Database>` object used to - select the collection. - - Operations within the :phpclass:`MongoDB\\Collection` class inherit the - collection's options. - -Type Map Limitations --------------------- - - The :manual:`aggregate </reference/command/aggregate>` (when not using a - cursor), :manual:`distinct </reference/command/distinct>`, and - :manual:`findAndModify </reference/command/findAndModify>` helpers do not - support a ``typeMap`` option due to a driver limitation. The - :phpmethod:`aggregate() <MongoDB\\Collection::aggregate>`, - :phpmethod:`distinct() <MongoDB\\Collection::distinct>`, - :phpmethod:`findOneAndReplace() <MongoDB\\Collection::findOneAndReplace>`, - :phpmethod:`findOneAndUpdate() <MongoDB\\Collection::findOneAndUpdate>`, and - :phpmethod:`findOneAndDelete() <MongoDB\\Collection::findOneAndDelete>` - methods return BSON documents as `stdClass` objects and BSON arrays as - arrays. - -Methods -------- - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBCollection__construct - /reference/method/MongoDBCollection-aggregate - /reference/method/MongoDBCollection-bulkWrite - /reference/method/MongoDBCollection-count - /reference/method/MongoDBCollection-createIndex - /reference/method/MongoDBCollection-createIndexes - /reference/method/MongoDBCollection-deleteMany - /reference/method/MongoDBCollection-deleteOne - /reference/method/MongoDBCollection-distinct - /reference/method/MongoDBCollection-drop - /reference/method/MongoDBCollection-dropIndex - /reference/method/MongoDBCollection-dropIndexes - /reference/method/MongoDBCollection-find - /reference/method/MongoDBCollection-findOne - /reference/method/MongoDBCollection-findOneAndDelete - /reference/method/MongoDBCollection-findOneAndReplace - /reference/method/MongoDBCollection-findOneAndUpdate - /reference/method/MongoDBCollection-getCollectionName - /reference/method/MongoDBCollection-getDatabaseName - /reference/method/MongoDBCollection-getManager - /reference/method/MongoDBCollection-getNamespace - /reference/method/MongoDBCollection-insertMany - /reference/method/MongoDBCollection-insertOne - /reference/method/MongoDBCollection-listIndexes - /reference/method/MongoDBCollection-replaceOne - /reference/method/MongoDBCollection-updateMany - /reference/method/MongoDBCollection-updateOne - /reference/method/MongoDBCollection-withOptions diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBDatabase.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBDatabase.txt deleted file mode 100644 index 4489f21..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBDatabase.txt +++ /dev/null @@ -1,58 +0,0 @@ -======================= -MongoDB\\Database Class -======================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpclass:: MongoDB\\Database - - Provides methods for common operations on a database, such as executing - database commands and managing collections. - - You can construct a database directly using the driver's - :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class or - select a database from the library's :phpclass:`MongoDB\\Client` class. A - database may also be cloned from an existing :phpclass:`MongoDB\\Database` - object via the :phpmethod:`withOptions() <MongoDB\\Database::withOptions>` - method. - - :phpclass:`MongoDB\\Database` supports the :php:`readConcern - <mongodb-driver-readconcern>`, :php:`readPreference - <mongodb-driver-readpreference>`, :php:`typeMap - <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`, - and :php:`writeConcern <mongodb-driver-writeconcern>` options. If you omit an - option, the database inherits the value from the :php:`Manager - <mongodb-driver-manager>` constructor argument or the :phpclass:`Client - <MongoDB\\Client>` object used to select the database. - - Operations within the :phpclass:`MongoDB\\Database` class inherit the - Database's options. - -Methods -------- - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBDatabase__construct - /reference/method/MongoDBDatabase__get - /reference/method/MongoDBDatabase-command - /reference/method/MongoDBDatabase-createCollection - /reference/method/MongoDBDatabase-drop - /reference/method/MongoDBDatabase-dropCollection - /reference/method/MongoDBDatabase-getDatabaseName - /reference/method/MongoDBDatabase-getManager - /reference/method/MongoDBDatabase-listCollections - /reference/method/MongoDBDatabase-selectCollection - /reference/method/MongoDBDatabase-selectGridFSBucket - /reference/method/MongoDBDatabase-withOptions - diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBGridFSBucket.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBGridFSBucket.txt deleted file mode 100644 index 1f79701..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/class/MongoDBGridFSBucket.txt +++ /dev/null @@ -1,52 +0,0 @@ -============================ -MongoDB\\GridFS\Bucket Class -============================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpclass:: MongoDB\\GridFS\\Bucket - - :manual:`GridFS </core/gridfs>` is a specification for storing and retrieving - files in MongoDB. GridFS uses two collections to store files. One collection - stores the file chunks (e.g. ``fs.chunks``), and the other stores file - metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class - provides an interface around these collections for working with the files as - PHP :php:`Streams <stream>`. - - You can construct a GridFS bucket using the driver's - :php:`Manager <class.mongodb-driver-manager>` class, or select a bucket from - the library's :phpclass:`MongoDB\\Database` class via the - :phpmethod:`selectGridFSBucket() <MongoDB\\Database::selectGridFSBucket>` - method. - -Methods -------- - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBGridFSBucket__construct - /reference/method/MongoDBGridFSBucket-delete - /reference/method/MongoDBGridFSBucket-downloadToStream - /reference/method/MongoDBGridFSBucket-downloadToStreamByName - /reference/method/MongoDBGridFSBucket-drop - /reference/method/MongoDBGridFSBucket-find - /reference/method/MongoDBGridFSBucket-findOne - /reference/method/MongoDBGridFSBucket-getBucketName - /reference/method/MongoDBGridFSBucket-getDatabaseName - /reference/method/MongoDBGridFSBucket-getFileDocumentForStream - /reference/method/MongoDBGridFSBucket-getFileIdForStream - /reference/method/MongoDBGridFSBucket-openDownloadStream - /reference/method/MongoDBGridFSBucket-openDownloadStreamByName - /reference/method/MongoDBGridFSBucket-openUploadStream - /reference/method/MongoDBGridFSBucket-rename - /reference/method/MongoDBGridFSBucket-uploadFromStream diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/enumeration-classes.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/enumeration-classes.txt deleted file mode 100644 index 045091a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/enumeration-classes.txt +++ /dev/null @@ -1,161 +0,0 @@ -=================== -Enumeration Classes -=================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -MongoDB\\Model\\CollectionInfo ------------------------------- - -Definition -~~~~~~~~~~ - -.. phpclass:: MongoDB\\Model\\CollectionInfo - - This class models information about a collection. Instances of this class are - returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`, - which is returned by :phpmethod:`MongoDB\\Database::listCollections()`. - -Methods -~~~~~~~ - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBModelCollectionInfo-getCappedMax - /reference/method/MongoDBModelCollectionInfo-getCappedSize - /reference/method/MongoDBModelCollectionInfo-getName - /reference/method/MongoDBModelCollectionInfo-getOptions - /reference/method/MongoDBModelCollectionInfo-isCapped - ----- - -MongoDB\\Model\\CollectionInfoIterator --------------------------------------- - -Definition -~~~~~~~~~~ - -.. phpclass:: MongoDB\\Model\\CollectionInfoIterator - - This interface extends PHP's :php:`Iterator <manual/en/class.iterator.php>` - interface. An instance of this interface is returned by - :phpmethod:`MongoDB\\Database::listCollections()`. - -Methods -~~~~~~~ - -This interface adds no new methods to :php:`Iterator -<manual/en/class.iterator.php>`, but specifies that :php:`current() -<manual/en/iterator.current.php>` will return an instance of -:phpclass:`MongoDB\\Model\\CollectionInfo`. - ----- - -MongoDB\\Model\\DatabaseInfo ----------------------------- - -Definition -~~~~~~~~~~ - -.. phpclass:: MongoDB\\Model\\DatabaseInfo - - This class models information about a database. Instances of this class are - returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`, - which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`. - -Methods -~~~~~~~ - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBModelDatabaseInfo-getName - /reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk - /reference/method/MongoDBModelDatabaseInfo-isEmpty - ----- - -MongoDB\\Model\\DatabaseInfoIterator ------------------------------------- - -Definition -~~~~~~~~~~ - -.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator - - This interface extends PHP's :php:`Iterator <manual/en/class.iterator.php>` - interface. An instance of this interface is returned by - :phpmethod:`MongoDB\\Client::listDatabases()`. - -Methods -~~~~~~~ - -This interface adds no new methods to :php:`Iterator -<manual/en/class.iterator.php>`, but specifies that :php:`current() -<manual/en/iterator.current.php>` will return an instance of -:phpclass:`MongoDB\\Model\\DatabaseInfo`. - ----- - -MongoDB\\Model\\IndexInfo -------------------------- - -.. phpclass:: MongoDB\\Model\\IndexInfo - - This class models information about an index. Instances of this class are - returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`, - which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`. - - This class implements PHP's :php:`ArrayAccess <arrayaccess>` interface. This - provides a mechanism for accessing index fields for which there exists no - helper method. :php`isset() <isset>` may be used to check for the existence - of a field before accessing it with ``[]``. - - .. note:: - - The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting - to modify it via the :php:`ArrayAccess <arrayaccess>` interface will - result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`. - -Methods -~~~~~~~ - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBModelIndexInfo-getKey - /reference/method/MongoDBModelIndexInfo-getName - /reference/method/MongoDBModelIndexInfo-getNamespace - /reference/method/MongoDBModelIndexInfo-getVersion - /reference/method/MongoDBModelIndexInfo-isSparse - /reference/method/MongoDBModelIndexInfo-isTtl - /reference/method/MongoDBModelIndexInfo-isUnique - ----- - -MongoDB\\Model\\IndexInfoIterator ---------------------------------- - -Definition -~~~~~~~~~~ - -.. phpclass:: MongoDB\\Model\\IndexInfoIterator - - This interface extends PHP's :php:`Iterator <manual/en/class.iterator.php>` - interface. An instance of this interface is returned by - :phpmethod:`MongoDB\\Collection::listIndexes()`. - -Methods -~~~~~~~ - -This interface adds no new methods to :php:`Iterator -<manual/en/class.iterator.php>`, but specifies that :php:`current() -<manual/en/iterator.current.php>` will return an instance of -:phpclass:`MongoDB\\Model\\IndexInfo`. diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/exception-classes.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/exception-classes.txt deleted file mode 100644 index 289e4ff..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/exception-classes.txt +++ /dev/null @@ -1,140 +0,0 @@ -================= -Exception Classes -================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -MongoDB\\Exception\\BadMethodCallException ------------------------------------------- - -.. phpclass:: MongoDB\\Exception\\BadMethodCallException - - This exception is thrown when an unsupported method is invoked on an object. - - For example, using an unacknowledged write concern with - :phpmethod:`MongoDB\\Collection::insertMany()` will return a - :phpclass:`MongoDB\\InsertManyResult` object. It is a logical error to call - :phpmethod:`MongoDB\\InsertManyResult::getInsertedCount()`, since the number - of inserted documents can only be determined from the response of an - acknowledged write operation. - - This class extends PHP's :php:`BadMethodCallException - <badmethodcallexception>` class and implements the library's - :phpclass:`Exception <MongoDB\\Exception\\Exception>` interface. - ----- - -MongoDB\\Exception\\InvalidArgumentException --------------------------------------------- - -.. phpclass:: MongoDB\\Exception\\InvalidArgumentException - - Thrown for errors related to the parsing of parameters or options within the - library. - - This class extends the driver's :php:`InvalidArgumentException - <mongodb-driver-exception-invalidargumentexception>` class and implements the - library's :phpclass:`Exception <MongoDB\\Exception\\Exception>` interface. - ----- - -MongoDB\\Exception\\UnexpectedValueException --------------------------------------------- - -.. phpclass:: MongoDB\\Exception\\UnexpectedValueException - - This exception is thrown when a command response from the server is - malformed or not what the library expected. This exception means that an - assertion in some operation, which abstracts a database command, has failed. - It may indicate a corrupted BSON response or bug in the server, driver, or - library. - - This class extends the driver's :php:`UnexpectedValueException - <mongodb-driver-exception-unexpectedvalueexception>` class and implements the - library's :phpclass:`Exception <MongoDB\\Exception\\Exception>` interface. - ----- - -MongoDB\\Exception\\UnsupportedException ----------------------------------------- - -.. phpclass:: MongoDB\\Exception\\UnsupportedException - - This exception is thrown if an option is used and not supported by the - selected server. It is used sparingly in cases where silently ignoring the - unsupported option might otherwise lead to unexpected behavior. - - For example, the ``collation`` option for - :phpmethod:`MongoDB\\Collection::deleteOne()` is only supported by - MongoDB 3.4+. Since collation determines how a document is matched, silently - ignoring the option for an older server version could result in an - unintended document being deleted. - - This class extends the library's :phpclass:`RuntimeException - <MongoDB\\Exception\\RuntimeException>` class. - - .. note:: - - Unlike :phpclass:`InvalidArgumentException - <MongoDB\\Exception\\InvalidArgumentException>`, which may be thrown when - an operation's parameters and options are parsed during construction, the - selected server is not known until an operation is executed. - ----- - -MongoDB\\GridFS\\Exception\\CorruptFileException ------------------------------------------------- - -.. phpclass:: MongoDB\\GridFS\\Exception\\CorruptFileException - - This exception is thrown if a GridFS file's metadata or chunk documents - contain unexpected or invalid data. - - When selecting a GridFS file, this may be thrown if a metadata field has an - incorrect type or its value is out of range (e.g. negative ``length``). When - reading a GridFS file, this may be thrown if a chunk's index is out of - sequence or its binary data's length out of range. - - This class extends the library's :phpclass:`RuntimeException - <MongoDB\\Exception\\RuntimeException>` class. - ----- - -MongoDB\\GridFS\\Exception\\FileNotFoundException -------------------------------------------------- - -.. phpclass:: MongoDB\\GridFS\\Exception\\FileNotFoundException - - This exception is thrown if no GridFS file was found for the selection - criteria (e.g. ``id``, ``filename``). - - This class extends the library's :phpclass:`RuntimeException - <MongoDB\\Exception\\RuntimeException>` class. - ----- - -MongoDB\\Exception\\Exception ------------------------------ - -.. phpclass:: MongoDB\\Exception\\Exception - - This interface extends the driver's :php:`Exception - <mongodb-driver-exception-exception>` interface and is implemented by all - exception classes within the library. - ----- - -MongoDB\\Exception\\RuntimeException ------------------------------------- - -.. phpclass:: MongoDB\\Exception\\RuntimeException - - This class extends the driver's :php:`RuntimeException - <mongodb-driver-exception-runtimeexception>` class, which in turn extends - PHP's :php:`RuntimeException <runtimeexception>` class. diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt deleted file mode 100644 index d0501d3..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt +++ /dev/null @@ -1,42 +0,0 @@ -=========================================== -MongoDB\\BulkWriteResult::getDeletedCount() -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\BulkWriteResult::getDeletedCount() - - Return the total number of documents that were deleted by all delete - operations in the bulk write. - - .. code-block:: php - - function getDeletedCount(): integer - - This method should only be called if the write was acknowledged. - -Return Values -------------- - -The total number of documents that were deleted by all delete operations in the -bulk write. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::getDeletedCount() - <manual/en/mongodb-driver-writeresult.getdeletedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt deleted file mode 100644 index 6eb1b5d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt +++ /dev/null @@ -1,42 +0,0 @@ -============================================ -MongoDB\\BulkWriteResult::getInsertedCount() -============================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\BulkWriteResult::getInsertedCount() - - Return the total number of documents that were inserted by all insert - operations in the bulk write. - - .. code-block:: php - - function getInsertedCount(): integer - - This method should only be called if the write was acknowledged. - -Return Values -------------- - -The total number of documents that were inserted by all insert operations in the -bulk write. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount() - <manual/en/mongodb-driver-writeresult.getinsertedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt deleted file mode 100644 index 679c940..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt +++ /dev/null @@ -1,38 +0,0 @@ -========================================== -MongoDB\\BulkWriteResult::getInsertedIds() -========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\BulkWriteResult::getInsertedIds() - - Return a map of IDs (i.e. ``_id`` field values) for documents that were - inserted by all insert operations in the bulk write. - - .. code-block:: php - - function getInsertedIds(): array - - Since IDs are created by the driver, this method may be called irrespective - of whether the write was acknowledged. - -Return Values -------------- - -A map of IDs (i.e. ``_id`` field values) for documents that were inserted by all -insert operations in the bulk write. - -The index of each ID in the map corresponds to each document's position in the -bulk operation. If a document had an ID prior to inserting (i.e. the driver did -not generate an ID), the index will contain its ``_id`` field value. Any -driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectID -<class.mongodb-bson-objectid>` instance. diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt deleted file mode 100644 index af1ad98..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt +++ /dev/null @@ -1,51 +0,0 @@ -=========================================== -MongoDB\\BulkWriteResult::getMatchedCount() -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\BulkWriteResult::getMatchedCount() - - Return the total number of documents that were matched by all update and - replace operations in the bulk write. - - .. code-block:: php - - function getMatchedCount(): integer - - This method should only be called if the write was acknowledged. - - .. note:: - - If an update/replace operation results in no change to the document - (e.g. setting the value of a field to its current value), the matched - count may be greater than the value returned by - :phpmethod:`getModifiedCount() - <MongoDB\\BulkWriteResult::getModifiedCount()>`. - -Return Values -------------- - -The total number of documents that were matched by all update and replace -operations in the bulk write. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :phpmethod:`MongoDB\\BulkWriteResult::getModifiedCount()` -- :php:`MongoDB\\Driver\\WriteResult::getMatchedCount() - <manual/en/mongodb-driver-writeresult.getmatchedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt deleted file mode 100644 index 674a03c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt +++ /dev/null @@ -1,54 +0,0 @@ -============================================ -MongoDB\\BulkWriteResult::getModifiedCount() -============================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\BulkWriteResult::getModifiedCount() - - Return the total number of documents that were modified by all update and - replace operations in the bulk write. - - .. code-block:: php - - function getModifiedCount(): integer|null - - This method should only be called if the write was acknowledged. - - .. note:: - - If an update/replace operation results in no change to the document - (e.g. setting the value of a field to its current value), the modified - count may be less than the value returned by :phpmethod:`getMatchedCount() - <MongoDB\\BulkWriteResult::getMatchedCount()>`. - -Return Values -------------- - -The total number of documents that were modified by all update and replace -operations in the bulk write. - -The modified count is not available on versions of MongoDB before 2.6, which -used the legacy wire protocol version (i.e. ``OP_UPDATE``). If this is the case, -the modified count will be ``null``. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :phpmethod:`MongoDB\\BulkWriteResult::getMatchedCount()` -- :php:`MongoDB\\Driver\\WriteResult::getModifiedCount() - <manual/en/mongodb-driver-writeresult.getmodifiedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt deleted file mode 100644 index 1f0dff2..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt +++ /dev/null @@ -1,42 +0,0 @@ -============================================ -MongoDB\\BulkWriteResult::getUpsertedCount() -============================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\BulkWriteResult::getUpsertedCount() - - Return the total number of documents that were upserted by all update and - replace operations in the bulk write. - - .. code-block:: php - - function getUpsertedCount(): integer - - This method should only be called if the write was acknowledged. - -Return Values -------------- - -The total number of documents that were upserted by all update and replace -operations in the bulk write. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::getUpsertedCount() - <manual/en/mongodb-driver-writeresult.getupsertedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt deleted file mode 100644 index fb2232a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt +++ /dev/null @@ -1,46 +0,0 @@ -========================================== -MongoDB\\BulkWriteResult::getUpsertedIds() -========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\BulkWriteResult::getUpsertedIds() - - Return a map of IDs (i.e. ``_id`` field values) for documents that were - upserted by all update and replace operations in the bulk write. - - .. code-block:: php - - function getUpsertedIds(): array - -Return Values -------------- - -A map of IDs (i.e. ``_id`` field values) for documents that were upserted by all -update and replace operations in the bulk write. - -The index of each ID in the map corresponds to each document's position in the -bulk operation. If a document had an ID prior to upserting (i.e. the server did -not generate an ID), the index will contain its ``_id`` field value. Any -server-generated ID will be a :php:`MongoDB\\BSON\\ObjectID -<class.mongodb-bson-objectid>` instance. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::getUpsertedIds() - <manual/en/mongodb-driver-writeresult.getupsertedids.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt deleted file mode 100644 index 1a857ca..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt +++ /dev/null @@ -1,34 +0,0 @@ -========================================== -MongoDB\\BulkWriteResult::isAcknowledged() -========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\BulkWriteResult::isAcknowledged() - - Return whether the write was acknowledged. - - .. code-block:: php - - function isAcknowledged(): boolean - -Return Values -------------- - -A boolean indicating whether the write was acknowledged. - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged() - <manual/en/mongodb-driver-writeresult.isacknowledged.php>` -- :manual:`Write Concern </reference/write-concern>` in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-dropDatabase.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-dropDatabase.txt deleted file mode 100644 index e97dddd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-dropDatabase.txt +++ /dev/null @@ -1,78 +0,0 @@ -=============================== -MongoDB\\Client::dropDatabase() -=============================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Client::dropDatabase() - - Drop a database on the server. - - .. code-block:: php - - function dropDatabase($databaseName, array $options []): array|object - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-option.rst - -Return Values -------------- - -An array or object with the result document of the :manual:`dropDatabase -</reference/command/dropDatabase>` command. The return type will depend on the -``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Example -------- - -The following example drops the ``demo`` database: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client; - - $result = $client->dropDatabase('demo'); - - var_dump($result); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#8 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["dropped"]=> - string(4) "demo" - ["ok"]=> - float(1) - } - } - -See Also --------- - -- :phpmethod:`MongoDB\\Database::drop()` -- :manual:`dropDatabase </reference/command/dropDatabase>` command reference in - the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-getManager.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-getManager.txt deleted file mode 100644 index c320595..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-getManager.txt +++ /dev/null @@ -1,35 +0,0 @@ -============================= -MongoDB\\Client::getManager() -============================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Client::getManager() - - Accessor for the - :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` used by this - :phpclass:`Client <MongoDB\\Client>`. - - .. code-block:: php - - function getManager(): MongoDB\Manager - -Return Values -------------- - -A :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` object. - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::getManager()` -- :phpmethod:`MongoDB\\Database::getManager()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-listDatabases.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-listDatabases.txt deleted file mode 100644 index 876a3f0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-listDatabases.txt +++ /dev/null @@ -1,84 +0,0 @@ -================================ -MongoDB\\Client::listDatabases() -================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Client::listDatabases() - - Returns information for all databases on the server. - - .. code-block:: php - - function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst - -Return Values -------------- - -A traversable :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`, which contains -a :phpclass:`MongoDB\\Model\\DatabaseInfo` object for each database on the -server. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unexpectedvalueexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Example -------- - -The following example lists all databases on the server: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client; - - foreach ($client->listDatabases() as $databaseInfo) { - var_dump($databaseInfo); - } - -The output would then resemble:: - - object(MongoDB\Model\DatabaseInfo)#4 (3) { - ["name"]=> - string(5) "local" - ["sizeOnDisk"]=> - float(65536) - ["empty"]=> - bool(false) - } - object(MongoDB\Model\DatabaseInfo)#7 (3) { - ["name"]=> - string(4) "test" - ["sizeOnDisk"]=> - float(32768) - ["empty"]=> - bool(false) - } - -See Also --------- - -- :manual:`listDatabases </reference/command/listDatabases>` command reference - in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-selectCollection.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-selectCollection.txt deleted file mode 100644 index 4804404..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-selectCollection.txt +++ /dev/null @@ -1,83 +0,0 @@ -=================================== -MongoDB\\Client::selectCollection() -=================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Client::selectCollection() - - Selects a collection on the server. - - .. code-block:: php - - function selectCollection($databaseName, $collectionName, array $options = []): MongoDB\Collection - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\Collection` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst - -Behavior --------- - -The selected collection inherits options such as read preference and type -mapping from the :phpclass:`Client <MongoDB\\Client>` object. Options may be -overridden via the ``$options`` parameter. - -Example -------- - -The following example selects the ``users`` collection in the ``demo`` database: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client; - - $collection = $client->selectCollection('demo', 'users'); - -The following example selects the ``users`` collection in the ``demo`` database -with a custom read preference: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client; - - $collection = $client->selectCollection( - 'demo', - 'users', - [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), - ] - ); - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::__construct()` -- :phpmethod:`MongoDB\\Database::selectCollection()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-selectDatabase.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-selectDatabase.txt deleted file mode 100644 index 77a4a6f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient-selectDatabase.txt +++ /dev/null @@ -1,82 +0,0 @@ -================================= -MongoDB\\Client::selectDatabase() -================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Client::selectDatabase() - - Selects a database on the server. - - .. code-block:: php - - function selectDatabase($databaseName, array $options = []): MongoDB\Database - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\Database` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst - -Behavior --------- - -The selected database inherits options such as read preference and type mapping -from the :phpclass:`Client <MongoDB\\Client>` object. Options may be overridden -via the ``$options`` parameter. - -Example -------- - -The following example selects the ``demo`` database: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client; - - $db = $client->selectDatabase('demo'); - -The following examples selects the ``demo`` database with a custom read -preference: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client; - - $db = $client->selectDatabase( - 'demo', - [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), - ] - ); - -See Also --------- - -- :phpmethod:`MongoDB\\Client::__get()` -- :phpmethod:`MongoDB\\Database::__construct()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient__construct.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient__construct.txt deleted file mode 100644 index ad864d1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient__construct.txt +++ /dev/null @@ -1,143 +0,0 @@ -============================== -MongoDB\\Client::__construct() -============================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Client::__construct() - - Constructs a new :phpclass:`Client <MongoDB\\Client>` instance. - - .. code-block:: php - - function __construct($uri = 'mongodb://127.0.0.1/', array $uriOptions = [], array $driverOptions = []) - - This constructor has the following parameters: - - .. include:: /includes/apiargs/MongoDBClient-method-construct-param.rst - - The ``$driverOptions`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBClient-method-construct-driverOptions.rst - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -A :php:`MongoDB\\Driver\\Manager <mongodb-driver-manager>` is constructed -internally. Per the `Server Discovery and Monitoring -<https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#single-threaded-client-construction>`_ -specification, :php:`MongoDB\\Driver\\Manager::__construct() -<mongodb-driver-manager.construct>` performs no I/O. Connections will be -initialized on demand, when the first operation is executed. - -Examples --------- - -Connecting to a Replica Set -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you do not specify a ``$uri`` value, the driver connects to a standalone -:program:`mongod` on ``127.0.0.1`` via port ``27017``. The following example -demonstrates how to connect to a replica set with a custom read preference: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client( - 'mongodb://rs1.example.com,rs2.example.com/?replicaSet=myReplicaSet', - [ - 'readPreference' => 'secondaryPreferred', - ] - ); - -Connecting with SSL and Authentication -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following example demonstrates how to connect to a MongoDB replica set with -SSL and authentication, as is used for `MongoDB Atlas -<https://cloud.mongodb.com/?jmp=docs>`_: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client( - 'mongodb://myUsername:myPassword@rs1.example.com,rs2.example.com/?ssl=true&replicaSet=myReplicaSet&authSource=admin' - ); - -Alternatively, the authentication credentials and URI parameters may be -specified in the constructor's ``$uriOptions`` parameter: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client( - 'mongodb://rs1.example.com,rs2.example.com/' - [ - 'username' => 'myUsername', - 'password' => 'myPassword', - 'ssl' => true, - 'replicaSet' => 'myReplicaSet', - 'authSource' => 'admin', - ], - ); - -The driver supports additional :php:`SSL options -<mongodb-driver-manager.construct#mongodb-driver-manager.construct-driveroptions>`, -which may be specified in the constructor's ``$driverOptions`` parameter. Those -options are covered in the :php:`MongoDB\\Driver\\Manager::__construct() -<mongodb-driver-manager.construct>` documentation. - -Specifying a Custom Type Map -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -By default, the |php-library| deserializes BSON documents and arrays -as :phpclass:`MongoDB\\Model\\BSONDocument` and -:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The following -example demonstrates how to have the library unserialize everything as a PHP -array, as was done in the legacy :php:`mongo extension <mongo>`. - -.. code-block:: php - - <?php - - $client = new MongoDB\Client( - null, - [], - [ - 'typeMap' => [ - 'root' => 'array', - 'document' => 'array', - 'array' => 'array', - ], - ] - ); - -See Also --------- - -- :php:`MongoDB\\Driver\\Manager::__construct() - <mongodb-driver-manager.construct>` -- :manual:`Connection String URI Format </reference/connection-string>` in the - MongoDB manual -- `Server Discovery and Monitoring - <https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#single-threaded-client-construction>`_ - specification diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient__get.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient__get.txt deleted file mode 100644 index 7e0ee29..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBClient__get.txt +++ /dev/null @@ -1,69 +0,0 @@ -======================== -MongoDB\\Client::__get() -======================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Client::__get() - - Selects a database on the server. This :php:`magic method <oop5.magic>` is - an alias for the :phpmethod:`selectDatabase() - <MongoDB\\Client::selectDatabase>` method. - - .. code-block:: php - - function __get($databaseName): MongoDB\Database - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBClient-method-get-param.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\Database` object. - -Behavior --------- - -The selected database inherits options such as read preference and type mapping -from the :phpclass:`Client <MongoDB\\Client>` object. If you wish to override -any options, use the :phpmethod:`MongoDB\\Client::selectDatabase` method. - -.. note:: - - To select databases whose names contain special characters, such as - ``-``, use complex syntax, as in ``$client->{'that-database'}``. - - Alternatively, :phpmethod:`MongoDB\\Client::selectDatabase()` supports - selecting databases whose names contain special characters. - -Examples --------- - -The following example selects the ``demo`` and ``another-app`` databases: - -.. code-block:: php - - <?php - - $client = new MongoDB\Client; - - $demo = $client->demo; - $anotherApp = $client->{'another-app'}; - -See Also --------- - -- :phpmethod:`MongoDB\\Client::selectDatabase()` -- :phpmethod:`MongoDB\\Database::__construct()` -- :php:`Property Overloading <oop5.overloading>` in the PHP Manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-aggregate.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-aggregate.txt deleted file mode 100644 index 6d09218..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-aggregate.txt +++ /dev/null @@ -1,69 +0,0 @@ -================================ -MongoDB\\Collection::aggregate() -================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::aggregate() - - Executes an :manual:`aggregation framework pipeline - </core/aggregation-pipeline>` operation on the collection. - - .. code-block:: php - - function aggregate(array $pipeline, array $options = []): Traversable - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-option.rst - -Return Values -------------- - -A :php:`MongoDB\\Driver\\Cursor <class.mongodb-driver-cursor>` or -:php:`ArrayIterator <arrayiterator>` object. In both cases, the return value -will be :php:`Traversable <traversable>`. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unexpectedvalueexception.rst -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -.. _php-agg-method-behavior: - -Behavior --------- - -:phpmethod:`MongoDB\\Collection::aggregate()`'s return value depends on the -MongoDB server version and whether the ``useCursor`` option is specified. If -``useCursor`` is ``true``, a :php:`MongoDB\\Driver\\Cursor -<class.mongodb-driver-cursor>` object is returned. If ``useCursor`` is -``false``, an :php:`ArrayIterator <arrayiterator>` is returned that wraps the -``result`` array from the command response document. In both cases, the return -value will be :php:`Traversable <traversable>`. - -.. todo: add examples - -See Also --------- - -- :manual:`aggregate </reference/command/aggregate>` command reference in the - MongoDB manual -- :manual:`Aggregation Pipeline </core/aggregation-pipeline>` documentation in - the MongoDB Manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-bulkWrite.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-bulkWrite.txt deleted file mode 100644 index e58688c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-bulkWrite.txt +++ /dev/null @@ -1,64 +0,0 @@ -================================ -MongoDB\\Collection::bulkWrite() -================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::bulkWrite() - - Executes multiple write operations. - - .. code-block:: php - - function bulkWrite(array $operations, array $options = []): MongoDB\BulkWriteResult - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\BulkWriteResult` object, which encapsulates a -:php:`MongoDB\\Driver\\WriteResult <class.mongodb-driver-writeresult>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-bulkwriteexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/bulkwriteexception-result.rst -.. include:: /includes/extracts/bulkwriteexception-ordered.rst - -.. todo: add output and examples - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::deleteMany()` -- :phpmethod:`MongoDB\\Collection::deleteOne()` -- :phpmethod:`MongoDB\\Collection::insertMany()` -- :phpmethod:`MongoDB\\Collection::insertOne()` -- :phpmethod:`MongoDB\\Collection::replaceOne()` -- :phpmethod:`MongoDB\\Collection::updateMany()` -- :phpmethod:`MongoDB\\Collection::updateOne()` -- :doc:`/tutorial/crud` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-count.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-count.txt deleted file mode 100644 index 396ba25..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-count.txt +++ /dev/null @@ -1,56 +0,0 @@ -============================ -MongoDB\\Collection::count() -============================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::count() - - Count the number of documents that match the filter criteria. - - .. code-block:: php - - function count($filter = [], array $options = []): integer - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-count-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-count-option.rst - -Return Values -------------- - -The number of documents matching the filter criteria. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unexpectedvalueexception.rst -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst - -.. todo: add output and examples - -See Also --------- - -- :manual:`count </reference/command/count>` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-createIndex.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-createIndex.txt deleted file mode 100644 index 162f44b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-createIndex.txt +++ /dev/null @@ -1,109 +0,0 @@ -================================ -MongoDBCollection::createIndex() -================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::createIndex() - - Create an index for the collection. - - .. code-block:: php - - function createIndex($key, array $options = []): string - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst - - The ``$options`` parameter accepts all index options that your MongoDB - version supports. MongoDB includes the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst - - For a full list of the supported index creation options, refer to the - :manual:`createIndexes </reference/command/createIndexes>` command reference - in the MongoDB manual. - -Return Values -------------- - -The name of the created index as a string. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Examples --------- - -Create a Compound Index -~~~~~~~~~~~~~~~~~~~~~~~ - -The following example creates a :manual:`compound index </core/index-compound>` -on the ``borough`` and ``cuisine`` fields in the ``restaurants`` collection in -the ``example`` database. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->selectCollection('example', 'restaurants'); - - $indexName = $collection->createIndex(['borough' => 1, 'cuisine' => 1]); - - var_dump($indexName); - -The output would then resemble:: - - string(19) "borough_1_cuisine_1" - -Create a Partial Index -~~~~~~~~~~~~~~~~~~~~~~ - -The following example adds a :manual:`partial index </core/index-parital>` on -the ``borough`` field in the ``restaurants`` collection in the ``example`` -database. The partial index indexes only documents where the ``borough`` field -exists. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->selectCollection('example, 'restaurants'); - - $indexName = $collection->createIndex( - ['borough' => 1], - [ - 'partialFilterExpression' => [ - 'borough' => ['$exists' => true], - ], - ] - ); - - var_dump($indexName); - -The output would then resemble:: - - string(9) "borough_1" - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::createIndexes()` -- :doc:`/tutorial/indexes` -- :manual:`createIndexes </reference/command/createIndexes>` command reference - in the MongoDB manual -- :manual:`Index </indexes>` documentation in the MongoDB Manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-createIndexes.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-createIndexes.txt deleted file mode 100644 index 8ec9ffb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-createIndexes.txt +++ /dev/null @@ -1,100 +0,0 @@ -================================== -MongoDBCollection::createIndexes() -================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::createIndexes($indexes) - - Create one or more indexes for the collection. - - .. code-block:: php - - function createIndexes(array $indexes, array $options = []): string[] - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-option.rst - -Return Values -------------- - -The names of the created indexes as an array of strings. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -``$indexes`` parameter ----------------------- - -The ``$indexes`` parameter is an array of index specification documents. Each -element in ``$indexes`` must itself be an array or object with a ``key`` field, -which corresponds to the ``$key`` parameter of :phpmethod:`createIndex() -<MongoDB\\Collection::createIndex()>`. The array or object may include other -fields that correspond to index options accepted by :phpmethod:`createIndex() -<MongoDB\\Collection::createIndex()>` (excluding ``writeConcern``). - -For example, the following ``$indexes`` parameter creates two indexes. The first -is an ascending unique index on the ``username`` field and the second is a -2dsphere index on the ``loc`` field with a custom name:: - - [ - [ 'key' => [ 'username' => 1 ], 'unique' => true ], - [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo_index' ], - ] - -Example -------- - -The following example creates two indexes on the ``restaurants`` collection in -the ``example`` database. One index is a compound index on the ``borough`` and -``cuisine`` fields and the other is 2dsphere index on the ``loc`` field with a -custom name. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->selectCollection('example', 'restaurants'); - - $indexNames = $collection->createIndexes([ - [ 'key' => [ 'borough' => 1, 'cuisine' => 1] ], - [ 'key' => [ 'loc' => '2dsphere'], 'name' => 'geo_index' ], - ]); - - var_dump($indexNames); - -The output would then resemble:: - - array(2) { - [0]=> - string(19) "borough_1_cuisine_1" - [1]=> - string(9) "geo_index" - } - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::createIndex()` -- :doc:`/tutorial/indexes` -- :manual:`createIndexes </reference/command/createIndexes>` command reference - in the MongoDB manual -- :manual:`Index </indexes>` documentation in the MongoDB Manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-deleteMany.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-deleteMany.txt deleted file mode 100644 index b3f965e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-deleteMany.txt +++ /dev/null @@ -1,82 +0,0 @@ -================================= -MongoDB\\Collection::deleteMany() -================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::deleteMany() - - Deletes all documents that match the filter criteria. - - .. code-block:: php - - function deleteMany($filter, array $options = []): MongoDB\DeleteResult - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a -:php:`MongoDB\\Driver\\WriteResult <class.mongodb-driver-writeresult>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-bulkwriteexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst -.. include:: /includes/extracts/bulkwriteexception-result.rst - -Example -------- - -The following example deletes all of the documents in the ``users`` collection -that have ``"ny"`` as the value for the ``state`` field: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->users; - $collection->drop(); - - $collection->insertOne(['name' => 'Bob', 'state' => 'ny']); - $collection->insertOne(['name' => 'Alice', 'state' => 'ny']); - $deleteResult = $collection->deleteMany(['state' => 'ny']); - - printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); - -The output would then resemble:: - - Deleted 2 document(s) - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::deleteOne()` -- :phpmethod:`MongoDB\\Collection::bulkWrite()` -- :doc:`/tutorial/crud` -- :manual:`delete </reference/command/delete` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-deleteOne.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-deleteOne.txt deleted file mode 100644 index bb824dc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-deleteOne.txt +++ /dev/null @@ -1,84 +0,0 @@ -================================ -MongoDB\\Collection::deleteOne() -================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::deleteOne() - - Deletes at most one document that matches the filter criteria. If multiple - documents match the filter criteria, only the :term:`first <natural order>` - matching document will be deleted. - - .. code-block:: php - - function deleteOne($filter, array $options = []): MongoDB\DeleteResult - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a -:php:`MongoDB\\Driver\\WriteResult <class.mongodb-driver-writeresult>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-bulkwriteexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst -.. include:: /includes/extracts/bulkwriteexception-result.rst - -Example -------- - -The following example deletes one document in the ``users`` collection that has -has ``"ny"`` as the value for the ``state`` field: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->users; - $collection->drop(); - - $collection->insertOne(['name' => 'Bob', 'state' => 'ny']); - $collection->insertOne(['name' => 'Alice', 'state' => 'ny']); - $deleteResult = $collection->deleteOne(['state' => 'ny']); - - printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); - -The output would then resemble:: - - Deleted 1 document(s) - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::deleteMany()` -- :phpmethod:`MongoDB\\Collection::bulkWrite()` -- :doc:`/tutorial/crud` -- :manual:`delete </reference/command/delete` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-distinct.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-distinct.txt deleted file mode 100644 index b35343e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-distinct.txt +++ /dev/null @@ -1,262 +0,0 @@ -=============================== -MongoDB\\Collection::distinct() -=============================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::distinct() - - Finds the distinct values for a specified field across the collection. - - .. code-block:: php - - function distinct($fieldName, $filter = [], array $options = []): mixed[] - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-distinct-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-distinct-option.rst - -Return Values -------------- - -An array of the distinct values. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unexpectedvalueexception.rst -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst - -Examples --------- - -Return Distinct Values for a Field -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following example identifies the distinct values for the ``borough`` field -in the ``restaurants`` collection in the ``example`` database. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - $distinct = $collection->distinct('borough'); - - var_dump($distinct); - -The output would then resemble:: - - array(6) { - [0]=> - string(5) "Bronx" - [1]=> - string(8) "Brooklyn" - [2]=> - string(9) "Manhattan" - [3]=> - string(7) "Missing" - [4]=> - string(6) "Queens" - [5]=> - string(13) "Staten Island" - } - -Return Distinct Values Using a Filter -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following example identifies the distinct values for the ``cuisine`` field -in the ``restaurants`` collection in the ``example`` database for documents -where the ``borough`` is ``Queens``: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - $distinct = $collection->distinct('cuisine', ['borough' => 'Queens']); - - var_dump($distinct); - -The output would then resemble:: - - array(75) { - [0]=> - string(6) "Afghan" - [1]=> - string(7) "African" - [2]=> - string(9) "American " - [3]=> - string(8) "Armenian" - [4]=> - string(5) "Asian" - [5]=> - string(10) "Australian" - [6]=> - string(15) "Bagels/Pretzels" - [7]=> - string(6) "Bakery" - [8]=> - string(11) "Bangladeshi" - [9]=> - string(8) "Barbecue" - [10]=> - string(55) "Bottled beverages, including water, sodas, juices, etc." - [11]=> - string(9) "Brazilian" - [12]=> - string(4) "Cafe" - [13]=> - string(16) "Café/Coffee/Tea" - [14]=> - string(5) "Cajun" - [15]=> - string(9) "Caribbean" - [16]=> - string(7) "Chicken" - [17]=> - string(7) "Chinese" - [18]=> - string(13) "Chinese/Cuban" - [19]=> - string(16) "Chinese/Japanese" - [20]=> - string(11) "Continental" - [21]=> - string(6) "Creole" - [22]=> - string(5) "Czech" - [23]=> - string(12) "Delicatessen" - [24]=> - string(6) "Donuts" - [25]=> - string(16) "Eastern European" - [26]=> - string(8) "Egyptian" - [27]=> - string(7) "English" - [28]=> - string(8) "Filipino" - [29]=> - string(6) "French" - [30]=> - string(17) "Fruits/Vegetables" - [31]=> - string(6) "German" - [32]=> - string(5) "Greek" - [33]=> - string(10) "Hamburgers" - [34]=> - string(16) "Hotdogs/Pretzels" - [35]=> - string(31) "Ice Cream, Gelato, Yogurt, Ices" - [36]=> - string(6) "Indian" - [37]=> - string(10) "Indonesian" - [38]=> - string(5) "Irish" - [39]=> - string(7) "Italian" - [40]=> - string(8) "Japanese" - [41]=> - string(13) "Jewish/Kosher" - [42]=> - string(30) "Juice, Smoothies, Fruit Salads" - [43]=> - string(6) "Korean" - [44]=> - string(64) "Latin (Cuban, Dominican, Puerto Rican, South & Central American)" - [45]=> - string(13) "Mediterranean" - [46]=> - string(7) "Mexican" - [47]=> - string(14) "Middle Eastern" - [48]=> - string(8) "Moroccan" - [49]=> - string(25) "Not Listed/Not Applicable" - [50]=> - string(18) "Nuts/Confectionary" - [51]=> - string(5) "Other" - [52]=> - string(9) "Pakistani" - [53]=> - string(16) "Pancakes/Waffles" - [54]=> - string(8) "Peruvian" - [55]=> - string(5) "Pizza" - [56]=> - string(13) "Pizza/Italian" - [57]=> - string(6) "Polish" - [58]=> - string(10) "Portuguese" - [59]=> - string(7) "Russian" - [60]=> - string(6) "Salads" - [61]=> - string(10) "Sandwiches" - [62]=> - string(30) "Sandwiches/Salads/Mixed Buffet" - [63]=> - string(7) "Seafood" - [64]=> - string(9) "Soul Food" - [65]=> - string(18) "Soups & Sandwiches" - [66]=> - string(12) "Southwestern" - [67]=> - string(7) "Spanish" - [68]=> - string(5) "Steak" - [69]=> - string(5) "Tapas" - [70]=> - string(7) "Tex-Mex" - [71]=> - string(4) "Thai" - [72]=> - string(7) "Turkish" - [73]=> - string(10) "Vegetarian" - [74]=> - string(29) "Vietnamese/Cambodian/Malaysia" - } - -See Also --------- - -- :manual:`distinct </reference/command/distinct>` command reference in the - MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-drop.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-drop.txt deleted file mode 100644 index 4fdd169..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-drop.txt +++ /dev/null @@ -1,81 +0,0 @@ -=========================== -MongoDB\\Collection::drop() -=========================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::drop() - - Drop the collection. - - .. code-block:: php - - function drop(array $options = []): array|object - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-drop-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-drop-option.rst - -Return Values -------------- - -An array or object with the result document of the :manual:`drop -</reference/command/drop>` command. The return type will depend on the -``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Example -------- - -The following operation drops the ``restaurants`` collection in the ``example`` -database: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - $result = $collection->drop(); - - var_dump($result); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#9 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["ns"]=> - string(19) "example.restaurants" - ["nIndexesWas"]=> - int(3) - ["ok"]=> - float(1) - } - } - -See Also --------- - -- :phpmethod:`MongoDB\\Database::dropCollection()` -- :manual:`drop </reference/command/drop>` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-dropIndex.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-dropIndex.txt deleted file mode 100644 index 489886b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-dropIndex.txt +++ /dev/null @@ -1,81 +0,0 @@ -================================ -MongoDB\\Collection::dropIndex() -================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::dropIndex() - - Drop an index from the collection. - - .. code-block:: php - - function dropIndex($indexName, array $options = []): array|object - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst - -Return Values -------------- - -An array or object with the result document of the :manual:`dropIndexes -</reference/command/dropIndexes>` command. The return type will depend on the -``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Example -------- - -The following drops an indexes with name ``borough_1`` from the ``restaurants`` -collection in the ``example`` database: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - $result = $collection->dropIndex('borough_1'); - - var_dump($result); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#9 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["nIndexesWas"]=> - int(2) - ["ok"]=> - float(1) - } - } - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::dropIndexes()` -- :doc:`/tutorial/indexes` -- :manual:`dropIndexes </reference/command/dropIndexes>` command reference in - the MongoDB manual -- :manual:`Index documentation </indexes>` in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-dropIndexes.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-dropIndexes.txt deleted file mode 100644 index d1139a0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-dropIndexes.txt +++ /dev/null @@ -1,84 +0,0 @@ -================================== -MongoDB\\Collection::dropIndexes() -================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::dropIndexes() - - Drop all indexes in the collection, except for the required index on the - ``_id`` field. - - .. code-block:: php - - function dropIndexes(array $options = []): array|object - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst - -Return Values -------------- - -An array or object with the result document of the :manual:`dropIndexes -</reference/command/dropIndexes>` command. The return type will depend on the -``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Example -------- - -The following drops all indexes from the ``restaurants`` collection in the -``example`` database: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - $result = $collection->dropIndexes(); - - var_dump($result); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#9 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["nIndexesWas"]=> - int(3) - ["msg"]=> - string(38) "non-_id indexes dropped for collection" - ["ok"]=> - float(1) - } - } - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::dropIndex()` -- :doc:`/tutorial/indexes` -- :manual:`dropIndexes </reference/command/dropIndexes>` command reference in - the MongoDB manual -- :manual:`Index documentation </indexes>` in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-find.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-find.txt deleted file mode 100644 index 6b1bc2c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-find.txt +++ /dev/null @@ -1,168 +0,0 @@ -=========================== -MongoDB\\Collection::find() -=========================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::find() - - Finds documents matching the query. - - .. code-block:: php - - function find($filter = [], array $options = []): MongoDB\Driver\Cursor - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-find-option.rst - -Return Values -------------- - -A :php:`MongoDB\\Driver\\Cursor <class.mongodb-driver-cursor>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst - -Examples --------- - -The following example finds restaurants based on the ``cuisine`` and ``borough`` -fields and uses a :manual:`projection -</tutorial/project-fields-from-query-results>` to limit the fields that are -returned. It also limits the results to 5 documents. - -.. code-block:: php - - $collection = (new MongoDB\Client)->example->restaurants; - - $cursor = $collection->find( - [ - 'cuisine' => 'Italian', - 'borough' => 'Manhattan', - ], - [ - 'limit' => 5, - 'projection' => [ - 'name' => 1, - 'borough' => 1, - 'cuisine' => 1, - ], - ] - ); - - foreach ($cursor as $restaurant) { - var_dump($restaurant); - }; - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#10 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#8 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3f983" - } - ["borough"]=> - string(9) "Manhattan" - ["cuisine"]=> - string(7) "Italian" - ["name"]=> - string(23) "Isle Of Capri Resturant" - } - } - object(MongoDB\Model\BSONDocument)#13 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#12 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3f98d" - } - ["borough"]=> - string(9) "Manhattan" - ["cuisine"]=> - string(7) "Italian" - ["name"]=> - string(18) "Marchis Restaurant" - } - } - object(MongoDB\Model\BSONDocument)#8 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#10 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3f99b" - } - ["borough"]=> - string(9) "Manhattan" - ["cuisine"]=> - string(7) "Italian" - ["name"]=> - string(19) "Forlinis Restaurant" - } - } - object(MongoDB\Model\BSONDocument)#12 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#13 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3f9a8" - } - ["borough"]=> - string(9) "Manhattan" - ["cuisine"]=> - string(7) "Italian" - ["name"]=> - string(22) "Angelo Of Mulberry St." - } - } - object(MongoDB\Model\BSONDocument)#10 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#8 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3f9b4" - } - ["borough"]=> - string(9) "Manhattan" - ["cuisine"]=> - string(7) "Italian" - ["name"]=> - string(16) "V & T Restaurant" - } - } - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::findOne()` -- :manual:`find </reference/command/find>` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOne.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOne.txt deleted file mode 100644 index 07da2d0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOne.txt +++ /dev/null @@ -1,103 +0,0 @@ -============================== -MongoDB\\Collection::findOne() -============================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::findOne() - - Finds a single document matching the query. - - .. code-block:: php - - function findOne($filter = [], array $options = []): array|object|null - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-findOne-option.rst - -Return Values -------------- - -An array or object for the :term:`first document <natural order>` that matched -the query, or ``null`` if no document matched the query. The return type will -depend on the ``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst - -Examples --------- - -The following example finds a restaurant based on the ``cuisine`` and -``borough`` fields and uses a :manual:`projection -</tutorial/project-fields-from-query-results>` to limit the fields that are -returned. - -.. code-block:: php - - $collection = (new MongoDB\Client)->example->restaurants; - - $restaurant = $collection->findOne( - [ - 'cuisine' => 'Italian', - 'borough' => 'Manhattan', - ], - [ - 'projection' => [ - 'name' => 1, - 'borough' => 1, - 'cuisine' => 1, - ], - ] - ); - - var_dump($restaurant); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#10 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#8 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3f983" - } - ["borough"]=> - string(9) "Manhattan" - ["cuisine"]=> - string(7) "Italian" - ["name"]=> - string(23) "Isle Of Capri Resturant" - } - } - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::find()` -- :manual:`find </reference/command/find>` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndDelete.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndDelete.txt deleted file mode 100644 index dddde0e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndDelete.txt +++ /dev/null @@ -1,98 +0,0 @@ -======================================= -MongoDB\\Collection::findOneAndDelete() -======================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::findOneAndDelete() - - Finds a single document matching the query and deletes it. - - .. code-block:: php - - function findOneAndDelete($filter = [], array $options = []): object|null - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-option.rst - -Return Values -------------- - -An array or object for the document that was deleted, or ``null`` if no document -matched the query. The return type will depend on the ``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unexpectedvalueexception.rst -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst - -Examples --------- - -The following example finds and deletes the document with ``restaurant_id`` of -``"40375376"`` from the ``restaurants`` collection in the ``example`` database: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - $deletedRestaurant = $collection->findOneAndDelete( - [ 'restaurant_id' => '40375376' ], - [ - 'projection' => [ - 'name' => 1, - 'borough' => 1, - 'restaurant_id' => 1, - ], - ] - ); - - var_dump($deletedRestaurant); - -The output would then resemble:: - - object(stdClass)#14 (4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#11 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3fad9" - } - ["borough"]=> - string(9) "Manhattan" - ["name"]=> - string(15) "Agra Restaurant" - ["restaurant_id"]=> - string(8) "40375376" - } - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::findOneAndReplace()` -- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()` -- :manual:`findAndModify </reference/command/findAndModify>` command reference - in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndReplace.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndReplace.txt deleted file mode 100644 index b48417c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndReplace.txt +++ /dev/null @@ -1,145 +0,0 @@ -======================================== -MongoDB\\Collection::findOneAndReplace() -======================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::findOneAndReplace() - - Finds a single document matching the query and replaces it. - - .. code-block:: php - - function findOneAndReplace($filter, $replacement, array $options = []): object|null - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-option.rst - -Return Values -------------- - -An array object for either the original or the replaced document, depending on -the specified value of the ``returnDocument`` option. By default, the original -document is returned. If no document matched the query, ``null`` is returned. -The return type will depend on the ``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unexpectedvalueexception.rst -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst - -Examples --------- - -Consider the following document in the ``restaurants`` collection in the -``example`` database: - -.. code-block:: javascript - - { - "_id" : ObjectId("576023c7b02fa9281da4139e"), - "address" : { - "building" : "977", - "coord" : [ - -74.06940569999999, - 40.6188443 - ], - "street" : "Bay Street", - "zipcode" : "10305" - }, - "borough" : "Staten Island", - "cuisine" : "French", - "grades" : [ - { - "date" : ISODate("2014-08-15T00:00:00Z"), - "grade" : "A", - "score" : 7 - }, - { - "date" : ISODate("2014-02-13T00:00:00Z"), - "grade" : "A", - "score" : 5 - }, - { - "date" : ISODate("2013-06-07T00:00:00Z"), - "grade" : "A", - "score" : 11 - } - ], - "name" : "Zest", - "restaurant_id" : "41220906" - } - -The following operation replaces the document with ``restaurant_id`` of -``"41220906"`` with a new document: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - $replacedRestaurant = $collection->findOneAndReplace( - [ 'restaurant_id' => '41220906' ], - [ - 'Borough' => 'Staten Island', - 'cuisine' => 'Italian', - 'grades' => [], - 'name' => 'Staten Island Pastaria', - 'restaurant_id' => '999999999', - ], - [ 'returnDocument' => MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER ] - ); - - var_dump($replacedRestaurant) - -The output would then resemble:: - - object(stdClass)#14 (6) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#11 (1) { - ["oid"]=> - string(24) "576023c7b02fa9281da4139e" - } - ["borough"]=> - string(13) "Staten Island" - ["cuisine"]=> - string(7) "Italian" - ["grades"]=> - array(0) { - } - ["name"]=> - string(22) "Staten Island Pastaria" - ["restaurant_id"]=> - string(9) "999999999" - } - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::findOneAndDelete()` -- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()` -- :manual:`findAndModify </reference/command/findAndModify>` command reference - in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndUpdate.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndUpdate.txt deleted file mode 100644 index 4401164..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-findOneAndUpdate.txt +++ /dev/null @@ -1,109 +0,0 @@ -======================================= -MongoDB\\Collection::findOneAndUpdate() -======================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::findOneAndUpdate() - - Finds a single document matching the query and updates it. - - .. code-block:: php - - function findOneAndUpdate($filter, $update, array $options = []): object|null - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-option.rst - -Return Values -------------- - -An array or object for either the original or the updated document, depending on -the specified value of the ``returnDocument`` option. By default, the original -document is returned. If no document matched the query, ``null`` is returned. -The return type will depend on the ``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unexpectedvalueexception.rst -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst - -Examples --------- - -The following operation updates the restaurant with ``restaurant_id`` of -``"40361708"`` in the ``restaurants`` collection in the ``example`` database by -setting its building number to ``"761"``: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - $updatedRestaurant = $collection->findOneAndUpdate( - [ 'restaurant_id' => '40361708' ], - [ '$set' => [ 'address.building' => '761' ]], - [ - 'projection' => [ 'address' => 1 ], - 'returnDocument' => MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER, - ] - ); - - var_dump($updatedRestaurant) - -The output would then resemble:: - - object(stdClass)#16 (2) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#10 (1) { - ["oid"]=> - string(24) "5813a08d29032c6e72d566a7" - } - ["address"]=> - object(stdClass)#15 (4) { - ["building"]=> - string(3) "761" - ["coord"]=> - array(2) { - [0]=> - float(-73.9925306) - [1]=> - float(40.7309346) - } - ["street"]=> - string(8) "Broadway" - ["zipcode"]=> - string(5) "10003" - } - } - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::findOneAndDelete()` -- :phpmethod:`MongoDB\\Collection::findOneAndReplace()` -- :manual:`findAndModify </reference/command/findAndModify>` command reference - in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getCollectionName.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getCollectionName.txt deleted file mode 100644 index b126c7f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getCollectionName.txt +++ /dev/null @@ -1,51 +0,0 @@ -======================================== -MongoDB\\Collection::getCollectionName() -======================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::getCollectionName() - - Returns the name of this collection. - - .. code-block:: php - - function getCollectionName(): string - -Return Values -------------- - -The name of this collection as a string. - -Example -------- - -The following returns the collection name for the ``zips`` collection in the -``demo`` database. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - echo $collection->getCollectionName(); - -The output would then resemble:: - - zips - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::getDatabaseName()` -- :phpmethod:`MongoDB\\Collection::getNamespace()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getDatabaseName.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getDatabaseName.txt deleted file mode 100644 index 10ea267..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getDatabaseName.txt +++ /dev/null @@ -1,52 +0,0 @@ -====================================== -MongoDB\\Collection::getDatabaseName() -====================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::getDatabaseName() - - Returns the name of the database containing this collection. - - .. code-block:: php - - function getDatabaseName(): string - -Return Values -------------- - -The name of the database containing this collection as a string. - -Example -------- - -The following returns the database name for the ``zips`` collection in the -``demo`` database. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - echo $collection->getDatabaseName(); - -The output would then resemble:: - - demo - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::getCollectionName()` -- :phpmethod:`MongoDB\\Collection::getNamespace()` - diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getManager.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getManager.txt deleted file mode 100644 index e0bbea0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getManager.txt +++ /dev/null @@ -1,35 +0,0 @@ -================================= -MongoDB\\Collection::getManager() -================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::getManager() - - Accessor for the - :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` used by this - :phpclass:`Collection <MongoDB\\Collection>`. - - .. code-block:: php - - function getManager(): MongoDB\Manager - -Return Values -------------- - -A :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` object. - -See Also --------- - -- :phpmethod:`MongoDB\\Client::getManager()` -- :phpmethod:`MongoDB\\Database::getManager()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getNamespace.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getNamespace.txt deleted file mode 100644 index 256a7cf..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-getNamespace.txt +++ /dev/null @@ -1,52 +0,0 @@ -=================================== -MongoDB\\Collection::getNamespace() -=================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::getNamespace() - - Returns the :term:`namespace` of the collection. A namespace is the canonical - name of an index or collection in MongoDB. - - .. code-block:: php - - function getNamespace(): string - -Return Values -------------- - -The namespace of this collection as a string. - -Example -------- - -The following returns the namespace of the ``zips`` collection in the ``demo`` -database. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - echo $collection->getNamespace(); - -The output would then resemble:: - - demo.zips - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::getCollectionName()` -- :phpmethod:`MongoDB\\Collection::getDatabaseName()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-insertMany.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-insertMany.txt deleted file mode 100644 index 5ba2704..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-insertMany.txt +++ /dev/null @@ -1,107 +0,0 @@ -================================= -MongoDB\\Collection::insertMany() -================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::insertMany() - - Insert multiple documents. - - .. code-block:: php - - function insertMany(array $documents, array $options = []): MongoDB\InsertManyResult - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\InsertManyResult` object, which encapsulates a -:php:`MongoDB\\Driver\\WriteResult <class.mongodb-driver-writeresult>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-bulkwriteexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/bulkwriteexception-result.rst -.. include:: /includes/extracts/bulkwriteexception-ordered.rst - -Example -------- - -.. start-crud-include - -The following operation inserts two documents into the ``users`` collection -in the ``example`` database: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->users; - - $insertManyResult = $collection->insertMany([ - [ - 'username' => 'admin', - 'email' => 'admin@example.com', - 'name' => 'Admin User', - ], - [ - 'username' => 'test', - 'email' => 'test@example.com', - 'name' => 'Test User', - ], - ]); - - printf("Inserted %d document(s)\n", $insertManyResult->getInsertedCount()); - - var_dump($insertManyResult->getInsertedIds()); - -The output would then resemble:: - - Inserted 2 document(s) - array(2) { - [0]=> - object(MongoDB\BSON\ObjectID)#11 (1) { - ["oid"]=> - string(24) "579a25921f417dd1e5518141" - } - [1]=> - object(MongoDB\BSON\ObjectID)#12 (1) { - ["oid"]=> - string(24) "579a25921f417dd1e5518142" - } - } - -.. end-crud-include - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::insertOne()` -- :phpmethod:`MongoDB\\Collection::bulkWrite()` -- :doc:`/tutorial/crud` -- :manual:`insert </reference/command/insert>` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-insertOne.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-insertOne.txt deleted file mode 100644 index 8353559..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-insertOne.txt +++ /dev/null @@ -1,91 +0,0 @@ -================================ -MongoDB\\Collection::insertOne() -================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::insertOne() - - Insert one document. - - .. code-block:: php - - function insertOne($document, array $options = []): MongoDB\InsertOneResult - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\InsertOneResult` object, which encapsulates a -:php:`MongoDB\\Driver\\WriteResult <class.mongodb-driver-writeresult>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-bulkwriteexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/bulkwriteexception-result.rst - -Example -------- - -.. start-crud-include - -The following operation inserts a document into the ``users`` collection in the -``example`` database: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->users; - - $insertOneResult = $collection->insertOne([ - 'username' => 'admin', - 'email' => 'admin@example.com', - 'name' => 'Admin User', - ]); - - printf("Inserted %d document(s)\n", $insertOneResult->getInsertedCount()); - - var_dump($insertOneResult->getInsertedId()); - -The output would then resemble:: - - Inserted 1 document(s) - object(MongoDB\BSON\ObjectID)#11 (1) { - ["oid"]=> - string(24) "579a25921f417dd1e5518141" - } - -.. end-crud-include - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::insertMany()` -- :phpmethod:`MongoDB\\Collection::bulkWrite()` -- :doc:`/tutorial/crud` -- :manual:`insert </reference/command/insert>` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-listIndexes.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-listIndexes.txt deleted file mode 100644 index a0b0237..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-listIndexes.txt +++ /dev/null @@ -1,111 +0,0 @@ -================================== -MongoDB\\Collection::listIndexes() -================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::listIndexes() - - Returns information for all indexes for this collection. - - .. code-block:: php - - function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-option.rst - -Return Values -------------- - -A traversable :phpclass:`MongoDB\\Model\\IndexInfoIterator`, which contains a -:phpclass:`MongoDB\\Model\\IndexInfo` object for each index for the collection. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Example -------- - -The following example lists all of the indexes for the ``restaurants`` -collection in the ``example`` database: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - foreach ($collection->listIndexes() as $index) { - var_dump($index); - } - -The output would then resemble:: - - object(MongoDB\Model\IndexInfo)#8 (4) { - ["v"]=> - int(1) - ["key"]=> - array(1) { - ["_id"]=> - int(1) - } - ["name"]=> - string(4) "_id_" - ["ns"]=> - string(19) "example.restaurants" - } - object(MongoDB\Model\IndexInfo)#12 (4) { - ["v"]=> - int(1) - ["key"]=> - array(1) { - ["cuisine"]=> - float(-1) - } - ["name"]=> - string(10) "cuisine_-1" - ["ns"]=> - string(19) "example.restaurants" - } - object(MongoDB\Model\IndexInfo)#8 (4) { - ["v"]=> - int(1) - ["key"]=> - array(1) { - ["borough"]=> - float(1) - } - ["name"]=> - string(9) "borough_1" - ["ns"]=> - string(19) "example.restaurants" - } - -See Also --------- - -- :doc:`/tutorial/indexes` -- :manual:`listIndexes </reference/command/listIndexes>` command reference in - the MongoDB manual -- :manual:`Index documentation </core/indexes>` in the MongoDB manual -- `Enumerating Collections - <https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst>`_ - specification diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-replaceOne.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-replaceOne.txt deleted file mode 100644 index 6186d57..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-replaceOne.txt +++ /dev/null @@ -1,93 +0,0 @@ -================================= -MongoDB\\Collection::replaceOne() -================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::replaceOne() - - Replace at most one document that matches the filter criteria. If multiple - documents match the filter criteria, only the :term:`first <natural order>` - matching document will be replaced. - - .. code-block:: php - - function replaceOne($filter, $replacement, array $options = []): MongoDB\UpdateResult - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a -:php:`MongoDB\\Driver\\WriteResult <class.mongodb-driver-writeresult>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-bulkwriteexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst -.. include:: /includes/extracts/bulkwriteexception-result.rst - -Example -------- - -The following example replaces the document with ``restaurant_id`` of -``"40356068"`` in the ``restaurants`` collection in the ``example`` database: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - $updateResult = $collection->replaceOne( - [ 'restaurant_id' => '40356068' ], - [ - 'name' => 'New Restaurant', - 'restaurant_id' => '99988877', - 'borough' => 'Queens', - 'cuisine' => 'Cafe', - 'grades' => [], - ] - ); - - printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); - printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); - -The output would then resemble:: - - Matched 1 document(s) - Modified 1 document(s) - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::updateMany()` -- :phpmethod:`MongoDB\\Collection::updateOne()` -- :phpmethod:`MongoDB\\Collection::bulkWrite()` -- :doc:`/tutorial/crud` -- :manual:`update </reference/command/update>` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-updateMany.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-updateMany.txt deleted file mode 100644 index 271fa75..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-updateMany.txt +++ /dev/null @@ -1,83 +0,0 @@ -================================= -MongoDB\\Collection::updateMany() -================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::updateMany() - - Update all documents that match the filter criteria. - - .. code-block:: php - - function updateMany($filter, $update, array $options = []): MongoDB\UpdateResult - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a -:php:`MongoDB\\Driver\\WriteResult <class.mongodb-driver-writeresult>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-bulkwriteexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst -.. include:: /includes/extracts/bulkwriteexception-result.rst - -Examples --------- - -The following example updates all of the documents with the ``borough`` of -``"Queens"`` by setting the ``active`` field to ``true``: - -.. code-block:: php - - $collection = (new MongoDB\Client)->example->restaurants; - - $updateResult = $collection->updateMany( - [ 'borough' => 'Queens' ], - [ '$set' => [ 'active' => 'True' ]] - ); - - printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); - printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); - -The output would then resemble:: - - Matched 5656 document(s) - Modified 5656 document(s) - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::replaceOne()` -- :phpmethod:`MongoDB\\Collection::updateOne()` -- :phpmethod:`MongoDB\\Collection::bulkWrite()` -- :doc:`/tutorial/crud` -- :manual:`update </reference/command/update>` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-updateOne.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-updateOne.txt deleted file mode 100644 index 88e9c0b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-updateOne.txt +++ /dev/null @@ -1,85 +0,0 @@ -================================ -MongoDB\\Collection::updateOne() -================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::updateOne() - - Update at most one document that matches the filter criteria. If multiple - documents match the filter criteria, only the :term:`first <natural order>` - matching document will be updated. - - .. code-block:: php - - function updateOne($filter, $update, array $options = []): MongoDB\UpdateResult - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a -:php:`MongoDB\\Driver\\WriteResult <class.mongodb-driver-writeresult>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-bulkwriteexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst -.. include:: /includes/extracts/bulkwriteexception-result.rst - -Examples --------- - -The following example updates one document with the ``restaurant_id`` of -``"40356151"`` by setting the ``name`` field to ``"Brunos on Astoria"``: - -.. code-block:: php - - $collection = (new MongoDB\Client)->example->restaurants; - - $updateResult = $collection->updateOne( - [ 'restaurant_id' => '40356151' ], - [ '$set' => [ 'name' => 'Brunos on Astoria' ]] - ); - - printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); - printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); - -The output would then resemble:: - - Matched 1 document(s) - Modified 1 document(s) - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::replaceOne()` -- :phpmethod:`MongoDB\\Collection::updateMany()` -- :phpmethod:`MongoDB\\Collection::bulkWrite()` -- :doc:`/tutorial/crud` -- :manual:`update </reference/command/update>` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-withOptions.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-withOptions.txt deleted file mode 100644 index f3e68df..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection-withOptions.txt +++ /dev/null @@ -1,61 +0,0 @@ -================================== -MongoDB\\Collection::withOptions() -================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::withOptions() - - Returns a clone of the Collection object, but with different options. - - .. code-block:: php - - function withOptions(array $options = []): MongoDB\Collection - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\Collection` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst - -Example -------- - -The following example clones an existing Collection object with a new read -preference: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->selectCollect('demo', 'restaurants'); - - $newCollection = $sourceCollection->withOptions([ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), - ]); - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::__construct()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection__construct.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection__construct.txt deleted file mode 100644 index c3ef0c6..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBCollection__construct.txt +++ /dev/null @@ -1,54 +0,0 @@ -================================== -MongoDB\\Collection::__construct() -================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Collection::__construct() - - Constructs a new :phpclass:`Collection <MongoDB\\Collection>` instance. - - .. code-block:: php - - function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = []) - - This constructor has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-construct-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBCollection-method-construct-option.rst - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst - -Behavior --------- - -If you construct a Collection explicitly, the Collection inherits any options -from the :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` object. -If you select the Collection from a :phpclass:`Client <MongoDB\\Client>` or -:phpclass:`Database <MongoDB\\Database>` object, the Collection inherits its -options from that object. - -.. todo: add an example - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::withOptions()` -- :phpmethod:`MongoDB\\Client::selectCollection()` -- :phpmethod:`MongoDB\\Database::selectCollection()` -- :phpmethod:`MongoDB\\Database::__get()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-command.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-command.txt deleted file mode 100644 index 46776a8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-command.txt +++ /dev/null @@ -1,155 +0,0 @@ -============================ -MongoDB\\Database::command() -============================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::command() - - Execute a :manual:`command </reference/command>` on the database. - - .. code-block:: php - - function command($command, array $options = []): MongoDB\Driver\Cursor - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBDatabase-method-command-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBDatabase-method-command-option.rst - -Return Values -------------- - -A :php:`MongoDB\\Driver\\Cursor <class.mongodb-driver-cursor>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Example -------- - -The following example executes an :manual:`isMaster -</reference/command/isMaster>` command, which returns a cursor with a single -result document: - -.. code-block:: php - - <?php - - $database = (new MongoDB\Client)->example; - - $cursor = $database->command(['isMaster' => 1]); - - var_dump($c->toArray()[0]); - -The output would resemble:: - - object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(8) { - ["ismaster"]=> - bool(true) - ["maxBsonObjectSize"]=> - int(16777216) - ["maxMessageSizeBytes"]=> - int(48000000) - ["maxWriteBatchSize"]=> - int(1000) - ["localTime"]=> - object(MongoDB\BSON\UTCDateTime)#3 (1) { - ["milliseconds"]=> - string(13) "1477608046464" - } - ["maxWireVersion"]=> - int(4) - ["minWireVersion"]=> - int(0) - ["ok"]=> - float(1) - } - } - -The following example executes a :manual:`listCollections -</reference/command/listCollections>` command, which returns a cursor with -multiple result documents: - -.. code-block:: php - - <?php - - $database = (new MongoDB\Client)->example; - - $cursor = $database->command(['isMaster' => 1]); - - var_dump($c->toArray()); - -The output would resemble:: - - array(3) { - [0]=> - object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["name"]=> - string(11) "restaurants" - ["options"]=> - object(MongoDB\Model\BSONDocument)#3 (1) { - ["storage":"ArrayObject":private]=> - array(0) { - } - } - } - } - [1]=> - object(MongoDB\Model\BSONDocument)#13 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["name"]=> - string(5) "users" - ["options"]=> - object(MongoDB\Model\BSONDocument)#12 (1) { - ["storage":"ArrayObject":private]=> - array(0) { - } - } - } - } - [2]=> - object(MongoDB\Model\BSONDocument)#15 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["name"]=> - string(6) "restos" - ["options"]=> - object(MongoDB\Model\BSONDocument)#14 (1) { - ["storage":"ArrayObject":private]=> - array(0) { - } - } - } - } - } - -See Also --------- - -- :doc:`/tutorial/commands` -- :manual:`Database Commands </reference/command>` in the MongoDB manual -- :php:`MongoDB\\Driver\\Cursor <class.mongodb-driver-cursor>` -- :php:`MongoDB\\Driver\\Manager::executeCommand() - <manual/en/mongodb-driver-manager.executecommand.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-createCollection.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-createCollection.txt deleted file mode 100644 index e66c8c6..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-createCollection.txt +++ /dev/null @@ -1,99 +0,0 @@ -===================================== -MongoDB\\Database::createCollection() -===================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::createCollection() - - Explicitly creates a collection. - - .. code-block:: php - - function createCollection($collectionName, array $options = []): array|object - - MongoDB creates collections implicitly when you first reference the - collection in a command, such as when inserting a document into a new - collection. You may also explicitly create a collection with specific options - using the :phpmethod:`MongoDB\\Database::createCollection()` method, or using - :manual:`db.createCollection() </reference/method/db.createCollection>` in - the :program:`mongo` shell. - - Explicitly creating collections enables you to create - :manual:`capped collections </core/capped-collections>`, specify - :manual:`document validation criteria </core/document-validation>`, - or configure your storage engine or indexing options. - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-option.rst - - Note that not all options are available on all versions of MongoDB. Document - validation, for example, was added in MongoDB 3.2; similarly, the WiredTiger - storage engine is available only for MongoDB 3.0 and later. Refer to the - :manual:`create </reference/command/create>` command reference in the MongoDB - manual for compatibility considerations. - -Return Values -------------- - -An array or object with the result document of the :manual:`create -</reference/command/create>` command. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Example -------- - -The following example creates a ``users`` collection in the ``demo`` -database with document validation criteria: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - $result = $db->createCollection('users', [ - 'validator' => [ - 'username' => ['$type' => 'string'], - 'email' => ['$regex' => '@mongodb\.com$'], - ], - ]); - - var_dump($result); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(1) { - ["ok"]=> - float(1) - } - } - -See Also --------- - -- :manual:`create </reference/command/create>` command reference in the MongoDB - manual -- :manual:`db.createCollection() </reference/method/db.createCollection>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-drop.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-drop.txt deleted file mode 100644 index 3fe566f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-drop.txt +++ /dev/null @@ -1,78 +0,0 @@ -========================= -MongoDB\\Database::drop() -========================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::drop() - - Drop the database. - - .. code-block:: php - - function drop(array $options = []): array|object - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBDatabase-method-drop-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBDatabase-method-drop-option.rst - -Return Values -------------- - -An array or object with the result document of the :manual:`dropDatabase -</reference/command/dropDatabase>` command. The return type will depend on the -``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Example -------- - -The following example drops the ``demo`` database: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - $result = $db->drop(); - - var_dump($result); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#8 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["dropped"]=> - string(4) "demo" - ["ok"]=> - float(1) - } - } - -See Also --------- - -- :phpmethod:`MongoDB\\Client::dropDatabase()` -- :manual:`dropDatabase </reference/command/dropDatabase>` command reference in - the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-dropCollection.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-dropCollection.txt deleted file mode 100644 index d6158d4..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-dropCollection.txt +++ /dev/null @@ -1,80 +0,0 @@ -=================================== -MongoDB\\Database::dropCollection() -=================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::dropCollection() - - Drop a collection within the current database. - - .. code-block:: php - - function dropCollection($collectionName, array $options = []): array|object - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-option.rst - -Return Values -------------- - -An array or object with the result document of the :manual:`drop -</reference/command/drop>` command. The return type will depend on the -``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Example -------- - -The following example drops the ``users`` collection in the ``demo`` database: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - $result = $db->dropCollection('users'); - - var_dump($result); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#8 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["ns"]=> - string(10) "demo.users" - ["nIndexesWas"]=> - int(1) - ["ok"]=> - float(1) - } - } - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::drop()` -- :manual:`drop </reference/command/drop>` command reference in the MongoDB - manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-getDatabaseName.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-getDatabaseName.txt deleted file mode 100644 index b4ce912..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-getDatabaseName.txt +++ /dev/null @@ -1,44 +0,0 @@ -==================================== -MongoDB\\Database::getDatabaseName() -==================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::getDatabaseName() - - Returns the name of this database. - - .. code-block:: php - - function getDatabaseName(): string - -Return Values -------------- - -The name of this database as a string. - -Example -------- - -The following example prints the name of a database object: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - echo $db->getDatabaseName(); - -The output would then resemble:: - - demo diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-getManager.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-getManager.txt deleted file mode 100644 index 72a2b05..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-getManager.txt +++ /dev/null @@ -1,35 +0,0 @@ -=============================== -MongoDB\\Database::getManager() -=============================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::getManager() - - Accessor for the - :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` used by this - :phpclass:`Database <MongoDB\\Database>`. - - .. code-block:: php - - function getManager(): MongoDB\Manager - -Return Values -------------- - -A :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` object. - -See Also --------- - -- :phpmethod:`MongoDB\\Client::getManager()` -- :phpmethod:`MongoDB\\Collection::getManager()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-listCollections.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-listCollections.txt deleted file mode 100644 index caca2c8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-listCollections.txt +++ /dev/null @@ -1,121 +0,0 @@ -==================================== -MongoDB\\Database::listCollections() -==================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::listCollections() - - Returns information for all collections in this database. - - .. code-block:: php - - function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst - -Return Values -------------- - -A traversable :phpclass:`MongoDB\\Model\\CollectionInfoIterator`, which contains -a :phpclass:`MongoDB\\Model\\CollectionInfo` object for each collection in the -database. - -Example -------- - -The following example lists all of the collections in the ``example`` database: - -.. code-block:: php - - <?php - - $database = (new MongoDB\Client)->example; - - foreach ($database->listCollections() as $collectionInfo) { - var_dump($collectionInfo); - } - -The output would then resemble:: - - object(MongoDB\Model\CollectionInfo)#3 (2) { - ["name"]=> - string(11) "restaurants" - ["options"]=> - array(0) { - } - } - object(MongoDB\Model\CollectionInfo)#3 (2) { - ["name"]=> - string(5) "users" - ["options"]=> - array(0) { - } - } - object(MongoDB\Model\CollectionInfo)#3 (2) { - ["name"]=> - string(6) "restos" - ["options"]=> - array(0) { - } - } - -The following example lists all collections whose name starts with ``"rest"`` -in the ``example`` database: - -.. code-block:: php - - <?php - - $database = (new MongoDB\Client)->example; - - $collections = $database->listCollections([ - 'filter' => [ - 'name' => new MongoDB\BSON\Regex('^rest.*'), - ], - ]); - - foreach ($collections as $collectionInfo) { - var_dump($collectionInfo); - } - -The output would then resemble:: - - object(MongoDB\Model\CollectionInfo)#3 (2) { - ["name"]=> - string(11) "restaurants" - ["options"]=> - array(0) { - } - } - object(MongoDB\Model\CollectionInfo)#3 (2) { - ["name"]=> - string(6) "restos" - ["options"]=> - array(0) { - } - } - -See Also --------- - -- :manual:`listCollections </reference/command/listCollections` command - reference in the MongoDB manual -- `Enumerating Collections - <https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst>`_ - specification diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-selectCollection.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-selectCollection.txt deleted file mode 100644 index 173fdad..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-selectCollection.txt +++ /dev/null @@ -1,83 +0,0 @@ -===================================== -MongoDB\\Database::selectCollection() -===================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::selectCollection() - - Selects a collection within the database. - - .. code-block:: php - - function selectCollection($collectionName, array $options = []): MongoDB\Collection - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\Collection` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst - -Behavior --------- - -The selected collection inherits options such as read preference and type -mapping from the :phpclass:`Database <MongoDB\\Database>` object. Options may be -overridden via the ``$options`` parameter. - -Example -------- - -The following example selects the ``users`` collection in the ``demo`` database: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - $collection = $db->selectCollection('demo', 'users'); - -The following example selects the ``users`` collection in the ``demo`` -database with a custom read preference: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - $users = $db->selectCollection( - 'users', - [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), - ] - ); - -See Also --------- - -- :phpmethod:`MongoDB\\Database::__get()` -- :phpmethod:`MongoDB\\Client::selectCollection()` -- :phpmethod:`MongoDB\\Collection::__construct()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-selectGridFSBucket.txt deleted file mode 100644 index e3b3dfb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-selectGridFSBucket.txt +++ /dev/null @@ -1,80 +0,0 @@ -======================================= -MongoDB\\Database::selectGridFSBucket() -======================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::selectGridFSBucket() - - Selects a GridFS bucket within the database. - - .. code-block:: php - - function selectGridFSBucket(array $options = []): MongoDB\GridFS\Bucket - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\GridFS\\Bucket` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst - -Behavior --------- - -The selected bucket inherits options such as read preference and type -mapping from the :phpclass:`Database <MongoDB\\Database>` object. Options may be -overridden via the ``$options`` parameter. - -Example -------- - -The following example selects the default ``fs.files`` bucket in the ``demo`` -database: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - $bucket = $db->selectGridFSBucket(); - -The following example selects the custom ``images.files`` bucket in the ``demo`` -database with a custom read preference: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - $imagesBucket = $db->selectGridFSBucket([ - 'bucketName' => 'images', - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), - ]); - -See Also --------- - -- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-withOptions.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-withOptions.txt deleted file mode 100644 index 4c6f092..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase-withOptions.txt +++ /dev/null @@ -1,61 +0,0 @@ -================================ -MongoDB\\Database::withOptions() -================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::withOptions() - - Returns a clone of the Database object, but with different options. - - .. code-block:: php - - function withOptions(array $options = []): MongoDB\Database - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-option.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\Database` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst - -Example -------- - -The following example clones an existing Database object with a new read -preference: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - $newDb = $db->withOptions([ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), - ]); - -See Also --------- - -- :phpmethod:`MongoDB\\Database::__construct()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase__construct.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase__construct.txt deleted file mode 100644 index 2d3e7f5..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase__construct.txt +++ /dev/null @@ -1,50 +0,0 @@ -================================ -MongoDB\\Database::__construct() -================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::__construct() - - Constructs a new :phpclass:`Database <MongoDB\\Database>` instance. - - .. code-block:: php - - function __construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = []) - - This constructor has the following parameters: - - .. include:: /includes/apiargs/MongoDBDatabase-method-construct-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBDatabase-method-construct-option.rst - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst - -Behavior --------- - -If you construct a Database explicitly, the Database inherits any options from -the :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` object. If -you select the Database from a :phpclass:`Client <MongoDB\\Client>` object, the -Database inherits its options from that object. - -See Also --------- - -- :phpmethod:`MongoDB\\Database::withOptions()` -- :phpmethod:`MongoDB\\Client::selectDatabase()` -- :phpmethod:`MongoDB\\Client::__get()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase__get.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase__get.txt deleted file mode 100644 index c0f4256..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDatabase__get.txt +++ /dev/null @@ -1,69 +0,0 @@ -========================== -MongoDB\\Database::__get() -========================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Database::__get() - - Select a collection within the database. - - .. code-block:: php - - function __get($collectionName): MongoDB\Collection - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBDatabase-method-get-param.rst - -Return Values -------------- - -A :phpclass:`MongoDB\\Collection` object. - -Behavior --------- - -The selected collection inherits options such as read preference and type -mapping from the :phpclass:`Database <MongoDB\\Database>` object. If you wish to -override any options, use the :phpmethod:`MongoDB\\Database::selectCollection` -method. - -.. note:: - - To select collections whose names contain special characters, such as - ``.``, use complex syntax, as in ``$database->{'that.database'}``. - - Alternatively, :phpmethod:`MongoDB\\Database::selectCollection` supports - selecting collections whose names contain special characters. - -Examples --------- - -The following example selects the ``users`` and ``system.profile`` -collections from the ``demo`` database: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - $users = $db->users; - $systemProfile = $db->{'system.profile'}; - -See Also --------- - -- :phpmethod:`MongoDB\\Database::selectCollection()` -- :phpmethod:`MongoDB\\Client::selectCollection()` -- :php:`Property Overloading <oop5.overloading>` in the PHP Manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDeleteResult-getDeletedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDeleteResult-getDeletedCount.txt deleted file mode 100644 index dcda257..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDeleteResult-getDeletedCount.txt +++ /dev/null @@ -1,40 +0,0 @@ -======================================== -MongoDB\\DeleteResult::getDeletedCount() -======================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\DeleteResult::getDeletedCount() - - Return the number of documents that were deleted. - - .. code-block:: php - - function getDeletedCount(): integer - - This method should only be called if the write was acknowledged. - -Return Values -------------- - -The number of documents that were deleted. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::getDeletedCount() - <manual/en/mongodb-driver-writeresult.getdeletedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDeleteResult-isAcknowledged.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDeleteResult-isAcknowledged.txt deleted file mode 100644 index a82fa52..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBDeleteResult-isAcknowledged.txt +++ /dev/null @@ -1,34 +0,0 @@ -======================================= -MongoDB\\DeleteResult::isAcknowledged() -======================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\DeleteResult::isAcknowledged() - - Return whether the write was acknowledged. - - .. code-block:: php - - function isAcknowledged(): boolean - -Return Values -------------- - -A boolean indicating whether the write was acknowledged. - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged() - <manual/en/mongodb-driver-writeresult.isacknowledged.php>` -- :manual:`Write Concern </reference/write-concern>` in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-delete.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-delete.txt deleted file mode 100644 index 6e4eeac..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-delete.txt +++ /dev/null @@ -1,40 +0,0 @@ -================================= -MongoDB\\GridFS\\Bucket::delete() -================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::delete() - - Delete a file and its chunks from the GridFS bucket. - - .. code-block:: php - - function delete($id): void - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-delete-param.rst - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -If the files collection document is not found, this method will still attempt to -delete orphaned chunks. - -.. todo: add examples diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-downloadToStream.txt deleted file mode 100644 index 6200950..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-downloadToStream.txt +++ /dev/null @@ -1,43 +0,0 @@ -=========================================== -MongoDB\\GridFS\\Bucket::downloadToStream() -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStream() - - Selects a GridFS file by its ``_id`` and copies its contents to a writable - stream. - - .. code-block:: php - - function downloadToStream($id, $destination): void - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStream-param.rst - -.. todo: add examples - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -See Also --------- - -- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()` -- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()` -- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt deleted file mode 100644 index 0fd2c8f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt +++ /dev/null @@ -1,47 +0,0 @@ -=========================================== -MongoDB\\GridFS\\Bucket::downloadToStream() -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStreamByName() - - Selects a GridFS file by its ``filename`` and copies its contents to a - writable stream. - - .. code-block:: php - - function downloadToStreamByName($filename, $destination, array $options = []): void - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-option.rst - -.. todo: add examples - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -See Also --------- - -- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()` -- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()` -- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-drop.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-drop.txt deleted file mode 100644 index a6730fc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-drop.txt +++ /dev/null @@ -1,29 +0,0 @@ -=============================== -MongoDB\\GridFS\\Bucket::drop() -=============================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::drop() - - Drops the files and chunks collections associated with this GridFS bucket. - - .. code-block:: php - - function drop(): void - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -.. todo: add examples diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-find.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-find.txt deleted file mode 100644 index 8f40253..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-find.txt +++ /dev/null @@ -1,55 +0,0 @@ -=============================== -MongoDB\\GridFS\\Bucket::find() -=============================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::find() - - Finds documents from the GridFS bucket's files collection matching the query. - - .. code-block:: php - - function find($filter = [], array $options = []): MongoDB\Driver\Cursor - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-find-option.rst - -Return Values -------------- - -A :php:`MongoDB\\Driver\\Cursor <class.mongodb-driver-cursor>` object. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst - -.. todo: add examples - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::find()` -- :phpmethod:`MongoDB\\GridFS\\Bucket::findOne()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-findOne.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-findOne.txt deleted file mode 100644 index f07a613..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-findOne.txt +++ /dev/null @@ -1,58 +0,0 @@ -================================== -MongoDB\\GridFS\\Bucket::findOne() -================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::findOne() - - Finds a single document from the GridFS bucket's files collection matching - the query. - - .. code-block:: php - - function findOne($filter = [], array $options = []): array|object|null - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-findOne-option.rst - -Return Values -------------- - -An array or object for the :term:`first document <natural order>` that matched -the query, or ``null`` if no document matched the query. The return type will -depend on the ``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-unsupportedexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -Behavior --------- - -.. include:: /includes/extracts/note-bson-comparison.rst - -.. todo: add examples - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::findOne()` -- :phpmethod:`MongoDB\\GridFS\\Bucket::find()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getBucketName.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getBucketName.txt deleted file mode 100644 index 1fafde1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getBucketName.txt +++ /dev/null @@ -1,29 +0,0 @@ -=========================================== -MongoDB\\GridFS\\Bucket::downloadToStream() -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::getBucketName() - - Returns the name of this bucket. - - .. code-block:: php - - function getBucketName(): string - -Return Values -------------- - -The name of this bucket as a string. - -.. todo: add examples diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getDatabaseName.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getDatabaseName.txt deleted file mode 100644 index dc3ceea..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getDatabaseName.txt +++ /dev/null @@ -1,29 +0,0 @@ -========================================== -MongoDB\\GridFS\\Bucket::getDatabaseName() -========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::getDatabaseName() - - Returns the name of the database containing this bucket. - - .. code-block:: php - - function getDatabaseName(): string - -Return Values -------------- - -The name of the database containing this bucket as a string. - -.. todo: add examples diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt deleted file mode 100644 index faa5891..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt +++ /dev/null @@ -1,45 +0,0 @@ -=================================================== -MongoDB\\GridFS\\Bucket::getFileDocumentForStream() -=================================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileDocumentForStream() - - Gets the file document of the GridFS file associated with a stream. - - .. code-block:: php - - function getFileDocumentForStream($stream): array|object - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileDocumentForStream-param.rst - -Return Values -------------- - -The metadata document associated with the GridFS stream. The return type will -depend on the bucket's ``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -.. todo: add examples - -See Also --------- - -- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt deleted file mode 100644 index b7ef996..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt +++ /dev/null @@ -1,46 +0,0 @@ -============================================= -MongoDB\\GridFS\\Bucket::getFileIdForStream() -============================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileIdForStream() - - Gets the file document's ID of the GridFS file associated with a stream. - - .. code-block:: php - - function getFileIdForStream($stream): mixed - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileIdForStream-param.rst - -Return Values -------------- - -The ``_id`` field of the metadata document associated with the GridFS stream. -The return type will depend on the bucket's ``typeMap`` option. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-gridfs-corruptfileexception.rst -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -.. todo: add examples - -See Also --------- - -- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openDownloadStream.txt deleted file mode 100644 index 69f6d54..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openDownloadStream.txt +++ /dev/null @@ -1,46 +0,0 @@ -============================================= -MongoDB\\GridFS\\Bucket::openDownloadStream() -============================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStream() - - Selects a GridFS file by its ``_id`` and opens it as a readable stream. - - .. code-block:: php - - function openDownloadStream($id): resource - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStream-param.rst - -Return Values -------------- - -A readable stream resource. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -.. todo: add examples - -See Also --------- - -- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()` -- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()` -- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt deleted file mode 100644 index b497685..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt +++ /dev/null @@ -1,50 +0,0 @@ -=================================================== -MongoDB\\GridFS\\Bucket::openDownloadStreamByName() -=================================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStreamByName() - - Selects a GridFS file by its ``filename`` and opens it as a readable stream. - - .. code-block:: php - - function openDownloadStreamByName($filename, array $options = []): resource - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-option.rst - -Return Values -------------- - -A readable stream resource. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -.. todo: add examples - -See Also --------- - -- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()` -- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()` -- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openUploadStream.txt deleted file mode 100644 index 2ad11c4..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-openUploadStream.txt +++ /dev/null @@ -1,48 +0,0 @@ -=========================================== -MongoDB\\GridFS\\Bucket::openUploadStream() -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::openUploadStream() - - Opens a writable stream for a new GridFS file. - - .. code-block:: php - - function openUploadStream($filename, array $options = []): resource - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-option.rst - -Return Values -------------- - -A writable stream resource. - -Behavior --------- - -Chunk documents will be created as data is written to the writable stream. The -metadata document will be created when the writable stream is closed. - -.. todo: add examples - -See Also --------- - -- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-rename.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-rename.txt deleted file mode 100644 index 77fd899..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-rename.txt +++ /dev/null @@ -1,34 +0,0 @@ -================================= -MongoDB\\GridFS\\Bucket::rename() -================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::rename() - - Selects a GridFS file by its ``_id`` and alters its ``filename``. - - .. code-block:: php - - function rename($id, $newFilename): void - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-rename-param.rst - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -.. todo: add examples diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-uploadFromStream.txt deleted file mode 100644 index f1c47f1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket-uploadFromStream.txt +++ /dev/null @@ -1,51 +0,0 @@ -=========================================== -MongoDB\\GridFS\\Bucket::uploadFromStream() -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::uploadFromStream() - - Creates a new GridFS file and copies the contents of a readable stream to it. - - .. code-block:: php - - function uploadFromStream($filename, $source, array $options = []): mixed - - This method has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-option.rst - -Return Values -------------- - -The ``_id`` field of the metadata document associated with the newly created -GridFS file. If the ``_id`` option is not specified, a new -:php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object will be used -by default. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst -.. include:: /includes/extracts/error-driver-runtimeexception.rst - -.. todo: add examples - -See Also --------- - -- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket__construct.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket__construct.txt deleted file mode 100644 index d6c2937..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBGridFSBucket__construct.txt +++ /dev/null @@ -1,50 +0,0 @@ -====================================== -MongoDB\\GridFS\\Bucket::__construct() -====================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\GridFS\\Bucket::__construct() - - Constructs a new :phpclass:`Bucket <MongoDB\\GridFS\\Bucket>` instance. - - .. code-block:: php - - function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = []) - - This constructor has the following parameters: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-param.rst - - The ``$options`` parameter supports the following options: - - .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-option.rst - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-invalidargumentexception.rst - -Behavior --------- - -If you construct a Bucket explicitly, the Bucket inherits any options -from the :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` object. -If you select the Bucket from a :phpclass:`Database <MongoDB\\Database>` object, -the Bucket inherits its options from that object. - -.. todo: add an example - -See Also --------- - -- :phpmethod:`MongoDB\\Database::selectGridFSBucket()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-getInsertedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-getInsertedCount.txt deleted file mode 100644 index 9297008..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-getInsertedCount.txt +++ /dev/null @@ -1,40 +0,0 @@ -============================================= -MongoDB\\InsertManyResult::getInsertedCount() -============================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\InsertManyResult::getInsertedCount() - - Return the number of documents that were inserted. - - .. code-block:: php - - function getInsertedCount(): integer - - This method should only be called if the write was acknowledged. - -Return Values -------------- - -The number of documents that were inserted. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount() - <manual/en/mongodb-driver-writeresult.getinsertedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-getInsertedIds.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-getInsertedIds.txt deleted file mode 100644 index 88e76fe..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-getInsertedIds.txt +++ /dev/null @@ -1,36 +0,0 @@ -=========================================== -MongoDB\\InsertManyResult::getInsertedIds() -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\InsertManyResult::getInsertedIds() - - Return a map of IDs (i.e. ``_id`` field values) for the inserted documents. - - .. code-block:: php - - function getInsertedIds(): array - - Since IDs are created by the driver, this method may be called irrespective - of whether the write was acknowledged. - -Return Values -------------- - -A map of IDs (i.e. ``_id`` field values) for the inserted documents. - -The index of each ID in the map corresponds to each document's position in the -bulk operation. If a document had an ID prior to inserting (i.e. the driver did -not generate an ID), the index will contain its ``_id`` field value. Any -driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectID -<class.mongodb-bson-objectid>` instance. diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-isAcknowledged.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-isAcknowledged.txt deleted file mode 100644 index db376e5..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertManyResult-isAcknowledged.txt +++ /dev/null @@ -1,34 +0,0 @@ -=========================================== -MongoDB\\InsertManyResult::isAcknowledged() -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\InsertManyResult::isAcknowledged() - - Return whether the write was acknowledged. - - .. code-block:: php - - function isAcknowledged(): boolean - -Return Values -------------- - -A boolean indicating whether the write was acknowledged. - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged() - <manual/en/mongodb-driver-writeresult.isacknowledged.php>` -- :manual:`Write Concern </reference/write-concern>` in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-getInsertedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-getInsertedCount.txt deleted file mode 100644 index 3550801..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-getInsertedCount.txt +++ /dev/null @@ -1,41 +0,0 @@ -============================================ -MongoDB\\InsertOneResult::getInsertedCount() -============================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\InsertOneResult::getInsertedCount() - - Return the number of documents that were inserted. - - .. code-block:: php - - function getInsertedCount(): integer - - This method should only be called if the write was acknowledged. - -Return Values -------------- - -The number of documents that were inserted. This should be ``1`` for an -acknowledged insert operation. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount() - <manual/en/mongodb-driver-writeresult.getinsertedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-getInsertedId.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-getInsertedId.txt deleted file mode 100644 index 7d7a3d6..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-getInsertedId.txt +++ /dev/null @@ -1,35 +0,0 @@ -========================================= -MongoDB\\InsertOneResult::getInsertedId() -========================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\InsertOneResult::getInsertedId() - - Return the ID (i.e. ``_id`` field value) for the inserted document. - - .. code-block:: php - - function getInsertedId(): mixed - - Since IDs are created by the driver, this method may be called irrespective - of whether the write was acknowledged. - -Return Values -------------- - -The ID (i.e. ``_id`` field value) of the inserted document. - -If the document had an ID prior to inserting (i.e. the driver did not need to -generate an ID), this will contain its ``_id`` field value. Any driver-generated -ID will be a :php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` -instance. diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-isAcknowledged.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-isAcknowledged.txt deleted file mode 100644 index 921e3a6..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBInsertOneResult-isAcknowledged.txt +++ /dev/null @@ -1,34 +0,0 @@ -========================================== -MongoDB\\InsertOneResult::isAcknowledged() -========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\InsertOneResult::isAcknowledged() - - Return whether the write was acknowledged. - - .. code-block:: php - - function isAcknowledged(): boolean - -Return Values -------------- - -A boolean indicating whether the write was acknowledged. - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged() - <manual/en/mongodb-driver-writeresult.isacknowledged.php>` -- :manual:`Write Concern </reference/write-concern>` in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt deleted file mode 100644 index 693350f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt +++ /dev/null @@ -1,39 +0,0 @@ -============================================== -MongoDB\\Model\\CollectionInfo::getCappedMax() -============================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedMax() - - Return the document limit for the capped collection. This correlates with the - ``max`` option for :phpmethod:`MongoDB\\Database::createCollection()`. - - .. code-block:: php - - function getCappedMax(): integer|null - -Return Values -------------- - -The document limit for the capped collection. If the collection is not capped, -``null`` will be returned. - -See Also --------- - -- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()` -- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()` -- :phpmethod:`MongoDB\\Database::createCollection()` -- :manual:`Capped Collections </core/capped-collections>` in the MongoDB manual -- :manual:`listCollections </reference/command/listCollections>` command - reference in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt deleted file mode 100644 index cc0bd76..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt +++ /dev/null @@ -1,40 +0,0 @@ -=============================================== -MongoDB\\Model\\CollectionInfo::getCappedSize() -=============================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedSize() - - Return the size limit for the capped collection in bytes. This correlates - with the ``size`` option for - :phpmethod:`MongoDB\\Database::createCollection()`. - - .. code-block:: php - - function getCappedSize(): integer|null - -Return Values -------------- - -The size limit for the capped collection in bytes. If the collection is not -capped, ``null`` will be returned. - -See Also --------- - -- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()` -- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()` -- :phpmethod:`MongoDB\\Database::createCollection()` -- :manual:`Capped Collections </core/capped-collections>` in the MongoDB manual -- :manual:`listCollections </reference/command/listCollections>` command - reference in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getName.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getName.txt deleted file mode 100644 index cd04ffa..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getName.txt +++ /dev/null @@ -1,34 +0,0 @@ -========================================= -MongoDB\\Model\\CollectionInfo::getName() -========================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\CollectionInfo::getName() - - Return the collection name. - - .. code-block:: php - - function getName(): string - -Return Values -------------- - -The collection name. - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::getCollectionName()` -- :manual:`listCollections </reference/command/listCollections>` command - reference in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getOptions.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getOptions.txt deleted file mode 100644 index e360522..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-getOptions.txt +++ /dev/null @@ -1,36 +0,0 @@ -============================================ -MongoDB\\Model\\CollectionInfo::getOptions() -============================================ - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\CollectionInfo::getOptions() - - Return the collection options. This correlates with the options for - :phpmethod:`MongoDB\\Database::createCollection()`, but may include - additional fields set by the server. - - .. code-block:: php - - function getOptions(): array - -Return Values -------------- - -The collection options. - -See Also --------- - -- :phpmethod:`MongoDB\\Database::createCollection()` -- :manual:`listCollections </reference/command/listCollections>` command - reference in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-isCapped.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-isCapped.txt deleted file mode 100644 index abfc387..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelCollectionInfo-isCapped.txt +++ /dev/null @@ -1,37 +0,0 @@ -========================================== -MongoDB\\Model\\CollectionInfo::isCapped() -========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\CollectionInfo::isCapped() - - Return whether the collection is a :manual:`capped collection - </core/capped-collections>`. - - .. code-block:: php - - function isCapped(): boolean - -Return Values -------------- - -A boolean indicating whether the collection is a capped collection. - -See Also --------- - -- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()` -- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()` -- :manual:`Capped Collections </core/capped-collections>` in the MongoDB manual -- :manual:`listCollections </reference/command/listCollections>` command - reference in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-getName.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-getName.txt deleted file mode 100644 index 47991f1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-getName.txt +++ /dev/null @@ -1,34 +0,0 @@ -======================================= -MongoDB\\Model\\DatabaseInfo::getName() -======================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getName() - - Return the database name. - - .. code-block:: php - - function getName(): string - -Return Values -------------- - -The database name. - -See Also --------- - -- :phpmethod:`MongoDB\\Database::getDatabaseName()` -- :manual:`listDatabases </reference/command/listDatabases>` command reference - in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt deleted file mode 100644 index 2a8fe5a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt +++ /dev/null @@ -1,33 +0,0 @@ -============================================= -MongoDB\\Model\\DatabaseInfo::getSizeOnDisk() -============================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getSizeOnDisk() - - Return the total size of the database file on disk in bytes. - - .. code-block:: php - - function getSizeOnDisk(): integer - -Return Values -------------- - -The total size of the database file on disk in bytes. - -See Also --------- - -- :manual:`listDatabases </reference/command/listDatabases>` command reference - in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt deleted file mode 100644 index 878844d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt +++ /dev/null @@ -1,33 +0,0 @@ -======================================= -MongoDB\\Model\\DatabaseInfo::isEmpty() -======================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\DatabaseInfo::isEmpty() - - Return whether the database has any data. - - .. code-block:: php - - function isEmpty(): boolean - -Return Values -------------- - -A boolean indicating whether the database has any data. - -See Also --------- - -- :manual:`listDatabases </reference/command/listDatabases>` command reference - in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getKey.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getKey.txt deleted file mode 100644 index 6ad0712..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getKey.txt +++ /dev/null @@ -1,36 +0,0 @@ -=================================== -MongoDB\\Model\\IndexInfo::getKey() -=================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\IndexInfo::getKey() - - Return the index specification (i.e. indexed field(s) and order). This - correlates with the ``$key`` parameter for - :phpmethod:`MongoDB\\Collection::createIndex()`. - - .. code-block:: php - - function getKey(): array - -Return Values -------------- - -The index specification as an associative array. - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::createIndex()` -- :manual:`listIndexes </reference/command/listIndexes>` command reference in - the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getName.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getName.txt deleted file mode 100644 index 2698379..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getName.txt +++ /dev/null @@ -1,37 +0,0 @@ -==================================== -MongoDB\\Model\\IndexInfo::getName() -==================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\IndexInfo::getName() - - Return the index name. This correlates with the return value of - :phpmethod:`MongoDB\\Collection::createIndex()`. An index name may be derived - from the ``$key`` parameter or or explicitly specified via the ``name`` - option. - - .. code-block:: php - - function getName(): string - -Return Values -------------- - -The index name. - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::createIndex()` -- :manual:`listIndexes </reference/command/listIndexes>` command reference in - the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getNamespace.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getNamespace.txt deleted file mode 100644 index 987c8be..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getNamespace.txt +++ /dev/null @@ -1,36 +0,0 @@ -========================================= -MongoDB\\Model\\IndexInfo::getNamespace() -========================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\IndexInfo::getNamespace() - - Return the index namespace, which is the namespace of the collection - containing the index. - - .. code-block:: php - - function getNamespace(): string - -Return Values -------------- - -The index namespace. - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::createIndex()` -- :phpmethod:`MongoDB\\Collection::getNamespace()` -- :manual:`listIndexes </reference/command/listIndexes>` command reference in - the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getVersion.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getVersion.txt deleted file mode 100644 index e2480df..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-getVersion.txt +++ /dev/null @@ -1,34 +0,0 @@ -======================================= -MongoDB\\Model\\IndexInfo::getVersion() -======================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\IndexInfo::getVersion() - - Return the index version. - - .. code-block:: php - - function getVersion(): integer - -Return Values -------------- - -The index version. - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::createIndex()` -- :manual:`listIndexes </reference/command/listIndexes>` command reference in - the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isSparse.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isSparse.txt deleted file mode 100644 index 580e2f6..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isSparse.txt +++ /dev/null @@ -1,37 +0,0 @@ -===================================== -MongoDB\\Model\\IndexInfo::isSparse() -===================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\IndexInfo::isSparse() - - Return whether the index is a :manual:`sparse index </core/index-sparse>`. - This correlates with the ``sparse`` option for - :phpmethod:`MongoDB\\Collection::createIndex()`. - - .. code-block:: php - - function isSparse(): boolean - -Return Values -------------- - -A boolean indicating whether the index is a sparse index. - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::createIndex()` -- :manual:`listIndexes </reference/command/listIndexes>` command reference in - the MongoDB manual -- :manual:`Sparse Indexes </core/index-sparse>` in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isTtl.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isTtl.txt deleted file mode 100644 index f2f16e0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isTtl.txt +++ /dev/null @@ -1,37 +0,0 @@ -================================== -MongoDB\\Model\\IndexInfo::isTtl() -================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\IndexInfo::isTtl() - - Return whether the index is a :manual:`TTL index </core/index-ttl>`. This - correlates with the ``expireAfterSeconds`` option for - :phpmethod:`MongoDB\\Collection::createIndex()`. - - .. code-block:: php - - function isTtl(): boolean - -Return Values -------------- - -A boolean indicating whether the index is a TTL index. - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::createIndex()` -- :manual:`listIndexes </reference/command/listIndexes>` command reference in - the MongoDB manual -- :manual:`TTL Indexes </core/index-ttl>` in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isUnique.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isUnique.txt deleted file mode 100644 index 5fbfa76..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBModelIndexInfo-isUnique.txt +++ /dev/null @@ -1,37 +0,0 @@ -===================================== -MongoDB\\Model\\IndexInfo::isUnique() -===================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\Model\\IndexInfo::isUnique() - - Return whether the index is a :manual:`unique index </core/index-unique>`. - This correlates with the ``unique`` option for - :phpmethod:`MongoDB\\Collection::createIndex()`. - - .. code-block:: php - - function isUnique(): boolean - -Return Values -------------- - -A boolean indicating whether the index is a unique index. - -See Also --------- - -- :phpmethod:`MongoDB\\Collection::createIndex()` -- :manual:`listIndexes </reference/command/listIndexes>` command reference in - the MongoDB manual -- :manual:`Unique Indexes </core/index-unique>` in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getMatchedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getMatchedCount.txt deleted file mode 100644 index f347a8c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getMatchedCount.txt +++ /dev/null @@ -1,49 +0,0 @@ -======================================== -MongoDB\\UpdateResult::getMatchedCount() -======================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\UpdateResult::getMatchedCount() - - Return the number of documents that were matched. - - .. code-block:: php - - function getMatchedCount(): integer - - This method should only be called if the write was acknowledged. - - .. note:: - - If an update/replace operation results in no change to the document - (e.g. setting the value of a field to its current value), the matched - count may be greater than the value returned by - :phpmethod:`getModifiedCount() - <MongoDB\\UpdateResult::getModifiedCount()>`. - -Return Values -------------- - -The number of documents that were matched. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :phpmethod:`MongoDB\\UpdateResult::getModifiedCount()` -- :php:`MongoDB\\Driver\\WriteResult::getMatchedCount() - <manual/en/mongodb-driver-writeresult.getmatchedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getModifiedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getModifiedCount.txt deleted file mode 100644 index 0bd708a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getModifiedCount.txt +++ /dev/null @@ -1,52 +0,0 @@ -========================================= -MongoDB\\UpdateResult::getModifiedCount() -========================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\UpdateResult::getModifiedCount() - - Return the number of documents that were modified. - - .. code-block:: php - - function getModifiedCount(): integer|null - - This method should only be called if the write was acknowledged. - - .. note:: - - If an update/replace operation results in no change to the document - (e.g. setting the value of a field to its current value), the modified - count may be less than the value returned by :phpmethod:`getMatchedCount() - <MongoDB\\UpdateResult::getMatchedCount()>`. - -Return Values -------------- - -The number of documents that were modified. - -The modified count is not available on versions of MongoDB before 2.6, which -used the legacy wire protocol version (i.e. ``OP_UPDATE``). If this is the case, -the modified count will be ``null``. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :phpmethod:`MongoDB\\UpdateResult::getMatchedCount()` -- :php:`MongoDB\\Driver\\WriteResult::getModifiedCount() - <manual/en/mongodb-driver-writeresult.getmodifiedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getUpsertedCount.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getUpsertedCount.txt deleted file mode 100644 index 0bbb39f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getUpsertedCount.txt +++ /dev/null @@ -1,42 +0,0 @@ -========================================= -MongoDB\\UpdateResult::getUpsertedCount() -========================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\UpdateResult::getUpsertedCount() - - Return the number of documents that were upserted. - - .. code-block:: php - - function getUpsertedCount(): integer - - This method should only be called if the write was acknowledged. - -Return Values -------------- - -The total number of documents that were upserted. This should be either ``0`` or -``1`` for an acknowledged update or replace operation, depending on whether an -upsert occurred. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::getUpsertedCount() - <manual/en/mongodb-driver-writeresult.getupsertedcount.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getUpsertedId.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getUpsertedId.txt deleted file mode 100644 index ed948c0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-getUpsertedId.txt +++ /dev/null @@ -1,44 +0,0 @@ -====================================== -MongoDB\\UpdateResult::getUpsertedId() -====================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\UpdateResult::getUpsertedId() - - Return the ID (i.e. ``_id`` field value) of the upserted document. - - .. code-block:: php - - function getUpsertedId(): mixed|null - -Return Values -------------- - -The ID (i.e. ``_id`` field value) of the upserted document. If no document was -upserted, ``null`` will be returned. - -If the document had an ID prior to upserting (i.e. the server did not need to -generate an ID), this will contain its ``_id`` field value. Any server-generated -ID will be a :php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` -instance. - -Errors/Exceptions ------------------ - -.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::getUpsertedIds() - <manual/en/mongodb-driver-writeresult.getupsertedids.php>` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-isAcknowledged.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-isAcknowledged.txt deleted file mode 100644 index af15d1f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/method/MongoDBUpdateResult-isAcknowledged.txt +++ /dev/null @@ -1,34 +0,0 @@ -======================================= -MongoDB\\UpdateResult::isAcknowledged() -======================================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Definition ----------- - -.. phpmethod:: MongoDB\\UpdateResult::isAcknowledged() - - Return whether the write was acknowledged. - - .. code-block:: php - - function isAcknowledged(): boolean - -Return Values -------------- - -A boolean indicating whether the write was acknowledged. - -See Also --------- - -- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged() - <manual/en/mongodb-driver-writeresult.isacknowledged.php>` -- :manual:`Write Concern </reference/write-concern>` in the MongoDB manual diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/write-result-classes.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/write-result-classes.txt deleted file mode 100644 index f410c08..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/reference/write-result-classes.txt +++ /dev/null @@ -1,143 +0,0 @@ -==================== -Write Result Classes -==================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -MongoDB\\BulkWriteResult ------------------------- - -Definition -~~~~~~~~~~ - -.. phpclass:: MongoDB\\BulkWriteResult - - This class contains information about an executed bulk write operation. It - encapsulates a :php:`MongoDB\\Driver\\WriteResult - <class.mongodb-driver-writeresult>` object and is returned from - :phpmethod:`MongoDB\\Collection::bulkWrite()`. - -Methods -~~~~~~~ - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBBulkWriteResult-getDeletedCount - /reference/method/MongoDBBulkWriteResult-getInsertedCount - /reference/method/MongoDBBulkWriteResult-getInsertedIds - /reference/method/MongoDBBulkWriteResult-getMatchedCount - /reference/method/MongoDBBulkWriteResult-getModifiedCount - /reference/method/MongoDBBulkWriteResult-getUpsertedCount - /reference/method/MongoDBBulkWriteResult-getUpsertedIds - /reference/method/MongoDBBulkWriteResult-isAcknowledged - ----- - -MongoDB\\DeleteResult ---------------------- - -Definition -~~~~~~~~~~ - -.. phpclass:: MongoDB\\DeleteResult - - This class contains information about an executed delete operation. It - encapsulates a :php:`MongoDB\\Driver\\WriteResult - <class.mongodb-driver-writeresult>` object and is returned from - :phpmethod:`MongoDB\\Collection::deleteMany()` or - :phpmethod:`MongoDB\\Collection::deleteOne()`. - -Methods -~~~~~~~ - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBDeleteResult-getDeletedCount - /reference/method/MongoDBDeleteResult-isAcknowledged - ----- - -MongoDB\\InsertManyResult -------------------------- - -Definition -~~~~~~~~~~ - -.. phpclass:: MongoDB\\InsertManyResult - - This class contains information about an executed bulk insert operation. It - encapsulates a :php:`MongoDB\\Driver\\WriteResult - <class.mongodb-driver-writeresult>` object and is returned from - :phpmethod:`MongoDB\\Collection::insertMany()`. - -Methods -~~~~~~~ - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBInsertManyResult-getInsertedCount - /reference/method/MongoDBInsertManyResult-getInsertedIds - /reference/method/MongoDBInsertManyResult-isAcknowledged - ----- - -MongoDB\\InsertOneResult ------------------------- - -Definition -~~~~~~~~~~ - -.. phpclass:: MongoDB\\InsertOneResult - - This class contains information about an executed insert operation. It - encapsulates a :php:`MongoDB\\Driver\\WriteResult - <class.mongodb-driver-writeresult>` object and is returned from - :phpmethod:`MongoDB\\Collection::insertOne()`. - -Methods -~~~~~~~ - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBInsertOneResult-getInsertedCount - /reference/method/MongoDBInsertOneResult-getInsertedId - /reference/method/MongoDBInsertOneResult-isAcknowledged - ----- - -MongoDB\\UpdateResult ---------------------- - -Definition -~~~~~~~~~~ - -.. phpclass:: MongoDB\\UpdateResult - - This class contains information about an executed update or replace - operation. It encapsulates a :php:`MongoDB\\Driver\\WriteResult - <class.mongodb-driver-writeresult>` object and is returned from - :phpmethod:`MongoDB\\Collection::replaceOne()`, - :phpmethod:`MongoDB\\Collection::updateMany()`, or - :phpmethod:`MongoDB\\Collection::updateOne()`. - -Methods -~~~~~~~ - -.. toctree:: - :titlesonly: - - /reference/method/MongoDBUpdateResult-getMatchedCount - /reference/method/MongoDBUpdateResult-getModifiedCount - /reference/method/MongoDBUpdateResult-getUpsertedCount - /reference/method/MongoDBUpdateResult-getUpsertedId - /reference/method/MongoDBUpdateResult-isAcknowledged diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial.txt deleted file mode 100644 index 27f3637..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial.txt +++ /dev/null @@ -1,14 +0,0 @@ -Tutorials -========= - -.. default-domain:: mongodb - -.. toctree:: - - /tutorial/crud - /tutorial/collation - /tutorial/commands - /tutorial/decimal128 - /tutorial/gridfs - /tutorial/indexes - /tutorial/example-data diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/collation.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/collation.txt deleted file mode 100644 index 71b28a8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/collation.txt +++ /dev/null @@ -1,373 +0,0 @@ -========= -Collation -========= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -.. versionadded:: 1.1 - -Overview --------- - -MongoDB 3.4 introduced support for :manual:`collations -</manual/reference/collation/>`, which provide a set of rules to comply with the -conventions of a particular language when comparing strings. - -For example, in Canadian French, the last accent in a given word determines the -sorting order. Consider the following French words: - -.. code-block:: none - - cote < coté < côte < côté - -The sort order using the Canadian French collation would result in the -following: - -.. code-block:: none - - cote < côte < coté < côté - -If collation is unspecified, MongoDB uses simple binary comparison for strings. -As such, the sort order of the words would be: - -.. code-block:: none - - cote < coté < côte < côté - -Usage ------ - -You can specify a default collation for collections and indexes when they are -created, or specify a collation for CRUD operations and aggregations. For -operations that support collation, MongoDB uses the collection's default -collation unless the operation specifies a different collation. - -Collation Parameters -~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: php - - 'collation' => [ - 'locale' => <string>, - 'caseLevel' => <boolean>, - 'caseFirst' => <string>, - 'strength' => <integer>, - 'numericOrdering' => <boolean>, - 'alternate' => <string>, - 'maxVariable' => <string>, - 'normalization' => <boolean>, - 'backwards' => <boolean>, - ] - -The only required parameter is ``locale``, which the server parses as an `ICU -format locale ID <http://userguide.icu-project.org/locale>`_. For example, set -``locale`` to ``en_US`` to represent US English or ``fr_CA`` to represent -Canadian French. - -For a complete description of the available parameters, see :manual:`Collation -Document </reference/collation/#collation-document>` in the MongoDB manual. - -Assign a Default Collation to a Collection -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following example creates a new collection called ``contacts`` on the -``test`` database and assigns a default collation with the ``fr_CA`` locale. -Specifying a collation when you create the collection ensures that all -operations involving a query that are run against the ``contacts`` collection -use the ``fr_CA`` collation, unless the query specifies another collation. Any -indexes on the new collection also inherit the default collation, unless the -creation command specifies another collation. - -.. code-block:: php - - <?php - - $database = (new MongoDB\Client)->test; - - $database->createCollection('contacts', [ - 'collation' => ['locale' => 'fr_CA'], - ]); - -Assign a Collation to an Index -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To specify a collation for an index, use the ``collation`` option when you -create the index. - -The following example creates an index on the ``name`` field of the -``address_book`` collection, with the ``unique`` parameter enabled and a default -collation with ``locale`` set to ``en_US``. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->test->address_book; - - $collection->createIndex( - ['first_name' => 1], - [ - 'collation' => ['locale' => 'en_US'], - 'unique' => true, - ] - ); - -To use this index, make sure your queries also specify the same collation. The -following query uses the above index: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->test->address_book; - - $cursor = $collection->find( - ['first_name' => 'Adam'], - [ - 'collation' => ['locale' => 'en_US'], - ] - ); - -The following queries do **NOT** use the index. The first query uses no -collation, and the second uses a collation with a different ``strength`` value -than the collation on the index. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->test->address_book; - - $cursor1 = $collection->find(['first_name' => 'Adam']); - - $cursor2 = $collection->find( - ['first_name' => 'Adam'], - [ - 'collation' => [ - 'locale' => 'en_US', - 'strength' => 2, - ], - ] - ); - -Operations that Support Collation ---------------------------------- - -All reading, updating, and deleting methods support collation. Some examples are -listed below. - -``find()`` with ``sort`` -~~~~~~~~~~~~~~~~~~~~~~~~ - -Individual queries can specify a collation to use when matching and sorting -results. The following query and sort operation uses a German collation with the -``locale`` parameter set to ``de``. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->test->contacts; - - $cursor = $collection->find( - ['city' => 'New York'], - [ - 'collation' => ['locale' => 'de'], - 'sort' => ['name' => 1], - ] - ); - -``findOneAndUpdate()`` -~~~~~~~~~~~~~~~~~~~~~~ - -A collection called ``names`` contains the following documents: - -.. code-block:: javascript - - { "_id" : 1, "first_name" : "Hans" } - { "_id" : 2, "first_name" : "Gunter" } - { "_id" : 3, "first_name" : "Günter" } - { "_id" : 4, "first_name" : "Jürgen" } - -The following :phpmethod:`findOneAndUpdate() -<MongoDB\\Collection::findOneAndUpdate>` operation on the collection does not -specify a collation. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->test->names; - - $document = $collection->findOneAndUpdate( - ['first_name' => ['$lt' =-> 'Gunter']], - ['$set' => ['verified' => true]] - ); - -Because ``Gunter`` is lexically first in the collection, the above operation -returns no results and updates no documents. - -Consider the same :phpmethod:`findOneAndUpdate() -<MongoDB\\Collection::findOneAndUpdate>` operation but with a collation -specified, which uses the locale ``de@collation=phonebook``. - -.. note:: - - Some locales have a ``collation=phonebook`` option available for use with - languages which sort proper nouns differently from other words. According to - the ``de@collation=phonebook`` collation, characters with umlauts come before - the same characters without umlauts. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->test->names; - - $document = $collection->findOneAndUpdate( - ['first_name' => ['$lt' =-> 'Gunter']], - ['$set' => ['verified' => true]], - [ - 'collation' => ['locale' => 'de@collation=phonebook'], - 'returnDocument' => MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER, - ] - ); - -The operation returns the following updated document: - -.. code-block:: javascript - - { "_id" => 3, "first_name" => "Günter", "verified" => true } - -``findOneAndDelete()`` -~~~~~~~~~~~~~~~~~~~~~~ - -Set the ``numericOrdering`` collation parameter to ``true`` to compare numeric -strings by their numeric values. - -The collection ``numbers`` contains the following documents: - -.. code-block:: javascript - - { "_id" : 1, "a" : "16" } - { "_id" : 2, "a" : "84" } - { "_id" : 3, "a" : "179" } - -The following example matches the first document in which field ``a`` has a -numeric value greater than 100 and deletes it. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->test->numbers; - - $document = $collection->findOneAndDelete( - ['a' => ['$gt' =-> '100']], - [ - 'collation' => [ - 'locale' => 'en', - 'numericOrdering' => true, - ], - ] - ); - -After the above operation, the following documents remain in the collection: - -.. code-block:: javascript - - { "_id" : 1, "a" : "16" } - { "_id" : 2, "a" : "84" } - -If you perform the same operation without collation, the server deletes the -first document it finds in which the lexical value of ``a`` is greater than -``"100"``. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->test->numbers; - - $document = $collection->findOneAndDelete(['a' => ['$gt' =-> '100']]); - -After the above operation is executed, the document in which ``a`` was equal to -``"16"`` has been deleted, and the following documents remain in the collection: - -.. code-block:: javascript - - { "_id" : 2, "a" : "84" } - { "_id" : 3, "a" : "179" } - -``deleteMany()`` -~~~~~~~~~~~~~~~~ - -You can use collations with all the various CRUD operations which exist in the -|php-library|. - -The collection ``recipes`` contains the following documents: - -.. code-block:: javascript - - { "_id" : 1, "dish" : "veggie empanadas", "cuisine" : "Spanish" } - { "_id" : 2, "dish" : "beef bourgignon", "cuisine" : "French" } - { "_id" : 3, "dish" : "chicken molé", "cuisine" : "Mexican" } - { "_id" : 4, "dish" : "chicken paillard", "cuisine" : "french" } - { "_id" : 5, "dish" : "pozole verde", "cuisine" : "Mexican" } - -Setting the ``strength`` parameter of the collation document to ``1`` or ``2`` -causes the server to disregard case in the query filter. The following example -uses a case-insensitive query filter to delete all records in which the -``cuisine`` field matches ``French``. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->test->recipes; - - $collection->deleteMany( - ['cuisine' => 'French'], - [ - 'collation' => [ - 'locale' => 'en_US', - 'strength' => 1, - ], - ] - ); - -After the above operation runs, the documents with ``_id`` values of ``2`` and -``4`` are deleted from the collection. - -Aggregation -~~~~~~~~~~~ - -To use collation with an :phpmethod:`aggregate() -<MongoDB\\Collection::aggregate>` operation, specify a collation in the -aggregation options. - -The following aggregation example uses a collection called ``names`` and groups -the ``first_name`` field together, counts the total number of results in each -group, and sorts the results by German phonebook order. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->test->recipes; - - $cursor = $collection->aggregate( - [ - ['$group' => ['_id' => '$first_name', 'name_count' => ['$sum' => 1]]], - ['$sort' => ['_id' => 1]], - ], - [ - 'collation' => ['locale' => 'de@collation=phonebook'], - ] - ); diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/commands.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/commands.txt deleted file mode 100644 index 4b90501..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/commands.txt +++ /dev/null @@ -1,325 +0,0 @@ -========================= -Execute Database Commands -========================= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -Overview --------- - -The |php-library| provides helper methods across the :phpclass:`Client -<MongoDB\\Client>`, :phpclass:`Database <MongoDB\\Database>`, and -:phpclass:`Collection <MongoDB\\Collection>` classes for common -:manual:`database commands </reference/command>`. In addition, the -:phpmethod:`MongoDB\\Database::command()` method may be used to run database -commands that do not have a helper method. - -Execute Database Commands -------------------------- - -Basic Command -~~~~~~~~~~~~~ - -To execute a command on a :program:`mongod` instance, use the -:phpmethod:`MongoDB\\Database::command()` method. For instance, the following -operation uses the :manual:`geoNear </reference/command/geoNear>` command to -search for the three closest documents to longitude ``-74`` and latitude ``40`` -in the ``restos`` collection in the ``example`` database: - -.. code-block:: php - - <?php - - $database = (new MongoDB\Client)->example; - - $cursor = $database->command([ - 'geoNear' => 'restos', - 'near' => [ - 'type' => 'Point', - 'coordinates' => [-74.0, 40.0], - ], - 'spherical' => 'true', - 'num' => 3, - ]); - - $results = $cursor->toArray()[0]; - - var_dump($results); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#27 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["waitedMS"]=> - int(0) - ["results"]=> - object(MongoDB\Model\BSONArray)#25 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - [0]=> - object(MongoDB\Model\BSONDocument)#14 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["dis"]=> - float(39463.618389163) - ["obj"]=> - object(MongoDB\Model\BSONDocument)#13 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#3 (1) { - ["oid"]=> - string(24) "55cba2486c522cafdb059bed" - } - ["location"]=> - object(MongoDB\Model\BSONDocument)#12 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["coordinates"]=> - object(MongoDB\Model\BSONArray)#11 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - [0]=> - float(-74.1641319) - [1]=> - float(39.6686512) - } - } - ["type"]=> - string(5) "Point" - } - } - ["name"]=> - string(32) "Soul Food Kitchen Seafood Heaven" - } - } - } - } - [1]=> - object(MongoDB\Model\BSONDocument)#19 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["dis"]=> - float(50686.851650416) - ["obj"]=> - object(MongoDB\Model\BSONDocument)#18 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#15 (1) { - ["oid"]=> - string(24) "55cba2476c522cafdb0544df" - } - ["location"]=> - object(MongoDB\Model\BSONDocument)#17 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["coordinates"]=> - object(MongoDB\Model\BSONArray)#16 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - [0]=> - float(-74.2566332) - [1]=> - float(40.4109872) - } - } - ["type"]=> - string(5) "Point" - } - } - ["name"]=> - string(20) "Seguine Bagel Bakery" - } - } - } - } - [2]=> - object(MongoDB\Model\BSONDocument)#24 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["dis"]=> - float(58398.379630263) - ["obj"]=> - object(MongoDB\Model\BSONDocument)#23 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#20 (1) { - ["oid"]=> - string(24) "55cba2476c522cafdb053c92" - } - ["location"]=> - object(MongoDB\Model\BSONDocument)#22 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["coordinates"]=> - object(MongoDB\Model\BSONArray)#21 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - [0]=> - float(-74.3731727) - [1]=> - float(40.4404759) - } - } - ["type"]=> - string(5) "Point" - } - } - ["name"]=> - string(17) "Water'S Edge Club" - } - } - } - } - } - } - ["stats"]=> - object(MongoDB\Model\BSONDocument)#26 (1) { - ["storage":"ArrayObject":private]=> - array(5) { - ["nscanned"]=> - int(25139) - ["objectsLoaded"]=> - int(25134) - ["avgDistance"]=> - float(49516.283223281) - ["maxDistance"]=> - float(58398.379630263) - ["time"]=> - int(126) - } - } - ["ok"]=> - float(1) - } - } - -Commands with Custom Read Preference -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some commands, such as :manual:`createUser </reference/command/createUser>`, may -only be executed on a :term:`primary` replica set member or a -:term:`standalone`. - -The command helper methods in the |php-library|, such as -:phpmethod:`MongoDB\\Database::drop()`, know to apply their own :term:`read -preference` if necessary. However, the :phpmethod:`MongoDB\\Database::command()` -method is a generic method and defaults to the read preference of the Database -object on which it is invoked. To execute commands that require a specific read -preference, specify the read preference in the ``$options`` parameter of the -method. - -The following example adds a user to the ``demo`` database and specifies a -custom read preference: - -.. code-block:: php - - <?php - - $db = (new MongoDB\Client)->demo; - - $cursor = $db->command( - [ - 'createUser' => 'username', - 'pwd' => 'password', - 'roles' => ['readWrite'], - ], - [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY), - ] - ); - - var_dump($cursor->toArray()[0]); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#8 (1) { - ["storage":"ArrayObject":private]=> - array(1) { - ["ok"]=> - float(1) - } - } - -View Command Results --------------------- - -View Single Result Documents -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The :phpmethod:`MongoDB\\Database::command()` method returns a -:php:`MongoDB\\Driver\\Cursor <mongodb-driver-cursor>` object. - -Many MongoDB commands return their responses as a single document. To read the -command response, you may either iterate on the cursor and access the first -document, or access the first result in the array, as in the following: - -.. code-block:: php - - <?php - - $database = (new MongoDB\Client)->demo; - - $cursor = $database->command(['ping' => 1]); - - var_dump($cursor->toArray()[0]); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#2 (1) { - ["storage":"ArrayObject":private]=> - array(1) { - ["ok"]=> - float(1) - } - } - -Iterate Results from a Cursor -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some commands, such as :manual:`listCollections -</reference/command/listCollections>`, return their results via an iterable -cursor. To view the results, iterate through the cursor. - -The following example lists the collections in the ``demo`` database by -iterating through the cursor returned by the ``listCollections`` command using a -``foreach`` loop: - -.. code-block:: php - - <?php - - $database = (new MongoDB\Client)->demo; - - $cursor = $database->command(['listCollections' => 1]); - - foreach ($cursor as $collection) { - echo $collection['name'], "\n"; - } - -The output would then be a list of the values for the ``name`` key, for -instance:: - - persons - posts - zips - -.. note:: - - At the *protocol* level, commands that support a cursor return a single - result document with the essential ingredients for constructing the command - cursor (i.e. the cursor's ID, namespace, and the first batch of results). In - the PHP driver implementation, the - :php:`MongoDB\Driver\Manager::executeCommand() - <mongodb-driver-manager.executecommand>` method detects such a result and - constructs the iterable command cursor, which is returned rather than the - base result document. diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/crud.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/crud.txt deleted file mode 100644 index efc82fc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/crud.txt +++ /dev/null @@ -1,727 +0,0 @@ -=============== -CRUD Operations -=============== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - - -CRUD operations *create*, *read*, *update*, and *delete* documents. The -|php-library|'s :phpclass:`MongoDB\\Collection` class implements MongoDB's -cross-driver `CRUD specification -<https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst>`_, -providing access to methods for inserting, finding, updating, and deleting -documents in MongoDB. - -This document provides a general introduction to inserting, querying, updating, -and deleting documents using the |php-library|. The MongoDB Manual's -:manual:`CRUD Section </crud>` provides a more thorough introduction to CRUD -operations with MongoDB. - -Insert Documents ----------------- - -Insert One Document -~~~~~~~~~~~~~~~~~~~ - -The :phpmethod:`MongoDB\\Collection::insertOne()` method inserts a single -document into MongoDB and returns an instance of -:phpclass:`MongoDB\\InsertOneResult`, which you can use to access the ID of the -inserted document. - -.. this uses the insertOne example from the method reference: - -.. include:: /reference/method/MongoDBCollection-insertOne.txt - :start-after: start-crud-include - :end-before: end-crud-include - -The output includes the ID of the inserted document. - -If you include an ``_id`` value when inserting a document, MongoDB checks to -ensure that the ``_id`` value is unique for the collection. If the ``_id`` value -is not unique, the insert operation fails due to a duplicate key error. - -The following example inserts a document while specifying the value for the -``_id``: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->users; - - $insertOneResult = $collection->insertOne(['_id' => 1, 'name' => 'Alice']); - - printf("Inserted %d document(s)\n", $insertOneResult->getInsertedCount()); - - var_dump($insertOneResult->getInsertedId()); - -The output would then resemble:: - - Inserted 1 document(s) - int(1) - -.. seealso:: :phpmethod:`MongoDB\\Collection::insertOne()` - -Insert Many Documents -~~~~~~~~~~~~~~~~~~~~~ - -The :phpmethod:`MongoDB\\Collection::insertMany()` method allows you to insert -multiple documents in one write operation and returns an instance of -:phpclass:`MongoDB\\InsertManyResult`, which you can use to access the IDs of -the inserted documents. - -.. this uses the insertMany example from the method reference: - -.. include:: /reference/method/MongoDBCollection-insertMany.txt - :start-after: start-crud-include - :end-before: end-crud-include - -.. seealso:: :phpmethod:`MongoDB\\Collection::insertMany()` - -Query Documents ---------------- - -The |php-library| provides the :phpmethod:`MongoDB\\Collection::findOne()` and -:phpmethod:`MongoDB\\Collection::find()` methods for querying documents and the -:phpmethod:`MongoDB\\Collection::aggregate()` method for performing -:manual:`aggregation operations </core/aggregation-pipeline>`. - -.. include:: /includes/extracts/note-bson-comparison.rst - -Find One Document -~~~~~~~~~~~~~~~~~ - -:phpmethod:`MongoDB\\Collection::findOne()` returns the :term:`first document -<natural order>` that matches the query or ``null`` if no document matches the -query. - -The following example searches for the document with ``_id`` of ``"94301"``: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - $document = $collection->findOne(['_id' => '94301']); - - var_dump($document); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#13 (1) { - ["storage":"ArrayObject":private]=> - array(5) { - ["_id"]=> - string(5) "94301" - ["city"]=> - string(9) "PALO ALTO" - ["loc"]=> - object(MongoDB\Model\BSONArray)#12 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - [0]=> - float(-122.149685) - [1]=> - float(37.444324) - } - } - ["pop"]=> - int(15965) - ["state"]=> - string(2) "CA" - } - } - -.. note:: - - The criteria in this example matched an ``_id`` with a string value of - ``"94301"``. The same criteria would not have matched a document with an - integer value of ``94301`` due to MongoDB's :manual:`comparison rules for - BSON types </reference/bson-type-comparison-order>`. Similarly, users should - use a :php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object - when matching an ``_id`` with an :manual:`ObjectId </reference/object-id/>` - value, as strings and ObjectIds are not directly comparable. - -.. seealso:: :phpmethod:`MongoDB\\Collection::findOne()` - -Find Many Documents -~~~~~~~~~~~~~~~~~~~ - -:phpmethod:`MongoDB\\Collection::find()` returns a -:php:`MongoDB\\Driver\\Cursor <mongodb-driver-cursor>` object, which you can -iterate upon to access all matched documents. - -The following example lists the documents in the ``zips`` collection with the -specified city and state values: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - $cursor = $collection->find(['city' => 'JERSEY CITY', 'state' => 'NJ']); - - foreach ($cursor as $document) { - echo $document['_id'], "\n"; - } - -The output would resemble:: - - 07302 - 07304 - 07305 - 07306 - 07307 - 07310 - -.. seealso:: :phpmethod:`MongoDB\\Collection::find()` - -.. _php-query-projection: - -Query Projection -~~~~~~~~~~~~~~~~ - -By default, queries in MongoDB return all fields in matching documents. To limit -the amount of data that MongoDB sends to applications, you can include a -:manual:`projection document </tutorial/project-fields-from-query-results>` in -the query operation. - -.. note:: - - MongoDB includes the ``_id`` field by default unless you explicitly exclude - it in a projection document. - -The following example finds restaurants based on the ``cuisine`` and ``borough`` -fields and uses a :manual:`projection -</tutorial/project-fields-from-query-results>` to limit the fields that are -returned. It also limits the results to 5 documents. - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->example->restaurants; - - $cursor = $collection->find( - [ - 'cuisine' => 'Italian', - 'borough' => 'Manhattan', - ], - [ - 'projection' => [ - 'name' => 1, - 'borough' => 1, - 'cuisine' => 1, - ], - 'limit' => 4, - ] - ); - - foreach($cursor as $restaurant) { - var_dump($restaurant); - }; - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#10 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#8 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3f983" - } - ["borough"]=> - string(9) "Manhattan" - ["cuisine"]=> - string(7) "Italian" - ["name"]=> - string(23) "Isle Of Capri Resturant" - } - } - object(MongoDB\Model\BSONDocument)#13 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#12 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3f98d" - } - ["borough"]=> - string(9) "Manhattan" - ["cuisine"]=> - string(7) "Italian" - ["name"]=> - string(18) "Marchis Restaurant" - } - } - object(MongoDB\Model\BSONDocument)#8 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#10 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3f99b" - } - ["borough"]=> - string(9) "Manhattan" - ["cuisine"]=> - string(7) "Italian" - ["name"]=> - string(19) "Forlinis Restaurant" - } - } - object(MongoDB\Model\BSONDocument)#12 (1) { - ["storage":"ArrayObject":private]=> - array(4) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#13 (1) { - ["oid"]=> - string(24) "576023c6b02fa9281da3f9a8" - } - ["borough"]=> - string(9) "Manhattan" - ["cuisine"]=> - string(7) "Italian" - ["name"]=> - string(22) "Angelo Of Mulberry St." - } - } - -Limit, Sort, and Skip Options -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In addition to :ref:`projection criteria <php-query-projection>`, you can -specify options to limit, sort, and skip documents during queries. - -The following example uses the ``limit`` and ``sort`` options to query for the -five most populous zip codes in the United States: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - $cursor = $collection->find( - [], - [ - 'limit' => 5, - 'sort' => ['pop' => -1], - ] - ); - - foreach ($cursor as $document) { - printf("%s: %s, %s\n", $document['_id'], $document['city'], $document['state']); - } - -The output would then resemble:: - - 60623: CHICAGO, IL - 11226: BROOKLYN, NY - 10021: NEW YORK, NY - 10025: NEW YORK, NY - 90201: BELL GARDENS, CA - -Regular Expressions -~~~~~~~~~~~~~~~~~~~ - -Filter criteria may include regular expressions, either by using the -:php:`MongoDB\\BSON\\Regex <mongodb-bson-regex>` class directory or the -:query:`$regex` operator. - -The following example lists documents in the ``zips`` collection where the city -name starts with "garden" and the state is Texas: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - $cursor = $collection->find([ - 'city' => new MongoDB\BSON\Regex('^garden', 'i'), - 'state' => 'TX', - ]); - - foreach ($cursor as $document) { - printf("%s: %s, %s\n", $document['_id'], $document['city'], $document['state']); - } - -The output would then resemble:: - - 78266: GARDEN RIDGE, TX - 79739: GARDEN CITY, TX - 79758: GARDENDALE, TX - -An equivalent filter could be constructed using the :query:`$regex` operator: - -.. code-block:: php - - [ - 'city' => ['$regex' => '^garden', '$options' => 'i'], - 'state' => 'TX', - ] - -.. seealso:: :manual:`$regex </reference/operator/query/regex>` in the MongoDB manual - -Complex Queries with Aggregation -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -MongoDB's :manual:`Aggregation Framework </core/aggregation-pipeline>` allows -you to issue complex queries that filter, transform, and group collection data. -The |php-library|\'s :phpmethod:`MongoDB\\Collection::aggregate()` method -returns a :php:`Traversable <traversable>` object, which you can iterate upon to -access the results of the aggregation operation. Refer to the -:phpmethod:`MongoDB\\Collection::aggregate()` method's :ref:`behavior -reference <php-agg-method-behavior>` for more about the method's output. - -The following example lists the 5 US states with the most zip codes associated -with them: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - $cursor = $collection->aggregate([ - ['$group' => ['_id' => '$state', 'count' => ['$sum' => 1]]], - ['$sort' => ['count' => -1]], - ['$limit' => 5], - ]); - - foreach ($cursor as $state) { - printf("%s has %d zip codes\n", $state['_id'], $state['count']); - } - -The output would then resemble:: - - TX has 1671 zip codes - NY has 1595 zip codes - CA has 1516 zip codes - PA has 1458 zip codes - IL has 1237 zip codes - -.. seealso:: :phpmethod:`MongoDB\\Collection::aggregate()` - -Update Documents ----------------- - -Update One Document -~~~~~~~~~~~~~~~~~~~ - -Use the :phpmethod:`MongoDB\\Collection::updateOne()` method to update a single -document matching a filter. :phpmethod:`MongoDB\\Collection::updateOne()` -returns a :phpclass:`MongoDB\\UpdateResult` object, which you can use to access -statistics about the update operation. - -Update methods have two required parameters: the query filter that identifies -the document or documents to update, and an update document that specifies what -updates to perform. The :phpmethod:`MongoDB\\Collection::updateOne()` reference -describes each parameter in detail. - -The following example inserts two documents into an empty ``users`` collection -in the ``demo`` database using the :phpmethod:`MongoDB\\Collection::insertOne()` -method, and then updates the documents where the value for the ``state`` field -is ``"ny"`` to include a ``country`` field set to ``"us"``: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->users; - $collection->drop(); - - $collection->insertOne(['name' => 'Bob', 'state' => 'ny']); - $collection->insertOne(['name' => 'Alice', 'state' => 'ny']); - $updateResult = $collection->updateOne( - ['state' => 'ny'], - ['$set' => ['country' => 'us']] - ); - - printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); - printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); - -Since the update operation uses the -:phpmethod:`MongoDB\\Collection::updateOne()` method, which updates the first -document to match the filter criteria, the results would then resemble:: - - Matched 1 document(s) - Modified 1 document(s) - -It is possible for a document to match the filter but *not be modified* by an -update, as is the case where the update sets a field's value to its existing -value, as in this example: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->users; - $collection->drop(); - - $collection->insertOne(['name' => 'Bob', 'state' => 'ny']); - $updateResult = $collection->updateOne( - ['name' => 'Bob'], - ['$set' => ['state' => 'ny']] - ); - - printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); - printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); - -The number of matched documents and the number of *modified* documents would -therefore not be equal, and the output from the operation would resemble:: - - Matched 1 document(s) - Modified 0 document(s) - -.. seealso:: - - - :phpmethod:`MongoDB\\Collection::updateOne()` - - :phpmethod:`MongoDB\\Collection::findOneAndUpdate()` - -Update Many Documents -~~~~~~~~~~~~~~~~~~~~~ - -:phpmethod:`MongoDB\\Collection::updateMany()` updates one or more documents -matching the filter criteria and returns a :phpclass:`MongoDB\\UpdateResult` -object, which you can use to access statistics about the update operation. - -Update methods have two required parameters: the query filter that identifies -the document or documents to update, and an update document that specifies what -updates to perform. The :phpmethod:`MongoDB\\Collection::updateMany()` reference -describes each parameter in detail. - -The following example inserts three documents into an empty ``users`` collection -in the ``demo`` database and then uses the :query:`$set` operator to update the -documents matching the filter criteria to include the ``country`` field with -value ``"us"``: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->users; - $collection->drop(); - - $collection->insertOne(['name' => 'Bob', 'state' => 'ny', 'country' => 'us']); - $collection->insertOne(['name' => 'Alice', 'state' => 'ny']); - $collection->insertOne(['name' => 'Sam', 'state' => 'ny']); - $updateResult = $collection->updateMany( - ['state' => 'ny'], - ['$set' => ['country' => 'us']] - ); - - printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); - printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); - -If an update operation results in no change to a document, such as setting the -value of the field to its current value, the number of modified documents can be -less than the number of *matched* documents. Since the update document with -``name`` of ``"Bob"`` results in no changes to the document, the output of the -operation therefore resembles:: - - Matched 3 document(s) - Modified 2 document(s) - -.. seealso:: :phpmethod:`MongoDB\\Collection::updateMany()` - -Replace Documents -~~~~~~~~~~~~~~~~~ - -Replacement operations are similar to update operations, but instead of updating -a document to include new fields or new field values, a replacement operation -replaces the entire document with a new document, but retains the original -document's ``_id`` value. - -The :phpmethod:`MongoDB\\Collection::replaceOne()` method replaces a single -document that matches the filter criteria and returns an instance of -:phpclass:`MongoDB\\UpdateResult`, which you can use to access statistics about -the replacement operation. - -:phpmethod:`MongoDB\\Collection::replaceOne()` has two required parameters: the -query filter that identifies the document or documents to replace, and a -replacement document that will replace the original document in MongoDB. The -:phpmethod:`MongoDB\\Collection::replaceOne()` reference describes each -parameter in detail. - -.. important:: - - Replacement operations replace all of the fields in a document except the - ``_id`` value. To avoid accidentally overwriting or deleting desired fields, - use the :phpmethod:`MongoDB\\Collection::updateOne()` or - :phpmethod:`MongoDB\\Collection::updateMany()` methods to update individual - fields in a document rather than replacing the entire document. - -The following example inserts one document into an empty ``users`` collection in -the ``demo`` database, and then replaces that document with a new one: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->users; - $collection->drop(); - - $collection->insertOne(['name' => 'Bob', 'state' => 'ny']); - $updateResult = $collection->replaceOne( - ['name' => 'Bob'], - ['name' => 'Robert', 'state' => 'ca'] - ); - - printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); - printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); - -The output would then resemble:: - - Matched 1 document(s) - Modified 1 document(s) - -.. seealso:: - - - :phpmethod:`MongoDB\\Collection::replaceOne()` - - :phpmethod:`MongoDB\\Collection::findOneAndReplace()` - -Upsert -~~~~~~ - -Update and replace operations support an :manual:`upsert -</tutorial/update-documents/#upsert-option>` option. When ``upsert`` is ``true`` -*and* no documents match the specified filter, the operation creates a new -document and inserts it. If there *are* matching documents, then the operation -modifies or replaces the matching document or documents. - -When a document is upserted, the ID is accessible via -:phpmethod:`MongoDB\\UpdateResult::getUpsertedId()`. - -The following example uses :phpmethod:`MongoDB\\Collection::updateOne()` with -the ``upsert`` option set to ``true`` and an empty ``users`` collection in the -``demo`` database, therefore inserting the document into the database: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->users; - $collection->drop(); - - $updateResult = $collection->updateOne( - ['name' => 'Bob'], - ['$set' => ['state' => 'ny']], - ['upsert' => true] - ); - - printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); - printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); - printf("Upserted %d document(s)\n", $updateResult->getUpsertedCount()); - - $upsertedDocument = $collection->findOne([ - '_id' => $updateResult->getUpsertedId(), - ]); - - var_dump($upsertedDocument); - -The output would then resemble:: - - Matched 0 document(s) - Modified 0 document(s) - Upserted 1 document(s) - object(MongoDB\Model\BSONDocument)#16 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#15 (1) { - ["oid"]=> - string(24) "57509c4406d7241dad86e7c3" - } - ["name"]=> - string(3) "Bob" - ["state"]=> - string(2) "ny" - } - } - -Delete Documents ----------------- - -Delete One Document -~~~~~~~~~~~~~~~~~~~ - -The :phpmethod:`MongoDB\\Collection::deleteOne()` method deletes a single -document that matches the filter criteria and returns a -:phpclass:`MongoDB\\DeleteResult`, which you can use to access statistics about -the delete operation. - -If multiple documents match the filter criteria, -:phpmethod:`MongoDB\\Collection::deleteOne()` deletes the :term:`first -<natural order>` matching document. - -:phpmethod:`MongoDB\\Collection::deleteOne()` has one required parameter: a -query filter that specifies the document to delete. Refer to the -:phpmethod:`MongoDB\\Collection::deleteOne()` reference for full method -documentation. - -The following operation deletes the first document where the ``state`` field's -value is ``"ny"``: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->users; - $collection->drop(); - - $collection->insertOne(['name' => 'Bob', 'state' => 'ny']); - $collection->insertOne(['name' => 'Alice', 'state' => 'ny']); - $deleteResult = $collection->deleteOne(['state' => 'ny']); - - printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); - -The output would then resemble:: - - Deleted 1 document(s) - -.. seealso:: :phpmethod:`MongoDB\\Collection::deleteOne()` - -Delete Many Documents -~~~~~~~~~~~~~~~~~~~~~ - -:phpmethod:`MongoDB\\Collection::deleteMany()` deletes all of the documents that -match the filter criteria and returns a :phpclass:`MongoDB\\DeleteResult`, which -you can use to access statistics about the delete operation. - -:phpmethod:`MongoDB\\Collection::deleteMany()` has one required parameter: a -query filter that specifies the document to delete. Refer to the -:phpmethod:`MongoDB\\Collection::deleteMany()` reference for full method -documentation. - -The following operation deletes all of the documents where the ``state`` field's -value is ``"ny"``: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->users; - $collection->drop(); - - $collection->insertOne(['name' => 'Bob', 'state' => 'ny']); - $collection->insertOne(['name' => 'Alice', 'state' => 'ny']); - $deleteResult = $collection->deleteMany(['state' => 'ny']); - - printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); - -The output would then resemble:: - - Deleted 2 document(s) - -.. seealso:: :phpmethod:`MongoDB\\Collection::deleteMany()` diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/decimal128.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/decimal128.txt deleted file mode 100644 index 03272a8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/decimal128.txt +++ /dev/null @@ -1,124 +0,0 @@ -========== -Decimal128 -========== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -Overview --------- - -MongoDB 3.4 introduced support for a :manual:`Decimal128 BSON type -</manual/release-notes/3.4/#decimal-type>`, which is a 128-bit decimal-based -floating-point value capable of emulating decimal rounding with exact precision. -This functionality is intended for applications that handle :manual:`monetary -data </tutorial/model-monetary-data>`, such as financial and tax computations. - -The :php:`MongoDB\BSON\Decimal128 <mongodb-bson-decimal128>` class, which was -introduced in :php:`PHP driver <mongodb>` 1.2.0, may be used to work with this -type in PHP. - -Working with Decimal128 Values ------------------------------- - -Inserting a Decimal128 -~~~~~~~~~~~~~~~~~~~~~~ - -The following example inserts a value of type ``Decimal128`` into the ``price`` -field of a collection named ``inventory``: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->inventory; - - $collection->insertOne([ - '_id' => 1, - 'item' => '26-inch monitor', - 'price' => new MongoDB\BSON\Decimal128('428.79'), - ]); - - $item = $collection->findOne(['_id' => 1]); - - var_dump($item); - -The output would then resemble:: - - object(MongoDB\Model\BSONDocument)#9 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["_id"]=> - int(1) - ["item"]=> - string(15) "26-inch monitor" - ["price"]=> - object(MongoDB\BSON\Decimal128)#13 (1) { - ["dec"]=> - string(6) "428.79" - } - } - } - -Mathematical Operations with BCMath -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The :php:`PHP driver <mongodb>` does not provide any functionality for working -with ``Decimal128`` values; however, the string representation of a -:php:`MongoDB\BSON\Decimal128 <mongodb-bson-decimal128>` object may be used -with PHP's :php:`BCMath <bcmath>` extension. - -The following example adds two ``Decimal128`` values and creates a new -``Decimal128`` value with the result from :php:`bcadd() <bcadd>`: - -.. code-block:: php - - <?php - - $lhs = new MongoDB\BSON\Decimal128('1.234'); - $rhs = new MongoDB\BSON\Decimal128('5.678'); - $sum = new MongoDB\BSON\Decimal128(bcadd($lhs, $rhs)); - - var_dump($sum); - -The output would then resemble:: - - object(MongoDB\BSON\Decimal128)#4 (1) { - ["dec"]=> - string(1) "6" - } - -This does not match the expected result of "6.912". Each operation in the BCMath -API uses a scale to determine the number of decimal digits in the result. The -default scale is zero, which is why the above example produces a result with no -decimal precision. - -In the following example, we use a scale of three for :php:`bcadd() <bcadd>` to -obtain the expected result: - -.. code-block:: php - - <?php - - $lhs = new MongoDB\BSON\Decimal128('1.234'); - $rhs = new MongoDB\BSON\Decimal128('5.678'); - $sum = new MongoDB\BSON\Decimal128(bcadd($lhs, $rhs, 3)); - - var_dump($sum); - -The output would then resemble:: - - object(MongoDB\BSON\Decimal128)#4 (1) { - ["dec"]=> - string(5) "6.912" - } - -In lieu of specifying a scale for each operation, a default scale may be set via -:php:`bcscale() <bcscale>` or the :php:`bcmath.scale INI setting -<manual/en/bc.configuration.php#ini.bcmath.scale>`. The ``Decimal128`` type -supports up to 34 decimal digits (i.e. significant digits). diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/example-data.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/example-data.txt deleted file mode 100644 index 9d4bba9..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/example-data.txt +++ /dev/null @@ -1,42 +0,0 @@ -============ -Example Data -============ - -.. default-domain:: mongodb - -Some examples in this documentation use example data fixtures from -`zips.json <http://media.mongodb.org/zips.json>`_. This is a dataset comprised -of United States postal codes, populations, and geographic locations. - -Importing the dataset into MongoDB can be done in several ways. The following -example uses the :php:`driver <mongodb>` directly: - -.. code-block:: php - - <?php - - $file = 'http://media.mongodb.org/zips.json'; - $zips = file($file, FILE_IGNORE_NEW_LINES); - - $bulk = new MongoDB\Driver\BulkWrite; - - foreach ($zips as $string) { - $document = json_decode($string); - $bulk->insert($document); - } - - $manager = new MongoDB\Driver\Manager('mongodb://127.0.0.1/'); - - $result = $manager->executeBulkWrite('demo.zips', $bulk); - printf("Inserted %d documents\n", $result->getInsertedCount()); - -The output would then resemble:: - - Inserted 29353 documents - -You may also import the dataset using :manual:`mongoimport -</reference/program/mongoimport>`, which is included with MongoDB: - -.. code-block:: none - - $ mongoimport --db demo --collection zips --file zips.json --drop diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/gridfs.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/gridfs.txt deleted file mode 100644 index d302fcb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/gridfs.txt +++ /dev/null @@ -1,214 +0,0 @@ -====== -GridFS -====== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -:manual:`GridFS </core/gridfs>` is a specification for storing and retrieving -files in MongoDB. GridFS uses two collections to store files. One collection -stores the file chunks (e.g. ``fs.chunks``), and the other stores file metadata -(e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class provides an -interface around these collections for working with the files as PHP -:php:`Streams <stream>`. - -Creating a GridFS Bucket ------------------------- - -You can construct a GridFS bucket using the PHP extension's -:php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class, or select -a bucket from the |php-library|'s :phpclass:`MongoDB\\Database` class via the -:phpmethod:`selectGridFSBucket() <MongoDB\\Database::selectGridFSBucket>` -method. - -The bucket can be constructed with various options: - - - ``bucketName`` determines the prefix for the buckey's metadata and chunk - collections. The default value is ``"fs"``. - - ``chunkSizeBytes`` determines the size of each chunk. GridFS divides the - file into chunks of this length, except for the last, which is only as large - as needed. The default size is ``261120`` (i.e. 255 KiB). - - ``readConcern``, ``readPreference`` and ``writeConcern`` options can be used - to specify defaults for read and write operations, much like the - :phpclass:`MongoDB\\GridFS\\Collection` options. - -Uploading Files with Writable Streams -------------------------------------- - -To upload a file to GridFS using a writable stream, you can either open a stream -and write to it directly or write the entire contents of another readable stream -to GridFS all at once. - -To open an upload stream and write to it: - -.. code-block:: php - - <?php - - $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); - - $stream = $bucket->openUploadStream('my-file.txt'); - - $contents = file_get_contents('/path/to/my-file.txt'); - fwrite($stream, $contents); - fclose($stream); - -To upload the entire contents of a readable stream in one call: - -.. code-block:: php - - <?php - - $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); - - $file = fopen('/path/to/my-file.txt', 'rb'); - $bucket->uploadFromStream('my-file.txt', $file); - -Downloading Files with Readable Streams ---------------------------------------- - -To download a file from GridFS using a readable stream, you can either open a -stream and read from it directly or download the entire file all at once. - -To open a download stream and read from it: - -.. code-block:: php - - <?php - - // In practice, $fileId denotes the _id of an existing file in GridFS - $fileId = new MongoDB\BSON\ObjectId; - - $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); - - $stream = $bucket->openDownloadStream($fileId); - $contents = stream_get_contents($stream); - -To download the file all at once and write it to a writable stream: - -.. code-block:: php - - <?php - - // In practice, $fileId denotes the _id of an existing file in GridFS - $fileId = new MongoDB\BSON\ObjectId; - - $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); - - $file = fopen('/path/to/my-output-file.txt', 'wb'); - - $bucket->downloadToStream($fileId, $file); - -Selecting Files by Filename and Revision ----------------------------------------- - -You can also download a file specified by filename and (optionally) revision -number. Revision numbers are used to distinguish between files sharing the same -``filename`` metadata field, ordered by date of upload (i.e. the ``uploadDate`` -metadata field). The ``revision`` option accepted by -:phpmethod:`openDownloadStreamByName() -<MongoDB\\GridFS\\Bucket::openDownloadStreamByName>` and -:phpmethod:`downloadToStreamByName() -<MongoDB\\GridFS\\Bucket::downloadToStreamByName>` can be positive or negative. - -A positive ``revision`` number may be used to select files in order of the -oldest upload date. A revision of ``0`` would denote the file with the oldest -upload date, a revision of ``1`` would denote the second oldest upload, and so -on. - -A negative revision may be used to select files in order of the most recent -upload date. A revision of ``-1`` would denote a file with the most recent -upload date, a revision of ``-2`` would denote the second most recent upload, -and so on. The ``revision`` option defaults to ``-1`` if not specified. - -The following example downloads the contents of the oldest version of a -particular file: - -.. code-block:: php - - <?php - - $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); - - $stream = $bucket->openDownloadStreamByName('my-file.txt', ['revision' => 0]); - $contents = stream_get_contents($stream); - -Deleting Files --------------- - -You can delete a GridFS file by its ``_id``. - -.. code-block:: php - - <?php - - // In practice, $fileId denotes the _id of an existing file in GridFS - $fileId = new MongoDB\BSON\ObjectId; - - $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); - - $bucket->delete($fileId); - -Finding File Metadata ---------------------- - -The :phpmethod:`find() <MongoDB\\GridFS\\Bucket::find>` method allows you to -retrieve documents from the GridFS files collection, which contain metadata -about the GridFS files. - -.. code-block:: php - - <?php - - $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); - - $cursor = $bucket->find(['filename' => 'my-file.txt']); - -Accessing File Metadata for an Existing Stream ----------------------------------------------- - -The :phpmethod:`getFileDocumentForStream() -<MongoDB\\GridFS\\Bucket::getFileDocumentForStream>` method may be used to get -the file document for an existing readable or writable GridFS stream. - -.. code-block:: php - - <?php - - // In practice, $fileId denotes the _id of an existing file in GridFS - $fileId = new MongoDB\BSON\ObjectId; - - $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); - - $stream = $bucket->openDownloadStream($fileId); - $metadata = $bucket->getFileDocumentForStream($stream); - -.. note:: - - Since the file document for a writable stream is not committed to MongoDB - until the stream is closed, - :phpmethod:`getFileDocumentForStream() - <MongoDB\\GridFS\\Bucket::getFileDocumentForStream>` can only return an - in-memory document, which will be missing some fields (e.g. ``length``, - ``md5``). - -The :phpmethod:`getFileIdForStream() -<MongoDB\\GridFS\\Bucket::getFileIdForStream>` method may be used to get the -``_id`` for an existing readable or writable GridFS stream. This is a -convenience for accessing the ``_id`` property of the object returned by -:phpmethod:`getFileDocumentForStream() -<MongoDB\\GridFS\\Bucket::getFileDocumentForStream>`. - -.. code-block:: php - - <?php - - $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); - - $stream = $bucket->openDownloadStreamByName('my-file.txt'); - $fileId = $bucket->getFileIdForStream($stream); diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/indexes.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/indexes.txt deleted file mode 100644 index 733bfb4..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/indexes.txt +++ /dev/null @@ -1,133 +0,0 @@ -======= -Indexes -======= - -.. default-domain:: mongodb - -Indexes support the efficient execution of queries in MongoDB. Without indexes, -MongoDB must perform a *collection scan*, i.e. scan every document in a -collection, to select those documents that match the query statement. If an -appropriate index exists for a query, MongoDB can use the index to limit the -number of documents it must inspect. - -The PHP driver supports managing indexes through the -:phpclass:`MongoDB\\Collection` class, which implements MongoDB's -cross-driver `Index Management -<https://github.com/mongodb/specifications/blob/master/source/index-management.rst>`_ -and `Enumerating Indexes -<https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst>`_ -specifications. - -This document provides an introduction to creating, listing, and dropping -indexes using the |php-library|. The MongoDB Manual's :manual:`Indexes -</indexes>` reference provides more thorough information about indexing in -MongoDB. - -Create Indexes --------------- - -Create indexes with the :phpmethod:`MongoDB\\Collection::createIndex()` or -:phpmethod:`MongoDB\\Collection::createIndexes()` methods. Refer to the method -reference for more details about each method. - -The following example creates an ascending index on the ``state`` field using -the :phpmethod:`createIndex() <MongoDB\\Collection::createIndex>` method: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - $result = $collection->createIndex(['state' => 1]); - - var_dump($result); - -When you create an index, the method returns its name, which is automatically -generated from its specification. The above example would output something -similar to:: - - string(7) "state_1" - -List Indexes ------------- - -The :phpmethod:`MongoDB\\Collection::listIndexes()` method provides information -about the indexes in a collection. The -:phpmethod:`MongoDB\\Collection::listIndexes()` method returns an iterator of -:phpclass:`MongoDB\\Model\\IndexInfo` objects, which you can use to view -information about each index. Refer to the method reference for more details. - -The following example lists all indexes in the ``zips`` collection in the -``demo`` database: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - foreach ($collection->listIndexes() as $indexInfo) { - var_dump($indexInfo); - } - -The output would resemble:: - - object(MongoDB\Model\IndexInfo)#10 (4) { - ["v"]=> - int(1) - ["key"]=> - array(1) { - ["_id"]=> - int(1) - } - ["name"]=> - string(4) "_id_" - ["ns"]=> - string(9) "demo.zips" - } - object(MongoDB\Model\IndexInfo)#13 (4) { - ["v"]=> - int(1) - ["key"]=> - array(1) { - ["state"]=> - int(1) - } - ["name"]=> - string(7) "state_1" - ["ns"]=> - string(9) "demo.zips" - } - -Drop Indexes ------------- - -The :phpmethod:`MongoDB\\Collection::dropIndex()` method lets you drop a single -index while :phpmethod:`MongoDB\\Collection::dropIndexes()` drops all of the -indexes on a collection. Refer to the method reference for more details about -each method. - -The following example drops a single index by its name, ``state_1``: - -.. code-block:: php - - <?php - - $collection = (new MongoDB\Client)->demo->zips; - - $result = $collection->dropIndex('state_1'); - - var_dump($result); - -The operation's output would resemble:: - - object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["nIndexesWas"]=> - int(2) - ["ok"]=> - float(1) - } - } diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/install-php-library.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/install-php-library.txt deleted file mode 100644 index 0c4098a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/tutorial/install-php-library.txt +++ /dev/null @@ -1,58 +0,0 @@ -========================= -Install the |php-library| -========================= - -.. default-domain:: mongodb - -Prerequisites -------------- - -The |php-library| is a high-level abstraction for the MongoDB PHP driver. As -such, you must install the `mongodb` extension to use the library. - -:php:`Installing the MongoDB PHP Driver <manual/en/mongodb.installation.php>` -describes how to install the `mongodb` extension for PHP. Instructions for -installing the driver for HHVM may be found in the :php:`Installation with HHVM -<manual/en/mongodb.installation.hhvm>` article. - -Procedure ---------- - -Install the Library -~~~~~~~~~~~~~~~~~~~ - -The preferred method of installing |php-library| is with `Composer -<https://getcomposer.org/>`_ by running the following from your project -root: - -.. code-block:: sh - - composer require mongodb/mongodb - -While not recommended, you may also manually install the package via -the source tarballs attached to the `GitHub releases -<https://github.com/mongodb/mongo-php-library/releases>`_. - -Configure Autoloading -~~~~~~~~~~~~~~~~~~~~~ - -Once you have installed the library, ensure that your application -includes Composer's autoloader. The ``require_once`` -statement should point to Composer's autoloader, as in the following example: - -.. code-block:: php - - require_once __DIR__ . "/vendor/autoload.php"; - -Refer to Composer's `autoloading documentation -<https://getcomposer.org/doc/01-basic-usage.md#autoloading>`_ for more -information about setting up autoloading. - -If you installed the library manually from a source tarball, you -will also need to manually configure autoloading: - -#. Map the top-level ``MongoDB\`` namespace to the ``src/`` directory - using your preferred autoloader implementation. - -#. Manually require the ``src/functions.php`` file, since PHP does not - yet support function autoloading. diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/docs/upgrade.txt b/boilerplate/test/src/vendor/mongodb/mongodb/docs/upgrade.txt deleted file mode 100644 index 693b1e5..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/docs/upgrade.txt +++ /dev/null @@ -1,260 +0,0 @@ -============= -Upgrade Guide -============= - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -Overview --------- - -The |php-library| and underlying :php:`mongodb extension <mongodb>` have notable -API differences from the legacy :php:`mongo extension <mongo>`. This page will -summarize those differences for the benefit of those upgrading from the legacy -driver. - -Additionally, a community-developed `mongo-php-adapter -<https://github.com/alcaeus/mongo-php-adapter>`_ library exists, which -implements the `mongo extension <http://php.net/mongo>`_ API using this library -and the new driver. While this adapter library is not officially supported by -MongoDB, it does bear mentioning. - -Collection API --------------- - -This library's :phpclass:`MongoDB\\Collection` class implements MongoDB's -cross-driver `CRUD -<https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst>`_ -and `Index Management -<https://github.com/mongodb/specifications/blob/master/source/index-management.rst>`_ -specifications. Although some method names have changed in accordance with the -new specifications, the new class provides the same functionality as the legacy -driver's :php:`MongoCollection <mongocollection>` class with some notable -exceptions. - -Old and New Methods -~~~~~~~~~~~~~~~~~~~ - -.. list-table:: - :header-rows: 1 - - * - :php:`MongoCollection <mongocollection>` - - :phpclass:`MongoDB\\Collection` - - * - :php:`MongoCollection::aggregate() <mongocollection.aggregate>` - - :phpmethod:`MongoDB\\Collection::aggregate()` - - * - :php:`MongoCollection::aggregateCursor() <mongocollection.aggregatecursor>` - - :phpmethod:`MongoDB\\Collection::aggregate()` - - * - :php:`MongoCollection::batchInsert() <mongocollection.batchinsert>` - - :phpmethod:`MongoDB\\Collection::insertMany()` - - * - :php:`MongoCollection::count() <mongocollection.count>` - - :phpmethod:`MongoDB\\Collection::count()` - - * - :php:`MongoCollection::createDBRef() <mongocollection.createdbref>` - - Not yet implemented. See :issue:`PHPLIB-24`. - - * - :php:`MongoCollection::createIndex() <mongocollection.createindex>` - - :phpmethod:`MongoDB\\Collection::createIndex()` - - * - :php:`MongoCollection::deleteIndex() <mongocollection.deleteindex>` - - :phpmethod:`MongoDB\\Collection::dropIndex()` - - * - :php:`MongoCollection::deleteIndexes() <mongocollection.deleteindexes>` - - :phpmethod:`MongoDB\\Collection::dropIndexes()` - - * - :php:`MongoCollection::drop() <mongocollection.drop>` - - :phpmethod:`MongoDB\\Collection::drop()` - - * - :php:`MongoCollection::distinct() <mongocollection.distinct>` - - :phpmethod:`MongoDB\\Collection::distinct()` - - * - :php:`MongoCollection::ensureIndex() <mongocollection.ensureindex>` - - :phpmethod:`MongoDB\\Collection::createIndex()` - - * - :php:`MongoCollection::find() <mongocollection.find>` - - :phpmethod:`MongoDB\\Collection::find()` - - * - :php:`MongoCollection::findAndModify() <mongocollection.findandmodify>` - - :phpmethod:`MongoDB\\Collection::findOneAndDelete()`, - :phpmethod:`MongoDB\\Collection::findOneAndReplace()`, and - :phpmethod:`MongoDB\\Collection::findOneAndUpdate()` - - * - :php:`MongoCollection::findOne() <mongocollection.findone>` - - :phpmethod:`MongoDB\\Collection::findOne()` - - * - :php:`MongoCollection::getDBRef() <mongocollection.getdbref>` - - Not implemented. See :issue:`PHPLIB-24`. - - * - :php:`MongoCollection::getIndexInfo() <mongocollection.getindexinfo>` - - :phpmethod:`MongoDB\\Collection::listIndexes()` - - * - :php:`MongoCollection::getName() <mongocollection.getname>` - - :phpmethod:`MongoDB\\Collection::getCollectionName()` - - * - :php:`MongoCollection::getReadPreference() <mongocollection.getreadpreference>` - - Not implemented. - - * - :php:`MongoCollection::getSlaveOkay() <mongocollection.getslaveokay>` - - Not implemented. - - * - :php:`MongoCollection::getWriteConcern() <mongocollection.getwriteconcern>` - - Not implemented. - - * - :php:`MongoCollection::group() <mongocollection.group>` - - Not yet implemented. See :issue:`PHPLIB-177`. - Use :phpmethod:`MongoDB\\Database::command()`. - - * - :php:`MongoCollection::insert() <mongocollection.insert>` - - :phpmethod:`MongoDB\\Collection::insertOne()` - - * - :php:`MongoCollection::parallelCollectionScan() <mongocollection.parallelcollectionscan>` - - Not implemented. - - * - :php:`MongoCollection::remove() <mongocollection.remove>` - - :phpmethod:`MongoDB\\Collection::deleteMany()` and - :phpmethod:`MongoDB\\Collection::deleteOne()` - - * - :php:`MongoCollection::save() <mongocollection.save>` - - :phpmethod:`MongoDB\\Collection::insertOne()` or - :phpmethod:`MongoDB\\Collection::replaceOne()` with the ``upsert`` - option. - - * - :php:`MongoCollection::setReadPreference() <mongocollection.setreadpreference>` - - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()` - - * - :php:`MongoCollection::setSlaveOkay() <mongocollection.getslaveokay>` - - Not implemented. - - * - :php:`MongoCollection::setWriteConcern() <mongocollection.setwriteconcern>` - - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()` - - * - :php:`MongoCollection::update() <mongocollection.update>` - - :phpmethod:`MongoDB\\Collection::replaceOne()`, - :phpmethod:`MongoDB\\Collection::updateMany()`, and - :phpmethod:`MongoDB\\Collection::updateOne()`. - - * - :php:`MongoCollection::validate() <mongocollection.validate>` - - Not implemented. - -A guiding principle in designing the new APIs was that explicit method names are -preferable to overloaded terms found in the old API. For instance, -:php:`MongoCollection::save() <mongocollection.save>` and -:php:`MongoCollection::findAndModify() <mongocollection.findandmodify>` -have different modes of operation, depending on their arguments. Methods were -also split to distinguish between :manual:`updating specific fields -</tutorial/modify-documents>` and :manual:`full-document replacement -</tutorial/modify-documents/#replace-the-document>`. - -Group Command Helper --------------------- - -:phpclass:`MongoDB\\Collection` does not yet have a helper method for the -:manual:`group </reference/command/group>` command; however, it is planned in -:issue:`PHPLIB-177`. The following example demonstrates how to execute a group -command using the :phpmethod:`MongoDB\\Database::command()` method: - -.. code-block:: php - - <?php - - $database = (new MongoDB\Client)->selectDatabase('db_name'); - $cursor = $database->command([ - 'group' => [ - 'ns' => 'collection_name', - 'key' => ['field_name' => 1], - 'initial' => ['total' => 0], - '$reduce' => new MongoDB\BSON\Javascript('...'), - ], - ]); - - $resultDocument = $cursor->toArray()[0]; - -MapReduce Command Helper ------------------------- - -:phpclass:`MongoDB\\Collection` does not yet have a helper method for the -:manual:`mapReduce </reference/command/mapReduce>` command; however, that is -planned in :issue:`PHPLIB-53`. The following example demonstrates how to execute -a mapReduce command using the :phpmethod:`MongoDB\\Database::command()` method: - -.. code-block:: php - - <?php - - $database = (new MongoDB\Client)->selectDatabase('db_name'); - $cursor = $database->command([ - 'mapReduce' => 'collection_name', - 'map' => new MongoDB\BSON\Javascript('...'), - 'reduce' => new MongoDB\BSON\Javascript('...'), - 'out' => 'output_collection_name', - ]); - - $resultDocument = $cursor->toArray()[0]; - -DBRef Helpers -------------- - -:phpclass:`MongoDB\\Collection` does not yet have helper methods for working -with :manual:`DBRef </reference/database-references>` objects; however, that is -planned in :issue:`PHPLIB-24`. - -MongoCollection::save() Removed -------------------------------- - -:php:`MongoCollection::save() <mongocollection.save>`, which was syntactic sugar -for an insert or upsert operation, has been removed in favor of explicitly using -:phpmethod:`MongoDB\\Collection::insertOne` or -:phpmethod:`MongoDB\\Collection::replaceOne` (with the ``upsert`` option). - -.. .. figure:: /images/save-flowchart.png -.. :alt: save() flowchart - -While the ``save`` method does have its uses for interactive environments, such -as the mongo shell, it was intentionally excluded from the `CRUD specification -<https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst>`_ -for language drivers. Generally, application code should know if the document -has an identifier and be able to explicitly insert or replace the document and -handle the returned :phpclass:`MongoDB\\InsertOneResult` or -:phpclass:`MongoDB\\UpdateResult`, respectively. This also helps avoid -inadvertent and potentially dangerous :manual:`full-document replacements -</tutorial/modify-documents>`. - -Accessing IDs of Inserted Documents -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In the legacy driver, :php:`MongoCollection::insert() <mongocollection.insert>`, -:php:`MongoCollection::batchInsert() <mongocollection.batchinsert`, and -:php:`MongoCollection::save() <mongocollection.save>` (when inserting) would -modify their input argument by injecting an ``_id`` key with a generated -ObjectId (i.e. :php:`MongoId <class.mongoid>` object). This behavior was a bit -of a hack, as it did not rely on the argument being :php:`passed by reference -<language.references.pass>`; instead, it directly modified memory through the -extension API and could not be implemented in PHP userland. As such, it is no -longer done in the new driver and library. - -IDs of inserted documents (whether generated or not) may be accessed through the -following methods on the write result objects: - -- :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()` for - :phpmethod:`MongoDB\\Collection::insertOne()` -- :phpmethod:`MongoDB\\InsertManyResult::getInsertedIds()` for - :phpmethod:`MongoDB\\Collection::insertMany()` -- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()` for - :phpmethod:`MongoDB\\Collection::bulkWrite()` - -Bulk Write Operations ---------------------- - -The legacy driver's :php:`MongoWriteBatch <class.mongowritebatch>` classes have -been replaced with a general-purpose -:phpmethod:`MongoDB\\Collection::bulkWrite()` method. Whereas the legacy driver -only allowed bulk operations of the same type, the new method allows operations -to be mixed (e.g. inserts, updates, and deletes). diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/phpunit.xml.dist b/boilerplate/test/src/vendor/mongodb/mongodb/phpunit.xml.dist deleted file mode 100644 index 1ec848b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/phpunit.xml.dist +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<phpunit - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.3/phpunit.xsd" - backupGlobals="false" - backupStaticAttributes="false" - colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - stopOnFailure="false" - syntaxCheck="false" - bootstrap="tests/bootstrap.php" -> - - <php> - <ini name="error_reporting" value="-1"/> - <env name="MONGODB_URI" value="mongodb://127.0.0.1:27017/?serverSelectionTimeoutMS=100"/> - <env name="MONGODB_DATABASE" value="phplib_test"/> - </php> - - <testsuites> - <testsuite name="MongoDB CRUD Test Suite"> - <directory>./tests/</directory> - </testsuite> - </testsuites> -</phpunit> diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/BulkWriteResult.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/BulkWriteResult.php deleted file mode 100644 index 891e97c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/BulkWriteResult.php +++ /dev/null @@ -1,189 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB; - -use MongoDB\Driver\WriteResult; -use MongoDB\Exception\BadMethodCallException; - -/** - * Result class for a bulk write operation. - */ -class BulkWriteResult -{ - private $writeResult; - private $insertedIds; - private $isAcknowledged; - - /** - * Constructor. - * - * @param WriteResult $writeResult - * @param mixed[] $insertedIds - */ - public function __construct(WriteResult $writeResult, array $insertedIds) - { - $this->writeResult = $writeResult; - $this->insertedIds = $insertedIds; - $this->isAcknowledged = $writeResult->isAcknowledged(); - } - - /** - * Return the number of documents that were deleted. - * - * This method should only be called if the write was acknowledged. - * - * @see BulkWriteResult::isAcknowledged() - * @return integer - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getDeletedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getDeletedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return the number of documents that were inserted. - * - * This method should only be called if the write was acknowledged. - * - * @see BulkWriteResult::isAcknowledged() - * @return integer - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getInsertedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getInsertedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return a map of the inserted documents' IDs. - * - * The index of each ID in the map corresponds to each document's position - * in the bulk operation. If a document had an ID prior to inserting (i.e. - * the driver did not generate an ID), the index will contain its "_id" - * field value. Any driver-generated ID will be a MongoDB\BSON\ObjectID - * instance. - * - * @return mixed[] - */ - public function getInsertedIds() - { - return $this->insertedIds; - } - - /** - * Return the number of documents that were matched by the filter. - * - * This method should only be called if the write was acknowledged. - * - * @see BulkWriteResult::isAcknowledged() - * @return integer - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getMatchedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getMatchedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return the number of documents that were modified. - * - * This value is undefined (i.e. null) if the write executed as a legacy - * operation instead of command. - * - * This method should only be called if the write was acknowledged. - * - * @see BulkWriteResult::isAcknowledged() - * @return integer|null - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getModifiedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getModifiedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return the number of documents that were upserted. - * - * This method should only be called if the write was acknowledged. - * - * @see BulkWriteResult::isAcknowledged() - * @return integer - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getUpsertedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getUpsertedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return a map of the upserted documents' IDs. - * - * The index of each ID in the map corresponds to each document's position - * in bulk operation. If a document had an ID prior to upserting (i.e. the - * server did not need to generate an ID), this will contain its "_id". Any - * server-generated ID will be a MongoDB\BSON\ObjectID instance. - * - * This method should only be called if the write was acknowledged. - * - * @see BulkWriteResult::isAcknowledged() - * @return mixed[] - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getUpsertedIds() - { - if ($this->isAcknowledged) { - return $this->writeResult->getUpsertedIds(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return whether this update was acknowledged by the server. - * - * If the update was not acknowledged, other fields from the WriteResult - * (e.g. matchedCount) will be undefined. - * - * @return boolean - */ - public function isAcknowledged() - { - return $this->isAcknowledged; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Client.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Client.php deleted file mode 100644 index 067926a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Client.php +++ /dev/null @@ -1,215 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB; - -use MongoDB\Driver\Manager; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Driver\Exception\InvalidArgumentException as DriverInvalidArgumentException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnexpectedValueException; -use MongoDB\Exception\UnsupportedException; -use MongoDB\Model\DatabaseInfoIterator; -use MongoDB\Operation\DropDatabase; -use MongoDB\Operation\ListDatabases; - -class Client -{ - private static $defaultTypeMap = [ - 'array' => 'MongoDB\Model\BSONArray', - 'document' => 'MongoDB\Model\BSONDocument', - 'root' => 'MongoDB\Model\BSONDocument', - ]; - private static $wireVersionForWritableCommandWriteConcern = 5; - - private $manager; - private $uri; - private $typeMap; - private $writeConcern; - - /** - * Constructs a new Client instance. - * - * This is the preferred class for connecting to a MongoDB server or - * cluster of servers. It serves as a gateway for accessing individual - * databases and collections. - * - * Supported driver-specific options: - * - * * typeMap (array): Default type map for cursors and BSON documents. - * - * Other options are documented in MongoDB\Driver\Manager::__construct(). - * - * @see http://docs.mongodb.org/manual/reference/connection-string/ - * @see http://php.net/manual/en/mongodb-driver-manager.construct.php - * @see http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps - * @param string $uri MongoDB connection string - * @param array $uriOptions Additional connection string options - * @param array $driverOptions Driver-specific options - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverInvalidArgumentException for parameter/option parsing errors in the driver - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function __construct($uri = 'mongodb://127.0.0.1/', array $uriOptions = [], array $driverOptions = []) - { - $driverOptions += ['typeMap' => self::$defaultTypeMap]; - - if (isset($driverOptions['typeMap']) && ! is_array($driverOptions['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" driver option', $driverOptions['typeMap'], 'array'); - } - - $this->uri = (string) $uri; - $this->typeMap = isset($driverOptions['typeMap']) ? $driverOptions['typeMap'] : null; - - unset($driverOptions['typeMap']); - - $this->manager = new Manager($uri, $uriOptions, $driverOptions); - $this->writeConcern = $this->manager->getWriteConcern(); - } - - /** - * Return internal properties for debugging purposes. - * - * @see http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo - * @return array - */ - public function __debugInfo() - { - return [ - 'manager' => $this->manager, - 'uri' => $this->uri, - 'typeMap' => $this->typeMap, - 'writeConcern' => $this->writeConcern, - ]; - } - - /** - * Select a database. - * - * Note: databases whose names contain special characters (e.g. "-") may - * be selected with complex syntax (e.g. $client->{"that-database"}) or - * {@link selectDatabase()}. - * - * @see http://php.net/oop5.overloading#object.get - * @see http://php.net/types.string#language.types.string.parsing.complex - * @param string $databaseName Name of the database to select - * @return Database - */ - public function __get($databaseName) - { - return $this->selectDatabase($databaseName); - } - - /** - * Return the connection string (i.e. URI). - * - * @return string - */ - public function __toString() - { - return $this->uri; - } - - /** - * Drop a database. - * - * @see DropDatabase::__construct() for supported options - * @param string $databaseName Database name - * @param array $options Additional options - * @return array|object Command result document - * @throws UnsupportedException if options are unsupported on the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function dropDatabase($databaseName, array $options = []) - { - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new DropDatabase($databaseName, $options); - - return $operation->execute($server); - } - - /** - * Return the Manager. - * - * @return Manager - */ - public function getManager() - { - return $this->manager; - } - - /** - * List databases. - * - * @see ListDatabases::__construct() for supported options - * @return DatabaseInfoIterator - * @throws UnexpectedValueException if the command response was malformed - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function listDatabases(array $options = []) - { - $operation = new ListDatabases($options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Select a collection. - * - * @see Collection::__construct() for supported options - * @param string $databaseName Name of the database containing the collection - * @param string $collectionName Name of the collection to select - * @param array $options Collection constructor options - * @return Collection - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function selectCollection($databaseName, $collectionName, array $options = []) - { - $options += ['typeMap' => $this->typeMap]; - - return new Collection($this->manager, $databaseName, $collectionName, $options); - } - - /** - * Select a database. - * - * @see Database::__construct() for supported options - * @param string $databaseName Name of the database to select - * @param array $options Database constructor options - * @return Database - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function selectDatabase($databaseName, array $options = []) - { - $options += ['typeMap' => $this->typeMap]; - - return new Database($this->manager, $databaseName, $options); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Collection.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Collection.php deleted file mode 100644 index 95df5bc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Collection.php +++ /dev/null @@ -1,864 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB; - -use MongoDB\Driver\Cursor; -use MongoDB\Driver\Manager; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnexpectedValueException; -use MongoDB\Exception\UnsupportedException; -use MongoDB\Model\IndexInfoIterator; -use MongoDB\Operation\Aggregate; -use MongoDB\Operation\BulkWrite; -use MongoDB\Operation\CreateIndexes; -use MongoDB\Operation\Count; -use MongoDB\Operation\DeleteMany; -use MongoDB\Operation\DeleteOne; -use MongoDB\Operation\Distinct; -use MongoDB\Operation\DropCollection; -use MongoDB\Operation\DropIndexes; -use MongoDB\Operation\Find; -use MongoDB\Operation\FindOne; -use MongoDB\Operation\FindOneAndDelete; -use MongoDB\Operation\FindOneAndReplace; -use MongoDB\Operation\FindOneAndUpdate; -use MongoDB\Operation\InsertMany; -use MongoDB\Operation\InsertOne; -use MongoDB\Operation\ListIndexes; -use MongoDB\Operation\ReplaceOne; -use MongoDB\Operation\UpdateMany; -use MongoDB\Operation\UpdateOne; -use Traversable; - -class Collection -{ - private static $defaultTypeMap = [ - 'array' => 'MongoDB\Model\BSONArray', - 'document' => 'MongoDB\Model\BSONDocument', - 'root' => 'MongoDB\Model\BSONDocument', - ]; - private static $wireVersionForFindAndModifyWriteConcern = 4; - private static $wireVersionForReadConcern = 4; - private static $wireVersionForWritableCommandWriteConcern = 5; - - private $collectionName; - private $databaseName; - private $manager; - private $readConcern; - private $readPreference; - private $typeMap; - private $writeConcern; - - /** - * Constructs new Collection instance. - * - * This class provides methods for collection-specific operations, such as - * CRUD (i.e. create, read, update, and delete) and index management. - * - * Supported options: - * - * * readConcern (MongoDB\Driver\ReadConcern): The default read concern to - * use for collection operations. Defaults to the Manager's read concern. - * - * * readPreference (MongoDB\Driver\ReadPreference): The default read - * preference to use for collection operations. Defaults to the Manager's - * read preference. - * - * * typeMap (array): Default type map for cursors and BSON documents. - * - * * writeConcern (MongoDB\Driver\WriteConcern): The default write concern - * to use for collection operations. Defaults to the Manager's write - * concern. - * - * @param Manager $manager Manager instance from the driver - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array $options Collection options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct(Manager $manager, $databaseName, $collectionName, array $options = []) - { - if (strlen($databaseName) < 1) { - throw new InvalidArgumentException('$databaseName is invalid: ' . $databaseName); - } - - if (strlen($collectionName) < 1) { - throw new InvalidArgumentException('$collectionName is invalid: ' . $collectionName); - } - - if (isset($options['readConcern']) && ! $options['readConcern'] instanceof ReadConcern) { - throw InvalidArgumentException::invalidType('"readConcern" option', $options['readConcern'], 'MongoDB\Driver\ReadConcern'); - } - - if (isset($options['readPreference']) && ! $options['readPreference'] instanceof ReadPreference) { - throw InvalidArgumentException::invalidType('"readPreference" option', $options['readPreference'], 'MongoDB\Driver\ReadPreference'); - } - - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->manager = $manager; - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->readConcern = isset($options['readConcern']) ? $options['readConcern'] : $this->manager->getReadConcern(); - $this->readPreference = isset($options['readPreference']) ? $options['readPreference'] : $this->manager->getReadPreference(); - $this->typeMap = isset($options['typeMap']) ? $options['typeMap'] : self::$defaultTypeMap; - $this->writeConcern = isset($options['writeConcern']) ? $options['writeConcern'] : $this->manager->getWriteConcern(); - } - - /** - * Return internal properties for debugging purposes. - * - * @see http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo - * @return array - */ - public function __debugInfo() - { - return [ - 'collectionName' => $this->collectionName, - 'databaseName' => $this->databaseName, - 'manager' => $this->manager, - 'readConcern' => $this->readConcern, - 'readPreference' => $this->readPreference, - 'typeMap' => $this->typeMap, - 'writeConcern' => $this->writeConcern, - ]; - } - - /** - * Return the collection namespace (e.g. "db.collection"). - * - * @see https://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace - * @return string - */ - public function __toString() - { - return $this->databaseName . '.' . $this->collectionName; - } - - /** - * Executes an aggregation framework pipeline on the collection. - * - * Note: this method's return value depends on the MongoDB server version - * and the "useCursor" option. If "useCursor" is true, a Cursor will be - * returned; otherwise, an ArrayIterator is returned, which wraps the - * "result" array from the command response document. - * - * @see Aggregate::__construct() for supported options - * @param array $pipeline List of pipeline operations - * @param array $options Command options - * @return Traversable - * @throws UnexpectedValueException if the command response was malformed - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function aggregate(array $pipeline, array $options = []) - { - $hasOutStage = \MongoDB\is_last_pipeline_operator_out($pipeline); - - if ( ! isset($options['readPreference'])) { - $options['readPreference'] = $this->readPreference; - } - - if ($hasOutStage) { - $options['readPreference'] = new ReadPreference(ReadPreference::RP_PRIMARY); - } - - $server = $this->manager->selectServer($options['readPreference']); - - /* A "majority" read concern is not compatible with the $out stage, so - * avoid providing the Collection's read concern if it would conflict. - */ - if ( ! isset($options['readConcern']) && - ! ($hasOutStage && $this->readConcern->getLevel() === ReadConcern::MAJORITY) && - \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) { - $options['readConcern'] = $this->readConcern; - } - - if ( ! isset($options['typeMap']) && ( ! isset($options['useCursor']) || $options['useCursor'])) { - $options['typeMap'] = $this->typeMap; - } - - if ($hasOutStage && ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new Aggregate($this->databaseName, $this->collectionName, $pipeline, $options); - - return $operation->execute($server); - } - - /** - * Executes multiple write operations. - * - * @see BulkWrite::__construct() for supported options - * @param array[] $operations List of write operations - * @param array $options Command options - * @return BulkWriteResult - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function bulkWrite(array $operations, array $options = []) - { - if ( ! isset($options['writeConcern'])) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new BulkWrite($this->databaseName, $this->collectionName, $operations, $options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Gets the number of documents matching the filter. - * - * @see Count::__construct() for supported options - * @param array|object $filter Query by which to filter documents - * @param array $options Command options - * @return integer - * @throws UnexpectedValueException if the command response was malformed - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function count($filter = [], array $options = []) - { - if ( ! isset($options['readPreference'])) { - $options['readPreference'] = $this->readPreference; - } - - $server = $this->manager->selectServer($options['readPreference']); - - if ( ! isset($options['readConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) { - $options['readConcern'] = $this->readConcern; - } - - $operation = new Count($this->databaseName, $this->collectionName, $filter, $options); - - return $operation->execute($server); - } - - /** - * Create a single index for the collection. - * - * @see Collection::createIndexes() - * @see CreateIndexes::__construct() for supported command options - * @param array|object $key Document containing fields mapped to values, - * which denote order or an index type - * @param array $options Index options - * @return string The name of the created index - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function createIndex($key, array $options = []) - { - $indexOptions = array_diff_key($options, ['writeConcern' => 1]); - $commandOptions = array_intersect_key($options, ['writeConcern' => 1]); - - return current($this->createIndexes([['key' => $key] + $indexOptions], $commandOptions)); - } - - /** - * Create one or more indexes for the collection. - * - * Each element in the $indexes array must have a "key" document, which - * contains fields mapped to an order or type. Other options may follow. - * For example: - * - * $indexes = [ - * // Create a unique index on the "username" field - * [ 'key' => [ 'username' => 1 ], 'unique' => true ], - * // Create a 2dsphere index on the "loc" field with a custom name - * [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo' ], - * ]; - * - * If the "name" option is unspecified, a name will be generated from the - * "key" document. - * - * @see http://docs.mongodb.org/manual/reference/command/createIndexes/ - * @see http://docs.mongodb.org/manual/reference/method/db.collection.createIndex/ - * @see CreateIndexes::__construct() for supported command options - * @param array[] $indexes List of index specifications - * @param array $options Command options - * @return string[] The names of the created indexes - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function createIndexes(array $indexes, array $options = []) - { - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new CreateIndexes($this->databaseName, $this->collectionName, $indexes, $options); - - return $operation->execute($server); - } - - /** - * Deletes all documents matching the filter. - * - * @see DeleteMany::__construct() for supported options - * @see http://docs.mongodb.org/manual/reference/command/delete/ - * @param array|object $filter Query by which to delete documents - * @param array $options Command options - * @return DeleteResult - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function deleteMany($filter, array $options = []) - { - if ( ! isset($options['writeConcern'])) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new DeleteMany($this->databaseName, $this->collectionName, $filter, $options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Deletes at most one document matching the filter. - * - * @see DeleteOne::__construct() for supported options - * @see http://docs.mongodb.org/manual/reference/command/delete/ - * @param array|object $filter Query by which to delete documents - * @param array $options Command options - * @return DeleteResult - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function deleteOne($filter, array $options = []) - { - if ( ! isset($options['writeConcern'])) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new DeleteOne($this->databaseName, $this->collectionName, $filter, $options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Finds the distinct values for a specified field across the collection. - * - * @see Distinct::__construct() for supported options - * @param string $fieldName Field for which to return distinct values - * @param array|object $filter Query by which to filter documents - * @param array $options Command options - * @return mixed[] - * @throws UnexpectedValueException if the command response was malformed - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function distinct($fieldName, $filter = [], array $options = []) - { - if ( ! isset($options['readPreference'])) { - $options['readPreference'] = $this->readPreference; - } - - $server = $this->manager->selectServer($options['readPreference']); - - if ( ! isset($options['readConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) { - $options['readConcern'] = $this->readConcern; - } - - $operation = new Distinct($this->databaseName, $this->collectionName, $fieldName, $filter, $options); - - return $operation->execute($server); - } - - /** - * Drop this collection. - * - * @see DropCollection::__construct() for supported options - * @param array $options Additional options - * @return array|object Command result document - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function drop(array $options = []) - { - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new DropCollection($this->databaseName, $this->collectionName, $options); - - return $operation->execute($server); - } - - /** - * Drop a single index in the collection. - * - * @see DropIndexes::__construct() for supported options - * @param string $indexName Index name - * @param array $options Additional options - * @return array|object Command result document - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function dropIndex($indexName, array $options = []) - { - $indexName = (string) $indexName; - - if ($indexName === '*') { - throw new InvalidArgumentException('dropIndexes() must be used to drop multiple indexes'); - } - - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new DropIndexes($this->databaseName, $this->collectionName, $indexName, $options); - - return $operation->execute($server); - } - - /** - * Drop all indexes in the collection. - * - * @see DropIndexes::__construct() for supported options - * @param array $options Additional options - * @return array|object Command result document - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function dropIndexes(array $options = []) - { - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new DropIndexes($this->databaseName, $this->collectionName, '*', $options); - - return $operation->execute($server); - } - - /** - * Finds documents matching the query. - * - * @see Find::__construct() for supported options - * @see http://docs.mongodb.org/manual/core/read-operations-introduction/ - * @param array|object $filter Query by which to filter documents - * @param array $options Additional options - * @return Cursor - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function find($filter = [], array $options = []) - { - if ( ! isset($options['readPreference'])) { - $options['readPreference'] = $this->readPreference; - } - - $server = $this->manager->selectServer($options['readPreference']); - - if ( ! isset($options['readConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) { - $options['readConcern'] = $this->readConcern; - } - - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $operation = new Find($this->databaseName, $this->collectionName, $filter, $options); - - return $operation->execute($server); - } - - /** - * Finds a single document matching the query. - * - * @see FindOne::__construct() for supported options - * @see http://docs.mongodb.org/manual/core/read-operations-introduction/ - * @param array|object $filter Query by which to filter documents - * @param array $options Additional options - * @return array|object|null - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function findOne($filter = [], array $options = []) - { - if ( ! isset($options['readPreference'])) { - $options['readPreference'] = $this->readPreference; - } - - $server = $this->manager->selectServer($options['readPreference']); - - if ( ! isset($options['readConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) { - $options['readConcern'] = $this->readConcern; - } - - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $operation = new FindOne($this->databaseName, $this->collectionName, $filter, $options); - - return $operation->execute($server); - } - - /** - * Finds a single document and deletes it, returning the original. - * - * The document to return may be null if no document matched the filter. - * - * @see FindOneAndDelete::__construct() for supported options - * @see http://docs.mongodb.org/manual/reference/command/findAndModify/ - * @param array|object $filter Query by which to filter documents - * @param array $options Command options - * @return array|object|null - * @throws UnexpectedValueException if the command response was malformed - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function findOneAndDelete($filter, array $options = []) - { - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForFindAndModifyWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $operation = new FindOneAndDelete($this->databaseName, $this->collectionName, $filter, $options); - - return $operation->execute($server); - } - - /** - * Finds a single document and replaces it, returning either the original or - * the replaced document. - * - * The document to return may be null if no document matched the filter. By - * default, the original document is returned. Specify - * FindOneAndReplace::RETURN_DOCUMENT_AFTER for the "returnDocument" option - * to return the updated document. - * - * @see FindOneAndReplace::__construct() for supported options - * @see http://docs.mongodb.org/manual/reference/command/findAndModify/ - * @param array|object $filter Query by which to filter documents - * @param array|object $replacement Replacement document - * @param array $options Command options - * @return array|object|null - * @throws UnexpectedValueException if the command response was malformed - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function findOneAndReplace($filter, $replacement, array $options = []) - { - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForFindAndModifyWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $operation = new FindOneAndReplace($this->databaseName, $this->collectionName, $filter, $replacement, $options); - - return $operation->execute($server); - } - - /** - * Finds a single document and updates it, returning either the original or - * the updated document. - * - * The document to return may be null if no document matched the filter. By - * default, the original document is returned. Specify - * FindOneAndUpdate::RETURN_DOCUMENT_AFTER for the "returnDocument" option - * to return the updated document. - * - * @see FindOneAndReplace::__construct() for supported options - * @see http://docs.mongodb.org/manual/reference/command/findAndModify/ - * @param array|object $filter Query by which to filter documents - * @param array|object $update Update to apply to the matched document - * @param array $options Command options - * @return array|object|null - * @throws UnexpectedValueException if the command response was malformed - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function findOneAndUpdate($filter, $update, array $options = []) - { - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForFindAndModifyWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $operation = new FindOneAndUpdate($this->databaseName, $this->collectionName, $filter, $update, $options); - - return $operation->execute($server); - } - - /** - * Return the collection name. - * - * @return string - */ - public function getCollectionName() - { - return $this->collectionName; - } - - /** - * Return the database name. - * - * @return string - */ - public function getDatabaseName() - { - return $this->databaseName; - } - - /** - * Return the Manager. - * - * @return Manager - */ - public function getManager() - { - return $this->manager; - } - - /** - * Return the collection namespace. - * - * @see https://docs.mongodb.org/manual/reference/glossary/#term-namespace - * @return string - */ - public function getNamespace() - { - return $this->databaseName . '.' . $this->collectionName; - } - - /** - * Inserts multiple documents. - * - * @see InsertMany::__construct() for supported options - * @see http://docs.mongodb.org/manual/reference/command/insert/ - * @param array[]|object[] $documents The documents to insert - * @param array $options Command options - * @return InsertManyResult - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function insertMany(array $documents, array $options = []) - { - if ( ! isset($options['writeConcern'])) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new InsertMany($this->databaseName, $this->collectionName, $documents, $options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Inserts one document. - * - * @see InsertOne::__construct() for supported options - * @see http://docs.mongodb.org/manual/reference/command/insert/ - * @param array|object $document The document to insert - * @param array $options Command options - * @return InsertOneResult - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function insertOne($document, array $options = []) - { - if ( ! isset($options['writeConcern'])) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new InsertOne($this->databaseName, $this->collectionName, $document, $options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Returns information for all indexes for the collection. - * - * @see ListIndexes::__construct() for supported options - * @return IndexInfoIterator - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function listIndexes(array $options = []) - { - $operation = new ListIndexes($this->databaseName, $this->collectionName, $options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Replaces at most one document matching the filter. - * - * @see ReplaceOne::__construct() for supported options - * @see http://docs.mongodb.org/manual/reference/command/update/ - * @param array|object $filter Query by which to filter documents - * @param array|object $replacement Replacement document - * @param array $options Command options - * @return UpdateResult - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function replaceOne($filter, $replacement, array $options = []) - { - if ( ! isset($options['writeConcern'])) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new ReplaceOne($this->databaseName, $this->collectionName, $filter, $replacement, $options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Updates all documents matching the filter. - * - * @see UpdateMany::__construct() for supported options - * @see http://docs.mongodb.org/manual/reference/command/update/ - * @param array|object $filter Query by which to filter documents - * @param array|object $update Update to apply to the matched documents - * @param array $options Command options - * @return UpdateResult - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function updateMany($filter, $update, array $options = []) - { - if ( ! isset($options['writeConcern'])) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new UpdateMany($this->databaseName, $this->collectionName, $filter, $update, $options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Updates at most one document matching the filter. - * - * @see UpdateOne::__construct() for supported options - * @see http://docs.mongodb.org/manual/reference/command/update/ - * @param array|object $filter Query by which to filter documents - * @param array|object $update Update to apply to the matched document - * @param array $options Command options - * @return UpdateResult - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function updateOne($filter, $update, array $options = []) - { - if ( ! isset($options['writeConcern'])) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new UpdateOne($this->databaseName, $this->collectionName, $filter, $update, $options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Get a clone of this collection with different options. - * - * @see Collection::__construct() for supported options - * @param array $options Collection constructor options - * @return Collection - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function withOptions(array $options = []) - { - $options += [ - 'readConcern' => $this->readConcern, - 'readPreference' => $this->readPreference, - 'typeMap' => $this->typeMap, - 'writeConcern' => $this->writeConcern, - ]; - - return new Collection($this->manager, $this->databaseName, $this->collectionName, $options); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Database.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Database.php deleted file mode 100644 index 9cebfc4..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Database.php +++ /dev/null @@ -1,361 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB; - -use MongoDB\Collection; -use MongoDB\Driver\Cursor; -use MongoDB\Driver\Manager; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; -use MongoDB\GridFS\Bucket; -use MongoDB\Model\CollectionInfoIterator; -use MongoDB\Operation\CreateCollection; -use MongoDB\Operation\DatabaseCommand; -use MongoDB\Operation\DropCollection; -use MongoDB\Operation\DropDatabase; -use MongoDB\Operation\ListCollections; - -class Database -{ - private static $defaultTypeMap = [ - 'array' => 'MongoDB\Model\BSONArray', - 'document' => 'MongoDB\Model\BSONDocument', - 'root' => 'MongoDB\Model\BSONDocument', - ]; - private static $wireVersionForWritableCommandWriteConcern = 5; - - private $databaseName; - private $manager; - private $readConcern; - private $readPreference; - private $typeMap; - private $writeConcern; - - /** - * Constructs new Database instance. - * - * This class provides methods for database-specific operations and serves - * as a gateway for accessing collections. - * - * Supported options: - * - * * readConcern (MongoDB\Driver\ReadConcern): The default read concern to - * use for database operations and selected collections. Defaults to the - * Manager's read concern. - * - * * readPreference (MongoDB\Driver\ReadPreference): The default read - * preference to use for database operations and selected collections. - * Defaults to the Manager's read preference. - * - * * typeMap (array): Default type map for cursors and BSON documents. - * - * * writeConcern (MongoDB\Driver\WriteConcern): The default write concern - * to use for database operations and selected collections. Defaults to - * the Manager's write concern. - * - * @param Manager $manager Manager instance from the driver - * @param string $databaseName Database name - * @param array $options Database options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct(Manager $manager, $databaseName, array $options = []) - { - if (strlen($databaseName) < 1) { - throw new InvalidArgumentException('$databaseName is invalid: ' . $databaseName); - } - - if (isset($options['readConcern']) && ! $options['readConcern'] instanceof ReadConcern) { - throw InvalidArgumentException::invalidType('"readConcern" option', $options['readConcern'], 'MongoDB\Driver\ReadConcern'); - } - - if (isset($options['readPreference']) && ! $options['readPreference'] instanceof ReadPreference) { - throw InvalidArgumentException::invalidType('"readPreference" option', $options['readPreference'], 'MongoDB\Driver\ReadPreference'); - } - - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->manager = $manager; - $this->databaseName = (string) $databaseName; - $this->readConcern = isset($options['readConcern']) ? $options['readConcern'] : $this->manager->getReadConcern(); - $this->readPreference = isset($options['readPreference']) ? $options['readPreference'] : $this->manager->getReadPreference(); - $this->typeMap = isset($options['typeMap']) ? $options['typeMap'] : self::$defaultTypeMap; - $this->writeConcern = isset($options['writeConcern']) ? $options['writeConcern'] : $this->manager->getWriteConcern(); - } - - /** - * Return internal properties for debugging purposes. - * - * @see http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo - * @return array - */ - public function __debugInfo() - { - return [ - 'databaseName' => $this->databaseName, - 'manager' => $this->manager, - 'readConcern' => $this->readConcern, - 'readPreference' => $this->readPreference, - 'typeMap' => $this->typeMap, - 'writeConcern' => $this->writeConcern, - ]; - } - - /** - * Select a collection within this database. - * - * Note: collections whose names contain special characters (e.g. ".") may - * be selected with complex syntax (e.g. $database->{"system.profile"}) or - * {@link selectCollection()}. - * - * @see http://php.net/oop5.overloading#object.get - * @see http://php.net/types.string#language.types.string.parsing.complex - * @param string $collectionName Name of the collection to select - * @return Collection - */ - public function __get($collectionName) - { - return $this->selectCollection($collectionName); - } - - /** - * Return the database name. - * - * @return string - */ - public function __toString() - { - return $this->databaseName; - } - - /** - * Execute a command on this database. - * - * @see DatabaseCommand::__construct() for supported options - * @param array|object $command Command document - * @param array $options Options for command execution - * @return Cursor - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function command($command, array $options = []) - { - if ( ! isset($options['readPreference'])) { - $options['readPreference'] = $this->readPreference; - } - - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $operation = new DatabaseCommand($this->databaseName, $command, $options); - $server = $this->manager->selectServer($options['readPreference']); - - return $operation->execute($server); - } - - /** - * Create a new collection explicitly. - * - * @see CreateCollection::__construct() for supported options - * @param string $collectionName - * @param array $options - * @return array|object Command result document - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function createCollection($collectionName, array $options = []) - { - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new CreateCollection($this->databaseName, $collectionName, $options); - - return $operation->execute($server); - } - - /** - * Drop this database. - * - * @see DropDatabase::__construct() for supported options - * @param array $options Additional options - * @return array|object Command result document - * @throws UnsupportedException if options are unsupported on the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function drop(array $options = []) - { - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new DropDatabase($this->databaseName, $options); - - return $operation->execute($server); - } - - /** - * Drop a collection within this database. - * - * @see DropCollection::__construct() for supported options - * @param string $collectionName Collection name - * @param array $options Additional options - * @return array|object Command result document - * @throws UnsupportedException if options are unsupported on the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function dropCollection($collectionName, array $options = []) - { - if ( ! isset($options['typeMap'])) { - $options['typeMap'] = $this->typeMap; - } - - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) { - $options['writeConcern'] = $this->writeConcern; - } - - $operation = new DropCollection($this->databaseName, $collectionName, $options); - - return $operation->execute($server); - } - - /** - * Returns the database name. - * - * @return string - */ - public function getDatabaseName() - { - return $this->databaseName; - } - - /** - * Return the Manager. - * - * @return Manager - */ - public function getManager() - { - return $this->manager; - } - - /** - * Returns information for all collections in this database. - * - * @see ListCollections::__construct() for supported options - * @param array $options - * @return CollectionInfoIterator - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function listCollections(array $options = []) - { - $operation = new ListCollections($this->databaseName, $options); - $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - - return $operation->execute($server); - } - - /** - * Select a collection within this database. - * - * @see Collection::__construct() for supported options - * @param string $collectionName Name of the collection to select - * @param array $options Collection constructor options - * @return Collection - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function selectCollection($collectionName, array $options = []) - { - $options += [ - 'readConcern' => $this->readConcern, - 'readPreference' => $this->readPreference, - 'typeMap' => $this->typeMap, - 'writeConcern' => $this->writeConcern, - ]; - - return new Collection($this->manager, $this->databaseName, $collectionName, $options); - } - - /** - * Select a GridFS bucket within this database. - * - * @see Bucket::__construct() for supported options - * @param array $options Bucket constructor options - * @return Bucket - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function selectGridFSBucket(array $options = []) - { - $options += [ - 'readConcern' => $this->readConcern, - 'readPreference' => $this->readPreference, - 'typeMap' => $this->typeMap, - 'writeConcern' => $this->writeConcern, - ]; - - return new Bucket($this->manager, $this->databaseName, $options); - } - - /** - * Get a clone of this database with different options. - * - * @see Database::__construct() for supported options - * @param array $options Database constructor options - * @return Database - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function withOptions(array $options = []) - { - $options += [ - 'readConcern' => $this->readConcern, - 'readPreference' => $this->readPreference, - 'typeMap' => $this->typeMap, - 'writeConcern' => $this->writeConcern, - ]; - - return new Database($this->manager, $this->databaseName, $options); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/DeleteResult.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/DeleteResult.php deleted file mode 100644 index a60137b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/DeleteResult.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB; - -use MongoDB\Driver\WriteResult; -use MongoDB\Exception\BadMethodCallException; - -/** - * Result class for a delete operation. - */ -class DeleteResult -{ - private $writeResult; - private $isAcknowledged; - - /** - * Constructor. - * - * @param WriteResult $writeResult - */ - public function __construct(WriteResult $writeResult) - { - $this->writeResult = $writeResult; - $this->isAcknowledged = $writeResult->isAcknowledged(); - } - - /** - * Return the number of documents that were deleted. - * - * This method should only be called if the write was acknowledged. - * - * @see DeleteResult::isAcknowledged() - * @return integer - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getDeletedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getDeletedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return whether this delete was acknowledged by the server. - * - * If the delete was not acknowledged, other fields from the WriteResult - * (e.g. deletedCount) will be undefined. - * - * @return boolean - */ - public function isAcknowledged() - { - return $this->isAcknowledged; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/BadMethodCallException.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/BadMethodCallException.php deleted file mode 100644 index f1fe47a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/BadMethodCallException.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Exception; - -class BadMethodCallException extends \BadMethodCallException implements Exception -{ - /** - * Thrown when a mutable method is invoked on an immutable object. - * - * @param string $class Class name - * @return self - */ - public static function classIsImmutable($class) - { - return new static(sprintf('%s is immutable', $class)); - } - - /** - * Thrown when accessing a result field on an unacknowledged write result. - * - * @param string $method Method name - * @return self - */ - public static function unacknowledgedWriteResultAccess($method) - { - return new static(sprintf('%s should not be called for an unacknowledged write result', $method)); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/Exception.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/Exception.php deleted file mode 100644 index 703a44c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/Exception.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Exception; - -interface Exception extends \MongoDB\Driver\Exception\Exception -{ -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/InvalidArgumentException.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/InvalidArgumentException.php deleted file mode 100644 index 622215a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Exception; - -class InvalidArgumentException extends \MongoDB\Driver\Exception\InvalidArgumentException implements Exception -{ - /** - * Thrown when an argument or option has an invalid type. - * - * @param string $name Name of the argument or option - * @param mixed $value Actual value (used to derive the type) - * @param string $expectedType Expected type - * @return self - */ - public static function invalidType($name, $value, $expectedType) - { - return new static(sprintf('Expected %s to have type "%s" but found "%s"', $name, $expectedType, is_object($value) ? get_class($value) : gettype($value))); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/RuntimeException.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/RuntimeException.php deleted file mode 100644 index 4d8c0b8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/RuntimeException.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Exception; - -class RuntimeException extends \MongoDB\Driver\Exception\RuntimeException implements Exception -{ -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/UnexpectedValueException.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/UnexpectedValueException.php deleted file mode 100644 index a65eaa7..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/UnexpectedValueException.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Exception; - -class UnexpectedValueException extends \MongoDB\Driver\Exception\UnexpectedValueException implements Exception -{ -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/UnsupportedException.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/UnsupportedException.php deleted file mode 100644 index 80ae51a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Exception/UnsupportedException.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Exception; - -class UnsupportedException extends RuntimeException -{ - /** - * Thrown when collations are not supported by a server. - * - * @return self - */ - public static function collationNotSupported() - { - return new static('Collations are not supported by the server executing this operation'); - } - - /** - * Thrown when a command's readConcern option is not supported by a server. - * - * @return self - */ - public static function readConcernNotSupported() - { - return new static('Read concern is not supported by the server executing this command'); - } - - /** - * Thrown when a command's writeConcern option is not supported by a server. - * - * @return self - */ - public static function writeConcernNotSupported() - { - return new static('Write concern is not supported by the server executing this command'); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Bucket.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Bucket.php deleted file mode 100644 index 210230a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Bucket.php +++ /dev/null @@ -1,588 +0,0 @@ -<?php -/* - * Copyright 2016-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\GridFS; - -use MongoDB\Driver\Cursor; -use MongoDB\Driver\Manager; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\GridFS\Exception\CorruptFileException; -use MongoDB\GridFS\Exception\FileNotFoundException; -use MongoDB\Operation\Find; -use stdClass; - -/** - * Bucket provides a public API for interacting with the GridFS files and chunks - * collections. - * - * @api - */ -class Bucket -{ - private static $defaultBucketName = 'fs'; - private static $defaultChunkSizeBytes = 261120; - private static $defaultTypeMap = [ - 'array' => 'MongoDB\Model\BSONArray', - 'document' => 'MongoDB\Model\BSONDocument', - 'root' => 'MongoDB\Model\BSONDocument', - ]; - private static $streamWrapperProtocol = 'gridfs'; - - private $collectionWrapper; - private $databaseName; - private $manager; - private $bucketName; - private $chunkSizeBytes; - private $readConcern; - private $readPreference; - private $typeMap; - private $writeConcern; - - /** - * Constructs a GridFS bucket. - * - * Supported options: - * - * * bucketName (string): The bucket name, which will be used as a prefix - * for the files and chunks collections. Defaults to "fs". - * - * * chunkSizeBytes (integer): The chunk size in bytes. Defaults to - * 261120 (i.e. 255 KiB). - * - * * readConcern (MongoDB\Driver\ReadConcern): Read concern. - * - * * readPreference (MongoDB\Driver\ReadPreference): Read preference. - * - * * typeMap (array): Default type map for cursors and BSON documents. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param Manager $manager Manager instance from the driver - * @param string $databaseName Database name - * @param array $options Bucket options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct(Manager $manager, $databaseName, array $options = []) - { - $options += [ - 'bucketName' => self::$defaultBucketName, - 'chunkSizeBytes' => self::$defaultChunkSizeBytes, - ]; - - if (isset($options['bucketName']) && ! is_string($options['bucketName'])) { - throw InvalidArgumentException::invalidType('"bucketName" option', $options['bucketName'], 'string'); - } - - if (isset($options['chunkSizeBytes']) && ! is_integer($options['chunkSizeBytes'])) { - throw InvalidArgumentException::invalidType('"chunkSizeBytes" option', $options['chunkSizeBytes'], 'integer'); - } - - if (isset($options['chunkSizeBytes']) && $options['chunkSizeBytes'] < 1) { - throw new InvalidArgumentException(sprintf('Expected "chunkSizeBytes" option to be >= 1, %d given', $options['chunkSizeBytes'])); - } - - if (isset($options['readConcern']) && ! $options['readConcern'] instanceof ReadConcern) { - throw InvalidArgumentException::invalidType('"readConcern" option', $options['readConcern'], 'MongoDB\Driver\ReadConcern'); - } - - if (isset($options['readPreference']) && ! $options['readPreference'] instanceof ReadPreference) { - throw InvalidArgumentException::invalidType('"readPreference" option', $options['readPreference'], 'MongoDB\Driver\ReadPreference'); - } - - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->manager = $manager; - $this->databaseName = (string) $databaseName; - $this->bucketName = $options['bucketName']; - $this->chunkSizeBytes = $options['chunkSizeBytes']; - $this->readConcern = isset($options['readConcern']) ? $options['readConcern'] : $this->manager->getReadConcern(); - $this->readPreference = isset($options['readPreference']) ? $options['readPreference'] : $this->manager->getReadPreference(); - $this->typeMap = isset($options['typeMap']) ? $options['typeMap'] : self::$defaultTypeMap; - $this->writeConcern = isset($options['writeConcern']) ? $options['writeConcern'] : $this->manager->getWriteConcern(); - - $collectionOptions = array_intersect_key($options, ['readConcern' => 1, 'readPreference' => 1, 'typeMap' => 1, 'writeConcern' => 1]); - - $this->collectionWrapper = new CollectionWrapper($manager, $databaseName, $options['bucketName'], $collectionOptions); - $this->registerStreamWrapper(); - } - - /** - * Return internal properties for debugging purposes. - * - * @see http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo - * @return array - */ - public function __debugInfo() - { - return [ - 'bucketName' => $this->bucketName, - 'databaseName' => $this->databaseName, - 'manager' => $this->manager, - 'chunkSizeBytes' => $this->chunkSizeBytes, - 'readConcern' => $this->readConcern, - 'readPreference' => $this->readPreference, - 'typeMap' => $this->typeMap, - 'writeConcern' => $this->writeConcern, - ]; - } - - /** - * Delete a file from the GridFS bucket. - * - * If the files collection document is not found, this method will still - * attempt to delete orphaned chunks. - * - * @param mixed $id File ID - * @throws FileNotFoundException if no file could be selected - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function delete($id) - { - $file = $this->collectionWrapper->findFileById($id); - $this->collectionWrapper->deleteFileAndChunksById($id); - - if ($file === null) { - throw FileNotFoundException::byId($id, $this->getFilesNamespace()); - } - } - - /** - * Writes the contents of a GridFS file to a writable stream. - * - * @param mixed $id File ID - * @param resource $destination Writable Stream - * @throws FileNotFoundException if no file could be selected - * @throws InvalidArgumentException if $destination is not a stream - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function downloadToStream($id, $destination) - { - if ( ! is_resource($destination) || get_resource_type($destination) != "stream") { - throw InvalidArgumentException::invalidType('$destination', $destination, 'resource'); - } - - stream_copy_to_stream($this->openDownloadStream($id), $destination); - } - - /** - * Writes the contents of a GridFS file, which is selected by name and - * revision, to a writable stream. - * - * Supported options: - * - * * revision (integer): Which revision (i.e. documents with the same - * filename and different uploadDate) of the file to retrieve. Defaults - * to -1 (i.e. the most recent revision). - * - * Revision numbers are defined as follows: - * - * * 0 = the original stored file - * * 1 = the first revision - * * 2 = the second revision - * * etc… - * * -2 = the second most recent revision - * * -1 = the most recent revision - * - * @param string $filename Filename - * @param resource $destination Writable Stream - * @param array $options Download options - * @throws FileNotFoundException if no file could be selected - * @throws InvalidArgumentException if $destination is not a stream - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function downloadToStreamByName($filename, $destination, array $options = []) - { - if ( ! is_resource($destination) || get_resource_type($destination) != "stream") { - throw InvalidArgumentException::invalidType('$destination', $destination, 'resource'); - } - - stream_copy_to_stream($this->openDownloadStreamByName($filename, $options), $destination); - } - - /** - * Drops the files and chunks collections associated with this GridFS - * bucket. - * - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function drop() - { - $this->collectionWrapper->dropCollections(); - } - - /** - * Finds documents from the GridFS bucket's files collection matching the - * query. - * - * @see Find::__construct() for supported options - * @param array|object $filter Query by which to filter documents - * @param array $options Additional options - * @return Cursor - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function find($filter = [], array $options = []) - { - return $this->collectionWrapper->findFiles($filter, $options); - } - - /** - * Finds a single document from the GridFS bucket's files collection - * matching the query. - * - * @see FindOne::__construct() for supported options - * @param array|object $filter Query by which to filter documents - * @param array $options Additional options - * @return array|object|null - * @throws UnsupportedException if options are not supported by the selected server - * @throws InvalidArgumentException for parameter/option parsing errors - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function findOne($filter = [], array $options = []) - { - return $this->collectionWrapper->findOneFile($filter, $options); - } - - /** - * Return the bucket name. - * - * @return string - */ - public function getBucketName() - { - return $this->bucketName; - } - - /** - * Return the database name. - * - * @return string - */ - public function getDatabaseName() - { - return $this->databaseName; - } - - /** - * Gets the file document of the GridFS file associated with a stream. - * - * @param resource $stream GridFS stream - * @return array|object - * @throws InvalidArgumentException if $stream is not a GridFS stream - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function getFileDocumentForStream($stream) - { - $file = $this->getRawFileDocumentForStream($stream); - - // Filter the raw document through the specified type map - return \MongoDB\apply_type_map_to_document($file, $this->typeMap); - } - - /** - * Gets the file document's ID of the GridFS file associated with a stream. - * - * @param resource $stream GridFS stream - * @return mixed - * @throws CorruptFileException if the file "_id" field does not exist - * @throws InvalidArgumentException if $stream is not a GridFS stream - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function getFileIdForStream($stream) - { - $file = $this->getRawFileDocumentForStream($stream); - - /* Filter the raw document through the specified type map, but override - * the root type so we can reliably access the ID. - */ - $typeMap = ['root' => 'stdClass'] + $this->typeMap; - $file = \MongoDB\apply_type_map_to_document($file, $typeMap); - - if ( ! isset($file->_id) && ! property_exists($file, '_id')) { - throw new CorruptFileException('file._id does not exist'); - } - - return $file->_id; - } - - /** - * Opens a readable stream for reading a GridFS file. - * - * @param mixed $id File ID - * @return resource - * @throws FileNotFoundException if no file could be selected - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function openDownloadStream($id) - { - $file = $this->collectionWrapper->findFileById($id); - - if ($file === null) { - throw FileNotFoundException::byId($id, $this->getFilesNamespace()); - } - - return $this->openDownloadStreamByFile($file); - } - - /** - * Opens a readable stream stream to read a GridFS file, which is selected - * by name and revision. - * - * Supported options: - * - * * revision (integer): Which revision (i.e. documents with the same - * filename and different uploadDate) of the file to retrieve. Defaults - * to -1 (i.e. the most recent revision). - * - * Revision numbers are defined as follows: - * - * * 0 = the original stored file - * * 1 = the first revision - * * 2 = the second revision - * * etc… - * * -2 = the second most recent revision - * * -1 = the most recent revision - * - * @param string $filename Filename - * @param array $options Download options - * @return resource - * @throws FileNotFoundException if no file could be selected - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function openDownloadStreamByName($filename, array $options = []) - { - $options += ['revision' => -1]; - - $file = $this->collectionWrapper->findFileByFilenameAndRevision($filename, $options['revision']); - - if ($file === null) { - throw FileNotFoundException::byFilenameAndRevision($filename, $options['revision'], $this->getFilesNamespace()); - } - - return $this->openDownloadStreamByFile($file); - } - - /** - * Opens a writable stream for writing a GridFS file. - * - * Supported options: - * - * * _id (mixed): File document identifier. Defaults to a new ObjectId. - * - * * chunkSizeBytes (integer): The chunk size in bytes. Defaults to the - * bucket's chunk size. - * - * * metadata (document): User data for the "metadata" field of the files - * collection document. - * - * @param string $filename Filename - * @param array $options Upload options - * @return resource - */ - public function openUploadStream($filename, array $options = []) - { - $options += ['chunkSizeBytes' => $this->chunkSizeBytes]; - - $path = $this->createPathForUpload(); - $context = stream_context_create([ - self::$streamWrapperProtocol => [ - 'collectionWrapper' => $this->collectionWrapper, - 'filename' => $filename, - 'options' => $options, - ], - ]); - - return fopen($path, 'w', false, $context); - } - - /** - * Renames the GridFS file with the specified ID. - * - * @param mixed $id File ID - * @param string $newFilename New filename - * @throws FileNotFoundException if no file could be selected - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function rename($id, $newFilename) - { - $updateResult = $this->collectionWrapper->updateFilenameForId($id, $newFilename); - - if ($updateResult->getModifiedCount() === 1) { - return; - } - - /* If the update resulted in no modification, it's possible that the - * file did not exist, in which case we must raise an error. Checking - * the write result's matched count will be most efficient, but fall - * back to a findOne operation if necessary (i.e. legacy writes). - */ - $found = $updateResult->getMatchedCount() !== null - ? $updateResult->getMatchedCount() === 1 - : $this->collectionWrapper->findFileById($id) !== null; - - if ( ! $found) { - throw FileNotFoundException::byId($id, $this->getFilesNamespace()); - } - } - - /** - * Writes the contents of a readable stream to a GridFS file. - * - * Supported options: - * - * * _id (mixed): File document identifier. Defaults to a new ObjectId. - * - * * chunkSizeBytes (integer): The chunk size in bytes. Defaults to the - * bucket's chunk size. - * - * * metadata (document): User data for the "metadata" field of the files - * collection document. - * - * @param string $filename Filename - * @param resource $source Readable stream - * @param array $options Stream options - * @return mixed ID of the newly created GridFS file - * @throws InvalidArgumentException if $source is not a GridFS stream - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function uploadFromStream($filename, $source, array $options = []) - { - if ( ! is_resource($source) || get_resource_type($source) != "stream") { - throw InvalidArgumentException::invalidType('$source', $source, 'resource'); - } - - $destination = $this->openUploadStream($filename, $options); - stream_copy_to_stream($source, $destination); - - return $this->getFileIdForStream($destination); - } - - /** - * Creates a path for an existing GridFS file. - * - * @param stdClass $file GridFS file document - * @return string - */ - private function createPathForFile(stdClass $file) - { - if ( ! is_object($file->_id) || method_exists($file->_id, '__toString')) { - $id = (string) $file->_id; - } else { - $id = \MongoDB\BSON\toJSON(\MongoDB\BSON\fromPHP(['_id' => $file->_id])); - } - - return sprintf( - '%s://%s/%s.files/%s', - self::$streamWrapperProtocol, - urlencode($this->databaseName), - urlencode($this->bucketName), - urlencode($id) - ); - } - - /** - * Creates a path for a new GridFS file, which does not yet have an ID. - * - * @return string - */ - private function createPathForUpload() - { - return sprintf( - '%s://%s/%s.files', - self::$streamWrapperProtocol, - urlencode($this->databaseName), - urlencode($this->bucketName) - ); - } - - /** - * Returns the names of the files collection. - * - * @return string - */ - private function getFilesNamespace() - { - return sprintf('%s.%s.files', $this->databaseName, $this->bucketName); - } - - /** - * Gets the file document of the GridFS file associated with a stream. - * - * This returns the raw document from the StreamWrapper, which does not - * respect the Bucket's type map. - * - * @param resource $stream GridFS stream - * @return stdClass - * @throws InvalidArgumentException - */ - private function getRawFileDocumentForStream($stream) - { - if ( ! is_resource($stream) || get_resource_type($stream) != "stream") { - throw InvalidArgumentException::invalidType('$stream', $stream, 'resource'); - } - - $metadata = stream_get_meta_data($stream); - - if ( ! isset ($metadata['wrapper_data']) || ! $metadata['wrapper_data'] instanceof StreamWrapper) { - throw InvalidArgumentException::invalidType('$stream wrapper data', isset($metadata['wrapper_data']) ? $metadata['wrapper_data'] : null, 'MongoDB\Driver\GridFS\StreamWrapper'); - } - - return $metadata['wrapper_data']->getFile(); - } - - /** - * Opens a readable stream for the GridFS file. - * - * @param stdClass $file GridFS file document - * @return resource - */ - private function openDownloadStreamByFile(stdClass $file) - { - $path = $this->createPathForFile($file); - $context = stream_context_create([ - self::$streamWrapperProtocol => [ - 'collectionWrapper' => $this->collectionWrapper, - 'file' => $file, - ], - ]); - - return fopen($path, 'r', false, $context); - } - - /** - * Registers the GridFS stream wrapper if it is not already registered. - */ - private function registerStreamWrapper() - { - if (in_array(self::$streamWrapperProtocol, stream_get_wrappers())) { - return; - } - - StreamWrapper::register(self::$streamWrapperProtocol); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/CollectionWrapper.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/CollectionWrapper.php deleted file mode 100644 index 8c81c83..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/CollectionWrapper.php +++ /dev/null @@ -1,318 +0,0 @@ -<?php -/* - * Copyright 2016-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\GridFS; - -use MongoDB\Collection; -use MongoDB\UpdateResult; -use MongoDB\Driver\Cursor; -use MongoDB\Driver\Manager; -use MongoDB\Driver\ReadPreference; -use stdClass; - -/** - * CollectionWrapper abstracts the GridFS files and chunks collections. - * - * @internal - */ -class CollectionWrapper -{ - private $bucketName; - private $chunksCollection; - private $databaseName; - private $checkedIndexes = false; - private $filesCollection; - - /** - * Constructs a GridFS collection wrapper. - * - * @see Collection::__construct() for supported options - * @param Manager $manager Manager instance from the driver - * @param string $databaseName Database name - * @param string $bucketName Bucket name - * @param array $collectionOptions Collection options - * @throws InvalidArgumentException - */ - public function __construct(Manager $manager, $databaseName, $bucketName, array $collectionOptions = []) - { - $this->databaseName = (string) $databaseName; - $this->bucketName = (string) $bucketName; - - $this->filesCollection = new Collection($manager, $databaseName, sprintf('%s.files', $bucketName), $collectionOptions); - $this->chunksCollection = new Collection($manager, $databaseName, sprintf('%s.chunks', $bucketName), $collectionOptions); - } - - /** - * Deletes all GridFS chunks for a given file ID. - * - * @param mixed $id - */ - public function deleteChunksByFilesId($id) - { - $this->chunksCollection->deleteMany(['files_id' => $id]); - } - - /** - * Deletes a GridFS file and related chunks by ID. - * - * @param mixed $id - */ - public function deleteFileAndChunksById($id) - { - $this->filesCollection->deleteOne(['_id' => $id]); - $this->chunksCollection->deleteMany(['files_id' => $id]); - } - - /** - * Drops the GridFS files and chunks collections. - */ - public function dropCollections() - { - $this->filesCollection->drop(['typeMap' => []]); - $this->chunksCollection->drop(['typeMap' => []]); - } - - /** - * Finds GridFS chunk documents for a given file ID and optional offset. - * - * @param mixed $id File ID - * @param integer $fromChunk Starting chunk (inclusive) - * @return Cursor - */ - public function findChunksByFileId($id, $fromChunk = 0) - { - return $this->chunksCollection->find( - [ - 'files_id' => $id, - 'n' => ['$gte' => $fromChunk], - ], - [ - 'sort' => ['n' => 1], - 'typeMap' => ['root' => 'stdClass'], - ] - ); - } - - /** - * Finds a GridFS file document for a given filename and revision. - * - * Revision numbers are defined as follows: - * - * * 0 = the original stored file - * * 1 = the first revision - * * 2 = the second revision - * * etc… - * * -2 = the second most recent revision - * * -1 = the most recent revision - * - * @see Bucket::downloadToStreamByName() - * @see Bucket::openDownloadStreamByName() - * @param string $filename - * @param integer $revision - * @return stdClass|null - */ - public function findFileByFilenameAndRevision($filename, $revision) - { - $filename = (string) $filename; - $revision = (integer) $revision; - - if ($revision < 0) { - $skip = abs($revision) - 1; - $sortOrder = -1; - } else { - $skip = $revision; - $sortOrder = 1; - } - - return $this->filesCollection->findOne( - ['filename' => $filename], - [ - 'skip' => $skip, - 'sort' => ['uploadDate' => $sortOrder], - 'typeMap' => ['root' => 'stdClass'], - ] - ); - } - - /** - * Finds a GridFS file document for a given ID. - * - * @param mixed $id - * @return stdClass|null - */ - public function findFileById($id) - { - return $this->filesCollection->findOne( - ['_id' => $id], - ['typeMap' => ['root' => 'stdClass']] - ); - } - - /** - * Finds documents from the GridFS bucket's files collection. - * - * @see Find::__construct() for supported options - * @param array|object $filter Query by which to filter documents - * @param array $options Additional options - * @return Cursor - */ - public function findFiles($filter, array $options = []) - { - return $this->filesCollection->find($filter, $options); - } - - /** - * Finds a single document from the GridFS bucket's files collection. - * - * @param array|object $filter Query by which to filter documents - * @param array $options Additional options - * @return array|object|null - */ - public function findOneFile($filter, array $options = []) - { - return $this->filesCollection->findOne($filter, $options); - } - - /** - * Return the bucket name. - * - * @return string - */ - public function getBucketName() - { - return $this->bucketName; - } - - /** - * Return the database name. - * - * @return string - */ - public function getDatabaseName() - { - return $this->databaseName; - } - - /** - * Inserts a document into the chunks collection. - * - * @param array|object $chunk Chunk document - */ - public function insertChunk($chunk) - { - if ( ! $this->checkedIndexes) { - $this->ensureIndexes(); - } - - $this->chunksCollection->insertOne($chunk); - } - - /** - * Inserts a document into the files collection. - * - * The file document should be inserted after all chunks have been inserted. - * - * @param array|object $file File document - */ - public function insertFile($file) - { - if ( ! $this->checkedIndexes) { - $this->ensureIndexes(); - } - - $this->filesCollection->insertOne($file); - } - - /** - * Updates the filename field in the file document for a given ID. - * - * @param mixed $id - * @param string $filename - * @return UpdateResult - */ - public function updateFilenameForId($id, $filename) - { - return $this->filesCollection->updateOne( - ['_id' => $id], - ['$set' => ['filename' => (string) $filename]] - ); - } - - /** - * Create an index on the chunks collection if it does not already exist. - */ - private function ensureChunksIndex() - { - foreach ($this->chunksCollection->listIndexes() as $index) { - if ($index->isUnique() && $index->getKey() === ['files_id' => 1, 'n' => 1]) { - return; - } - } - - $this->chunksCollection->createIndex(['files_id' => 1, 'n' => 1], ['unique' => true]); - } - - /** - * Create an index on the files collection if it does not already exist. - */ - private function ensureFilesIndex() - { - foreach ($this->filesCollection->listIndexes() as $index) { - if ($index->getKey() === ['filename' => 1, 'uploadDate' => 1]) { - return; - } - } - - $this->filesCollection->createIndex(['filename' => 1, 'uploadDate' => 1]); - } - - /** - * Ensure indexes on the files and chunks collections exist. - * - * This method is called once before the first write operation on a GridFS - * bucket. Indexes are only be created if the files collection is empty. - */ - private function ensureIndexes() - { - if ($this->checkedIndexes) { - return; - } - - $this->checkedIndexes = true; - - if ( ! $this->isFilesCollectionEmpty()) { - return; - } - - $this->ensureFilesIndex(); - $this->ensureChunksIndex(); - } - - /** - * Returns whether the files collection is empty. - * - * @return boolean - */ - private function isFilesCollectionEmpty() - { - return null === $this->filesCollection->findOne([], [ - 'readPreference' => new ReadPreference(ReadPreference::RP_PRIMARY), - 'projection' => ['_id' => 1], - 'typeMap' => [], - ]); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Exception/CorruptFileException.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Exception/CorruptFileException.php deleted file mode 100644 index 787c9b8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Exception/CorruptFileException.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/* - * Copyright 2016-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\GridFS\Exception; - -use MongoDB\Exception\RuntimeException; - -class CorruptFileException extends RuntimeException -{ - /** - * Thrown when a chunk is not found for an expected index. - * - * @param integer $expectedIndex Expected index number - * @return self - */ - public static function missingChunk($expectedIndex) - { - return new static(sprintf('Chunk not found for index "%d"', $expectedIndex)); - } - - /** - * Thrown when a chunk has an unexpected index number. - * - * @param integer $index Actual index number (i.e. "n" field) - * @param integer $expectedIndex Expected index number - * @return self - */ - public static function unexpectedIndex($index, $expectedIndex) - { - return new static(sprintf('Expected chunk to have index "%d" but found "%d"', $expectedIndex, $index)); - } - - /** - * Thrown when a chunk has an unexpected data size. - * - * @param integer $size Actual size (i.e. "data" field length) - * @param integer $expectedSize Expected size - * @return self - */ - public static function unexpectedSize($size, $expectedSize) - { - return new static(sprintf('Expected chunk to have size "%d" but found "%d"', $expectedSize, $size)); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Exception/FileNotFoundException.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Exception/FileNotFoundException.php deleted file mode 100644 index 2d3d037..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/Exception/FileNotFoundException.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/* - * Copyright 2016-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\GridFS\Exception; - -use MongoDB\Exception\RuntimeException; - -class FileNotFoundException extends RuntimeException -{ - /** - * Thrown when a file cannot be found by its filename and revision. - * - * @param string $filename Filename - * @param integer $revision Revision - * @param string $namespace Namespace for the files collection - * @return self - */ - public static function byFilenameAndRevision($filename, $revision, $namespace) - { - return new static(sprintf('File with name "%s" and revision "%d" not found in "%s"', $filename, $revision, $namespace)); - } - - /** - * Thrown when a file cannot be found by its ID. - * - * @param mixed $id File ID - * @param string $namespace Namespace for the files collection - * @return self - */ - public static function byId($id, $namespace) - { - $json = \MongoDB\BSON\toJSON(\MongoDB\BSON\fromPHP(['_id' => $id])); - - return new static(sprintf('File "%s" not found in "%s"', $json, $namespace)); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/ReadableStream.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/ReadableStream.php deleted file mode 100644 index 3cb5781..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/ReadableStream.php +++ /dev/null @@ -1,235 +0,0 @@ -<?php -/* - * Copyright 2016-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\GridFS; - -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\GridFS\Exception\CorruptFileException; -use IteratorIterator; -use stdClass; - -/** - * ReadableStream abstracts the process of reading a GridFS file. - * - * @internal - */ -class ReadableStream -{ - private $buffer; - private $bufferOffset = 0; - private $chunkSize; - private $chunkOffset = 0; - private $chunksIterator; - private $collectionWrapper; - private $expectedLastChunkSize = 0; - private $file; - private $length; - private $numChunks = 0; - - /** - * Constructs a readable GridFS stream. - * - * @param CollectionWrapper $collectionWrapper GridFS collection wrapper - * @param stdClass $file GridFS file document - * @throws CorruptFileException - */ - public function __construct(CollectionWrapper $collectionWrapper, stdClass $file) - { - if ( ! isset($file->chunkSize) || ! is_integer($file->chunkSize) || $file->chunkSize < 1) { - throw new CorruptFileException('file.chunkSize is not an integer >= 1'); - } - - if ( ! isset($file->length) || ! is_integer($file->length) || $file->length < 0) { - throw new CorruptFileException('file.length is not an integer > 0'); - } - - if ( ! isset($file->_id) && ! property_exists($file, '_id')) { - throw new CorruptFileException('file._id does not exist'); - } - - $this->file = $file; - $this->chunkSize = (integer) $file->chunkSize; - $this->length = (integer) $file->length; - - $this->collectionWrapper = $collectionWrapper; - - if ($this->length > 0) { - $this->numChunks = (integer) ceil($this->length / $this->chunkSize); - $this->expectedLastChunkSize = ($this->length - (($this->numChunks - 1) * $this->chunkSize)); - } - } - - /** - * Return internal properties for debugging purposes. - * - * @see http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo - * @return array - */ - public function __debugInfo() - { - return [ - 'bucketName' => $this->collectionWrapper->getBucketName(), - 'databaseName' => $this->collectionWrapper->getDatabaseName(), - 'file' => $this->file, - ]; - } - - public function close() - { - // Nothing to do - } - - /** - * Return the stream's file document. - * - * @return stdClass - */ - public function getFile() - { - return $this->file; - } - - /** - * Return the stream's size in bytes. - * - * @return integer - */ - public function getSize() - { - return $this->length; - } - - /** - * Return whether the current read position is at the end of the stream. - * - * @return boolean - */ - public function isEOF() - { - if ($this->chunkOffset === $this->numChunks - 1) { - return $this->bufferOffset >= $this->expectedLastChunkSize; - } - - return $this->chunkOffset >= $this->numChunks; - } - - /** - * Read bytes from the stream. - * - * 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 - */ - public function readBytes($length) - { - if ($length < 0) { - throw new InvalidArgumentException(sprintf('$length must be >= 0; given: %d', $length)); - } - - if ($this->chunksIterator === null) { - $this->initChunksIterator(); - } - - if ($this->buffer === null && ! $this->initBufferFromCurrentChunk()) { - return ''; - } - - $data = ''; - - while (strlen($data) < $length) { - if ($this->bufferOffset >= strlen($this->buffer) && ! $this->initBufferFromNextChunk()) { - break; - } - - $initialDataLength = strlen($data); - $data .= substr($this->buffer, $this->bufferOffset, $length - $initialDataLength); - $this->bufferOffset += strlen($data) - $initialDataLength; - } - - return $data; - } - - /** - * Initialize the buffer to the current chunk's data. - * - * @return boolean Whether there was a current chunk to read - * @throws CorruptFileException if an expected chunk could not be read successfully - */ - private function initBufferFromCurrentChunk() - { - if ($this->chunkOffset === 0 && $this->numChunks === 0) { - return false; - } - - if ( ! $this->chunksIterator->valid()) { - throw CorruptFileException::missingChunk($this->chunkOffset); - } - - $currentChunk = $this->chunksIterator->current(); - - if ($currentChunk->n !== $this->chunkOffset) { - throw CorruptFileException::unexpectedIndex($currentChunk->n, $this->chunkOffset); - } - - $this->buffer = $currentChunk->data->getData(); - - $actualChunkSize = strlen($this->buffer); - - $expectedChunkSize = ($this->chunkOffset === $this->numChunks - 1) - ? $this->expectedLastChunkSize - : $this->chunkSize; - - if ($actualChunkSize !== $expectedChunkSize) { - throw CorruptFileException::unexpectedSize($actualChunkSize, $expectedChunkSize); - } - - return true; - } - - /** - * Advance to the next chunk and initialize the buffer to its data. - * - * @return boolean Whether there was a next chunk to read - * @throws CorruptFileException if an expected chunk could not be read successfully - */ - private function initBufferFromNextChunk() - { - if ($this->chunkOffset === $this->numChunks - 1) { - return false; - } - - $this->bufferOffset = 0; - $this->chunkOffset++; - $this->chunksIterator->next(); - - return $this->initBufferFromCurrentChunk(); - } - - /** - * Initializes the chunk iterator starting from the current offset. - */ - private function initChunksIterator() - { - $cursor = $this->collectionWrapper->findChunksByFileId($this->file->_id, $this->chunkOffset); - - $this->chunksIterator = new IteratorIterator($cursor); - $this->chunksIterator->rewind(); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/StreamWrapper.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/StreamWrapper.php deleted file mode 100644 index 6902251..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/StreamWrapper.php +++ /dev/null @@ -1,262 +0,0 @@ -<?php -/* - * Copyright 2016-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\GridFS; - -use MongoDB\BSON\UTCDateTime; -use Exception; - -/** - * Stream wrapper for reading and writing a GridFS file. - * - * @internal - * @see Bucket::openUploadStream() - * @see Bucket::openDownloadStream() - */ -class StreamWrapper -{ - /** - * @var resource|null Stream context (set by PHP) - */ - public $context; - - private $mode; - private $protocol; - private $stream; - - /** - * Return the stream's file document. - * - * @return stdClass - */ - public function getFile() - { - return $this->stream->getFile(); - } - - /** - * Register the GridFS stream wrapper. - * - * @param string $protocol Protocol to use for stream_wrapper_register() - */ - public static function register($protocol = 'gridfs') - { - if (in_array($protocol, stream_get_wrappers())) { - stream_wrapper_unregister($protocol); - } - - stream_wrapper_register($protocol, get_called_class(), \STREAM_IS_URL); - } - - /** - * Closes the stream. - * - * @see http://php.net/manual/en/streamwrapper.stream-close.php - */ - public function stream_close() - { - $this->stream->close(); - } - - /** - * Returns whether the file pointer is at the end of the stream. - * - * @see http://php.net/manual/en/streamwrapper.stream-eof.php - * @return boolean - */ - public function stream_eof() - { - if ( ! $this->stream instanceof ReadableStream) { - return false; - } - - return $this->stream->isEOF(); - } - - /** - * Opens the stream. - * - * @see http://php.net/manual/en/streamwrapper.stream-open.php - * @param string $path Path to the file resource - * @param string $mode Mode used to open the file (only "r" and "w" are supported) - * @param integer $options Additional flags set by the streams API - * @param string $openedPath Not used - */ - public function stream_open($path, $mode, $options, &$openedPath) - { - $this->initProtocol($path); - $this->mode = $mode; - - if ($mode === 'r') { - return $this->initReadableStream(); - } - - if ($mode === 'w') { - return $this->initWritableStream(); - } - - return false; - } - - /** - * Read bytes from the stream. - * - * 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 - */ - public function stream_read($length) - { - if ( ! $this->stream instanceof ReadableStream) { - return ''; - } - - try { - return $this->stream->readBytes($length); - } catch (Exception $e) { - trigger_error(sprintf('%s: %s', get_class($e), $e->getMessage()), \E_USER_WARNING); - return false; - } - } - - /** - * Return information about the stream. - * - * @see http://php.net/manual/en/streamwrapper.stream-stat.php - * @return array - */ - public function stream_stat() - { - $stat = $this->getStatTemplate(); - - $stat[2] = $stat['mode'] = $this->stream instanceof ReadableStream - ? 0100444 // S_IFREG & S_IRUSR & S_IRGRP & S_IROTH - : 0100222; // S_IFREG & S_IWUSR & S_IWGRP & S_IWOTH - $stat[7] = $stat['size'] = $this->stream->getSize(); - - $file = $this->stream->getFile(); - - if (isset($file->uploadDate) && $file->uploadDate instanceof UTCDateTime) { - $timestamp = $file->uploadDate->toDateTime()->getTimestamp(); - $stat[9] = $stat['mtime'] = $timestamp; - $stat[10] = $stat['ctime'] = $timestamp; - } - - if (isset($file->chunkSize) && is_integer($file->chunkSize)) { - $stat[11] = $stat['blksize'] = $file->chunkSize; - } - - return $stat; - } - - /** - * Write bytes to the stream. - * - * @see http://php.net/manual/en/streamwrapper.stream-write.php - * @param string $data Data to write - * @return integer The number of bytes written - */ - public function stream_write($data) - { - if ( ! $this->stream instanceof WritableStream) { - return 0; - } - - try { - return $this->stream->writeBytes($data); - } catch (Exception $e) { - trigger_error(sprintf('%s: %s', get_class($e), $e->getMessage()), \E_USER_WARNING); - return false; - } - } - - /** - * Returns a stat template with default values. - * - * @return array - */ - private function getStatTemplate() - { - return [ - 0 => 0, 'dev' => 0, - 1 => 0, 'ino' => 0, - 2 => 0, 'mode' => 0, - 3 => 0, 'nlink' => 0, - 4 => 0, 'uid' => 0, - 5 => 0, 'gid' => 0, - 6 => -1, 'rdev' => -1, - 7 => 0, 'size' => 0, - 8 => 0, 'atime' => 0, - 9 => 0, 'mtime' => 0, - 10 => 0, 'ctime' => 0, - 11 => -1, 'blksize' => -1, - 12 => -1, 'blocks' => -1, - ]; - } - - /** - * Initialize the protocol from the given path. - * - * @see StreamWrapper::stream_open() - * @param string $path - */ - private function initProtocol($path) - { - $parts = explode('://', $path, 2); - $this->protocol = $parts[0] ?: 'gridfs'; - } - - /** - * Initialize the internal stream for reading. - * - * @see StreamWrapper::stream_open() - * @return boolean - */ - private function initReadableStream() - { - $context = stream_context_get_options($this->context); - - $this->stream = new ReadableStream( - $context[$this->protocol]['collectionWrapper'], - $context[$this->protocol]['file'] - ); - - return true; - } - - /** - * Initialize the internal stream for writing. - * - * @see StreamWrapper::stream_open() - * @return boolean - */ - private function initWritableStream() - { - $context = stream_context_get_options($this->context); - - $this->stream = new WritableStream( - $context[$this->protocol]['collectionWrapper'], - $context[$this->protocol]['filename'], - $context[$this->protocol]['options'] - ); - - return true; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/WritableStream.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/WritableStream.php deleted file mode 100644 index 0f40b88..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/GridFS/WritableStream.php +++ /dev/null @@ -1,252 +0,0 @@ -<?php -/* - * Copyright 2016-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\GridFS; - -use MongoDB\BSON\Binary; -use MongoDB\BSON\ObjectId; -use MongoDB\BSON\UTCDateTime; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\RuntimeException; - -/** - * WritableStream abstracts the process of writing a GridFS file. - * - * @internal - */ -class WritableStream -{ - private static $defaultChunkSizeBytes = 261120; - - private $buffer = ''; - private $chunkOffset = 0; - private $chunkSize; - private $collectionWrapper; - private $ctx; - private $file; - private $isClosed = false; - private $length = 0; - - /** - * Constructs a writable GridFS stream. - * - * Supported options: - * - * * _id (mixed): File document identifier. Defaults to a new ObjectId. - * - * * aliases (array of strings): DEPRECATED An array of aliases. - * Applications wishing to store aliases should add an aliases field to - * the metadata document instead. - * - * * chunkSizeBytes (integer): The chunk size in bytes. Defaults to - * 261120 (i.e. 255 KiB). - * - * * contentType (string): DEPRECATED content type to be stored with the - * file. This information should now be added to the metadata. - * - * * metadata (document): User data for the "metadata" field of the files - * collection document. - * - * @param CollectionWrapper $collectionWrapper GridFS collection wrapper - * @param string $filename Filename - * @param array $options Upload options - * @throws InvalidArgumentException - */ - public function __construct(CollectionWrapper $collectionWrapper, $filename, array $options = []) - { - $options += [ - '_id' => new ObjectId, - 'chunkSizeBytes' => self::$defaultChunkSizeBytes, - ]; - - if (isset($options['aliases']) && ! \MongoDB\is_string_array($options['aliases'])) { - throw InvalidArgumentException::invalidType('"aliases" option', $options['aliases'], 'array of strings'); - } - - if (isset($options['chunkSizeBytes']) && ! is_integer($options['chunkSizeBytes'])) { - throw InvalidArgumentException::invalidType('"chunkSizeBytes" option', $options['chunkSizeBytes'], 'integer'); - } - - if (isset($options['chunkSizeBytes']) && $options['chunkSizeBytes'] < 1) { - throw new InvalidArgumentException(sprintf('Expected "chunkSizeBytes" option to be >= 1, %d given', $options['chunkSizeBytes'])); - } - - if (isset($options['contentType']) && ! is_string($options['contentType'])) { - throw InvalidArgumentException::invalidType('"contentType" option', $options['contentType'], 'string'); - } - - if (isset($options['metadata']) && ! is_array($options['metadata']) && ! is_object($options['metadata'])) { - throw InvalidArgumentException::invalidType('"metadata" option', $options['metadata'], 'array or object'); - } - - $this->chunkSize = $options['chunkSizeBytes']; - $this->collectionWrapper = $collectionWrapper; - $this->ctx = hash_init('md5'); - - $this->file = [ - '_id' => $options['_id'], - 'chunkSize' => $this->chunkSize, - 'filename' => (string) $filename, - 'uploadDate' => new UTCDateTime, - ] + array_intersect_key($options, ['aliases' => 1, 'contentType' => 1, 'metadata' => 1]); - } - - /** - * Return internal properties for debugging purposes. - * - * @see http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo - * @return array - */ - public function __debugInfo() - { - return [ - 'bucketName' => $this->collectionWrapper->getBucketName(), - 'databaseName' => $this->collectionWrapper->getDatabaseName(), - 'file' => $this->file, - ]; - } - - /** - * Closes an active stream and flushes all buffered data to GridFS. - */ - public function close() - { - if ($this->isClosed) { - // TODO: Should this be an error condition? e.g. BadMethodCallException - return; - } - - if (strlen($this->buffer) > 0) { - $this->insertChunkFromBuffer(); - } - - $this->fileCollectionInsert(); - $this->isClosed = true; - } - - /** - * Return the stream's file document. - * - * @return stdClass - */ - public function getFile() - { - return (object) $this->file; - } - - /** - * Return the stream's size in bytes. - * - * Note: this value will increase as more data is written to the stream. - * - * @return integer - */ - public function getSize() - { - return $this->length + strlen($this->buffer); - } - - /** - * Inserts binary data into GridFS via chunks. - * - * Data will be buffered internally until chunkSizeBytes are accumulated, at - * which point a chunk document will be inserted and the buffer reset. - * - * @param string $data Binary data to write - * @return integer - */ - public function writeBytes($data) - { - if ($this->isClosed) { - // TODO: Should this be an error condition? e.g. BadMethodCallException - return; - } - - $bytesRead = 0; - - while ($bytesRead != strlen($data)) { - $initialBufferLength = strlen($this->buffer); - $this->buffer .= substr($data, $bytesRead, $this->chunkSize - $initialBufferLength); - $bytesRead += strlen($this->buffer) - $initialBufferLength; - - if (strlen($this->buffer) == $this->chunkSize) { - $this->insertChunkFromBuffer(); - } - } - - return $bytesRead; - } - - private function abort() - { - try { - $this->collectionWrapper->deleteChunksByFilesId($this->file['_id']); - } catch (DriverRuntimeException $e) { - // We are already handling an error if abort() is called, so suppress this - } - - $this->isClosed = true; - } - - private function fileCollectionInsert() - { - $md5 = hash_final($this->ctx); - - $this->file['length'] = $this->length; - $this->file['md5'] = $md5; - - try { - $this->collectionWrapper->insertFile($this->file); - } catch (DriverRuntimeException $e) { - $this->abort(); - - throw $e; - } - - return $this->file['_id']; - } - - private function insertChunkFromBuffer() - { - if (strlen($this->buffer) == 0) { - return; - } - - $data = $this->buffer; - $this->buffer = ''; - - $chunk = [ - 'files_id' => $this->file['_id'], - 'n' => $this->chunkOffset, - 'data' => new Binary($data, Binary::TYPE_GENERIC), - ]; - - hash_update($this->ctx, $data); - - try { - $this->collectionWrapper->insertChunk($chunk); - } catch (DriverRuntimeException $e) { - $this->abort(); - - throw $e; - } - - $this->length += strlen($data); - $this->chunkOffset++; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/InsertManyResult.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/InsertManyResult.php deleted file mode 100644 index 7c47bec..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/InsertManyResult.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB; - -use MongoDB\Driver\WriteResult; -use MongoDB\Exception\BadMethodCallException; - -/** - * Result class for a multi-document insert operation. - */ -class InsertManyResult -{ - private $writeResult; - private $insertedIds; - private $isAcknowledged; - - /** - * Constructor. - * - * @param WriteResult $writeResult - * @param mixed[] $insertedIds - */ - public function __construct(WriteResult $writeResult, array $insertedIds) - { - $this->writeResult = $writeResult; - $this->insertedIds = $insertedIds; - $this->isAcknowledged = $writeResult->isAcknowledged(); - } - - /** - * Return the number of documents that were inserted. - * - * This method should only be called if the write was acknowledged. - * - * @see InsertManyResult::isAcknowledged() - * @return integer - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getInsertedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getInsertedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return a map of the inserted documents' IDs. - * - * The index of each ID in the map corresponds to each document's position - * in the bulk operation. If a document had an ID prior to inserting (i.e. - * the driver did not generate an ID), the index will contain its "_id" - * field value. Any driver-generated ID will be a MongoDB\BSON\ObjectID - * instance. - * - * @return mixed[] - */ - public function getInsertedIds() - { - return $this->insertedIds; - } - - /** - * Return whether this insert result was acknowledged by the server. - * - * If the insert was not acknowledged, other fields from the WriteResult - * (e.g. insertedCount) will be undefined. - * - * @return boolean - */ - public function isAcknowledged() - { - return $this->writeResult->isAcknowledged(); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/InsertOneResult.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/InsertOneResult.php deleted file mode 100644 index d379281..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/InsertOneResult.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB; - -use MongoDB\Driver\WriteResult; -use MongoDB\Exception\BadMethodCallException; - -/** - * Result class for a single-document insert operation. - */ -class InsertOneResult -{ - private $writeResult; - private $insertedId; - private $isAcknowledged; - - /** - * Constructor. - * - * @param WriteResult $writeResult - * @param mixed $insertedId - */ - public function __construct(WriteResult $writeResult, $insertedId) - { - $this->writeResult = $writeResult; - $this->insertedId = $insertedId; - $this->isAcknowledged = $writeResult->isAcknowledged(); - } - - /** - * Return the number of documents that were inserted. - * - * This method should only be called if the write was acknowledged. - * - * @see InsertOneResult::isAcknowledged() - * @return integer - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getInsertedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getInsertedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return the inserted document's ID. - * - * If the document had an ID prior to inserting (i.e. the driver did not - * need to generate an ID), this will contain its "_id". Any - * driver-generated ID will be a MongoDB\BSON\ObjectID instance. - * - * @return mixed - */ - public function getInsertedId() - { - return $this->insertedId; - } - - /** - * Return whether this insert was acknowledged by the server. - * - * If the insert was not acknowledged, other fields from the WriteResult - * (e.g. insertedCount) will be undefined. - * - * If the insert was not acknowledged, other fields from the WriteResult - * (e.g. insertedCount) will be undefined and their getter methods should - * not be invoked. - * - * @return boolean - */ - public function isAcknowledged() - { - return $this->writeResult->isAcknowledged(); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/BSONArray.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/BSONArray.php deleted file mode 100644 index 8474328..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/BSONArray.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php -/* - * Copyright 2016-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use MongoDB\BSON\Serializable; -use MongoDB\BSON\Unserializable; -use ArrayObject; -use JsonSerializable; - -/** - * Model class for a BSON array. - * - * The internal data will be filtered through array_values() during BSON - * serialization to ensure that it becomes a BSON array. - * - * @api - */ -class BSONArray extends ArrayObject implements JsonSerializable, Serializable, Unserializable -{ - /** - * Factory method for var_export(). - * - * @see http://php.net/oop5.magic#object.set-state - * @see http://php.net/var-export - * @param array $properties - * @return self - */ - public static function __set_state(array $properties) - { - $array = new static; - $array->exchangeArray($properties); - - return $array; - } - - /** - * Serialize the array to BSON. - * - * The array data will be numerically reindexed to ensure that it is stored - * as a BSON array. - * - * @see http://php.net/mongodb-bson-serializable.bsonserialize - * @return array - */ - public function bsonSerialize() - { - return array_values($this->getArrayCopy()); - } - - /** - * Unserialize the document to BSON. - * - * @see http://php.net/mongodb-bson-unserializable.bsonunserialize - * @param array $data Array data - */ - public function bsonUnserialize(array $data) - { - self::__construct($data); - } - - /** - * Serialize the array to JSON. - * - * The array data will be numerically reindexed to ensure that it is stored - * as a JSON array. - * - * @see http://php.net/jsonserializable.jsonserialize - * @return array - */ - public function jsonSerialize() - { - return array_values($this->getArrayCopy()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/BSONDocument.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/BSONDocument.php deleted file mode 100644 index 594c67e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/BSONDocument.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php -/* - * Copyright 2016-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use MongoDB\BSON\Serializable; -use MongoDB\BSON\Unserializable; -use ArrayObject; -use JsonSerializable; - -/** - * Model class for a BSON document. - * - * The internal data will be cast to an object during BSON serialization to - * ensure that it becomes a BSON document. - * - * @api - */ -class BSONDocument extends ArrayObject implements JsonSerializable, Serializable, Unserializable -{ - /** - * Constructor. - * - * This overrides the parent constructor to allow property access of entries - * by default. - * - * @see http://php.net/arrayobject.construct - */ - public function __construct($input = [], $flags = ArrayObject::ARRAY_AS_PROPS, $iterator_class = 'ArrayIterator') - { - parent::__construct($input, $flags, $iterator_class); - } - - /** - * Factory method for var_export(). - * - * @see http://php.net/oop5.magic#object.set-state - * @see http://php.net/var-export - * @param array $properties - * @return self - */ - public static function __set_state(array $properties) - { - $document = new static; - $document->exchangeArray($properties); - - return $document; - } - - /** - * Serialize the document to BSON. - * - * @see http://php.net/mongodb-bson-serializable.bsonserialize - * @return object - */ - public function bsonSerialize() - { - return (object) $this->getArrayCopy(); - } - - /** - * Unserialize the document to BSON. - * - * @see http://php.net/mongodb-bson-unserializable.bsonunserialize - * @param array $data Array data - */ - public function bsonUnserialize(array $data) - { - parent::__construct($data, ArrayObject::ARRAY_AS_PROPS); - } - - /** - * Serialize the array to JSON. - * - * @see http://php.net/jsonserializable.jsonserialize - * @return object - */ - public function jsonSerialize() - { - return (object) $this->getArrayCopy(); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfo.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfo.php deleted file mode 100644 index 70d90dd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfo.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -/** - * Collection information model class. - * - * This class models the collection information returned by the listCollections - * command or, for legacy servers, queries on the "system.namespaces" - * collection. It provides methods to access options for the collection. - * - * @api - * @see \MongoDB\Database::listCollections() - * @see https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst - */ -class CollectionInfo -{ - private $info; - - /** - * Constructor. - * - * @param array $info Collection info - */ - public function __construct(array $info) - { - $this->info = $info; - } - - /** - * Return the collection info as an array. - * - * @see http://php.net/oop5.magic#language.oop5.magic.debuginfo - * @return array - */ - public function __debugInfo() - { - return $this->info; - } - - /** - * Return the maximum number of documents to keep in the capped collection. - * - * @return integer|null - */ - public function getCappedMax() - { - return isset($this->info['options']['max']) ? (integer) $this->info['options']['max'] : null; - } - - /** - * Return the maximum size (in bytes) of the capped collection. - * - * @return integer|null - */ - public function getCappedSize() - { - return isset($this->info['options']['size']) ? (integer) $this->info['options']['size'] : null; - } - - /** - * Return the collection name. - * - * @return string - */ - public function getName() - { - return (string) $this->info['name']; - } - - /** - * Return the collection options. - * - * @return array - */ - public function getOptions() - { - return isset($this->info['options']) ? (array) $this->info['options'] : []; - } - - /** - * Return whether the collection is a capped collection. - * - * @return boolean - */ - public function isCapped() - { - return ! empty($this->info['options']['capped']); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoCommandIterator.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoCommandIterator.php deleted file mode 100644 index c4b7b8d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoCommandIterator.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use IteratorIterator; - -/** - * CollectionInfoIterator for listCollections command results. - * - * This iterator may be used to wrap a Cursor returned by the listCollections - * command. - * - * @internal - * @see \MongoDB\Database::listCollections() - * @see https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst - * @see http://docs.mongodb.org/manual/reference/command/listCollections/ - */ -class CollectionInfoCommandIterator extends IteratorIterator implements CollectionInfoIterator -{ - /** - * Return the current element as a CollectionInfo instance. - * - * @see CollectionInfoIterator::current() - * @see http://php.net/iterator.current - * @return CollectionInfo - */ - public function current() - { - return new CollectionInfo(parent::current()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoIterator.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoIterator.php deleted file mode 100644 index 999ee9a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoIterator.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use Iterator; - -/** - * CollectionInfoIterator interface. - * - * This iterator is used for enumerating collections in a database. - * - * @api - * @see \MongoDB\Database::listCollections() - */ -interface CollectionInfoIterator extends Iterator -{ - /** - * Return the current element as a CollectionInfo instance. - * - * @return CollectionInfo - */ - public function current(); -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoLegacyIterator.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoLegacyIterator.php deleted file mode 100644 index e68491f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/CollectionInfoLegacyIterator.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use FilterIterator; -use Iterator; -use IteratorIterator; -use Traversable; - -/** - * CollectionInfoIterator for legacy "system.namespaces" query results. - * - * This iterator may be used to wrap a Cursor returned for queries on the - * "system.namespaces" collection. It includes logic to filter out internal - * collections and modify the collection name to be consistent with results from - * the listCollections command. - * - * @internal - * @see \MongoDB\Database::listCollections() - * @see https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst - * @see http://docs.mongodb.org/manual/reference/command/listCollections/ - * @see http://docs.mongodb.org/manual/reference/system-collections/ - */ -class CollectionInfoLegacyIterator extends FilterIterator implements CollectionInfoIterator -{ - /** - * Constructor. - * - * @param Traversable $iterator - */ - public function __construct(Traversable $iterator) - { - /* FilterIterator requires an Iterator, so wrap all other Traversables - * with an IteratorIterator as a convenience. - */ - if ( ! $iterator instanceof Iterator) { - $iterator = new IteratorIterator($iterator); - } - - parent::__construct($iterator); - } - - /** - * Filter out internal or invalid collections. - * - * @see http://php.net/filteriterator.accept - * @return boolean - */ - public function accept() - { - $info = parent::current(); - - if ( ! isset($info['name']) || ! is_string($info['name'])) { - return false; - } - - // Reject names with "$" characters (e.g. indexes, oplog) - if (strpos($info['name'], '$') !== false) { - return false; - } - - $firstDot = strpos($info['name'], '.'); - - /* Legacy collection names are a namespace and should be prefixed with - * the database name and a dot. Reject values that omit this prefix or - * are empty beyond it. - */ - if ($firstDot === false || $firstDot + 1 == strlen($info['name'])) { - return false; - } - - return true; - } - - /** - * Return the current element as a CollectionInfo instance. - * - * @see CollectionInfoIterator::current() - * @see http://php.net/iterator.current - * @return CollectionInfo - */ - public function current() - { - $info = parent::current(); - - // Trim the database prefix up to and including the first dot - $firstDot = strpos($info['name'], '.'); - - if ($firstDot !== false) { - $info['name'] = (string) substr($info['name'], $firstDot + 1); - } - - return new CollectionInfo($info); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfo.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfo.php deleted file mode 100644 index dd32f92..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfo.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -/** - * Database information model class. - * - * This class models the database information returned by the listDatabases - * command. It provides methods to access common database properties. - * - * @api - * @see \MongoDB\Client::listDatabases() - * @see http://docs.mongodb.org/manual/reference/command/listDatabases/ - */ -class DatabaseInfo -{ - private $info; - - /** - * Constructor. - * - * @param array $info Database info - */ - public function __construct(array $info) - { - $this->info = $info; - } - - /** - * Return the collection info as an array. - * - * @see http://php.net/oop5.magic#language.oop5.magic.debuginfo - * @return array - */ - public function __debugInfo() - { - return $this->info; - } - - /** - * Return the database name. - * - * @return string - */ - public function getName() - { - return (string) $this->info['name']; - } - - /** - * Return the databases size on disk (in bytes). - * - * @return integer - */ - public function getSizeOnDisk() - { - return (integer) $this->info['sizeOnDisk']; - } - - /** - * Return whether the database is empty. - * - * @return boolean - */ - public function isEmpty() - { - return (boolean) $this->info['empty']; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfoIterator.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfoIterator.php deleted file mode 100644 index 91576eb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfoIterator.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use Iterator; - -/** - * DatabaseInfoIterator interface. - * - * This iterator is used for enumerating databases on a server. - * - * @api - * @see \MongoDB\Client::listDatabases() - */ -interface DatabaseInfoIterator extends Iterator -{ - /** - * Return the current element as a DatabaseInfo instance. - * - * @return DatabaseInfo - */ - public function current(); -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfoLegacyIterator.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfoLegacyIterator.php deleted file mode 100644 index 04be47e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/DatabaseInfoLegacyIterator.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -/** - * DatabaseInfoIterator for inline listDatabases command results. - * - * This iterator may be used to wrap the array returned within the listDatabases - * command's single-document result. - * - * @internal - * @see \MongoDB\Client::listDatabases() - * @see http://docs.mongodb.org/manual/reference/command/listDatabases/ - */ -class DatabaseInfoLegacyIterator implements DatabaseInfoIterator -{ - private $databases; - - /** - * Constructor. - * - * @param array $databases - */ - public function __construct(array $databases) - { - $this->databases = $databases; - } - - /** - * Return the current element as a DatabaseInfo instance. - * - * @see DatabaseInfoIterator::current() - * @see http://php.net/iterator.current - * @return DatabaseInfo - */ - public function current() - { - return new DatabaseInfo(current($this->databases)); - } - - /** - * Return the key of the current element. - * - * @see http://php.net/iterator.key - * @return integer - */ - public function key() - { - return key($this->databases); - } - - /** - * Move forward to next element. - * - * @see http://php.net/iterator.next - */ - public function next() - { - next($this->databases); - } - - /** - * Rewind the Iterator to the first element. - * - * @see http://php.net/iterator.rewind - */ - public function rewind() - { - reset($this->databases); - } - - /** - * Checks if current position is valid. - * - * @see http://php.net/iterator.valid - * @return boolean - */ - public function valid() - { - return key($this->databases) !== null; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfo.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfo.php deleted file mode 100644 index 64c37e8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfo.php +++ /dev/null @@ -1,186 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use MongoDB\Exception\BadMethodCallException; -use ArrayAccess; - -/** - * Index information model class. - * - * This class models the index information returned by the listIndexes command - * or, for legacy servers, queries on the "system.indexes" collection. It - * provides methods to access common index options, and allows access to other - * options through the ArrayAccess interface (write methods are not supported). - * For information on keys and index options, see the referenced - * db.collection.createIndex() documentation. - * - * @api - * @see \MongoDB\Collection::listIndexes() - * @see https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst - * @see http://docs.mongodb.org/manual/reference/method/db.collection.createIndex/ - */ -class IndexInfo implements ArrayAccess -{ - private $info; - - /** - * Constructor. - * - * @param array $info Index info - */ - public function __construct(array $info) - { - $this->info = $info; - } - - /** - * Return the collection info as an array. - * - * @see http://php.net/oop5.magic#language.oop5.magic.debuginfo - * @return array - */ - public function __debugInfo() - { - return $this->info; - } - - /** - * Return the index key. - * - * @return array - */ - public function getKey() - { - return (array) $this->info['key']; - } - - /** - * Return the index name. - * - * @return string - */ - public function getName() - { - return (string) $this->info['name']; - } - - /** - * Return the index namespace (e.g. "db.collection"). - * - * @return string - */ - public function getNamespace() - { - return (string) $this->info['ns']; - } - - /** - * Return the index version. - * - * @return integer - */ - public function getVersion() - { - return (integer) $this->info['v']; - } - - /** - * Return whether this is a sparse index. - * - * @see http://docs.mongodb.org/manual/core/index-sparse/ - * @return boolean - */ - public function isSparse() - { - return ! empty($this->info['sparse']); - } - - /** - * Return whether this is a TTL index. - * - * @see http://docs.mongodb.org/manual/core/index-ttl/ - * @return boolean - */ - public function isTtl() - { - return array_key_exists('expireAfterSeconds', $this->info); - } - - /** - * Return whether this is a unique index. - * - * @see http://docs.mongodb.org/manual/core/index-unique/ - * @return boolean - */ - public function isUnique() - { - return ! empty($this->info['unique']); - } - - /** - * Check whether a field exists in the index information. - * - * @see http://php.net/arrayaccess.offsetexists - * @param mixed $key - * @return boolean - */ - public function offsetExists($key) - { - return array_key_exists($key, $this->info); - } - - /** - * Return the field's value from the index information. - * - * This method satisfies the Enumerating Indexes specification's requirement - * that index fields be made accessible under their original names. It may - * also be used to access fields that do not have a helper method. - * - * @see http://php.net/arrayaccess.offsetget - * @see https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst#getting-full-index-information - * @param mixed $key - * @return mixed - */ - public function offsetGet($key) - { - return $this->info[$key]; - } - - /** - * Not supported. - * - * @see http://php.net/arrayaccess.offsetset - * @throws BadMethodCallException - */ - public function offsetSet($key, $value) - { - throw BadMethodCallException::classIsImmutable(__CLASS__); - } - - /** - * Not supported. - * - * @see http://php.net/arrayaccess.offsetunset - * @throws BadMethodCallException - */ - public function offsetUnset($key) - { - throw BadMethodCallException::classIsImmutable(__CLASS__); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfoIterator.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfoIterator.php deleted file mode 100644 index 5195172..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfoIterator.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use Iterator; - -/** - * IndexInfoIterator interface. - * - * This iterator is used for enumerating indexes in a collection. - * - * @api - * @see \MongoDB\Collection::listIndexes() - */ -interface IndexInfoIterator extends Iterator -{ - /** - * Return the current element as a IndexInfo instance. - * - * @return IndexInfo - */ - public function current(); -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfoIteratorIterator.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfoIteratorIterator.php deleted file mode 100644 index 7eb3b6b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInfoIteratorIterator.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use IteratorIterator; - -/** - * IndexInfoIterator for both listIndexes command and legacy query results. - * - * This common iterator may be used to wrap a Cursor returned by both the - * listIndexes command and, for legacy servers, queries on the "system.indexes" - * collection. - * - * @internal - * @see \MongoDB\Collection::listIndexes() - * @see https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst - * @see http://docs.mongodb.org/manual/reference/command/listIndexes/ - * @see http://docs.mongodb.org/manual/reference/system-collections/ - */ -class IndexInfoIteratorIterator extends IteratorIterator implements IndexInfoIterator -{ - /** - * Return the current element as an IndexInfo instance. - * - * @see IndexInfoIterator::current() - * @see http://php.net/iterator.current - * @return IndexInfo - */ - public function current() - { - return new IndexInfo(parent::current()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInput.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInput.php deleted file mode 100644 index b306fa0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/IndexInput.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use MongoDB\BSON\Serializable; -use MongoDB\Exception\InvalidArgumentException; - -/** - * Index input model class. - * - * This class is used to validate user input for index creation. - * - * @internal - * @see \MongoDB\Collection::createIndexes() - * @see https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst - * @see http://docs.mongodb.org/manual/reference/method/db.collection.createIndex/ - */ -class IndexInput implements Serializable -{ - private $index; - - /** - * Constructor. - * - * @param array $index Index specification - * @throws InvalidArgumentException - */ - public function __construct(array $index) - { - if ( ! isset($index['key'])) { - throw new InvalidArgumentException('Required "key" document is missing from index specification'); - } - - if ( ! is_array($index['key']) && ! is_object($index['key'])) { - throw InvalidArgumentException::invalidType('"key" option', $index['key'], 'array or object'); - } - - foreach ($index['key'] as $fieldName => $order) { - if ( ! is_int($order) && ! is_float($order) && ! is_string($order)) { - throw InvalidArgumentException::invalidType(sprintf('order value for "%s" field within "key" option', $fieldName), $order, 'numeric or string'); - } - } - - if ( ! isset($index['ns'])) { - throw new InvalidArgumentException('Required "ns" option is missing from index specification'); - } - - if ( ! is_string($index['ns'])) { - throw InvalidArgumentException::invalidType('"ns" option', $index['ns'], 'string'); - } - - if ( ! isset($index['name'])) { - $index['name'] = \MongoDB\generate_index_name($index['key']); - } - - if ( ! is_string($index['name'])) { - throw InvalidArgumentException::invalidType('"name" option', $index['name'], 'string'); - } - - $this->index = $index; - } - - /** - * Return the index name. - * - * @param string - */ - public function __toString() - { - return $this->index['name']; - } - - /** - * Serialize the index information to BSON for index creation. - * - * @see \MongoDB\Collection::createIndexes() - * @see http://php.net/mongodb-bson-serializable.bsonserialize - * @return array - */ - public function bsonSerialize() - { - return $this->index; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/TypeMapArrayIterator.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/TypeMapArrayIterator.php deleted file mode 100644 index 76d2a58..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Model/TypeMapArrayIterator.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/* - * Copyright 2016-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Model; - -use ArrayIterator; - -/** - * Iterator for applying a type map to documents in inline command results. - * - * This iterator may be used to apply a type map to an array of documents - * returned by a database command (e.g. aggregate on servers < 2.6) and allows - * for functional equivalence with commands that return their results via a - * cursor (e.g. aggregate on servers >= 2.6). - * - * @internal - */ -class TypeMapArrayIterator extends ArrayIterator -{ - private $typeMap; - - /** - * Constructor. - * - * @param array $documents - * @param array $typeMap - */ - public function __construct(array $documents = [], array $typeMap) - { - parent::__construct($documents); - - $this->typeMap = $typeMap; - } - - /** - * Return the current element with the type map applied to it. - * - * @see http://php.net/arrayiterator.current - * @return array|object - */ - public function current() - { - return \MongoDB\apply_type_map_to_document(parent::current(), $this->typeMap); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Aggregate.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Aggregate.php deleted file mode 100644 index 27874c0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Aggregate.php +++ /dev/null @@ -1,291 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnexpectedValueException; -use MongoDB\Exception\UnsupportedException; -use MongoDB\Model\TypeMapArrayIterator; -use ArrayIterator; -use stdClass; -use Traversable; - -/** - * Operation for the aggregate command. - * - * @api - * @see \MongoDB\Collection::aggregate() - * @see http://docs.mongodb.org/manual/reference/command/aggregate/ - */ -class Aggregate implements Executable -{ - private static $wireVersionForCollation = 5; - private static $wireVersionForCursor = 2; - private static $wireVersionForDocumentLevelValidation = 4; - private static $wireVersionForReadConcern = 4; - private static $wireVersionForWriteConcern = 5; - - private $databaseName; - private $collectionName; - private $pipeline; - private $options; - - /** - * Constructs an aggregate command. - * - * Supported options: - * - * * allowDiskUse (boolean): Enables writing to temporary files. When set - * to true, aggregation stages can write data to the _tmp sub-directory - * in the dbPath directory. The default is false. - * - * * batchSize (integer): The number of documents to return per batch. - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. This only applies when the $out - * stage is specified. - * - * For servers < 3.2, this option is ignored as document level validation - * is not available. - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * * readConcern (MongoDB\Driver\ReadConcern): Read concern. Note that a - * "majority" read concern is not compatible with the $out stage. - * - * This is not supported for server versions < 3.2 and will result in an - * exception at execution time if used. - * - * * readPreference (MongoDB\Driver\ReadPreference): Read preference. - * - * * typeMap (array): Type map for BSON deserialization. This will be - * applied to the returned Cursor (it is not sent to the server). - * - * * useCursor (boolean): Indicates whether the command will request that - * the server provide results using a cursor. The default is true. - * - * For servers < 2.6, this option is ignored as aggregation cursors are - * not available. - * - * For servers >= 2.6, this option allows users to turn off cursors if - * necessary to aid in mongod/mongos upgrades. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. This only - * applies when the $out stage is specified. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array $pipeline List of pipeline operations - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, array $pipeline, array $options = []) - { - if (empty($pipeline)) { - throw new InvalidArgumentException('$pipeline is empty'); - } - - $expectedIndex = 0; - - foreach ($pipeline as $i => $operation) { - if ($i !== $expectedIndex) { - throw new InvalidArgumentException(sprintf('$pipeline is not a list (unexpected index: "%s")', $i)); - } - - if ( ! is_array($operation) && ! is_object($operation)) { - throw InvalidArgumentException::invalidType(sprintf('$pipeline[%d]', $i), $operation, 'array or object'); - } - - $expectedIndex += 1; - } - - $options += [ - 'allowDiskUse' => false, - 'useCursor' => true, - ]; - - if ( ! is_bool($options['allowDiskUse'])) { - throw InvalidArgumentException::invalidType('"allowDiskUse" option', $options['allowDiskUse'], 'boolean'); - } - - if (isset($options['batchSize']) && ! is_integer($options['batchSize'])) { - throw InvalidArgumentException::invalidType('"batchSize" option', $options['batchSize'], 'integer'); - } - - if (isset($options['bypassDocumentValidation']) && ! is_bool($options['bypassDocumentValidation'])) { - throw InvalidArgumentException::invalidType('"bypassDocumentValidation" option', $options['bypassDocumentValidation'], 'boolean'); - } - - if (isset($options['collation']) && ! is_array($options['collation']) && ! is_object($options['collation'])) { - throw InvalidArgumentException::invalidType('"collation" option', $options['collation'], 'array or object'); - } - - if (isset($options['maxTimeMS']) && ! is_integer($options['maxTimeMS'])) { - throw InvalidArgumentException::invalidType('"maxTimeMS" option', $options['maxTimeMS'], 'integer'); - } - - if (isset($options['readConcern']) && ! $options['readConcern'] instanceof ReadConcern) { - throw InvalidArgumentException::invalidType('"readConcern" option', $options['readConcern'], 'MongoDB\Driver\ReadConcern'); - } - - if (isset($options['readPreference']) && ! $options['readPreference'] instanceof ReadPreference) { - throw InvalidArgumentException::invalidType('"readPreference" option', $options['readPreference'], 'MongoDB\Driver\ReadPreference'); - } - - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - if ( ! is_bool($options['useCursor'])) { - throw InvalidArgumentException::invalidType('"useCursor" option', $options['useCursor'], 'boolean'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - if (isset($options['batchSize']) && ! $options['useCursor']) { - throw new InvalidArgumentException('"batchSize" option should not be used if "useCursor" is false'); - } - - if (isset($options['typeMap']) && ! $options['useCursor']) { - throw new InvalidArgumentException('"typeMap" option should not be used if "useCursor" is false'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->pipeline = $pipeline; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return Traversable - * @throws UnexpectedValueException if the command response was malformed - * @throws UnsupportedException if collation, read concern, or write concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['collation']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForCollation)) { - throw UnsupportedException::collationNotSupported(); - } - - if (isset($this->options['readConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) { - throw UnsupportedException::readConcernNotSupported(); - } - - if (isset($this->options['writeConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForWriteConcern)) { - throw UnsupportedException::writeConcernNotSupported(); - } - - $isCursorSupported = \MongoDB\server_supports_feature($server, self::$wireVersionForCursor); - $readPreference = isset($this->options['readPreference']) ? $this->options['readPreference'] : null; - - $command = $this->createCommand($server, $isCursorSupported); - $cursor = $server->executeCommand($this->databaseName, $command, $readPreference); - - if ($isCursorSupported && $this->options['useCursor']) { - if (isset($this->options['typeMap'])) { - $cursor->setTypeMap($this->options['typeMap']); - } - - return $cursor; - } - - $result = current($cursor->toArray()); - - if ( ! isset($result->result) || ! is_array($result->result)) { - throw new UnexpectedValueException('aggregate command did not return a "result" array'); - } - - if (isset($this->options['typeMap'])) { - return new TypeMapArrayIterator($result->result, $this->options['typeMap']); - } - - return new ArrayIterator($result->result); - } - - /** - * Create the aggregate command. - * - * @param Server $server - * @param boolean $isCursorSupported - * @return Command - */ - private function createCommand(Server $server, $isCursorSupported) - { - $cmd = [ - 'aggregate' => $this->collectionName, - 'pipeline' => $this->pipeline, - ]; - - // Servers < 2.6 do not support any command options - if ( ! $isCursorSupported) { - return new Command($cmd); - } - - $cmd['allowDiskUse'] = $this->options['allowDiskUse']; - - if (isset($this->options['bypassDocumentValidation']) && \MongoDB\server_supports_feature($server, self::$wireVersionForDocumentLevelValidation)) { - $cmd['bypassDocumentValidation'] = $this->options['bypassDocumentValidation']; - } - - if (isset($this->options['collation'])) { - $cmd['collation'] = (object) $this->options['collation']; - } - - if (isset($this->options['maxTimeMS'])) { - $cmd['maxTimeMS'] = $this->options['maxTimeMS']; - } - - if (isset($this->options['readConcern'])) { - $cmd['readConcern'] = \MongoDB\read_concern_as_document($this->options['readConcern']); - } - - if (isset($this->options['writeConcern'])) { - $cmd['writeConcern'] = \MongoDB\write_concern_as_document($this->options['writeConcern']); - } - - if ($this->options['useCursor']) { - $cmd['cursor'] = isset($this->options["batchSize"]) - ? ['batchSize' => $this->options["batchSize"]] - : new stdClass; - } - - return new Command($cmd); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/BulkWrite.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/BulkWrite.php deleted file mode 100644 index 06ddc5a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/BulkWrite.php +++ /dev/null @@ -1,329 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\BulkWriteResult; -use MongoDB\Driver\BulkWrite as Bulk; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for executing multiple write operations. - * - * @api - * @see \MongoDB\Collection::bulkWrite() - */ -class BulkWrite implements Executable -{ - const DELETE_MANY = 'deleteMany'; - const DELETE_ONE = 'deleteOne'; - const INSERT_ONE = 'insertOne'; - const REPLACE_ONE = 'replaceOne'; - const UPDATE_MANY = 'updateMany'; - const UPDATE_ONE = 'updateOne'; - - private static $wireVersionForCollation = 5; - private static $wireVersionForDocumentLevelValidation = 4; - - private $databaseName; - private $collectionName; - private $operations; - private $options; - private $isCollationUsed = false; - - /** - * Constructs a bulk write operation. - * - * Example array structure for all supported operation types: - * - * [ - * [ 'deleteMany' => [ $filter, $options ] ], - * [ 'deleteOne' => [ $filter, $options ] ], - * [ 'insertOne' => [ $document ] ], - * [ 'replaceOne' => [ $filter, $replacement, $options ] ], - * [ 'updateMany' => [ $filter, $update, $options ] ], - * [ 'updateOne' => [ $filter, $update, $options ] ], - * ] - * - * Arguments correspond to the respective Operation classes; however, the - * writeConcern option is specified for the top-level bulk write operation - * instead of each individual operation. - * - * Supported options for deleteMany and deleteOne operations: - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * Supported options for replaceOne, updateMany, and updateOne operations: - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * upsert (boolean): When true, a new document is created if no document - * matches the query. The default is false. - * - * Supported options for the bulk write operation: - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. - * - * * ordered (boolean): If true, when an insert fails, return without - * performing the remaining writes. If false, when a write fails, - * continue with the remaining writes, if any. The default is true. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array[] $operations List of write operations - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, array $operations, array $options = []) - { - if (empty($operations)) { - throw new InvalidArgumentException('$operations is empty'); - } - - $expectedIndex = 0; - - foreach ($operations as $i => $operation) { - if ($i !== $expectedIndex) { - throw new InvalidArgumentException(sprintf('$operations is not a list (unexpected index: "%s")', $i)); - } - - if ( ! is_array($operation)) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]', $i), $operation, 'array'); - } - - if (count($operation) !== 1) { - throw new InvalidArgumentException(sprintf('Expected one element in $operation[%d], actually: %d', $i, count($operation))); - } - - $type = key($operation); - $args = current($operation); - - if ( ! isset($args[0]) && ! array_key_exists(0, $args)) { - throw new InvalidArgumentException(sprintf('Missing first argument for $operations[%d]["%s"]', $i, $type)); - } - - if ( ! is_array($args[0]) && ! is_object($args[0])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][0]', $i, $type), $args[0], 'array or object'); - } - - switch ($type) { - case self::INSERT_ONE: - break; - - case self::DELETE_MANY: - case self::DELETE_ONE: - if ( ! isset($args[1])) { - $args[1] = []; - } - - if ( ! is_array($args[1])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][1]', $i, $type), $args[1], 'array'); - } - - $args[1]['limit'] = ($type === self::DELETE_ONE ? 1 : 0); - - if (isset($args[1]['collation'])) { - $this->isCollationUsed = true; - - if ( ! is_array($args[1]['collation']) && ! is_object($args[1]['collation'])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][1]["collation"]', $i, $type), $args[1]['collation'], 'array or object'); - } - } - - $operations[$i][$type][1] = $args[1]; - - break; - - case self::REPLACE_ONE: - if ( ! isset($args[1]) && ! array_key_exists(1, $args)) { - throw new InvalidArgumentException(sprintf('Missing second argument for $operations[%d]["%s"]', $i, $type)); - } - - if ( ! is_array($args[1]) && ! is_object($args[1])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][1]', $i, $type), $args[1], 'array or object'); - } - - if (\MongoDB\is_first_key_operator($args[1])) { - throw new InvalidArgumentException(sprintf('First key in $operations[%d]["%s"][1] is an update operator', $i, $type)); - } - - if ( ! isset($args[2])) { - $args[2] = []; - } - - if ( ! is_array($args[2])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][2]', $i, $type), $args[2], 'array'); - } - - $args[2]['multi'] = false; - $args[2] += ['upsert' => false]; - - if (isset($args[2]['collation'])) { - $this->isCollationUsed = true; - - if ( ! is_array($args[2]['collation']) && ! is_object($args[2]['collation'])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][2]["collation"]', $i, $type), $args[2]['collation'], 'array or object'); - } - } - - if ( ! is_bool($args[2]['upsert'])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][2]["upsert"]', $i, $type), $args[2]['upsert'], 'boolean'); - } - - $operations[$i][$type][2] = $args[2]; - - break; - - case self::UPDATE_MANY: - case self::UPDATE_ONE: - if ( ! isset($args[1]) && ! array_key_exists(1, $args)) { - throw new InvalidArgumentException(sprintf('Missing second argument for $operations[%d]["%s"]', $i, $type)); - } - - if ( ! is_array($args[1]) && ! is_object($args[1])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][1]', $i, $type), $args[1], 'array or object'); - } - - if ( ! \MongoDB\is_first_key_operator($args[1])) { - throw new InvalidArgumentException(sprintf('First key in $operations[%d]["%s"][1] is not an update operator', $i, $type)); - } - - if ( ! isset($args[2])) { - $args[2] = []; - } - - if ( ! is_array($args[2])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][2]', $i, $type), $args[2], 'array'); - } - - $args[2]['multi'] = ($type === self::UPDATE_MANY); - $args[2] += ['upsert' => false]; - - if (isset($args[2]['collation'])) { - $this->isCollationUsed = true; - - if ( ! is_array($args[2]['collation']) && ! is_object($args[2]['collation'])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][2]["collation"]', $i, $type), $args[2]['collation'], 'array or object'); - } - } - - if ( ! is_bool($args[2]['upsert'])) { - throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][2]["upsert"]', $i, $type), $args[2]['upsert'], 'boolean'); - } - - $operations[$i][$type][2] = $args[2]; - - break; - - default: - throw new InvalidArgumentException(sprintf('Unknown operation type "%s" in $operations[%d]', $type, $i)); - } - - $expectedIndex += 1; - } - - $options += ['ordered' => true]; - - if (isset($options['bypassDocumentValidation']) && ! is_bool($options['bypassDocumentValidation'])) { - throw InvalidArgumentException::invalidType('"bypassDocumentValidation" option', $options['bypassDocumentValidation'], 'boolean'); - } - - if ( ! is_bool($options['ordered'])) { - throw InvalidArgumentException::invalidType('"ordered" option', $options['ordered'], 'boolean'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->operations = $operations; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return BulkWriteResult - * @throws UnsupportedException if collation is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if ($this->isCollationUsed && ! \MongoDB\server_supports_feature($server, self::$wireVersionForCollation)) { - throw UnsupportedException::collationNotSupported(); - } - - $options = ['ordered' => $this->options['ordered']]; - - if (isset($this->options['bypassDocumentValidation']) && \MongoDB\server_supports_feature($server, self::$wireVersionForDocumentLevelValidation)) { - $options['bypassDocumentValidation'] = $this->options['bypassDocumentValidation']; - } - - $bulk = new Bulk($options); - $insertedIds = []; - - foreach ($this->operations as $i => $operation) { - $type = key($operation); - $args = current($operation); - - switch ($type) { - case self::DELETE_MANY: - case self::DELETE_ONE: - $bulk->delete($args[0], $args[1]); - break; - - case self::INSERT_ONE: - $insertedId = $bulk->insert($args[0]); - - if ($insertedId !== null) { - $insertedIds[$i] = $insertedId; - } else { - $insertedIds[$i] = \MongoDB\extract_id_from_inserted_document($args[0]); - } - - break; - - case self::REPLACE_ONE: - case self::UPDATE_MANY: - case self::UPDATE_ONE: - $bulk->update($args[0], $args[1], $args[2]); - } - } - - $writeConcern = isset($this->options['writeConcern']) ? $this->options['writeConcern'] : null; - $writeResult = $server->executeBulkWrite($this->databaseName . '.' . $this->collectionName, $bulk, $writeConcern); - - return new BulkWriteResult($writeResult, $insertedIds); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Count.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Count.php deleted file mode 100644 index 8e2a260..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Count.php +++ /dev/null @@ -1,188 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnexpectedValueException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for the count command. - * - * @api - * @see \MongoDB\Collection::count() - * @see http://docs.mongodb.org/manual/reference/command/count/ - */ -class Count implements Executable -{ - private static $wireVersionForCollation = 5; - private static $wireVersionForReadConcern = 4; - - private $databaseName; - private $collectionName; - private $filter; - private $options; - - /** - * Constructs a count command. - * - * Supported options: - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * hint (string|document): The index to use. If a document, it will be - * interpretted as an index specification and a name will be generated. - * - * * limit (integer): The maximum number of documents to count. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * * readConcern (MongoDB\Driver\ReadConcern): Read concern. - * - * This is not supported for server versions < 3.2 and will result in an - * exception at execution time if used. - * - * * readPreference (MongoDB\Driver\ReadPreference): Read preference. - * - * * skip (integer): The number of documents to skip before returning the - * documents. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to filter documents - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter = [], array $options = []) - { - if ( ! is_array($filter) && ! is_object($filter)) { - throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object'); - } - - if (isset($options['collation']) && ! is_array($options['collation']) && ! is_object($options['collation'])) { - throw InvalidArgumentException::invalidType('"collation" option', $options['collation'], 'array or object'); - } - - if (isset($options['hint'])) { - if (is_array($options['hint']) || is_object($options['hint'])) { - $options['hint'] = \MongoDB\generate_index_name($options['hint']); - } - - if ( ! is_string($options['hint'])) { - throw InvalidArgumentException::invalidType('"hint" option', $options['hint'], 'string or array or object'); - } - } - - if (isset($options['limit']) && ! is_integer($options['limit'])) { - throw InvalidArgumentException::invalidType('"limit" option', $options['limit'], 'integer'); - } - - if (isset($options['maxTimeMS']) && ! is_integer($options['maxTimeMS'])) { - throw InvalidArgumentException::invalidType('"maxTimeMS" option', $options['maxTimeMS'], 'integer'); - } - - if (isset($options['readConcern']) && ! $options['readConcern'] instanceof ReadConcern) { - throw InvalidArgumentException::invalidType('"readConcern" option', $options['readConcern'], 'MongoDB\Driver\ReadConcern'); - } - - if (isset($options['readPreference']) && ! $options['readPreference'] instanceof ReadPreference) { - throw InvalidArgumentException::invalidType('"readPreference" option', $options['readPreference'], 'MongoDB\Driver\ReadPreference'); - } - - if (isset($options['skip']) && ! is_integer($options['skip'])) { - throw InvalidArgumentException::invalidType('"skip" option', $options['skip'], 'integer'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->filter = $filter; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return integer - * @throws UnexpectedValueException if the command response was malformed - * @throws UnsupportedException if collation or read concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['collation']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForCollation)) { - throw UnsupportedException::collationNotSupported(); - } - - if (isset($this->options['readConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) { - throw UnsupportedException::readConcernNotSupported(); - } - - $readPreference = isset($this->options['readPreference']) ? $this->options['readPreference'] : null; - - $cursor = $server->executeCommand($this->databaseName, $this->createCommand(), $readPreference); - $result = current($cursor->toArray()); - - // Older server versions may return a float - if ( ! isset($result->n) || ! (is_integer($result->n) || is_float($result->n))) { - throw new UnexpectedValueException('count command did not return a numeric "n" value'); - } - - return (integer) $result->n; - } - - /** - * Create the count command. - * - * @return Command - */ - private function createCommand() - { - $cmd = ['count' => $this->collectionName]; - - if ( ! empty($this->filter)) { - $cmd['query'] = (object) $this->filter; - } - - if (isset($this->options['collation'])) { - $cmd['collation'] = (object) $this->options['collation']; - } - - foreach (['hint', 'limit', 'maxTimeMS', 'skip'] as $option) { - if (isset($this->options[$option])) { - $cmd[$option] = $this->options[$option]; - } - } - - if (isset($this->options['readConcern'])) { - $cmd['readConcern'] = \MongoDB\read_concern_as_document($this->options['readConcern']); - } - - return new Command($cmd); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/CreateCollection.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/CreateCollection.php deleted file mode 100644 index 7096019..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/CreateCollection.php +++ /dev/null @@ -1,220 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for the create command. - * - * @api - * @see \MongoDB\Database::createCollection() - * @see http://docs.mongodb.org/manual/reference/command/create/ - */ -class CreateCollection implements Executable -{ - const USE_POWER_OF_2_SIZES = 1; - const NO_PADDING = 2; - - private static $wireVersionForCollation = 5; - private static $wireVersionForWriteConcern = 5; - - private $databaseName; - private $collectionName; - private $options = []; - - /** - * Constructs a create command. - * - * Supported options: - * - * * autoIndexId (boolean): Specify false to disable the automatic creation - * of an index on the _id field. For replica sets, this option cannot be - * false. The default is true. - * - * * capped (boolean): Specify true to create a capped collection. If set, - * the size option must also be specified. The default is false. - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * flags (integer): Options for the MMAPv1 storage engine only. Must be a - * bitwise combination CreateCollection::USE_POWER_OF_2_SIZES and - * CreateCollection::NO_PADDING. The default is - * CreateCollection::USE_POWER_OF_2_SIZES. - * - * * indexOptionDefaults (document): Default configuration for indexes when - * creating the collection. - * - * * max (integer): The maximum number of documents allowed in the capped - * collection. The size option takes precedence over this limit. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * * size (integer): The maximum number of bytes for a capped collection. - * - * * storageEngine (document): Storage engine options. - * - * * typeMap (array): Type map for BSON deserialization. This will only be - * used for the returned command result document. - * - * * validationAction (string): Validation action. - * - * * validationLevel (string): Validation level. - * - * * validator (document): Validation rules or expressions. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * @see http://source.wiredtiger.com/2.4.1/struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb - * @see https://docs.mongodb.org/manual/core/document-validation/ - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, array $options = []) - { - if (isset($options['autoIndexId']) && ! is_bool($options['autoIndexId'])) { - throw InvalidArgumentException::invalidType('"autoIndexId" option', $options['autoIndexId'], 'boolean'); - } - - if (isset($options['capped']) && ! is_bool($options['capped'])) { - throw InvalidArgumentException::invalidType('"capped" option', $options['capped'], 'boolean'); - } - - if (isset($options['collation']) && ! is_array($options['collation']) && ! is_object($options['collation'])) { - throw InvalidArgumentException::invalidType('"collation" option', $options['collation'], 'array or object'); - } - - if (isset($options['flags']) && ! is_integer($options['flags'])) { - throw InvalidArgumentException::invalidType('"flags" option', $options['flags'], 'integer'); - } - - if (isset($options['indexOptionDefaults']) && ! is_array($options['indexOptionDefaults']) && ! is_object($options['indexOptionDefaults'])) { - throw InvalidArgumentException::invalidType('"indexOptionDefaults" option', $options['indexOptionDefaults'], 'array or object'); - } - - if (isset($options['max']) && ! is_integer($options['max'])) { - throw InvalidArgumentException::invalidType('"max" option', $options['max'], 'integer'); - } - - if (isset($options['maxTimeMS']) && ! is_integer($options['maxTimeMS'])) { - throw InvalidArgumentException::invalidType('"maxTimeMS" option', $options['maxTimeMS'], 'integer'); - } - - if (isset($options['size']) && ! is_integer($options['size'])) { - throw InvalidArgumentException::invalidType('"size" option', $options['size'], 'integer'); - } - - if (isset($options['storageEngine']) && ! is_array($options['storageEngine']) && ! is_object($options['storageEngine'])) { - throw InvalidArgumentException::invalidType('"storageEngine" option', $options['storageEngine'], 'array or object'); - } - - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - if (isset($options['validationAction']) && ! is_string($options['validationAction'])) { - throw InvalidArgumentException::invalidType('"validationAction" option', $options['validationAction'], 'string'); - } - - if (isset($options['validationLevel']) && ! is_string($options['validationLevel'])) { - throw InvalidArgumentException::invalidType('"validationLevel" option', $options['validationLevel'], 'string'); - } - - if (isset($options['validator']) && ! is_array($options['validator']) && ! is_object($options['validator'])) { - throw InvalidArgumentException::invalidType('"validator" option', $options['validator'], 'array or object'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return array|object Command result document - * @throws UnsupportedException if collation or write concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['collation']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForCollation)) { - throw UnsupportedException::collationNotSupported(); - } - - if (isset($this->options['writeConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForWriteConcern)) { - throw UnsupportedException::writeConcernNotSupported(); - } - - $cursor = $server->executeCommand($this->databaseName, $this->createCommand()); - - if (isset($this->options['typeMap'])) { - $cursor->setTypeMap($this->options['typeMap']); - } - - return current($cursor->toArray()); - } - - /** - * Create the create command. - * - * @return Command - */ - private function createCommand() - { - $cmd = ['create' => $this->collectionName]; - - foreach (['autoIndexId', 'capped', 'flags', 'max', 'maxTimeMS', 'size', 'validationAction', 'validationLevel'] as $option) { - if (isset($this->options[$option])) { - $cmd[$option] = $this->options[$option]; - } - } - - foreach (['collation', 'indexOptionDefaults', 'storageEngine', 'validator'] as $option) { - if (isset($this->options[$option])) { - $cmd[$option] = (object) $this->options[$option]; - } - } - - if (isset($this->options['writeConcern'])) { - $cmd['writeConcern'] = \MongoDB\write_concern_as_document($this->options['writeConcern']); - } - - return new Command($cmd); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/CreateIndexes.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/CreateIndexes.php deleted file mode 100644 index 4999bcd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/CreateIndexes.php +++ /dev/null @@ -1,173 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Server; -use MongoDB\Driver\BulkWrite as Bulk; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; -use MongoDB\Model\IndexInput; - -/** - * Operation for the createIndexes command. - * - * @api - * @see \MongoDB\Collection::createIndex() - * @see \MongoDB\Collection::createIndexes() - * @see http://docs.mongodb.org/manual/reference/command/createIndexes/ - */ -class CreateIndexes implements Executable -{ - private static $wireVersionForCollation = 5; - private static $wireVersionForCommand = 2; - private static $wireVersionForWriteConcern = 5; - - private $databaseName; - private $collectionName; - private $indexes = []; - private $isCollationUsed = false; - private $options = []; - - /** - * Constructs a createIndexes command. - * - * Supported options: - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array[] $indexes List of index specifications - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, array $indexes, array $options = []) - { - if (empty($indexes)) { - throw new InvalidArgumentException('$indexes is empty'); - } - - $expectedIndex = 0; - - foreach ($indexes as $i => $index) { - if ($i !== $expectedIndex) { - throw new InvalidArgumentException(sprintf('$indexes is not a list (unexpected index: "%s")', $i)); - } - - if ( ! is_array($index)) { - throw InvalidArgumentException::invalidType(sprintf('$index[%d]', $i), $index, 'array'); - } - - if ( ! isset($index['ns'])) { - $index['ns'] = $databaseName . '.' . $collectionName; - } - - if (isset($index['collation'])) { - $this->isCollationUsed = true; - } - - $this->indexes[] = new IndexInput($index); - - $expectedIndex += 1; - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->options = $options; - } - - /** - * Execute the operation. - * - * For servers < 2.6, this will actually perform an insert operation on the - * database's "system.indexes" collection. - * - * @see Executable::execute() - * @param Server $server - * @return string[] The names of the created indexes - * @throws UnsupportedException if collation or write concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if ($this->isCollationUsed && ! \MongoDB\server_supports_feature($server, self::$wireVersionForCollation)) { - throw UnsupportedException::collationNotSupported(); - } - - if (isset($this->options['writeConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForWriteConcern)) { - throw UnsupportedException::writeConcernNotSupported(); - } - - if (\MongoDB\server_supports_feature($server, self::$wireVersionForCommand)) { - $this->executeCommand($server); - } else { - $this->executeLegacy($server); - } - - return array_map(function(IndexInput $index) { return (string) $index; }, $this->indexes); - } - - /** - * Create one or more indexes for the collection using the createIndexes - * command. - * - * @param Server $server - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - private function executeCommand(Server $server) - { - $cmd = [ - 'createIndexes' => $this->collectionName, - 'indexes' => $this->indexes, - ]; - - if (isset($this->options['writeConcern'])) { - $cmd['writeConcern'] = \MongoDB\write_concern_as_document($this->options['writeConcern']); - } - - $server->executeCommand($this->databaseName, new Command($cmd)); - } - - /** - * Create one or more indexes for the collection by inserting into the - * "system.indexes" collection (MongoDB <2.6). - * - * @param Server $server - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - private function executeLegacy(Server $server) - { - $bulk = new Bulk(['ordered' => true]); - - foreach ($this->indexes as $index) { - $bulk->insert($index); - } - - $server->executeBulkWrite($this->databaseName . '.system.indexes', $bulk, new WriteConcern(1)); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DatabaseCommand.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DatabaseCommand.php deleted file mode 100644 index 967e1b9..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DatabaseCommand.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Cursor; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\Server; -use MongoDB\Exception\InvalidArgumentException; - -/** - * Operation for executing a database command. - * - * @api - * @see \MongoDB\Database::command() - */ -class DatabaseCommand implements Executable -{ - private $databaseName; - private $command; - private $options; - - /** - * Constructs a command. - * - * Supported options: - * - * * readPreference (MongoDB\Driver\ReadPreference): The read preference to - * use when executing the command. This may be used when issuing the - * command to a replica set or mongos node to ensure that the driver sets - * the wire protocol accordingly or adds the read preference to the - * command document, respectively. - * - * * typeMap (array): Type map for BSON deserialization. This will be - * applied to the returned Cursor (it is not sent to the server). - * - * @param string $databaseName Database name - * @param array|object $command Command document - * @param array $options Options for command execution - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $command, array $options = []) - { - if ( ! is_array($command) && ! is_object($command)) { - throw InvalidArgumentException::invalidType('$command', $command, 'array or object'); - } - - if (isset($options['readPreference']) && ! $options['readPreference'] instanceof ReadPreference) { - throw InvalidArgumentException::invalidType('"readPreference" option', $options['readPreference'], 'MongoDB\Driver\ReadPreference'); - } - - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - $this->databaseName = (string) $databaseName; - $this->command = ($command instanceof Command) ? $command : new Command($command); - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return Cursor - */ - public function execute(Server $server) - { - $readPreference = isset($this->options['readPreference']) ? $this->options['readPreference'] : null; - - $cursor = $server->executeCommand($this->databaseName, $this->command, $readPreference); - - if (isset($this->options['typeMap'])) { - $cursor->setTypeMap($this->options['typeMap']); - } - - return $cursor; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Delete.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Delete.php deleted file mode 100644 index c83cc27..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Delete.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\DeleteResult; -use MongoDB\Driver\BulkWrite as Bulk; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for the delete command. - * - * This class is used internally by the DeleteMany and DeleteOne operation - * classes. - * - * @internal - * @see http://docs.mongodb.org/manual/reference/command/delete/ - */ -class Delete implements Executable -{ - private static $wireVersionForCollation = 5; - - private $databaseName; - private $collectionName; - private $filter; - private $limit; - private $options; - - /** - * Constructs a delete command. - * - * Supported options: - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to delete documents - * @param integer $limit The number of matching documents to - * delete. Must be 0 or 1, for all or a - * single document, respectively. - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, $limit, array $options = []) - { - if ( ! is_array($filter) && ! is_object($filter)) { - throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object'); - } - - if ($limit !== 0 && $limit !== 1) { - throw new InvalidArgumentException('$limit must be 0 or 1'); - } - - if (isset($options['collation']) && ! is_array($options['collation']) && ! is_object($options['collation'])) { - throw InvalidArgumentException::invalidType('"collation" option', $options['collation'], 'array or object'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->filter = $filter; - $this->limit = $limit; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return DeleteResult - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['collation']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForCollation)) { - throw UnsupportedException::collationNotSupported(); - } - - $deleteOptions = ['limit' => $this->limit]; - - if (isset($this->options['collation'])) { - $deleteOptions['collation'] = (object) $this->options['collation']; - } - - $bulk = new Bulk(); - $bulk->delete($this->filter, $deleteOptions); - - $writeConcern = isset($this->options['writeConcern']) ? $this->options['writeConcern'] : null; - $writeResult = $server->executeBulkWrite($this->databaseName . '.' . $this->collectionName, $bulk, $writeConcern); - - return new DeleteResult($writeResult); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DeleteMany.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DeleteMany.php deleted file mode 100644 index f515ee3..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DeleteMany.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\DeleteResult; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for deleting multiple document with the delete command. - * - * @api - * @see \MongoDB\Collection::deleteOne() - * @see http://docs.mongodb.org/manual/reference/command/delete/ - */ -class DeleteMany implements Executable -{ - private $delete; - - /** - * Constructs a delete command. - * - * Supported options: - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to delete documents - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, array $options = []) - { - $this->delete = new Delete($databaseName, $collectionName, $filter, 0, $options); - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return DeleteResult - * @throws UnsupportedException if collation is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - return $this->delete->execute($server); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DeleteOne.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DeleteOne.php deleted file mode 100644 index fb2d526..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DeleteOne.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\DeleteResult; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for deleting a single document with the delete command. - * - * @api - * @see \MongoDB\Collection::deleteOne() - * @see http://docs.mongodb.org/manual/reference/command/delete/ - */ -class DeleteOne implements Executable -{ - private $delete; - - /** - * Constructs a delete command. - * - * Supported options: - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to delete documents - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, array $options = []) - { - $this->delete = new Delete($databaseName, $collectionName, $filter, 1, $options); - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return DeleteResult - * @throws UnsupportedException if collation is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - return $this->delete->execute($server); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Distinct.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Distinct.php deleted file mode 100644 index e29543f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Distinct.php +++ /dev/null @@ -1,165 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnexpectedValueException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for the distinct command. - * - * @api - * @see \MongoDB\Collection::distinct() - * @see http://docs.mongodb.org/manual/reference/command/distinct/ - */ -class Distinct implements Executable -{ - private static $wireVersionForCollation = 5; - private static $wireVersionForReadConcern = 4; - - private $databaseName; - private $collectionName; - private $fieldName; - private $filter; - private $options; - - /** - * Constructs a distinct command. - * - * Supported options: - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * * readConcern (MongoDB\Driver\ReadConcern): Read concern. - * - * This is not supported for server versions < 3.2 and will result in an - * exception at execution time if used. - * - * * readPreference (MongoDB\Driver\ReadPreference): Read preference. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param string $fieldName Field for which to return distinct values - * @param array|object $filter Query by which to filter documents - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $fieldName, $filter = [], array $options = []) - { - if ( ! is_array($filter) && ! is_object($filter)) { - throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object'); - } - - if (isset($options['collation']) && ! is_array($options['collation']) && ! is_object($options['collation'])) { - throw InvalidArgumentException::invalidType('"collation" option', $options['collation'], 'array or object'); - } - - if (isset($options['maxTimeMS']) && ! is_integer($options['maxTimeMS'])) { - throw InvalidArgumentException::invalidType('"maxTimeMS" option', $options['maxTimeMS'], 'integer'); - } - - if (isset($options['readConcern']) && ! $options['readConcern'] instanceof ReadConcern) { - throw InvalidArgumentException::invalidType('"readConcern" option', $options['readConcern'], 'MongoDB\Driver\ReadConcern'); - } - - if (isset($options['readPreference']) && ! $options['readPreference'] instanceof ReadPreference) { - throw InvalidArgumentException::invalidType('"readPreference" option', $options['readPreference'], 'MongoDB\Driver\ReadPreference'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->fieldName = (string) $fieldName; - $this->filter = $filter; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return mixed[] - * @throws UnexpectedValueException if the command response was malformed - * @throws UnsupportedException if collation or read concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['collation']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForCollation)) { - throw UnsupportedException::collationNotSupported(); - } - - if (isset($this->options['readConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) { - throw UnsupportedException::readConcernNotSupported(); - } - - $readPreference = isset($this->options['readPreference']) ? $this->options['readPreference'] : null; - - $cursor = $server->executeCommand($this->databaseName, $this->createCommand(), $readPreference); - $result = current($cursor->toArray()); - - if ( ! isset($result->values) || ! is_array($result->values)) { - throw new UnexpectedValueException('distinct command did not return a "values" array'); - } - - return $result->values; - } - - /** - * Create the distinct command. - * - * @return Command - */ - private function createCommand() - { - $cmd = [ - 'distinct' => $this->collectionName, - 'key' => $this->fieldName, - ]; - - if ( ! empty($this->filter)) { - $cmd['query'] = (object) $this->filter; - } - - if (isset($this->options['collation'])) { - $cmd['collation'] = (object) $this->options['collation']; - } - - if (isset($this->options['maxTimeMS'])) { - $cmd['maxTimeMS'] = $this->options['maxTimeMS']; - } - - if (isset($this->options['readConcern'])) { - $cmd['readConcern'] = \MongoDB\read_concern_as_document($this->options['readConcern']); - } - - return new Command($cmd); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropCollection.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropCollection.php deleted file mode 100644 index 825c398..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropCollection.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for the drop command. - * - * @api - * @see \MongoDB\Collection::drop() - * @see \MongoDB\Database::dropCollection() - * @see http://docs.mongodb.org/manual/reference/command/drop/ - */ -class DropCollection implements Executable -{ - private static $errorMessageNamespaceNotFound = 'ns not found'; - private static $wireVersionForWriteConcern = 5; - - private $databaseName; - private $collectionName; - private $options; - - /** - * Constructs a drop command. - * - * Supported options: - * - * * typeMap (array): Type map for BSON deserialization. This will be used - * for the returned command result document. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, array $options = []) - { - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return array|object Command result document - * @throws UnsupportedException if writeConcern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['writeConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForWriteConcern)) { - throw UnsupportedException::writeConcernNotSupported(); - } - - try { - $cursor = $server->executeCommand($this->databaseName, $this->createCommand()); - } catch (DriverRuntimeException $e) { - /* The server may return an error if the collection does not exist. - * Check for an error message (unfortunately, there isn't a code) - * and NOP instead of throwing. - */ - if ($e->getMessage() === self::$errorMessageNamespaceNotFound) { - return (object) ['ok' => 0, 'errmsg' => self::$errorMessageNamespaceNotFound]; - } - - throw $e; - } - - if (isset($this->options['typeMap'])) { - $cursor->setTypeMap($this->options['typeMap']); - } - - return current($cursor->toArray()); - } - - /** - * Create the drop command. - * - * @return Command - */ - private function createCommand() - { - $cmd = ['drop' => $this->collectionName]; - - if (isset($this->options['writeConcern'])) { - $cmd['writeConcern'] = \MongoDB\write_concern_as_document($this->options['writeConcern']); - } - - return new Command($cmd); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropDatabase.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropDatabase.php deleted file mode 100644 index f0d7321..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropDatabase.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for the dropDatabase command. - * - * @api - * @see \MongoDB\Client::dropDatabase() - * @see \MongoDB\Database::drop() - * @see http://docs.mongodb.org/manual/reference/command/dropDatabase/ - */ -class DropDatabase implements Executable -{ - private static $wireVersionForWriteConcern = 5; - - private $databaseName; - private $options; - - /** - * Constructs a dropDatabase command. - * - * Supported options: - * - * * typeMap (array): Type map for BSON deserialization. This will be used - * for the returned command result document. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * @param string $databaseName Database name - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, array $options = []) - { - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->databaseName = (string) $databaseName; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return array|object Command result document - * @throws UnsupportedException if writeConcern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['writeConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForWriteConcern)) { - throw UnsupportedException::writeConcernNotSupported(); - } - - $cursor = $server->executeCommand($this->databaseName, $this->createCommand()); - - if (isset($this->options['typeMap'])) { - $cursor->setTypeMap($this->options['typeMap']); - } - - return current($cursor->toArray()); - } - - /** - * Create the dropDatabase command. - * - * @return Command - */ - private function createCommand() - { - $cmd = ['dropDatabase' => 1]; - - if (isset($this->options['writeConcern'])) { - $cmd['writeConcern'] = \MongoDB\write_concern_as_document($this->options['writeConcern']); - } - - return new Command($cmd); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropIndexes.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropIndexes.php deleted file mode 100644 index f2b0b15..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/DropIndexes.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for the dropIndexes command. - * - * @api - * @see \MongoDB\Collection::dropIndexes() - * @see http://docs.mongodb.org/manual/reference/command/dropIndexes/ - */ -class DropIndexes implements Executable -{ - private static $wireVersionForWriteConcern = 5; - - private $databaseName; - private $collectionName; - private $indexName; - private $options; - - /** - * Constructs a dropIndexes command. - * - * Supported options: - * - * * typeMap (array): Type map for BSON deserialization. This will be used - * for the returned command result document. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param string $indexName Index name (use "*" to drop all indexes) - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $indexName, array $options = []) - { - $indexName = (string) $indexName; - - if ($indexName === '') { - throw new InvalidArgumentException('$indexName cannot be empty'); - } - - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->indexName = $indexName; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return array|object Command result document - * @throws UnsupportedException if writeConcern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['writeConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForWriteConcern)) { - throw UnsupportedException::writeConcernNotSupported(); - } - - $cursor = $server->executeCommand($this->databaseName, $this->createCommand()); - - if (isset($this->options['typeMap'])) { - $cursor->setTypeMap($this->options['typeMap']); - } - - return current($cursor->toArray()); - } - - /** - * Create the dropIndexes command. - * - * @return Command - */ - private function createCommand() - { - $cmd = [ - 'dropIndexes' => $this->collectionName, - 'index' => $this->indexName, - ]; - - if (isset($this->options['writeConcern'])) { - $cmd['writeConcern'] = \MongoDB\write_concern_as_document($this->options['writeConcern']); - } - - return new Command($cmd); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Executable.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Executable.php deleted file mode 100644 index eee1b5f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Executable.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Server; - -/** - * Executable interface for operation classes. - * - * This interface is reserved for internal use until PHPC-378 is implemented, - * since execute() should ultimately be changed to use ServerInterface. - * - * @internal - */ -interface Executable -{ - /** - * Execute the operation. - * - * @param Server $server - * @return mixed - */ - public function execute(Server $server); -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Find.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Find.php deleted file mode 100644 index f50fc5b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Find.php +++ /dev/null @@ -1,265 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Cursor; -use MongoDB\Driver\Query; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for the find command. - * - * @api - * @see \MongoDB\Collection::find() - * @see http://docs.mongodb.org/manual/tutorial/query-documents/ - * @see http://docs.mongodb.org/manual/reference/operator/query-modifier/ - */ -class Find implements Executable -{ - const NON_TAILABLE = 1; - const TAILABLE = 2; - const TAILABLE_AWAIT = 3; - - private static $wireVersionForCollation = 5; - private static $wireVersionForReadConcern = 4; - - private $databaseName; - private $collectionName; - private $filter; - private $options; - - /** - * Constructs a find command. - * - * Supported options: - * - * * allowPartialResults (boolean): Get partial results from a mongos if - * some shards are inaccessible (instead of throwing an error). - * - * * batchSize (integer): The number of documents to return per batch. - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * comment (string): Attaches a comment to the query. If "$comment" also - * exists in the modifiers document, this option will take precedence. - * - * * cursorType (enum): Indicates the type of cursor to use. Must be either - * NON_TAILABLE, TAILABLE, or TAILABLE_AWAIT. The default is - * NON_TAILABLE. - * - * * limit (integer): The maximum number of documents to return. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. If "$maxTimeMS" also exists in the modifiers document, this - * option will take precedence. - * - * * modifiers (document): Meta-operators modifying the output or behavior - * of a query. - * - * * noCursorTimeout (boolean): The server normally times out idle cursors - * after an inactivity period (10 minutes) to prevent excess memory use. - * Set this option to prevent that. - * - * * oplogReplay (boolean): Internal replication use only. The driver - * should not set this. - * - * * projection (document): Limits the fields to return for the matching - * document. - * - * * readConcern (MongoDB\Driver\ReadConcern): Read concern. - * - * This is not supported for server versions < 3.2 and will result in an - * exception at execution time if used. - * - * * readPreference (MongoDB\Driver\ReadPreference): Read preference. - * - * * skip (integer): The number of documents to skip before returning. - * - * * sort (document): The order in which to return matching documents. If - * "$orderby" also exists in the modifiers document, this option will - * take precedence. - * - * * typeMap (array): Type map for BSON deserialization. This will be - * applied to the returned Cursor (it is not sent to the server). - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to filter documents - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, array $options = []) - { - if ( ! is_array($filter) && ! is_object($filter)) { - throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object'); - } - - if (isset($options['allowPartialResults']) && ! is_bool($options['allowPartialResults'])) { - throw InvalidArgumentException::invalidType('"allowPartialResults" option', $options['allowPartialResults'], 'boolean'); - } - - if (isset($options['batchSize']) && ! is_integer($options['batchSize'])) { - throw InvalidArgumentException::invalidType('"batchSize" option', $options['batchSize'], 'integer'); - } - - if (isset($options['collation']) && ! is_array($options['collation']) && ! is_object($options['collation'])) { - throw InvalidArgumentException::invalidType('"collation" option', $options['collation'], 'array or object'); - } - - if (isset($options['comment']) && ! is_string($options['comment'])) { - throw InvalidArgumentException::invalidType('"comment" option', $options['comment'], 'comment'); - } - - if (isset($options['cursorType'])) { - if ( ! is_integer($options['cursorType'])) { - throw InvalidArgumentException::invalidType('"cursorType" option', $options['cursorType'], 'integer'); - } - - if ($options['cursorType'] !== self::NON_TAILABLE && - $options['cursorType'] !== self::TAILABLE && - $options['cursorType'] !== self::TAILABLE_AWAIT) { - throw new InvalidArgumentException('Invalid value for "cursorType" option: ' . $options['cursorType']); - } - } - - if (isset($options['limit']) && ! is_integer($options['limit'])) { - throw InvalidArgumentException::invalidType('"limit" option', $options['limit'], 'integer'); - } - - if (isset($options['maxTimeMS']) && ! is_integer($options['maxTimeMS'])) { - throw InvalidArgumentException::invalidType('"maxTimeMS" option', $options['maxTimeMS'], 'integer'); - } - - if (isset($options['modifiers']) && ! is_array($options['modifiers']) && ! is_object($options['modifiers'])) { - throw InvalidArgumentException::invalidType('"modifiers" option', $options['modifiers'], 'array or object'); - } - - if (isset($options['noCursorTimeout']) && ! is_bool($options['noCursorTimeout'])) { - throw InvalidArgumentException::invalidType('"noCursorTimeout" option', $options['noCursorTimeout'], 'boolean'); - } - - if (isset($options['oplogReplay']) && ! is_bool($options['oplogReplay'])) { - throw InvalidArgumentException::invalidType('"oplogReplay" option', $options['oplogReplay'], 'boolean'); - } - - if (isset($options['projection']) && ! is_array($options['projection']) && ! is_object($options['projection'])) { - throw InvalidArgumentException::invalidType('"projection" option', $options['projection'], 'array or object'); - } - - if (isset($options['readConcern']) && ! $options['readConcern'] instanceof ReadConcern) { - throw InvalidArgumentException::invalidType('"readConcern" option', $options['readConcern'], 'MongoDB\Driver\ReadConcern'); - } - - if (isset($options['readPreference']) && ! $options['readPreference'] instanceof ReadPreference) { - throw InvalidArgumentException::invalidType('"readPreference" option', $options['readPreference'], 'MongoDB\Driver\ReadPreference'); - } - - if (isset($options['skip']) && ! is_integer($options['skip'])) { - throw InvalidArgumentException::invalidType('"skip" option', $options['skip'], 'integer'); - } - - if (isset($options['sort']) && ! is_array($options['sort']) && ! is_object($options['sort'])) { - throw InvalidArgumentException::invalidType('"sort" option', $options['sort'], 'array or object'); - } - - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->filter = $filter; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return Cursor - * @throws UnsupportedException if collation or read concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['collation']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForCollation)) { - throw UnsupportedException::collationNotSupported(); - } - - if (isset($this->options['readConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) { - throw UnsupportedException::readConcernNotSupported(); - } - - $readPreference = isset($this->options['readPreference']) ? $this->options['readPreference'] : null; - - $cursor = $server->executeQuery($this->databaseName . '.' . $this->collectionName, $this->createQuery(), $readPreference); - - if (isset($this->options['typeMap'])) { - $cursor->setTypeMap($this->options['typeMap']); - } - - return $cursor; - } - - /** - * Create the find query. - * - * @return Query - */ - private function createQuery() - { - $options = []; - - if (isset($this->options['cursorType'])) { - if ($this->options['cursorType'] === self::TAILABLE) { - $options['tailable'] = true; - } - if ($this->options['cursorType'] === self::TAILABLE_AWAIT) { - $options['tailable'] = true; - $options['awaitData'] = true; - } - } - - foreach (['allowPartialResults', 'batchSize', 'comment', 'limit', 'maxTimeMS', 'noCursorTimeout', 'oplogReplay', 'projection', 'readConcern', 'skip', 'sort'] as $option) { - if (isset($this->options[$option])) { - $options[$option] = $this->options[$option]; - } - } - - if (isset($this->options['collation'])) { - $options['collation'] = (object) $this->options['collation']; - } - - $modifiers = empty($this->options['modifiers']) ? [] : (array) $this->options['modifiers']; - - if ( ! empty($modifiers)) { - $options['modifiers'] = $modifiers; - } - - return new Query($this->filter, $options); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindAndModify.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindAndModify.php deleted file mode 100644 index 7196bb1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindAndModify.php +++ /dev/null @@ -1,248 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnexpectedValueException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for the findAndModify command. - * - * This class is used internally by the FindOneAndDelete, FindOneAndReplace, and - * FindOneAndUpdate operation classes. - * - * @internal - * @see http://docs.mongodb.org/manual/reference/command/findAndModify/ - */ -class FindAndModify implements Executable -{ - private static $wireVersionForCollation = 5; - private static $wireVersionForDocumentLevelValidation = 4; - private static $wireVersionForWriteConcern = 4; - - private $databaseName; - private $collectionName; - private $options; - - /** - * Constructs a findAndModify command. - * - * Supported options: - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. - * - * * fields (document): Limits the fields to return for the matching - * document. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * * new (boolean): When true, returns the modified document rather than - * the original. This option is ignored for remove operations. The - * The default is false. - * - * * query (document): Query by which to filter documents. - * - * * remove (boolean): When true, removes the matched document. This option - * cannot be true if the update option is set. The default is false. - * - * * sort (document): Determines which document the operation modifies if - * the query selects multiple documents. - * - * * typeMap (array): Type map for BSON deserialization. - * - * * update (document): Update or replacement to apply to the matched - * document. This option cannot be set if the remove option is true. - * - * * upsert (boolean): When true, a new document is created if no document - * matches the query. This option is ignored for remove operations. The - * default is false. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * This is not supported for server versions < 3.2 and will result in an - * exception at execution time if used. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, array $options) - { - $options += [ - 'new' => false, - 'remove' => false, - 'upsert' => false, - ]; - - if (isset($options['bypassDocumentValidation']) && ! is_bool($options['bypassDocumentValidation'])) { - throw InvalidArgumentException::invalidType('"bypassDocumentValidation" option', $options['bypassDocumentValidation'], 'boolean'); - } - - if (isset($options['collation']) && ! is_array($options['collation']) && ! is_object($options['collation'])) { - throw InvalidArgumentException::invalidType('"collation" option', $options['collation'], 'array or object'); - } - - if (isset($options['fields']) && ! is_array($options['fields']) && ! is_object($options['fields'])) { - throw InvalidArgumentException::invalidType('"fields" option', $options['fields'], 'array or object'); - } - - if (isset($options['maxTimeMS']) && ! is_integer($options['maxTimeMS'])) { - throw InvalidArgumentException::invalidType('"maxTimeMS" option', $options['maxTimeMS'], 'integer'); - } - - if ( ! is_bool($options['new'])) { - throw InvalidArgumentException::invalidType('"new" option', $options['new'], 'boolean'); - } - - if (isset($options['query']) && ! is_array($options['query']) && ! is_object($options['query'])) { - throw InvalidArgumentException::invalidType('"query" option', $options['query'], 'array or object'); - } - - if ( ! is_bool($options['remove'])) { - throw InvalidArgumentException::invalidType('"remove" option', $options['remove'], 'boolean'); - } - - if (isset($options['sort']) && ! is_array($options['sort']) && ! is_object($options['sort'])) { - throw InvalidArgumentException::invalidType('"sort" option', $options['sort'], 'array or object'); - } - - if (isset($options['typeMap']) && ! is_array($options['typeMap'])) { - throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array'); - } - - if (isset($options['update']) && ! is_array($options['update']) && ! is_object($options['update'])) { - throw InvalidArgumentException::invalidType('"update" option', $options['update'], 'array or object'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - if ( ! is_bool($options['upsert'])) { - throw InvalidArgumentException::invalidType('"upsert" option', $options['upsert'], 'boolean'); - } - - if ( ! (isset($options['update']) xor $options['remove'])) { - throw new InvalidArgumentException('The "remove" option must be true or an "update" document must be specified, but not both'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return array|object|null - * @throws UnexpectedValueException if the command response was malformed - * @throws UnsupportedException if collation or write concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['collation']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForCollation)) { - throw UnsupportedException::collationNotSupported(); - } - - if (isset($this->options['writeConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForWriteConcern)) { - throw UnsupportedException::writeConcernNotSupported(); - } - - $cursor = $server->executeCommand($this->databaseName, $this->createCommand($server)); - $result = current($cursor->toArray()); - - if ( ! isset($result->value)) { - return null; - } - - /* Prior to 3.0, findAndModify returns an empty document instead of null - * when an upsert is performed and the pre-modified document was - * requested. - */ - if ($this->options['upsert'] && ! $this->options['new'] && - isset($result->lastErrorObject->updatedExisting) && - ! $result->lastErrorObject->updatedExisting) { - - return null; - } - - if ( ! is_object($result->value)) { - throw new UnexpectedValueException('findAndModify command did not return a "value" document'); - } - - if (isset($this->options['typeMap'])) { - return \MongoDB\apply_type_map_to_document($result->value, $this->options['typeMap']); - } - - return $result->value; - } - - /** - * Create the findAndModify command. - * - * @param Server $server - * @return Command - */ - private function createCommand(Server $server) - { - $cmd = ['findAndModify' => $this->collectionName]; - - if ($this->options['remove']) { - $cmd['remove'] = true; - } else { - $cmd['new'] = $this->options['new']; - $cmd['upsert'] = $this->options['upsert']; - } - - foreach (['collation', 'fields', 'query', 'sort', 'update'] as $option) { - if (isset($this->options[$option])) { - $cmd[$option] = (object) $this->options[$option]; - } - } - - if (isset($this->options['maxTimeMS'])) { - $cmd['maxTimeMS'] = $this->options['maxTimeMS']; - } - - if (isset($this->options['bypassDocumentValidation']) && \MongoDB\server_supports_feature($server, self::$wireVersionForDocumentLevelValidation)) { - $cmd['bypassDocumentValidation'] = $this->options['bypassDocumentValidation']; - } - - if (isset($this->options['writeConcern'])) { - $cmd['writeConcern'] = \MongoDB\write_concern_as_document($this->options['writeConcern']); - } - - return new Command($cmd); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOne.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOne.php deleted file mode 100644 index 72a03b0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOne.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for finding a single document with the find command. - * - * @api - * @see \MongoDB\Collection::findOne() - * @see http://docs.mongodb.org/manual/tutorial/query-documents/ - * @see http://docs.mongodb.org/manual/reference/operator/query-modifier/ - */ -class FindOne implements Executable -{ - private $find; - private $options; - - /** - * Constructs a find command for finding a single document. - * - * Supported options: - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * comment (string): Attaches a comment to the query. If "$comment" also - * exists in the modifiers document, this option will take precedence. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. If "$maxTimeMS" also exists in the modifiers document, this - * option will take precedence. - * - * * modifiers (document): Meta-operators modifying the output or behavior - * of a query. - * - * * projection (document): Limits the fields to return for the matching - * document. - * - * * readConcern (MongoDB\Driver\ReadConcern): Read concern. - * - * This is not supported for server versions < 3.2 and will result in an - * exception at execution time if used. - * - * * readPreference (MongoDB\Driver\ReadPreference): Read preference. - * - * * skip (integer): The number of documents to skip before returning. - * - * * sort (document): The order in which to return matching documents. If - * "$orderby" also exists in the modifiers document, this option will - * take precedence. - * - * * typeMap (array): Type map for BSON deserialization. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to filter documents - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, array $options = []) - { - $this->find = new Find( - $databaseName, - $collectionName, - $filter, - ['limit' => 1] + $options - ); - - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return array|object|null - * @throws UnsupportedException if collation or read concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - $cursor = $this->find->execute($server); - $document = current($cursor->toArray()); - - return ($document === false) ? null : $document; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndDelete.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndDelete.php deleted file mode 100644 index 8759565..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndDelete.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for deleting a document with the findAndModify command. - * - * @api - * @see \MongoDB\Collection::findOneAndDelete() - * @see http://docs.mongodb.org/manual/reference/command/findAndModify/ - */ -class FindOneAndDelete implements Executable -{ - private $findAndModify; - - /** - * Constructs a findAndModify command for deleting a document. - * - * Supported options: - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * * projection (document): Limits the fields to return for the matching - * document. - * - * * sort (document): Determines which document the operation modifies if - * the query selects multiple documents. - * - * * typeMap (array): Type map for BSON deserialization. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * This is not supported for server versions < 3.2 and will result in an - * exception at execution time if used. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to filter documents - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, array $options = []) - { - if ( ! is_array($filter) && ! is_object($filter)) { - throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object'); - } - - if (isset($options['projection']) && ! is_array($options['projection']) && ! is_object($options['projection'])) { - throw InvalidArgumentException::invalidType('"projection" option', $options['projection'], 'array or object'); - } - - if (isset($options['projection'])) { - $options['fields'] = $options['projection']; - } - - unset($options['projection']); - - $this->findAndModify = new FindAndModify( - $databaseName, - $collectionName, - ['query' => $filter, 'remove' => true] + $options - ); - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return array|object|null - * @throws UnsupportedException if collation or write concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - return $this->findAndModify->execute($server); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndReplace.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndReplace.php deleted file mode 100644 index 752a796..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndReplace.php +++ /dev/null @@ -1,144 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for replacing a document with the findAndModify command. - * - * @api - * @see \MongoDB\Collection::findOneAndReplace() - * @see http://docs.mongodb.org/manual/reference/command/findAndModify/ - */ -class FindOneAndReplace implements Executable -{ - const RETURN_DOCUMENT_BEFORE = 1; - const RETURN_DOCUMENT_AFTER = 2; - - private $findAndModify; - - /** - * Constructs a findAndModify command for replacing a document. - * - * Supported options: - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * * projection (document): Limits the fields to return for the matching - * document. - * - * * returnDocument (enum): Whether to return the document before or after - * the update is applied. Must be either - * FindOneAndReplace::RETURN_DOCUMENT_BEFORE or - * FindOneAndReplace::RETURN_DOCUMENT_AFTER. The default is - * FindOneAndReplace::RETURN_DOCUMENT_BEFORE. - * - * * sort (document): Determines which document the operation modifies if - * the query selects multiple documents. - * - * * typeMap (array): Type map for BSON deserialization. - * - * * upsert (boolean): When true, a new document is created if no document - * matches the query. The default is false. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * This is not supported for server versions < 3.2 and will result in an - * exception at execution time if used. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to filter documents - * @param array|object $replacement Replacement document - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, $replacement, array $options = []) - { - if ( ! is_array($filter) && ! is_object($filter)) { - throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object'); - } - - if ( ! is_array($replacement) && ! is_object($replacement)) { - throw InvalidArgumentException::invalidType('$replacement', $replacement, 'array or object'); - } - - if (\MongoDB\is_first_key_operator($replacement)) { - throw new InvalidArgumentException('First key in $replacement argument is an update operator'); - } - - $options += [ - 'returnDocument' => self::RETURN_DOCUMENT_BEFORE, - 'upsert' => false, - ]; - - if (isset($options['projection']) && ! is_array($options['projection']) && ! is_object($options['projection'])) { - throw InvalidArgumentException::invalidType('"projection" option', $options['projection'], 'array or object'); - } - - if ( ! is_integer($options['returnDocument'])) { - throw InvalidArgumentException::invalidType('"returnDocument" option', $options['returnDocument'], 'integer'); - } - - if ($options['returnDocument'] !== self::RETURN_DOCUMENT_AFTER && - $options['returnDocument'] !== self::RETURN_DOCUMENT_BEFORE) { - throw new InvalidArgumentException('Invalid value for "returnDocument" option: ' . $options['returnDocument']); - } - - if (isset($options['projection'])) { - $options['fields'] = $options['projection']; - } - - $options['new'] = $options['returnDocument'] === self::RETURN_DOCUMENT_AFTER; - - unset($options['projection'], $options['returnDocument']); - - $this->findAndModify = new FindAndModify( - $databaseName, - $collectionName, - ['query' => $filter, 'update' => $replacement] + $options - ); - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return array|object|null - * @throws UnsupportedException if collation or write concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - return $this->findAndModify->execute($server); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndUpdate.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndUpdate.php deleted file mode 100644 index 41e7abf..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/FindOneAndUpdate.php +++ /dev/null @@ -1,144 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for updating a document with the findAndModify command. - * - * @api - * @see \MongoDB\Collection::findOneAndUpdate() - * @see http://docs.mongodb.org/manual/reference/command/findAndModify/ - */ -class FindOneAndUpdate implements Executable -{ - const RETURN_DOCUMENT_BEFORE = 1; - const RETURN_DOCUMENT_AFTER = 2; - - private $findAndModify; - - /** - * Constructs a findAndModify command for updating a document. - * - * Supported options: - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * * projection (document): Limits the fields to return for the matching - * document. - * - * * returnDocument (enum): Whether to return the document before or after - * the update is applied. Must be either - * FindOneAndUpdate::RETURN_DOCUMENT_BEFORE or - * FindOneAndUpdate::RETURN_DOCUMENT_AFTER. The default is - * FindOneAndUpdate::RETURN_DOCUMENT_BEFORE. - * - * * sort (document): Determines which document the operation modifies if - * the query selects multiple documents. - * - * * typeMap (array): Type map for BSON deserialization. - * - * * upsert (boolean): When true, a new document is created if no document - * matches the query. The default is false. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * This is not supported for server versions < 3.2 and will result in an - * exception at execution time if used. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to filter documents - * @param array|object $update Update to apply to the matched document - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, $update, array $options = []) - { - if ( ! is_array($filter) && ! is_object($filter)) { - throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object'); - } - - if ( ! is_array($update) && ! is_object($update)) { - throw InvalidArgumentException::invalidType('$update', $update, 'array or object'); - } - - if ( ! \MongoDB\is_first_key_operator($update)) { - throw new InvalidArgumentException('First key in $update argument is not an update operator'); - } - - $options += [ - 'returnDocument' => self::RETURN_DOCUMENT_BEFORE, - 'upsert' => false, - ]; - - if (isset($options['projection']) && ! is_array($options['projection']) && ! is_object($options['projection'])) { - throw InvalidArgumentException::invalidType('"projection" option', $options['projection'], 'array or object'); - } - - if ( ! is_integer($options['returnDocument'])) { - throw InvalidArgumentException::invalidType('"returnDocument" option', $options['returnDocument'], 'integer'); - } - - if ($options['returnDocument'] !== self::RETURN_DOCUMENT_AFTER && - $options['returnDocument'] !== self::RETURN_DOCUMENT_BEFORE) { - throw new InvalidArgumentException('Invalid value for "returnDocument" option: ' . $options['returnDocument']); - } - - if (isset($options['projection'])) { - $options['fields'] = $options['projection']; - } - - $options['new'] = $options['returnDocument'] === self::RETURN_DOCUMENT_AFTER; - - unset($options['projection'], $options['returnDocument']); - - $this->findAndModify = new FindAndModify( - $databaseName, - $collectionName, - ['query' => $filter, 'update' => $update] + $options - ); - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return array|object|null - * @throws UnsupportedException if collation or write concern is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - return $this->findAndModify->execute($server); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/InsertMany.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/InsertMany.php deleted file mode 100644 index 1160408..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/InsertMany.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\InsertManyResult; -use MongoDB\Driver\BulkWrite as Bulk; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; - -/** - * Operation for inserting multiple documents with the insert command. - * - * @api - * @see \MongoDB\Collection::insertMany() - * @see http://docs.mongodb.org/manual/reference/command/insert/ - */ -class InsertMany implements Executable -{ - private static $wireVersionForDocumentLevelValidation = 4; - - private $databaseName; - private $collectionName; - private $documents; - private $options; - - /** - * Constructs an insert command. - * - * Supported options: - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. - * - * * ordered (boolean): If true, when an insert fails, return without - * performing the remaining writes. If false, when a write fails, - * continue with the remaining writes, if any. The default is true. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array[]|object[] $documents List of documents to insert - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, array $documents, array $options = []) - { - if (empty($documents)) { - throw new InvalidArgumentException('$documents is empty'); - } - - $expectedIndex = 0; - - foreach ($documents as $i => $document) { - if ($i !== $expectedIndex) { - throw new InvalidArgumentException(sprintf('$documents is not a list (unexpected index: "%s")', $i)); - } - - if ( ! is_array($document) && ! is_object($document)) { - throw InvalidArgumentException::invalidType(sprintf('$documents[%d]', $i), $document, 'array or object'); - } - - $expectedIndex += 1; - } - - $options += ['ordered' => true]; - - if (isset($options['bypassDocumentValidation']) && ! is_bool($options['bypassDocumentValidation'])) { - throw InvalidArgumentException::invalidType('"bypassDocumentValidation" option', $options['bypassDocumentValidation'], 'boolean'); - } - - if ( ! is_bool($options['ordered'])) { - throw InvalidArgumentException::invalidType('"ordered" option', $options['ordered'], 'boolean'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->documents = $documents; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return InsertManyResult - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - $options = ['ordered' => $this->options['ordered']]; - - if (isset($this->options['bypassDocumentValidation']) && \MongoDB\server_supports_feature($server, self::$wireVersionForDocumentLevelValidation)) { - $options['bypassDocumentValidation'] = $this->options['bypassDocumentValidation']; - } - - $bulk = new Bulk($options); - $insertedIds = []; - - foreach ($this->documents as $i => $document) { - $insertedId = $bulk->insert($document); - - if ($insertedId !== null) { - $insertedIds[$i] = $insertedId; - } else { - $insertedIds[$i] = \MongoDB\extract_id_from_inserted_document($document); - } - } - - $writeConcern = isset($this->options['writeConcern']) ? $this->options['writeConcern'] : null; - $writeResult = $server->executeBulkWrite($this->databaseName . '.' . $this->collectionName, $bulk, $writeConcern); - - return new InsertManyResult($writeResult, $insertedIds); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/InsertOne.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/InsertOne.php deleted file mode 100644 index f93197c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/InsertOne.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\InsertOneResult; -use MongoDB\Driver\BulkWrite as Bulk; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; - -/** - * Operation for inserting a single document with the insert command. - * - * @api - * @see \MongoDB\Collection::insertOne() - * @see http://docs.mongodb.org/manual/reference/command/insert/ - */ -class InsertOne implements Executable -{ - private static $wireVersionForDocumentLevelValidation = 4; - - private $databaseName; - private $collectionName; - private $document; - private $options; - - /** - * Constructs an insert command. - * - * Supported options: - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $document Document to insert - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $document, array $options = []) - { - if ( ! is_array($document) && ! is_object($document)) { - throw InvalidArgumentException::invalidType('$document', $document, 'array or object'); - } - - if (isset($options['bypassDocumentValidation']) && ! is_bool($options['bypassDocumentValidation'])) { - throw InvalidArgumentException::invalidType('"bypassDocumentValidation" option', $options['bypassDocumentValidation'], 'boolean'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->document = $document; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return InsertOneResult - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - $options = []; - - if (isset($this->options['bypassDocumentValidation']) && \MongoDB\server_supports_feature($server, self::$wireVersionForDocumentLevelValidation)) { - $options['bypassDocumentValidation'] = $this->options['bypassDocumentValidation']; - } - - $bulk = new Bulk($options); - $insertedId = $bulk->insert($this->document); - - if ($insertedId === null) { - $insertedId = \MongoDB\extract_id_from_inserted_document($this->document); - } - - $writeConcern = isset($this->options['writeConcern']) ? $this->options['writeConcern'] : null; - $writeResult = $server->executeBulkWrite($this->databaseName . '.' . $this->collectionName, $bulk, $writeConcern); - - return new InsertOneResult($writeResult, $insertedId); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListCollections.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListCollections.php deleted file mode 100644 index c901e67..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListCollections.php +++ /dev/null @@ -1,143 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Query; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Model\CollectionInfoCommandIterator; -use MongoDB\Model\CollectionInfoIterator; -use MongoDB\Model\CollectionInfoLegacyIterator; - -/** - * Operation for the listCollections command. - * - * @api - * @see \MongoDB\Database::listCollections() - * @see http://docs.mongodb.org/manual/reference/command/listCollections/ - */ -class ListCollections implements Executable -{ - private static $wireVersionForCommand = 3; - - private $databaseName; - private $options; - - /** - * Constructs a listCollections command. - * - * Supported options: - * - * * filter (document): Query by which to filter collections. - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * @param string $databaseName Database name - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, array $options = []) - { - if (isset($options['filter']) && ! is_array($options['filter']) && ! is_object($options['filter'])) { - throw InvalidArgumentException::invalidType('"filter" option', $options['filter'], 'array or object'); - } - - if (isset($options['maxTimeMS']) && ! is_integer($options['maxTimeMS'])) { - throw InvalidArgumentException::invalidType('"maxTimeMS" option', $options['maxTimeMS'], 'integer'); - } - - $this->databaseName = (string) $databaseName; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return CollectionInfoIterator - * @throws InvalidArgumentException if filter.name is not a string for legacy execution - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - return \MongoDB\server_supports_feature($server, self::$wireVersionForCommand) - ? $this->executeCommand($server) - : $this->executeLegacy($server); - } - - /** - * Returns information for all collections in this database using the - * listCollections command. - * - * @param Server $server - * @return CollectionInfoCommandIterator - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - private function executeCommand(Server $server) - { - $cmd = ['listCollections' => 1]; - - if ( ! empty($this->options['filter'])) { - $cmd['filter'] = (object) $this->options['filter']; - } - - if (isset($this->options['maxTimeMS'])) { - $cmd['maxTimeMS'] = $this->options['maxTimeMS']; - } - - $cursor = $server->executeCommand($this->databaseName, new Command($cmd)); - $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); - - return new CollectionInfoCommandIterator($cursor); - } - - /** - * Returns information for all collections in this database by querying the - * "system.namespaces" collection (MongoDB <3.0). - * - * @param Server $server - * @return CollectionInfoLegacyIterator - * @throws InvalidArgumentException if filter.name is not a string - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - private function executeLegacy(Server $server) - { - $filter = empty($this->options['filter']) ? [] : (array) $this->options['filter']; - - if (array_key_exists('name', $filter)) { - if ( ! is_string($filter['name'])) { - throw InvalidArgumentException::invalidType('filter name for MongoDB <3.0', $filter['name'], 'string'); - } - - $filter['name'] = $this->databaseName . '.' . $filter['name']; - } - - $options = isset($this->options['maxTimeMS']) - ? ['modifiers' => ['$maxTimeMS' => $this->options['maxTimeMS']]] - : []; - - $cursor = $server->executeQuery($this->databaseName . '.system.namespaces', new Query($filter, $options)); - $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); - - return new CollectionInfoLegacyIterator($cursor); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListDatabases.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListDatabases.php deleted file mode 100644 index b9f17a7..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListDatabases.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnexpectedValueException; -use MongoDB\Model\DatabaseInfoIterator; -use MongoDB\Model\DatabaseInfoLegacyIterator; - -/** - * Operation for the ListDatabases command. - * - * @api - * @see \MongoDB\Client::listDatabases() - * @see http://docs.mongodb.org/manual/reference/command/ListDatabases/ - */ -class ListDatabases implements Executable -{ - private $options; - - /** - * Constructs a listDatabases command. - * - * Supported options: - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct(array $options = []) - { - if (isset($options['maxTimeMS']) && ! is_integer($options['maxTimeMS'])) { - throw InvalidArgumentException::invalidType('"maxTimeMS" option', $options['maxTimeMS'], 'integer'); - } - - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return DatabaseInfoIterator - * @throws UnexpectedValueException if the command response was malformed - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - $cmd = ['listDatabases' => 1]; - - if (isset($this->options['maxTimeMS'])) { - $cmd['maxTimeMS'] = $this->options['maxTimeMS']; - } - - $cursor = $server->executeCommand('admin', new Command($cmd)); - $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); - $result = current($cursor->toArray()); - - if ( ! isset($result['databases']) || ! is_array($result['databases'])) { - throw new UnexpectedValueException('listDatabases command did not return a "databases" array'); - } - - /* Return an Iterator instead of an array in case listDatabases is - * eventually changed to return a command cursor, like the collection - * and index enumeration commands. This makes the "totalSize" command - * field inaccessible, but users can manually invoke the command if they - * need that value. - */ - return new DatabaseInfoLegacyIterator($result['databases']); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListIndexes.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListIndexes.php deleted file mode 100644 index d68cc90..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ListIndexes.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Query; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Model\IndexInfoIterator; -use MongoDB\Model\IndexInfoIteratorIterator; -use EmptyIterator; - -/** - * Operation for the listIndexes command. - * - * @api - * @see \MongoDB\Collection::listIndexes() - * @see http://docs.mongodb.org/manual/reference/command/listIndexes/ - */ -class ListIndexes implements Executable -{ - private static $errorCodeDatabaseNotFound = 60; - private static $errorCodeNamespaceNotFound = 26; - private static $wireVersionForCommand = 3; - - private $databaseName; - private $collectionName; - private $options; - - /** - * Constructs a listIndexes command. - * - * Supported options: - * - * * maxTimeMS (integer): The maximum amount of time to allow the query to - * run. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, array $options = []) - { - if (isset($options['maxTimeMS']) && ! is_integer($options['maxTimeMS'])) { - throw InvalidArgumentException::invalidType('"maxTimeMS" option', $options['maxTimeMS'], 'integer'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return IndexInfoIterator - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - return \MongoDB\server_supports_feature($server, self::$wireVersionForCommand) - ? $this->executeCommand($server) - : $this->executeLegacy($server); - } - - /** - * Returns information for all indexes for this collection using the - * listIndexes command. - * - * @param Server $server - * @return IndexInfoIteratorIterator - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - private function executeCommand(Server $server) - { - $cmd = ['listIndexes' => $this->collectionName]; - - if (isset($this->options['maxTimeMS'])) { - $cmd['maxTimeMS'] = $this->options['maxTimeMS']; - } - - try { - $cursor = $server->executeCommand($this->databaseName, new Command($cmd)); - } catch (DriverRuntimeException $e) { - /* The server may return an error if the collection does not exist. - * Check for possible error codes (see: SERVER-20463) and return an - * empty iterator instead of throwing. - */ - if ($e->getCode() === self::$errorCodeNamespaceNotFound || $e->getCode() === self::$errorCodeDatabaseNotFound) { - return new IndexInfoIteratorIterator(new EmptyIterator); - } - - throw $e; - } - - $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); - - return new IndexInfoIteratorIterator($cursor); - } - - /** - * Returns information for all indexes for this collection by querying the - * "system.indexes" collection (MongoDB <3.0). - * - * @param Server $server - * @return IndexInfoIteratorIterator - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - private function executeLegacy(Server $server) - { - $filter = ['ns' => $this->databaseName . '.' . $this->collectionName]; - - $options = isset($this->options['maxTimeMS']) - ? ['modifiers' => ['$maxTimeMS' => $this->options['maxTimeMS']]] - : []; - - $cursor = $server->executeQuery($this->databaseName . '.system.indexes', new Query($filter, $options)); - $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); - - return new IndexInfoIteratorIterator($cursor); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ReplaceOne.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ReplaceOne.php deleted file mode 100644 index 0bb0c92..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/ReplaceOne.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\UpdateResult; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for replacing a single document with the update command. - * - * @api - * @see \MongoDB\Collection::replaceOne() - * @see http://docs.mongodb.org/manual/reference/command/update/ - */ -class ReplaceOne implements Executable -{ - private $update; - - /** - * Constructs an update command. - * - * Supported options: - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * upsert (boolean): When true, a new document is created if no document - * matches the query. The default is false. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to filter documents - * @param array|object $replacement Replacement document - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, $replacement, array $options = []) - { - if ( ! is_array($replacement) && ! is_object($replacement)) { - throw InvalidArgumentException::invalidType('$replacement', $replacement, 'array or object'); - } - - if (\MongoDB\is_first_key_operator($replacement)) { - throw new InvalidArgumentException('First key in $replacement argument is an update operator'); - } - - $this->update = new Update( - $databaseName, - $collectionName, - $filter, - $replacement, - ['multi' => false] + $options - ); - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return UpdateResult - * @throws UnsupportedException if collation is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - return $this->update->execute($server); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Update.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Update.php deleted file mode 100644 index 2faa9b9..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/Update.php +++ /dev/null @@ -1,162 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\UpdateResult; -use MongoDB\Driver\BulkWrite as Bulk; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for the update command. - * - * This class is used internally by the ReplaceOne, UpdateMany, and UpdateOne - * operation classes. - * - * @internal - * @see http://docs.mongodb.org/manual/reference/command/update/ - */ -class Update implements Executable -{ - private static $wireVersionForCollation = 5; - private static $wireVersionForDocumentLevelValidation = 4; - - private $databaseName; - private $collectionName; - private $filter; - private $update; - private $options; - - /** - * Constructs a update command. - * - * Supported options: - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * multi (boolean): When true, updates all documents matching the query. - * This option cannot be true if the $update argument is a replacement - * document (i.e. contains no update operators). The default is false. - * - * * upsert (boolean): When true, a new document is created if no document - * matches the query. The default is false. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to delete documents - * @param array|object $update Update to apply to the matched - * document(s) or a replacement document - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, $update, array $options = []) - { - if ( ! is_array($filter) && ! is_object($filter)) { - throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object'); - } - - if ( ! is_array($update) && ! is_object($update)) { - throw InvalidArgumentException::invalidType('$update', $filter, 'array or object'); - } - - $options += [ - 'multi' => false, - 'upsert' => false, - ]; - - if (isset($options['bypassDocumentValidation']) && ! is_bool($options['bypassDocumentValidation'])) { - throw InvalidArgumentException::invalidType('"bypassDocumentValidation" option', $options['bypassDocumentValidation'], 'boolean'); - } - - if (isset($options['collation']) && ! is_array($options['collation']) && ! is_object($options['collation'])) { - throw InvalidArgumentException::invalidType('"collation" option', $options['collation'], 'array or object'); - } - - if ( ! is_bool($options['multi'])) { - throw InvalidArgumentException::invalidType('"multi" option', $options['multi'], 'boolean'); - } - - if ($options['multi'] && ! \MongoDB\is_first_key_operator($update)) { - throw new InvalidArgumentException('"multi" option cannot be true if $update is a replacement document'); - } - - if ( ! is_bool($options['upsert'])) { - throw InvalidArgumentException::invalidType('"upsert" option', $options['upsert'], 'boolean'); - } - - if (isset($options['writeConcern']) && ! $options['writeConcern'] instanceof WriteConcern) { - throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern'); - } - - $this->databaseName = (string) $databaseName; - $this->collectionName = (string) $collectionName; - $this->filter = $filter; - $this->update = $update; - $this->options = $options; - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return UpdateResult - * @throws UnsupportedException if collation is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - if (isset($this->options['collation']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForCollation)) { - throw UnsupportedException::collationNotSupported(); - } - - $updateOptions = [ - 'multi' => $this->options['multi'], - 'upsert' => $this->options['upsert'], - ]; - - if (isset($this->options['collation'])) { - $updateOptions['collation'] = (object) $this->options['collation']; - } - - $bulkOptions = []; - - if (isset($this->options['bypassDocumentValidation']) && \MongoDB\server_supports_feature($server, self::$wireVersionForDocumentLevelValidation)) { - $bulkOptions['bypassDocumentValidation'] = $this->options['bypassDocumentValidation']; - } - - $bulk = new Bulk($bulkOptions); - $bulk->update($this->filter, $this->update, $updateOptions); - - $writeConcern = isset($this->options['writeConcern']) ? $this->options['writeConcern'] : null; - $writeResult = $server->executeBulkWrite($this->databaseName . '.' . $this->collectionName, $bulk, $writeConcern); - - return new UpdateResult($writeResult); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/UpdateMany.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/UpdateMany.php deleted file mode 100644 index 509374e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/UpdateMany.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\UpdateResult; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for updating multiple documents with the update command. - * - * @api - * @see \MongoDB\Collection::updateMany() - * @see http://docs.mongodb.org/manual/reference/command/update/ - */ -class UpdateMany implements Executable -{ - private $update; - - /** - * Constructs an update command. - * - * Supported options: - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * upsert (boolean): When true, a new document is created if no document - * matches the query. The default is false. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to filter documents - * @param array|object $update Update to apply to the matched documents - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, $update, array $options = []) - { - if ( ! is_array($update) && ! is_object($update)) { - throw InvalidArgumentException::invalidType('$update', $update, 'array or object'); - } - - if ( ! \MongoDB\is_first_key_operator($update)) { - throw new InvalidArgumentException('First key in $update argument is not an update operator'); - } - - $this->update = new Update( - $databaseName, - $collectionName, - $filter, - $update, - ['multi' => true] + $options - ); - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return UpdateResult - * @throws UnsupportedException if collation is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - return $this->update->execute($server); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/UpdateOne.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/UpdateOne.php deleted file mode 100644 index e2b9e00..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/Operation/UpdateOne.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB\Operation; - -use MongoDB\UpdateResult; -use MongoDB\Driver\Server; -use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException; -use MongoDB\Exception\InvalidArgumentException; -use MongoDB\Exception\UnsupportedException; - -/** - * Operation for updating a single document with the update command. - * - * @api - * @see \MongoDB\Collection::updateOne() - * @see http://docs.mongodb.org/manual/reference/command/update/ - */ -class UpdateOne implements Executable -{ - private $update; - - /** - * Constructs an update command. - * - * Supported options: - * - * * bypassDocumentValidation (boolean): If true, allows the write to opt - * out of document level validation. - * - * * collation (document): Collation specification. - * - * This is not supported for server versions < 3.4 and will result in an - * exception at execution time if used. - * - * * upsert (boolean): When true, a new document is created if no document - * matches the query. The default is false. - * - * * writeConcern (MongoDB\Driver\WriteConcern): Write concern. - * - * @param string $databaseName Database name - * @param string $collectionName Collection name - * @param array|object $filter Query by which to filter documents - * @param array|object $update Update to apply to the matched document - * @param array $options Command options - * @throws InvalidArgumentException for parameter/option parsing errors - */ - public function __construct($databaseName, $collectionName, $filter, $update, array $options = []) - { - if ( ! is_array($update) && ! is_object($update)) { - throw InvalidArgumentException::invalidType('$update', $update, 'array or object'); - } - - if ( ! \MongoDB\is_first_key_operator($update)) { - throw new InvalidArgumentException('First key in $update argument is not an update operator'); - } - - $this->update = new Update( - $databaseName, - $collectionName, - $filter, - $update, - ['multi' => false] + $options - ); - } - - /** - * Execute the operation. - * - * @see Executable::execute() - * @param Server $server - * @return UpdateResult - * @throws UnsupportedException if collation is used and unsupported - * @throws DriverRuntimeException for other driver errors (e.g. connection errors) - */ - public function execute(Server $server) - { - return $this->update->execute($server); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/UpdateResult.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/UpdateResult.php deleted file mode 100644 index 49516e0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/UpdateResult.php +++ /dev/null @@ -1,140 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB; - -use MongoDB\Driver\WriteResult; -use MongoDB\Exception\BadMethodCallException; - -/** - * Result class for an update operation. - */ -class UpdateResult -{ - private $writeResult; - private $isAcknowledged; - - /** - * Constructor. - * - * @param WriteResult $writeResult - */ - public function __construct(WriteResult $writeResult) - { - $this->writeResult = $writeResult; - $this->isAcknowledged = $writeResult->isAcknowledged(); - } - - /** - * Return the number of documents that were matched by the filter. - * - * This method should only be called if the write was acknowledged. - * - * @see UpdateResult::isAcknowledged() - * @return integer - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getMatchedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getMatchedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return the number of documents that were modified. - * - * This value is undefined (i.e. null) if the write executed as a legacy - * operation instead of command. - * - * This method should only be called if the write was acknowledged. - * - * @see UpdateResult::isAcknowledged() - * @return integer|null - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getModifiedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getModifiedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return the number of documents that were upserted. - * - * This method should only be called if the write was acknowledged. - * - * @see UpdateResult::isAcknowledged() - * @return integer - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getUpsertedCount() - { - if ($this->isAcknowledged) { - return $this->writeResult->getUpsertedCount(); - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return the ID of the document inserted by an upsert operation. - * - * If the document had an ID prior to upserting (i.e. the server did not - * need to generate an ID), this will contain its "_id". Any - * server-generated ID will be a MongoDB\BSON\ObjectID instance. - * - * This value is undefined (i.e. null) if an upsert did not take place. - * - * This method should only be called if the write was acknowledged. - * - * @see UpdateResult::isAcknowledged() - * @return mixed|null - * @throws BadMethodCallException is the write result is unacknowledged - */ - public function getUpsertedId() - { - if ($this->isAcknowledged) { - foreach ($this->writeResult->getUpsertedIds() as $id) { - return $id; - } - - return null; - } - - throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); - } - - /** - * Return whether this update was acknowledged by the server. - * - * If the update was not acknowledged, other fields from the WriteResult - * (e.g. matchedCount) will be undefined and their getter methods should not - * be invoked. - * - * @return boolean - */ - public function isAcknowledged() - { - return $this->isAcknowledged; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/src/functions.php b/boilerplate/test/src/vendor/mongodb/mongodb/src/functions.php deleted file mode 100644 index 7119d9f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/src/functions.php +++ /dev/null @@ -1,228 +0,0 @@ -<?php -/* - * Copyright 2015-2017 MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace MongoDB; - -use MongoDB\BSON\Serializable; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\Server; -use MongoDB\Driver\WriteConcern; -use MongoDB\Exception\InvalidArgumentException; -use stdClass; - -/** - * Applies a type map to a document. - * - * This function is used by operations where it is not possible to apply a type - * map to the cursor directly because the root document is a command response - * (e.g. findAndModify). - * - * @internal - * @param array|object $document Document to which the type map will be applied - * @param array $typeMap Type map for BSON deserialization. - * @return array|object - * @throws InvalidArgumentException - */ -function apply_type_map_to_document($document, array $typeMap) -{ - if ( ! is_array($document) && ! is_object($document)) { - throw InvalidArgumentException::invalidType('$document', $document, 'array or object'); - } - - return \MongoDB\BSON\toPHP(\MongoDB\BSON\fromPHP($document), $typeMap); -} - -/** - * Extracts an ID from an inserted document. - * - * This function is used when BulkWrite::insert() does not return a generated - * ID, which means that the ID should be fetched from an array offset, public - * property, or in the data returned by bsonSerialize(). - * - * @internal - * @see https://jira.mongodb.org/browse/PHPC-382 - * @param array|object $document Inserted document - * @return mixed - */ -function extract_id_from_inserted_document($document) -{ - if ($document instanceof Serializable) { - return extract_id_from_inserted_document($document->bsonSerialize()); - } - - return is_array($document) ? $document['_id'] : $document->_id; -} - -/** - * Generate an index name from a key specification. - * - * @internal - * @param array|object $document Document containing fields mapped to values, - * which denote order or an index type - * @return string - * @throws InvalidArgumentException - */ -function generate_index_name($document) -{ - if ($document instanceof Serializable) { - $document = $document->bsonSerialize(); - } - - if (is_object($document)) { - $document = get_object_vars($document); - } - - if ( ! is_array($document)) { - throw InvalidArgumentException::invalidType('$document', $document, 'array or object'); - } - - $name = ''; - - foreach ($document as $field => $type) { - $name .= ($name != '' ? '_' : '') . $field . '_' . $type; - } - - return $name; -} - -/** - * Return whether the first key in the document starts with a "$" character. - * - * This is used for differentiating update and replacement documents. - * - * @internal - * @param array|object $document Update or replacement document - * @return boolean - * @throws InvalidArgumentException - */ -function is_first_key_operator($document) -{ - if ($document instanceof Serializable) { - $document = $document->bsonSerialize(); - } - - if (is_object($document)) { - $document = get_object_vars($document); - } - - if ( ! is_array($document)) { - throw InvalidArgumentException::invalidType('$document', $document, 'array or object'); - } - - reset($document); - $firstKey = (string) key($document); - - return (isset($firstKey[0]) && $firstKey[0] === '$'); -} - -/** - * Return whether the aggregation pipeline ends with an $out operator. - * - * This is used for determining whether the aggregation pipeline msut be - * executed against a primary server. - * - * @internal - * @param array $pipeline List of pipeline operations - * @return boolean - */ -function is_last_pipeline_operator_out(array $pipeline) -{ - $lastOp = end($pipeline); - - if ($lastOp === false) { - return false; - } - - $lastOp = (array) $lastOp; - - return key($lastOp) === '$out'; -} - -/** - * Converts a ReadConcern instance to a stdClass for use in a BSON document. - * - * @internal - * @see https://jira.mongodb.org/browse/PHPC-498 - * @param ReadConcern $readConcern Read concern - * @return stdClass - */ -function read_concern_as_document(ReadConcern $readConcern) -{ - $document = []; - - if ($readConcern->getLevel() !== null) { - $document['level'] = $readConcern->getLevel(); - } - - return (object) $document; -} - -/** - * Return whether the server supports a particular feature. - * - * @internal - * @param Server $server Server to check - * @param integer $feature Feature constant (i.e. wire protocol version) - * @return boolean - */ -function server_supports_feature(Server $server, $feature) -{ - $info = $server->getInfo(); - $maxWireVersion = isset($info['maxWireVersion']) ? (integer) $info['maxWireVersion'] : 0; - $minWireVersion = isset($info['minWireVersion']) ? (integer) $info['minWireVersion'] : 0; - - return ($minWireVersion <= $feature && $maxWireVersion >= $feature); -} - -function is_string_array($input) { - if (!is_array($input)){ - return false; - } - foreach($input as $item) { - if (!is_string($item)) { - return false; - } - } - return true; -} - -/** - * Converts a WriteConcern instance to a stdClass for use in a BSON document. - * - * @internal - * @see https://jira.mongodb.org/browse/PHPC-498 - * @param WriteConcern $writeConcern Write concern - * @return stdClass - */ -function write_concern_as_document(WriteConcern $writeConcern) -{ - $document = []; - - if ($writeConcern->getW() !== null) { - $document['w'] = $writeConcern->getW(); - } - - if ($writeConcern->getJournal() !== null) { - $document['j'] = $writeConcern->getJournal(); - } - - if ($writeConcern->getWtimeout() !== 0) { - $document['wtimeout'] = $writeConcern->getWtimeout(); - } - - return (object) $document; -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/ClientFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/ClientFunctionalTest.php deleted file mode 100644 index e197a60..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/ClientFunctionalTest.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Client; -use MongoDB\Driver\BulkWrite; -use MongoDB\Driver\Command; -use MongoDB\Model\DatabaseInfo; - -/** - * Functional tests for the Client class. - */ -class ClientFunctionalTest extends FunctionalTestCase -{ - private $client; - - public function setUp() - { - parent::setUp(); - - $this->client = new Client($this->getUri()); - $this->client->dropDatabase($this->getDatabaseName()); - } - - public function testGetManager() - { - $this->assertInstanceOf('MongoDB\Driver\Manager', $this->client->getManager()); - } - - public function testDropDatabase() - { - $bulkWrite = new BulkWrite(); - $bulkWrite->insert(['x' => 1]); - - $writeResult = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - $this->assertEquals(1, $writeResult->getInsertedCount()); - - $commandResult = $this->client->dropDatabase($this->getDatabaseName()); - $this->assertCommandSucceeded($commandResult); - $this->assertCollectionCount($this->getNamespace(), 0); - } - - public function testListDatabases() - { - $bulkWrite = new BulkWrite(); - $bulkWrite->insert(['x' => 1]); - - $writeResult = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - $this->assertEquals(1, $writeResult->getInsertedCount()); - - $databases = $this->client->listDatabases(); - - $this->assertInstanceOf('MongoDB\Model\DatabaseInfoIterator', $databases); - - foreach ($databases as $database) { - $this->assertInstanceOf('MongoDB\Model\DatabaseInfo', $database); - } - - $that = $this; - $this->assertDatabaseExists($this->getDatabaseName(), function(DatabaseInfo $info) use ($that) { - $that->assertFalse($info->isEmpty()); - $that->assertGreaterThan(0, $info->getSizeOnDisk()); - }); - } - - /** - * Asserts that a database with the given name exists on the server. - * - * An optional $callback may be provided, which should take a DatabaseInfo - * argument as its first and only parameter. If a DatabaseInfo matching - * the given name is found, it will be passed to the callback, which may - * perform additional assertions. - * - * @param string $databaseName - * @param callable $callback - */ - private function assertDatabaseExists($databaseName, $callback = null) - { - if ($callback !== null && ! is_callable($callback)) { - throw new InvalidArgumentException('$callback is not a callable'); - } - - $databases = $this->client->listDatabases(); - - $foundDatabase = null; - - foreach ($databases as $database) { - if ($database->getName() === $databaseName) { - $foundDatabase = $database; - break; - } - } - - $this->assertNotNull($foundDatabase, sprintf('Database %s does not exist on the server', $databaseName)); - - if ($callback !== null) { - call_user_func($callback, $foundDatabase); - } - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/ClientTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/ClientTest.php deleted file mode 100644 index 07a68bb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/ClientTest.php +++ /dev/null @@ -1,163 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Client; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\WriteConcern; - -/** - * Unit tests for the Client class. - */ -class ClientTest extends TestCase -{ - public function testConstructorDefaultUri() - { - $client = new Client(); - - $this->assertEquals('mongodb://127.0.0.1/', (string) $client); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorDriverOptions - */ - public function testConstructorDriverOptionTypeChecks(array $driverOptions) - { - new Client($this->getUri(), [], $driverOptions); - } - - public function provideInvalidConstructorDriverOptions() - { - $options = []; - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - return $options; - } - - public function testToString() - { - $client = new Client($this->getUri()); - - $this->assertSame($this->getUri(), (string) $client); - } - - public function testSelectCollectionInheritsOptions() - { - $this->markTestSkipped('Depends on https://jira.mongodb.org/browse/PHPC-523'); - - $uriOptions = [ - 'readConcernLevel' => ReadConcern::LOCAL, - 'readPreference' => 'secondaryPreferred', - 'w' => WriteConcern::MAJORITY, - ]; - - $driverOptions = [ - 'typeMap' => ['root' => 'array'], - ]; - - $client = new Client($this->getUri(), $uriOptions, $driverOptions); - $collection = $client->selectCollection($this->getDatabaseName(), $this->getCollectionName()); - $debug = $collection->__debugInfo(); - - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInternalType('array', $debug['typeMap']); - $this->assertSame(['root' => 'array'], $debug['typeMap']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testSelectCollectionPassesOptions() - { - $collectionOptions = [ - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_SECONDARY_PREFERRED), - 'typeMap' => ['root' => 'array'], - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY), - ]; - - $client = new Client($this->getUri()); - $collection = $client->selectCollection($this->getDatabaseName(), $this->getCollectionName(), $collectionOptions); - $debug = $collection->__debugInfo(); - - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInternalType('array', $debug['typeMap']); - $this->assertSame(['root' => 'array'], $debug['typeMap']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testGetSelectsDatabaseAndInheritsOptions() - { - $uriOptions = ['w' => WriteConcern::MAJORITY]; - - $client = new Client($this->getUri(), $uriOptions); - $database = $client->{$this->getDatabaseName()}; - $debug = $database->__debugInfo(); - - $this->assertSame($this->getDatabaseName(), $debug['databaseName']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testSelectDatabaseInheritsOptions() - { - $this->markTestSkipped('Depends on https://jira.mongodb.org/browse/PHPC-523'); - - $uriOptions = [ - 'readConcernLevel' => ReadConcern::LOCAL, - 'readPreference' => 'secondaryPreferred', - 'w' => WriteConcern::MAJORITY, - ]; - - $driverOptions = [ - 'typeMap' => ['root' => 'array'], - ]; - - $client = new Client($this->getUri(), $uriOptions, $driverOptions); - $database = $client->selectDatabase($this->getDatabaseName()); - $debug = $database->__debugInfo(); - - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInternalType('array', $debug['typeMap']); - $this->assertSame(['root' => 'array'], $debug['typeMap']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testSelectDatabasePassesOptions() - { - $databaseOptions = [ - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_SECONDARY_PREFERRED), - 'typeMap' => ['root' => 'array'], - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY), - ]; - - $client = new Client($this->getUri()); - $database = $client->selectDatabase($this->getDatabaseName(), $databaseOptions); - $debug = $database->__debugInfo(); - - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInternalType('array', $debug['typeMap']); - $this->assertSame(['root' => 'array'], $debug['typeMap']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/CollectionFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/CollectionFunctionalTest.php deleted file mode 100644 index 7654061..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/CollectionFunctionalTest.php +++ /dev/null @@ -1,203 +0,0 @@ -<?php - -namespace MongoDB\Tests\Collection; - -use MongoDB\Collection; -use MongoDB\Driver\BulkWrite; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\WriteConcern; - -/** - * Functional tests for the Collection class. - */ -class CollectionFunctionalTest extends FunctionalTestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDatabaseAndCollectionNames - */ - public function testConstructorDatabaseNameArgument($databaseName) - { - // TODO: Move to unit test once ManagerInterface can be mocked (PHPC-378) - new Collection($this->manager, $databaseName, $this->getCollectionName()); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDatabaseAndCollectionNames - */ - public function testConstructorCollectionNameArgument($collectionName) - { - // TODO: Move to unit test once ManagerInterface can be mocked (PHPC-378) - new Collection($this->manager, $this->getDatabaseName(), $collectionName); - } - - public function provideInvalidDatabaseAndCollectionNames() - { - return [ - [null], - [''], - ]; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidReadConcernValues() as $value) { - $options[][] = ['readConcern' => $value]; - } - - foreach ($this->getInvalidReadPreferenceValues() as $value) { - $options[][] = ['readPreference' => $value]; - } - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } - - public function testGetManager() - { - $this->assertSame($this->manager, $this->collection->getManager()); - } - - public function testToString() - { - $this->assertEquals($this->getNamespace(), (string) $this->collection); - } - - public function getGetCollectionName() - { - $this->assertEquals($this->getCollectionName(), $this->collection->getCollectionName()); - } - - public function getGetDatabaseName() - { - $this->assertEquals($this->getDatabaseName(), $this->collection->getDatabaseName()); - } - - public function testGetNamespace() - { - $this->assertEquals($this->getNamespace(), $this->collection->getNamespace()); - } - - public function testDrop() - { - $writeResult = $this->collection->insertOne(['x' => 1]); - $this->assertEquals(1, $writeResult->getInsertedCount()); - - $commandResult = $this->collection->drop(); - $this->assertCommandSucceeded($commandResult); - $this->assertCollectionCount($this->getNamespace(), 0); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @todo Move this to a unit test once Manager can be mocked - */ - public function testDropIndexShouldNotAllowWildcardCharacter() - { - $this->collection->dropIndex('*'); - } - - public function testFindOne() - { - $this->createFixtures(5); - - $filter = ['_id' => ['$lt' => 5]]; - $options = [ - 'skip' => 1, - 'sort' => ['x' => -1], - ]; - - $expected = ['_id' => 3, 'x' => 33]; - - $this->assertSameDocument($expected, $this->collection->findOne($filter, $options)); - } - - public function testWithOptionsInheritsOptions() - { - $collectionOptions = [ - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_SECONDARY_PREFERRED), - 'typeMap' => ['root' => 'array'], - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY), - ]; - - $collection = new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $collectionOptions); - $clone = $collection->withOptions(); - $debug = $clone->__debugInfo(); - - $this->assertSame($this->manager, $debug['manager']); - $this->assertSame($this->getDatabaseName(), $debug['databaseName']); - $this->assertSame($this->getCollectionName(), $debug['collectionName']); - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInternalType('array', $debug['typeMap']); - $this->assertSame(['root' => 'array'], $debug['typeMap']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testWithOptionsPassesOptions() - { - $collectionOptions = [ - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_SECONDARY_PREFERRED), - 'typeMap' => ['root' => 'array'], - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY), - ]; - - $clone = $this->collection->withOptions($collectionOptions); - $debug = $clone->__debugInfo(); - - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInternalType('array', $debug['typeMap']); - $this->assertSame(['root' => 'array'], $debug['typeMap']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - /** - * Create data fixtures. - * - * @param integer $n - */ - private function createFixtures($n) - { - $bulkWrite = new BulkWrite(['ordered' => true]); - - for ($i = 1; $i <= $n; $i++) { - $bulkWrite->insert([ - '_id' => $i, - 'x' => (integer) ($i . $i), - ]); - } - - $result = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - - $this->assertEquals($n, $result->getInsertedCount()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/CrudSpecFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/CrudSpecFunctionalTest.php deleted file mode 100644 index 0461851..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/CrudSpecFunctionalTest.php +++ /dev/null @@ -1,353 +0,0 @@ -<?php - -namespace MongoDB\Tests\Collection; - -use MongoDB\Collection; -use MongoDB\Operation\FindOneAndReplace; -use IteratorIterator; -use LogicException; -use MultipleIterator; - -/** - * CRUD spec functional tests. - * - * @see https://github.com/mongodb/specifications/tree/master/source/crud/tests - */ -class CrudSpecFunctionalTest extends FunctionalTestCase -{ - private $expectedCollection; - - public function setUp() - { - parent::setUp(); - - $this->expectedCollection = new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName() . '.expected'); - $this->expectedCollection->drop(); - } - - /** - * @dataProvider provideSpecificationTests - */ - public function testSpecification(array $initialData, array $test, $minServerVersion, $maxServerVersion) - { - $this->setName(str_replace(' ', '_', $test['description'])); - - if (isset($minServerVersion) || isset($maxServerVersion)) { - $this->checkServerVersion($minServerVersion, $maxServerVersion); - } - - $expectedData = isset($test['outcome']['collection']['data']) ? $test['outcome']['collection']['data'] : null; - $this->initializeData($initialData, $expectedData); - - $result = $this->executeOperation($test['operation']); - $this->executeOutcome($test['operation'], $test['outcome'], $result); - } - - public function provideSpecificationTests() - { - $testArgs = []; - - foreach (glob(__DIR__ . '/spec-tests/*/*.json') as $filename) { - $json = json_decode(file_get_contents($filename), true); - - $minServerVersion = isset($json['minServerVersion']) ? $json['minServerVersion'] : null; - $maxServerVersion = isset($json['maxServerVersion']) ? $json['maxServerVersion'] : null; - - foreach ($json['tests'] as $test) { - $testArgs[] = [$json['data'], $test, $minServerVersion, $maxServerVersion]; - } - } - - return $testArgs; - } - - /** - * Assert that the collections contain equivalent documents. - * - * @param Collection $expectedCollection - * @param Collection $actualCollection - */ - private function assertEquivalentCollections($expectedCollection, $actualCollection) - { - $mi = new MultipleIterator; - $mi->attachIterator(new IteratorIterator($expectedCollection->find())); - $mi->attachIterator(new IteratorIterator($actualCollection->find())); - - foreach ($mi as $documents) { - list($expectedDocument, $actualDocument) = $documents; - $this->assertSameDocument($expectedDocument, $actualDocument); - } - } - - /** - * Checks that the server version is within the allowed bounds (if any). - * - * @param string|null $minServerVersion - * @param string|null $maxServerVersion - * @throws \PHPUnit_Framework_SkippedTestError - */ - private function checkServerVersion($minServerVersion, $maxServerVersion) - { - $serverVersion = $this->getServerVersion(); - - if (isset($minServerVersion) && version_compare($serverVersion, $minServerVersion, '<')) { - $this->markTestSkipped(sprintf('Server version "%s" < minServerVersion "%s"', $serverVersion, $minServerVersion)); - } - - if (isset($maxServerVersion) && version_compare($serverVersion, $maxServerVersion, '>=')) { - $this->markTestSkipped(sprintf('Server version "%s" >= maxServerVersion "%s"', $serverVersion, $maxServerVersion)); - } - } - - /** - * Executes an "operation" block. - * - * @param array $operation - * @return mixed - * @throws LogicException if the operation is unsupported - */ - private function executeOperation(array $operation) - { - switch ($operation['name']) { - case 'aggregate': - return $this->collection->aggregate( - $operation['arguments']['pipeline'], - array_diff_key($operation['arguments'], ['pipeline' => 1]) - ); - - case 'count': - case 'find': - return $this->collection->{$operation['name']}( - isset($operation['arguments']['filter']) ? $operation['arguments']['filter'] : [], - array_diff_key($operation['arguments'], ['filter' => 1]) - ); - - case 'deleteMany': - case 'deleteOne': - case 'findOneAndDelete': - return $this->collection->{$operation['name']}( - $operation['arguments']['filter'], - array_diff_key($operation['arguments'], ['filter' => 1]) - ); - - case 'distinct': - return $this->collection->distinct( - $operation['arguments']['fieldName'], - isset($operation['arguments']['filter']) ? $operation['arguments']['filter'] : [], - array_diff_key($operation['arguments'], ['fieldName' => 1, 'filter' => 1]) - ); - - case 'findOneAndReplace': - $operation['arguments'] = $this->prepareFindAndModifyArguments($operation['arguments']); - // Fall through - - case 'replaceOne': - return $this->collection->{$operation['name']}( - $operation['arguments']['filter'], - $operation['arguments']['replacement'], - array_diff_key($operation['arguments'], ['filter' => 1, 'replacement' => 1]) - ); - - case 'findOneAndUpdate': - $operation['arguments'] = $this->prepareFindAndModifyArguments($operation['arguments']); - // Fall through - - case 'updateMany': - case 'updateOne': - return $this->collection->{$operation['name']}( - $operation['arguments']['filter'], - $operation['arguments']['update'], - array_diff_key($operation['arguments'], ['filter' => 1, 'update' => 1]) - ); - - case 'insertMany': - return $this->collection->insertMany( - $operation['arguments']['documents'], - array_diff_key($operation['arguments'], ['documents' => 1]) - ); - - case 'insertOne': - return $this->collection->insertOne( - $operation['arguments']['document'], - array_diff_key($operation['arguments'], ['document' => 1]) - ); - - default: - throw new LogicException('Unsupported operation: ' . $operation['name']); - } - } - - /** - * Executes an "outcome" block. - * - * @param array $operation - * @param array $outcome - * @param mixed $actualResult - * @return mixed - * @throws LogicException if the operation is unsupported - */ - private function executeOutcome(array $operation, array $outcome, $actualResult) - { - if (array_key_exists('result', $outcome)) { - $this->executeAssertResult($operation, $outcome['result'], $actualResult); - } - - if (isset($outcome['collection'])) { - $actualCollection = isset($outcome['collection']['name']) - ? new Collection($this->manager, $this->getDatabaseName(), $outcome['collection']['name']) - : $this->collection; - - $this->assertEquivalentCollections($this->expectedCollection, $actualCollection); - } - } - - /** - * Executes the "result" section of an "outcome" block. - * - * @param array $operation - * @param mixed $expectedResult - * @param mixed $actualResult - * @throws LogicException if the operation is unsupported - */ - private function executeAssertResult(array $operation, $expectedResult, $actualResult) - { - switch ($operation['name']) { - case 'aggregate': - /* Returning a cursor for the $out collection is optional per - * the CRUD specification and is not implemented in the library - * since we have no concept of lazy cursors. We will not assert - * the result here; however, assertEquivalentCollections() will - * assert the output collection's contents later. - */ - if ( ! \MongoDB\is_last_pipeline_operator_out($operation['arguments']['pipeline'])) { - $this->assertSameDocuments($expectedResult, $actualResult); - } - break; - - case 'count': - $this->assertSame($expectedResult, $actualResult); - break; - - case 'distinct': - $this->assertSameDocument( - ['values' => $expectedResult], - ['values' => $actualResult] - ); - break; - - case 'find': - $this->assertSameDocuments($expectedResult, $actualResult); - break; - - case 'deleteMany': - case 'deleteOne': - $this->assertInstanceOf('MongoDB\DeleteResult', $actualResult); - - if (isset($expectedResult['deletedCount'])) { - $this->assertSame($expectedResult['deletedCount'], $actualResult->getDeletedCount()); - } - break; - - case 'findOneAndDelete': - case 'findOneAndReplace': - case 'findOneAndUpdate': - $this->assertSameDocument( - ['result' => $expectedResult], - ['result' => $actualResult] - ); - break; - - case 'insertMany': - $this->assertInstanceOf('MongoDB\InsertManyResult', $actualResult); - - if (isset($expectedResult['insertedCount'])) { - $this->assertSame($expectedResult['insertedCount'], $actualResult->getInsertedCount()); - } - - if (isset($expectedResult['insertedIds'])) { - $this->assertSameDocument( - ['insertedIds' => $expectedResult['insertedIds']], - ['insertedIds' => $actualResult->getInsertedIds()] - ); - } - break; - - case 'insertOne': - $this->assertInstanceOf('MongoDB\InsertOneResult', $actualResult); - - if (isset($expectedResult['insertedCount'])) { - $this->assertSame($expectedResult['insertedCount'], $actualResult->getInsertedCount()); - } - - if (isset($expectedResult['insertedId'])) { - $this->assertSameDocument( - ['insertedId' => $expectedResult['insertedId']], - ['insertedId' => $actualResult->getInsertedId()] - ); - } - break; - - case 'replaceOne': - case 'updateMany': - case 'updateOne': - $this->assertInstanceOf('MongoDB\UpdateResult', $actualResult); - - if (isset($expectedResult['matchedCount'])) { - $this->assertSame($expectedResult['matchedCount'], $actualResult->getMatchedCount()); - } - - if (isset($expectedResult['modifiedCount'])) { - $this->assertSame($expectedResult['modifiedCount'], $actualResult->getModifiedCount()); - } - - if (isset($expectedResult['upsertedCount'])) { - $this->assertSame($expectedResult['upsertedCount'], $actualResult->getUpsertedCount()); - } - - if (array_key_exists('upsertedId', $expectedResult)) { - $this->assertSameDocument( - ['upsertedId' => $expectedResult['upsertedId']], - ['upsertedId' => $actualResult->getUpsertedId()] - ); - } - break; - - default: - throw new LogicException('Unsupported operation: ' . $operationName); - } - } - - /** - * Initializes data in the test collections. - * - * @param array $initialData - * @param array $expectedData - */ - private function initializeData(array $initialData, array $expectedData = null) - { - if ( ! empty($initialData)) { - $this->collection->insertMany($initialData); - } - - if ( ! empty($expectedData)) { - $this->expectedCollection->insertMany($expectedData); - } - } - - /** - * Prepares arguments for findOneAndReplace and findOneAndUpdate operations. - * - * @param array $arguments - * @return array - */ - private function prepareFindAndModifyArguments($arguments) - { - if (isset($arguments['returnDocument'])) { - $arguments['returnDocument'] = ('after' === strtolower($arguments['returnDocument'])) - ? FindOneAndReplace::RETURN_DOCUMENT_AFTER - : FindOneAndReplace::RETURN_DOCUMENT_BEFORE; - } - - return $arguments; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/FunctionalTestCase.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/FunctionalTestCase.php deleted file mode 100644 index 66c94b8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/FunctionalTestCase.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace MongoDB\Tests\Collection; - -use MongoDB\Collection; -use MongoDB\Operation\DropCollection; -use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase; - -/** - * Base class for Collection functional tests. - */ -abstract class FunctionalTestCase extends BaseFunctionalTestCase -{ - protected $collection; - - public function setUp() - { - parent::setUp(); - - $this->collection = new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName()); - $operation = new DropCollection($this->getDatabaseName(), $this->getCollectionName()); - $operation->execute($this->getPrimaryServer()); - } - - public function tearDown() - { - if ($this->hasFailed()) { - return; - } - - $operation = new DropCollection($this->getDatabaseName(), $this->getCollectionName()); - $operation->execute($this->getPrimaryServer()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate-collation.json deleted file mode 100644 index 903a583..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate-collation.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": "ping" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "Aggregate with collation", - "operation": { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "x": "PING" - } - } - ], - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": [ - { - "_id": 1, - "x": "ping" - } - ] - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate-out.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate-out.json deleted file mode 100644 index cbc8ca4..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate-out.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "minServerVersion": "2.6", - "tests": [ - { - "description": "Aggregate with $out", - "operation": { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ], - "batchSize": 2 - } - }, - "outcome": { - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "collection": { - "name": "other_test_collection", - "data": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate.json deleted file mode 100644 index 479fcb9..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/aggregate.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "Aggregate with multiple stages", - "operation": { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "batchSize": 2 - } - }, - "outcome": { - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/count-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/count-collation.json deleted file mode 100644 index 4621209..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/count-collation.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": "PING" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "Count with collation", - "operation": { - "name": "count", - "arguments": { - "filter": { - "x": "ping" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": 1 - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/count.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/count.json deleted file mode 100644 index 85c17e1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/count.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "Count without a filter", - "operation": { - "name": "count", - "arguments": { - "filter": {} - } - }, - "outcome": { - "result": 3 - } - }, - { - "description": "Count with a filter", - "operation": { - "name": "count", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - } - }, - "outcome": { - "result": 2 - } - }, - { - "description": "Count with skip and limit", - "operation": { - "name": "count", - "arguments": { - "filter": {}, - "skip": 1, - "limit": 3 - } - }, - "outcome": { - "result": 2 - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/distinct-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/distinct-collation.json deleted file mode 100644 index 4d688cc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/distinct-collation.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "string": "PING" - }, - { - "_id": 2, - "string": "ping" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "Distinct with a collation", - "operation": { - "name": "distinct", - "arguments": { - "fieldName": "string", - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": [ - "PING" - ] - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/distinct.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/distinct.json deleted file mode 100644 index 408d8a4..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/distinct.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "Distinct without a filter", - "operation": { - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": {} - } - }, - "outcome": { - "result": [ - 11, - 22, - 33 - ] - } - }, - { - "description": "Distinct with a filter", - "operation": { - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - } - }, - "outcome": { - "result": [ - 22, - 33 - ] - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/find-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/find-collation.json deleted file mode 100644 index b2d268a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/find-collation.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": "ping" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "Find with a collation", - "operation": { - "name": "find", - "arguments": { - "filter": { - "x": "PING" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": [ - { - "_id": 1, - "x": "ping" - } - ] - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/find.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/find.json deleted file mode 100644 index d92081d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/read/find.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ], - "tests": [ - { - "description": "Find with filter", - "operation": { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - } - }, - "outcome": { - "result": [ - { - "_id": 1, - "x": 11 - } - ] - } - }, - { - "description": "Find with filter, sort, skip, and limit", - "operation": { - "name": "find", - "arguments": { - "filter": { - "_id": { - "$gt": 2 - } - }, - "sort": { - "_id": 1 - }, - "skip": 2, - "limit": 2 - } - }, - "outcome": { - "result": [ - { - "_id": 5, - "x": 55 - } - ] - } - }, - { - "description": "Find with limit, sort, and batchsize", - "operation": { - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4, - "batchSize": 2 - } - }, - "outcome": { - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteMany-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteMany-collation.json deleted file mode 100644 index 593ad68..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteMany-collation.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "DeleteMany when many documents match with collation", - "operation": { - "name": "deleteMany", - "arguments": { - "filter": { - "x": "PING" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": { - "deletedCount": 2 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteMany.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteMany.json deleted file mode 100644 index 885ebd2..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteMany.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "DeleteMany when many documents match", - "operation": { - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - } - }, - "outcome": { - "result": { - "deletedCount": 2 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - } - ] - } - } - }, - { - "description": "DeleteMany when no document matches", - "operation": { - "name": "deleteMany", - "arguments": { - "filter": { - "_id": 4 - } - } - }, - "outcome": { - "result": { - "deletedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteOne-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteOne-collation.json deleted file mode 100644 index 9f22b11..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteOne-collation.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "DeleteOne when many documents matches with collation", - "operation": { - "name": "deleteOne", - "arguments": { - "filter": { - "x": "PING" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": { - "deletedCount": 1 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteOne.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteOne.json deleted file mode 100644 index 50226bd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/deleteOne.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "DeleteOne when many documents match", - "operation": { - "name": "deleteOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - } - }, - "outcome": { - "result": { - "deletedCount": 1 - } - } - }, - { - "description": "DeleteOne when one document matches", - "operation": { - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 2 - } - } - }, - "outcome": { - "result": { - "deletedCount": 1 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "DeleteOne when no documents match", - "operation": { - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 4 - } - } - }, - "outcome": { - "result": { - "deletedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndDelete-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndDelete-collation.json deleted file mode 100644 index e848d75..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndDelete-collation.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "FindOneAndDelete when one document matches with collation", - "operation": { - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 2, - "x": "PING" - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": { - "x": "ping" - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndDelete.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndDelete.json deleted file mode 100644 index 2bfcc32..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndDelete.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "FindOneAndDelete when many documents match", - "operation": { - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": { - "x": 22 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndDelete when one document matches", - "operation": { - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 2 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": { - "x": 22 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndDelete when no documents match", - "operation": { - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 4 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": null, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-collation.json deleted file mode 100644 index 5227b0f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-collation.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "FindOneAndReplace when one document matches with collation returning the document after modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "x": "PING" - }, - "replacement": { - "x": "pong" - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": { - "x": "pong" - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "pong" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-upsert.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-upsert.json deleted file mode 100644 index e13eb9c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-upsert.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "minServerVersion": "2.6", - "tests": [ - { - "description": "FindOneAndReplace when no documents match without id specified with upsert returning the document before modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "upsert": true - } - }, - "outcome": { - "result": null, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - } - }, - { - "description": "FindOneAndReplace when no documents match without id specified with upsert returning the document after modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - }, - "upsert": true - } - }, - "outcome": { - "result": { - "x": 44 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - } - }, - { - "description": "FindOneAndReplace when no documents match with id specified with upsert returning the document before modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "upsert": true - } - }, - "outcome": { - "result": null, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - } - }, - { - "description": "FindOneAndReplace when no documents match with id specified with upsert returning the document after modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - }, - "upsert": true - } - }, - "outcome": { - "result": { - "x": 44 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-upsert_pre_2.6.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-upsert_pre_2.6.json deleted file mode 100644 index 613c664..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace-upsert_pre_2.6.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "maxServerVersion": "2.4.99", - "tests": [ - { - "description": "FindOneAndReplace when no documents match without id specified with upsert returning the document before modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "upsert": true - } - }, - "outcome": { - "result": null - } - }, - { - "description": "FindOneAndReplace when no documents match without id specified with upsert returning the document after modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - }, - "upsert": true - } - }, - "outcome": { - "result": { - "x": 44 - } - } - }, - { - "description": "FindOneAndReplace when no documents match with id specified with upsert returning the document before modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "upsert": true - } - }, - "outcome": { - "result": null, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - } - }, - { - "description": "FindOneAndReplace when no documents match with id specified with upsert returning the document after modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - }, - "upsert": true - } - }, - "outcome": { - "result": { - "x": 44 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace.json deleted file mode 100644 index f8eb5eb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndReplace.json +++ /dev/null @@ -1,273 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "FindOneAndReplace when many documents match returning the document before modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 32 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": { - "x": 22 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 32 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndReplace when many documents match returning the document after modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 32 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": { - "x": 32 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 32 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndReplace when one document matches returning the document before modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 2 - }, - "replacement": { - "x": 32 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": { - "x": 22 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 32 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndReplace when one document matches returning the document after modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 2 - }, - "replacement": { - "x": 32 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": { - "x": 32 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 32 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndReplace when no documents match returning the document before modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": null, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndReplace when no documents match returning the document after modification", - "operation": { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": null, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndUpdate-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndUpdate-collation.json deleted file mode 100644 index 172149a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndUpdate-collation.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "FindOneAndUpdate when many documents match with collation returning the document before modification", - "operation": { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "x": "PING" - }, - "update": { - "$set": { - "x": "pong" - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "_id": 1 - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": { - "x": "ping" - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "pong" - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndUpdate.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndUpdate.json deleted file mode 100644 index c257b74..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/findOneAndUpdate.json +++ /dev/null @@ -1,379 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "FindOneAndUpdate when many documents match returning the document before modification", - "operation": { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": { - "x": 22 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndUpdate when many documents match returning the document after modification", - "operation": { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": { - "x": 23 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndUpdate when one document matches returning the document before modification", - "operation": { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": { - "x": 22 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndUpdate when one document matches returning the document after modification", - "operation": { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": { - "x": 23 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndUpdate when no documents match returning the document before modification", - "operation": { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": null, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndUpdate when no documents match with upsert returning the document before modification", - "operation": { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "upsert": true - } - }, - "outcome": { - "result": null, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - } - }, - { - "description": "FindOneAndUpdate when no documents match returning the document after modification", - "operation": { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - } - }, - "outcome": { - "result": null, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "FindOneAndUpdate when no documents match with upsert returning the document after modification", - "operation": { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - }, - "upsert": true - } - }, - "outcome": { - "result": { - "x": 1 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/insertMany.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/insertMany.json deleted file mode 100644 index f604ef7..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/insertMany.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - } - ], - "tests": [ - { - "description": "InsertMany with non-existing documents", - "operation": { - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - }, - "outcome": { - "result": { - "insertedIds": [ - 2, - 3 - ] - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/insertOne.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/insertOne.json deleted file mode 100644 index 83597fc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/insertOne.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - } - ], - "tests": [ - { - "description": "InsertOne with a non-existing document", - "operation": { - "name": "insertOne", - "arguments": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - "outcome": { - "result": { - "insertedId": 2 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-collation.json deleted file mode 100644 index c2a08c9..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-collation.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "ReplaceOne when one document matches with collation", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "x": "PING" - }, - "replacement": { - "_id": 2, - "x": "pong" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "pong" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-pre_2.6.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-pre_2.6.json deleted file mode 100644 index 363bad5..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-pre_2.6.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "maxServerVersion": "2.4.99", - "tests": [ - { - "description": "ReplaceOne when many documents match", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "upsertedCount": 0 - } - } - }, - { - "description": "ReplaceOne when one document matches", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "ReplaceOne when no documents match", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 1 - } - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "ReplaceOne with upsert when no documents match without an id specified", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 1 - }, - "upsert": true - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "upsertedCount": 1 - } - } - }, - { - "description": "ReplaceOne with upsert when no documents match with an id specified", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 1 - }, - "upsert": true - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-upsert.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-upsert.json deleted file mode 100644 index f3040dc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne-upsert.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "minServerVersion": "2.6", - "tests": [ - { - "description": "ReplaceOne with upsert when no documents match without an id specified", - "operation": { - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 1 - }, - "upsert": true - }, - "name": "replaceOne" - }, - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - }, - "result": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedId": 4 - } - } - }, - { - "description": "ReplaceOne with upsert when no documents match with an id specified", - "operation": { - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 1 - }, - "upsert": true - }, - "name": "replaceOne" - }, - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - }, - "result": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedId": 4 - } - } - } - ] -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne.json deleted file mode 100644 index 580e3b9..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/replaceOne.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "minServerVersion": "2.6", - "tests": [ - { - "description": "ReplaceOne when many documents match", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - }, - { - "description": "ReplaceOne when one document matches", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "ReplaceOne when no documents match", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 1 - } - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "ReplaceOne with upsert when no documents match without an id specified", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 1 - }, - "upsert": true - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - } - }, - { - "description": "ReplaceOne with upsert when no documents match with an id specified", - "operation": { - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 1 - }, - "upsert": true - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany-collation.json deleted file mode 100644 index d88ce60..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany-collation.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "UpdateMany when many documents match with collation", - "operation": { - "name": "updateMany", - "arguments": { - "filter": { - "x": "ping" - }, - "update": { - "$set": { - "x": "pong" - } - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "pong" - }, - { - "_id": 3, - "x": "pong" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany-pre_2.6.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany-pre_2.6.json deleted file mode 100644 index 89e8a5c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany-pre_2.6.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "maxServerVersion": "2.4.99", - "tests": [ - { - "description": "UpdateMany when many documents match", - "operation": { - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 2, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 34 - } - ] - } - } - }, - { - "description": "UpdateMany when one document matches", - "operation": { - "name": "updateMany", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "UpdateMany when no documents match", - "operation": { - "name": "updateMany", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "UpdateMany with upsert when no documents match", - "operation": { - "name": "updateMany", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany.json deleted file mode 100644 index 533e3f3..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateMany.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "minServerVersion": "2.6", - "tests": [ - { - "description": "UpdateMany when many documents match", - "operation": { - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 34 - } - ] - } - } - }, - { - "description": "UpdateMany when one document matches", - "operation": { - "name": "updateMany", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "UpdateMany when no documents match", - "operation": { - "name": "updateMany", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "UpdateMany with upsert when no documents match", - "operation": { - "name": "updateMany", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne-collation.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne-collation.json deleted file mode 100644 index 8e45ff3..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne-collation.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - } - ], - "minServerVersion": "3.4", - "tests": [ - { - "description": "UpdateOne when one document matches with collation", - "operation": { - "name": "updateOne", - "arguments": { - "filter": { - "x": "PING" - }, - "update": { - "$set": { - "x": "pong" - } - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "pong" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne-pre_2.6.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne-pre_2.6.json deleted file mode 100644 index de15c61..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne-pre_2.6.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "maxServerVersion": "2.4.99", - "tests": [ - { - "description": "UpdateOne when many documents match", - "operation": { - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "upsertedCount": 0 - } - } - }, - { - "description": "UpdateOne when one document matches", - "operation": { - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "UpdateOne when no documents match", - "operation": { - "name": "updateOne", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "UpdateOne with upsert when no documents match", - "operation": { - "name": "updateOne", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne.json deleted file mode 100644 index 1a51dff..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Collection/spec-tests/write/updateOne.json +++ /dev/null @@ -1,167 +0,0 @@ -{ - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "minServerVersion": "2.6", - "tests": [ - { - "description": "UpdateOne when many documents match", - "operation": { - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - }, - { - "description": "UpdateOne when one document matches", - "operation": { - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "UpdateOne when no documents match", - "operation": { - "name": "updateOne", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - } - }, - { - "description": "UpdateOne with upsert when no documents match", - "operation": { - "name": "updateOne", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - } - }, - "outcome": { - "result": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - }, - "collection": { - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/CollectionManagementFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/CollectionManagementFunctionalTest.php deleted file mode 100644 index 893c46c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/CollectionManagementFunctionalTest.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php - -namespace MongoDB\Tests\Database; - -use MongoDB\Driver\BulkWrite; -use MongoDB\Model\CollectionInfo; -use InvalidArgumentException; - -/** - * Functional tests for collection management methods. - */ -class CollectionManagementFunctionalTest extends FunctionalTestCase -{ - public function testCreateCollection() - { - $that = $this; - $basicCollectionName = $this->getCollectionName() . '.basic'; - - $commandResult = $this->database->createCollection($basicCollectionName); - $this->assertCommandSucceeded($commandResult); - $this->assertCollectionExists($basicCollectionName, function(CollectionInfo $info) use ($that) { - $that->assertFalse($info->isCapped()); - }); - - $cappedCollectionName = $this->getCollectionName() . '.capped'; - $cappedCollectionOptions = [ - 'capped' => true, - 'max' => 100, - 'size' => 1048576, - ]; - - $commandResult = $this->database->createCollection($cappedCollectionName, $cappedCollectionOptions); - $this->assertCommandSucceeded($commandResult); - $this->assertCollectionExists($cappedCollectionName, function(CollectionInfo $info) use ($that) { - $that->assertTrue($info->isCapped()); - $that->assertEquals(100, $info->getCappedMax()); - $that->assertEquals(1048576, $info->getCappedSize()); - }); - } - - public function testDropCollection() - { - $bulkWrite = new BulkWrite(); - $bulkWrite->insert(['x' => 1]); - - $writeResult = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - $this->assertEquals(1, $writeResult->getInsertedCount()); - - $commandResult = $this->database->dropCollection($this->getCollectionName()); - $this->assertCommandSucceeded($commandResult); - $this->assertCollectionCount($this->getNamespace(), 0); - } - - public function testListCollections() - { - $commandResult = $this->database->createCollection($this->getCollectionName()); - $this->assertCommandSucceeded($commandResult); - - $collections = $this->database->listCollections(); - $this->assertInstanceOf('MongoDB\Model\CollectionInfoIterator', $collections); - - foreach ($collections as $collection) { - $this->assertInstanceOf('MongoDB\Model\CollectionInfo', $collection); - } - } - - public function testListCollectionsWithFilter() - { - $commandResult = $this->database->createCollection($this->getCollectionName()); - $this->assertCommandSucceeded($commandResult); - - $collectionName = $this->getCollectionName(); - $options = ['filter' => ['name' => $collectionName]]; - - $collections = $this->database->listCollections($options); - $this->assertInstanceOf('MongoDB\Model\CollectionInfoIterator', $collections); - - foreach ($collections as $collection) { - $this->assertInstanceOf('MongoDB\Model\CollectionInfo', $collection); - $this->assertEquals($collectionName, $collection->getName()); - } - } - - /** - * Asserts that a collection with the given name exists in the database. - * - * An optional $callback may be provided, which should take a CollectionInfo - * argument as its first and only parameter. If a CollectionInfo matching - * the given name is found, it will be passed to the callback, which may - * perform additional assertions. - * - * @param callable $callback - */ - private function assertCollectionExists($collectionName, $callback = null) - { - if ($callback !== null && ! is_callable($callback)) { - throw new InvalidArgumentException('$callback is not a callable'); - } - - $collections = $this->database->listCollections(); - - $foundCollection = null; - - foreach ($collections as $collection) { - if ($collection->getName() === $collectionName) { - $foundCollection = $collection; - break; - } - } - - $this->assertNotNull($foundCollection, sprintf('Found %s collection in the database', $collectionName)); - - if ($callback !== null) { - call_user_func($callback, $foundCollection); - } - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/DatabaseFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/DatabaseFunctionalTest.php deleted file mode 100644 index 78237d0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/DatabaseFunctionalTest.php +++ /dev/null @@ -1,297 +0,0 @@ -<?php - -namespace MongoDB\Tests\Database; - -use MongoDB\Database; -use MongoDB\Driver\BulkWrite; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\WriteConcern; - -/** - * Functional tests for the Database class. - */ -class DatabaseFunctionalTest extends FunctionalTestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDatabaseNames - */ - public function testConstructorDatabaseNameArgument($databaseName) - { - // TODO: Move to unit test once ManagerInterface can be mocked (PHPC-378) - new Database($this->manager, $databaseName); - } - - public function provideInvalidDatabaseNames() - { - return [ - [null], - [''], - ]; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new Database($this->manager, $this->getDatabaseName(), $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidReadConcernValues() as $value) { - $options[][] = ['readConcern' => $value]; - } - - foreach ($this->getInvalidReadPreferenceValues() as $value) { - $options[][] = ['readPreference' => $value]; - } - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } - - public function testGetManager() - { - $this->assertSame($this->manager, $this->database->getManager()); - } - - public function testToString() - { - $this->assertEquals($this->getDatabaseName(), (string) $this->database); - } - - public function getGetDatabaseName() - { - $this->assertEquals($this->getDatabaseName(), $this->database->getDatabaseName()); - } - - public function testCommand() - { - $command = ['isMaster' => 1]; - $options = [ - 'readPreference' => new ReadPreference(ReadPreference::RP_PRIMARY), - ]; - - $cursor = $this->database->command($command, $options); - - $this->assertInstanceOf('MongoDB\Driver\Cursor', $cursor); - $commandResult = current($cursor->toArray()); - - $this->assertCommandSucceeded($commandResult); - $this->assertTrue(isset($commandResult->ismaster)); - $this->assertTrue($commandResult->ismaster); - } - - public function testCommandAppliesTypeMapToCursor() - { - $command = ['isMaster' => 1]; - $options = [ - 'readPreference' => new ReadPreference(ReadPreference::RP_PRIMARY), - 'typeMap' => ['root' => 'array'], - ]; - - $cursor = $this->database->command($command, $options); - - $this->assertInstanceOf('MongoDB\Driver\Cursor', $cursor); - $commandResult = current($cursor->toArray()); - - $this->assertCommandSucceeded($commandResult); - $this->assertInternalType('array', $commandResult); - $this->assertTrue(isset($commandResult['ismaster'])); - $this->assertTrue($commandResult['ismaster']); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testCommandCommandArgumentTypeCheck($command) - { - $this->database->command($command); - } - - public function testDrop() - { - $bulkWrite = new BulkWrite(); - $bulkWrite->insert(['x' => 1]); - - $writeResult = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - $this->assertEquals(1, $writeResult->getInsertedCount()); - - $commandResult = $this->database->drop(); - $this->assertCommandSucceeded($commandResult); - $this->assertCollectionCount($this->getNamespace(), 0); - } - - public function testGetSelectsCollectionAndInheritsOptions() - { - $databaseOptions = ['writeConcern' => new WriteConcern(WriteConcern::MAJORITY)]; - - $database = new Database($this->manager, $this->getDatabaseName(), $databaseOptions); - $collection = $database->{$this->getCollectionName()}; - $debug = $collection->__debugInfo(); - - $this->assertSame($this->manager, $debug['manager']); - $this->assertSame($this->getDatabaseName(), $debug['databaseName']); - $this->assertSame($this->getCollectionName(), $debug['collectionName']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testSelectCollectionInheritsOptions() - { - $databaseOptions = [ - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_SECONDARY_PREFERRED), - 'typeMap' => ['root' => 'array'], - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY), - ]; - - $database = new Database($this->manager, $this->getDatabaseName(), $databaseOptions); - $collection = $database->selectCollection($this->getCollectionName()); - $debug = $collection->__debugInfo(); - - $this->assertSame($this->manager, $debug['manager']); - $this->assertSame($this->getDatabaseName(), $debug['databaseName']); - $this->assertSame($this->getCollectionName(), $debug['collectionName']); - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInternalType('array', $debug['typeMap']); - $this->assertSame(['root' => 'array'], $debug['typeMap']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testSelectCollectionPassesOptions() - { - $collectionOptions = [ - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_SECONDARY_PREFERRED), - 'typeMap' => ['root' => 'array'], - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY), - ]; - - $collection = $this->database->selectCollection($this->getCollectionName(), $collectionOptions); - $debug = $collection->__debugInfo(); - - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInternalType('array', $debug['typeMap']); - $this->assertSame(['root' => 'array'], $debug['typeMap']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testSelectGridFSBucketInheritsOptions() - { - $databaseOptions = [ - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_SECONDARY_PREFERRED), - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY), - ]; - - $database = new Database($this->manager, $this->getDatabaseName(), $databaseOptions); - $bucket = $database->selectGridFSBucket(); - $debug = $bucket->__debugInfo(); - - $this->assertSame($this->manager, $debug['manager']); - $this->assertSame($this->getDatabaseName(), $debug['databaseName']); - $this->assertSame('fs', $debug['bucketName']); - $this->assertSame(261120, $debug['chunkSizeBytes']); - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testSelectGridFSBucketPassesOptions() - { - $bucketOptions = [ - 'bucketName' => 'custom_fs', - 'chunkSizeBytes' => 8192, - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_SECONDARY_PREFERRED), - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY), - ]; - - $database = new Database($this->manager, $this->getDatabaseName()); - $bucket = $database->selectGridFSBucket($bucketOptions); - $debug = $bucket->__debugInfo(); - - $this->assertSame($this->getDatabaseName(), $debug['databaseName']); - $this->assertSame('custom_fs', $debug['bucketName']); - $this->assertSame(8192, $debug['chunkSizeBytes']); - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testWithOptionsInheritsOptions() - { - $databaseOptions = [ - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_SECONDARY_PREFERRED), - 'typeMap' => ['root' => 'array'], - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY), - ]; - - $database = new Database($this->manager, $this->getDatabaseName(), $databaseOptions); - $clone = $database->withOptions(); - $debug = $clone->__debugInfo(); - - $this->assertSame($this->manager, $debug['manager']); - $this->assertSame($this->getDatabaseName(), $debug['databaseName']); - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInternalType('array', $debug['typeMap']); - $this->assertSame(['root' => 'array'], $debug['typeMap']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } - - public function testWithOptionsPassesOptions() - { - $databaseOptions = [ - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_SECONDARY_PREFERRED), - 'typeMap' => ['root' => 'array'], - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY), - ]; - - $clone = $this->database->withOptions($databaseOptions); - $debug = $clone->__debugInfo(); - - $this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']); - $this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel()); - $this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']); - $this->assertSame(ReadPreference::RP_SECONDARY_PREFERRED, $debug['readPreference']->getMode()); - $this->assertInternalType('array', $debug['typeMap']); - $this->assertSame(['root' => 'array'], $debug['typeMap']); - $this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']); - $this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/FunctionalTestCase.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/FunctionalTestCase.php deleted file mode 100644 index 2b84bbb..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Database/FunctionalTestCase.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace MongoDB\Tests\Database; - -use MongoDB\Database; -use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase; - -/** - * Base class for Database functional tests. - */ -abstract class FunctionalTestCase extends BaseFunctionalTestCase -{ - protected $database; - - public function setUp() - { - parent::setUp(); - - $this->database = new Database($this->manager, $this->getDatabaseName()); - $this->database->drop(); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/FunctionalTestCase.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/FunctionalTestCase.php deleted file mode 100644 index e39bedd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/FunctionalTestCase.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Cursor; -use MongoDB\Driver\Manager; -use MongoDB\Driver\ReadPreference; -use MongoDB\Model\BSONArray; -use MongoDB\Model\BSONDocument; -use InvalidArgumentException; -use stdClass; -use Traversable; - -abstract class FunctionalTestCase extends TestCase -{ - protected $manager; - - public function setUp() - { - $this->manager = new Manager($this->getUri()); - } - - protected function assertCollectionCount($namespace, $count) - { - list($databaseName, $collectionName) = explode('.', $namespace, 2); - - $cursor = $this->manager->executeCommand($databaseName, new Command(['count' => $collectionName])); - $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); - $document = current($cursor->toArray()); - - $this->assertArrayHasKey('n', $document); - $this->assertEquals($count, $document['n']); - } - - protected function assertCommandSucceeded($document) - { - $document = is_object($document) ? (array) $document : $document; - - $this->assertArrayHasKey('ok', $document); - $this->assertEquals(1, $document['ok']); - } - - protected function assertSameObjectID($expectedObjectID, $actualObjectID) - { - $this->assertInstanceOf('MongoDB\BSON\ObjectID', $expectedObjectID); - $this->assertInstanceOf('MongoDB\BSON\ObjectID', $actualObjectID); - $this->assertEquals((string) $expectedObjectID, (string) $actualObjectID); - } - - protected function assertSameDocument($expectedDocument, $actualDocument) - { - $this->assertEquals( - \MongoDB\BSON\toJSON(\MongoDB\BSON\fromPHP($this->normalizeBSON($expectedDocument))), - \MongoDB\BSON\toJSON(\MongoDB\BSON\fromPHP($this->normalizeBSON($actualDocument))) - ); - } - - protected function assertSameDocuments(array $expectedDocuments, $actualDocuments) - { - if ($actualDocuments instanceof Traversable) { - $actualDocuments = iterator_to_array($actualDocuments); - } - - if ( ! is_array($actualDocuments)) { - throw new InvalidArgumentException('$actualDocuments is not an array or Traversable'); - } - - $normalizeRootDocuments = function($document) { - return \MongoDB\BSON\toJSON(\MongoDB\BSON\fromPHP($this->normalizeBSON($document))); - }; - - $this->assertEquals( - array_map($normalizeRootDocuments, $expectedDocuments), - array_map($normalizeRootDocuments, $actualDocuments) - ); - } - - protected function getPrimaryServer() - { - return $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY)); - } - - protected function getServerVersion(ReadPreference $readPreference = null) - { - $cursor = $this->manager->executeCommand( - $this->getDatabaseName(), - new Command(['buildInfo' => 1]), - $readPreference ?: new ReadPreference(ReadPreference::RP_PRIMARY) - ); - - $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); - $document = current($cursor->toArray()); - - return $document['version']; - } - - /** - * Normalizes a BSON document or array for use with assertEquals(). - * - * The argument will be converted to a BSONArray or BSONDocument based on - * its type and keys. Document fields will be sorted alphabetically. Each - * value within the array or document will then be normalized recursively. - * - * @param array|object $bson - * @return BSONDocument|BSONArray - * @throws InvalidArgumentException if $bson is not an array or object - */ - private function normalizeBSON($bson) - { - if ( ! is_array($bson) && ! is_object($bson)) { - throw new InvalidArgumentException('$bson is not an array or object'); - } - - if ($bson instanceof BSONArray || (is_array($bson) && $bson === array_values($bson))) { - if ( ! $bson instanceof BSONArray) { - $bson = new BSONArray($bson); - } - } else { - if ( ! $bson instanceof BSONDocument) { - $bson = new BSONDocument((array) $bson); - } - - $bson->ksort(); - } - - foreach ($bson as $key => $value) { - if ($value instanceof BSONArray || (is_array($value) && $value === array_values($value))) { - $bson[$key] = $this->normalizeBSON($value); - continue; - } - - if ($value instanceof stdClass || $value instanceof BSONDocument || is_array($value)) { - $bson[$key] = $this->normalizeBSON($value); - continue; - } - } - - return $bson; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/FunctionsTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/FunctionsTest.php deleted file mode 100644 index f23b682..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/FunctionsTest.php +++ /dev/null @@ -1,164 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Model\BSONArray; -use MongoDB\Model\BSONDocument; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\WriteConcern; - -/** - * Unit tests for utility functions. - */ -class FunctionsTest extends TestCase -{ - /** - * @dataProvider provideDocumentAndTypeMap - */ - public function testApplyTypeMapToDocument($document, array $typeMap, $expectedDocument) - { - $this->assertEquals($expectedDocument, \MongoDB\apply_type_map_to_document($document, $typeMap)); - } - - public function provideDocumentAndTypeMap() - { - return [ - [ - [ - 'x' => 1, - 'y' => (object) ['foo' => 'bar'], - 'z' => [1, 2, 3], - ], - [ - 'root' => 'object', - 'document' => 'stdClass', - 'array' => 'array', - ], - (object) [ - 'x' => 1, - 'y' => (object) ['foo' => 'bar'], - 'z' => [1, 2, 3], - ], - ], - [ - [ - 'x' => 1, - 'y' => (object) ['foo' => 'bar'], - 'z' => [1, 2, 3], - ], - [ - 'root' => 'MongoDB\Model\BSONDocument', - 'document' => 'MongoDB\Model\BSONDocument', - 'array' => 'MongoDB\Model\BSONArray', - ], - new BSONDocument([ - 'x' => 1, - 'y' => new BSONDocument(['foo' => 'bar']), - 'z' => new BSONArray([1, 2, 3]), - ]), - ], - ]; - } - - /** - * @dataProvider provideIndexSpecificationDocumentsAndGeneratedNames - */ - public function testGenerateIndexName($document, $expectedName) - { - $this->assertSame($expectedName, \MongoDB\generate_index_name($document)); - } - - public function provideIndexSpecificationDocumentsAndGeneratedNames() - { - return [ - [ ['x' => 1], 'x_1' ], - [ ['x' => -1, 'y' => 1], 'x_-1_y_1' ], - [ ['x' => '2dsphere', 'y' => 1 ], 'x_2dsphere_y_1' ], - [ (object) ['x' => 1], 'x_1' ], - [ new BSONDocument(['x' => 1]), 'x_1' ], - ]; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testGenerateIndexNameArgumentTypeCheck($document) - { - \MongoDB\generate_index_name($document); - } - - /** - * @dataProvider provideIsFirstKeyOperatorDocuments - */ - public function testIsFirstKeyOperator($document, $isFirstKeyOperator) - { - $this->assertSame($isFirstKeyOperator, \MongoDB\is_first_key_operator($document)); - } - - public function provideIsFirstKeyOperatorDocuments() - { - return [ - [ ['y' => 1], false ], - [ (object) ['y' => 1], false ], - [ new BSONDocument(['y' => 1]), false ], - [ ['$set' => ['y' => 1]], true ], - [ (object) ['$set' => ['y' => 1]], true ], - [ new BSONDocument(['$set' => ['y' => 1]]), true ], - ]; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testIsFirstKeyOperatorArgumentTypeCheck($document) - { - \MongoDB\is_first_key_operator($document); - } - - /** - * @dataProvider provideReadConcernsAndDocuments - */ - public function testReadConcernAsDocument(ReadConcern $readConcern, $expectedDocument) - { - $this->assertEquals($expectedDocument, \MongoDB\read_concern_as_document($readConcern)); - } - - public function provideReadConcernsAndDocuments() - { - return [ - [ new ReadConcern, (object) [] ], - [ new ReadConcern(ReadConcern::LOCAL), (object) ['level' => ReadConcern::LOCAL] ], - [ new ReadConcern(ReadConcern::MAJORITY), (object) ['level' => ReadConcern::MAJORITY] ], - ]; - } - - /** - * @dataProvider provideWriteConcernsAndDocuments - */ - public function testWriteConcernAsDocument(WriteConcern $writeConcern, $expectedDocument) - { - $this->assertEquals($expectedDocument, \MongoDB\write_concern_as_document($writeConcern)); - } - - public function provideWriteConcernsAndDocuments() - { - return [ - [ new WriteConcern(-3), (object) ['w' => 'majority'] ], // MONGOC_WRITE_CONCERN_W_MAJORITY - [ new WriteConcern(-2), (object) [] ], // MONGOC_WRITE_CONCERN_W_DEFAULT - [ new WriteConcern(-1), (object) ['w' => -1] ], - [ new WriteConcern(0), (object) ['w' => 0] ], - [ new WriteConcern(1), (object) ['w' => 1] ], - [ new WriteConcern('majority'), (object) ['w' => 'majority'] ], - [ new WriteConcern('tag'), (object) ['w' => 'tag'] ], - [ new WriteConcern(1, 0), (object) ['w' => 1] ], - [ new WriteConcern(1, 0, false), (object) ['w' => 1, 'j' => false] ], - [ new WriteConcern(1, 1000), (object) ['w' => 1, 'wtimeout' => 1000] ], - [ new WriteConcern(1, 1000, true), (object) ['w' => 1, 'wtimeout' => 1000, 'j' => true] ], - [ new WriteConcern(-2, 0, true), (object) ['j' => true] ], - // Note: wtimeout is only applicable applies for w > 1 - [ new WriteConcern(-2, 1000), (object) ['wtimeout' => 1000] ], - ]; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/BucketFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/BucketFunctionalTest.php deleted file mode 100644 index 9138e02..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/BucketFunctionalTest.php +++ /dev/null @@ -1,741 +0,0 @@ -<?php - -namespace MongoDB\Tests\GridFS; - -use MongoDB\BSON\Binary; -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\WriteConcern; -use MongoDB\GridFS\Bucket; -use MongoDB\GridFS\Exception\FileNotFoundException; -use MongoDB\Model\IndexInfo; -use MongoDB\Operation\ListCollections; -use MongoDB\Operation\ListIndexes; - -/** - * Functional tests for the Bucket class. - */ -class BucketFunctionalTest extends FunctionalTestCase -{ - public function testValidConstructorOptions() - { - new Bucket($this->manager, $this->getDatabaseName(), [ - 'bucketName' => 'test', - 'chunkSizeBytes' => 8192, - 'readConcern' => new ReadConcern(ReadConcern::LOCAL), - 'readPreference' => new ReadPreference(ReadPreference::RP_PRIMARY), - 'writeConcern' => new WriteConcern(WriteConcern::MAJORITY, 1000), - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new Bucket($this->manager, $this->getDatabaseName(), $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidStringValues() as $value) { - $options[][] = ['bucketName' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['chunkSizeBytes' => $value]; - } - - foreach ($this->getInvalidReadConcernValues() as $value) { - $options[][] = ['readConcern' => $value]; - } - - foreach ($this->getInvalidReadPreferenceValues() as $value) { - $options[][] = ['readPreference' => $value]; - } - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Expected "chunkSizeBytes" option to be >= 1, 0 given - */ - public function testConstructorShouldRequireChunkSizeBytesOptionToBePositive() - { - new Bucket($this->manager, $this->getDatabaseName(), ['chunkSizeBytes' => 0]); - } - - /** - * @dataProvider provideInputDataAndExpectedChunks - */ - public function testDelete($input, $expectedChunks) - { - $id = $this->bucket->uploadFromStream('filename', $this->createStream($input)); - - $this->assertCollectionCount($this->filesCollection, 1); - $this->assertCollectionCount($this->chunksCollection, $expectedChunks); - - $this->bucket->delete($id); - - $this->assertCollectionCount($this->filesCollection, 0); - $this->assertCollectionCount($this->chunksCollection, 0); - } - - public function provideInputDataAndExpectedChunks() - { - return [ - ['', 0], - ['foobar', 1], - [str_repeat('a', 261120), 1], - [str_repeat('a', 261121), 2], - [str_repeat('a', 522240), 2], - [str_repeat('a', 522241), 3], - [str_repeat('foobar', 43520), 1], - [str_repeat('foobar', 43521), 2], - [str_repeat('foobar', 87040), 2], - [str_repeat('foobar', 87041), 3], - ]; - } - - /** - * @expectedException MongoDB\GridFS\Exception\FileNotFoundException - */ - public function testDeleteShouldRequireFileToExist() - { - $this->bucket->delete('nonexistent-id'); - } - - /** - * @dataProvider provideInputDataAndExpectedChunks - */ - public function testDeleteStillRemovesChunksIfFileDoesNotExist($input, $expectedChunks) - { - $id = $this->bucket->uploadFromStream('filename', $this->createStream($input)); - - $this->assertCollectionCount($this->filesCollection, 1); - $this->assertCollectionCount($this->chunksCollection, $expectedChunks); - - $this->filesCollection->deleteOne(['_id' => $id]); - - try { - $this->bucket->delete($id); - $this->fail('FileNotFoundException was not thrown'); - } catch (FileNotFoundException $e) {} - - $this->assertCollectionCount($this->chunksCollection, 0); - } - - /** - * @expectedException PHPUnit_Framework_Error_Warning - */ - public function testDownloadingFileWithMissingChunk() - { - $id = $this->bucket->uploadFromStream("filename", $this->createStream("foobar")); - - $this->chunksCollection->deleteOne(['files_id' => $id, 'n' => 0]); - - stream_get_contents($this->bucket->openDownloadStream($id)); - } - - /** - * @expectedException PHPUnit_Framework_Error_Warning - */ - public function testDownloadingFileWithUnexpectedChunkIndex() - { - $id = $this->bucket->uploadFromStream("filename", $this->createStream("foobar")); - - $this->chunksCollection->updateOne( - ['files_id' => $id, 'n' => 0], - ['$set' => ['n' => 1]] - ); - - stream_get_contents($this->bucket->openDownloadStream($id)); - } - - /** - * @expectedException PHPUnit_Framework_Error_Warning - */ - public function testDownloadingFileWithUnexpectedChunkSize() - { - $id = $this->bucket->uploadFromStream("filename", $this->createStream("foobar")); - - $this->chunksCollection->updateOne( - ['files_id' => $id, 'n' => 0], - ['$set' => ['data' => new Binary('fooba', Binary::TYPE_GENERIC)]] - ); - - stream_get_contents($this->bucket->openDownloadStream($id)); - } - - /** - * @dataProvider provideInputDataAndExpectedChunks - */ - public function testDownloadToStream($input) - { - $id = $this->bucket->uploadFromStream('filename', $this->createStream($input)); - $destination = $this->createStream(); - $this->bucket->downloadToStream($id, $destination); - rewind($destination); - - $this->assertStreamContents($input, $destination); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidStreamValues - */ - public function testDownloadToStreamShouldRequireDestinationStream($destination) - { - $this->bucket->downloadToStream('id', $destination); - } - - public function provideInvalidStreamValues() - { - return $this->wrapValuesForDataProvider($this->getInvalidStreamValues()); - } - - /** - * @expectedException MongoDB\GridFS\Exception\FileNotFoundException - */ - public function testDownloadToStreamShouldRequireFileToExist() - { - $this->bucket->downloadToStream('nonexistent-id', $this->createStream()); - } - - public function testDownloadToStreamByName() - { - $this->bucket->uploadFromStream('filename', $this->createStream('foo')); - $this->bucket->uploadFromStream('filename', $this->createStream('bar')); - $this->bucket->uploadFromStream('filename', $this->createStream('baz')); - - $destination = $this->createStream(); - $this->bucket->downloadToStreamByName('filename', $destination); - rewind($destination); - $this->assertStreamContents('baz', $destination); - - $destination = $this->createStream(); - $this->bucket->downloadToStreamByName('filename', $destination, ['revision' => -3]); - rewind($destination); - $this->assertStreamContents('foo', $destination); - - $destination = $this->createStream(); - $this->bucket->downloadToStreamByName('filename', $destination, ['revision' => -2]); - rewind($destination); - $this->assertStreamContents('bar', $destination); - - $destination = $this->createStream(); - $this->bucket->downloadToStreamByName('filename', $destination, ['revision' => -1]); - rewind($destination); - $this->assertStreamContents('baz', $destination); - - $destination = $this->createStream(); - $this->bucket->downloadToStreamByName('filename', $destination, ['revision' => 0]); - rewind($destination); - $this->assertStreamContents('foo', $destination); - - $destination = $this->createStream(); - $this->bucket->downloadToStreamByName('filename', $destination, ['revision' => 1]); - rewind($destination); - $this->assertStreamContents('bar', $destination); - - $destination = $this->createStream(); - $this->bucket->downloadToStreamByName('filename', $destination, ['revision' => 2]); - rewind($destination); - $this->assertStreamContents('baz', $destination); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidStreamValues - */ - public function testDownloadToStreamByNameShouldRequireDestinationStream($destination) - { - $this->bucket->downloadToStreamByName('filename', $destination); - } - - /** - * @expectedException MongoDB\GridFS\Exception\FileNotFoundException - * @dataProvider provideNonexistentFilenameAndRevision - */ - public function testDownloadToStreamByNameShouldRequireFilenameAndRevisionToExist($filename, $revision) - { - $this->bucket->uploadFromStream('filename', $this->createStream('foo')); - $this->bucket->uploadFromStream('filename', $this->createStream('bar')); - - $destination = $this->createStream(); - $this->bucket->downloadToStreamByName($filename, $destination, ['revision' => $revision]); - } - - public function provideNonexistentFilenameAndRevision() - { - return [ - ['filename', 2], - ['filename', -3], - ['nonexistent-filename', 0], - ['nonexistent-filename', -1], - ]; - } - - public function testDrop() - { - $this->bucket->uploadFromStream('filename', $this->createStream('foobar')); - - $this->assertCollectionCount($this->filesCollection, 1); - $this->assertCollectionCount($this->chunksCollection, 1); - - $this->bucket->drop(); - - $this->assertCollectionDoesNotExist($this->filesCollection->getCollectionName()); - $this->assertCollectionDoesNotExist($this->chunksCollection->getCollectionName()); - } - - public function testFind() - { - $this->bucket->uploadFromStream('a', $this->createStream('foo')); - $this->bucket->uploadFromStream('b', $this->createStream('foobar')); - $this->bucket->uploadFromStream('c', $this->createStream('foobarbaz')); - - $cursor = $this->bucket->find( - ['length' => ['$lte' => 6]], - [ - 'projection' => [ - 'filename' => 1, - 'length' => 1, - '_id' => 0, - ], - 'sort' => ['length' => -1], - ] - ); - - $expected = [ - ['filename' => 'b', 'length' => 6], - ['filename' => 'a', 'length' => 3], - ]; - - $this->assertSameDocuments($expected, $cursor); - } - - public function testFindUsesTypeMap() - { - $this->bucket->uploadFromStream('a', $this->createStream('foo')); - - $cursor = $this->bucket->find(); - $fileDocument = current($cursor->toArray()); - - $this->assertInstanceOf('MongoDB\Model\BSONDocument', $fileDocument); - } - - public function testFindOne() - { - $this->bucket->uploadFromStream('a', $this->createStream('foo')); - $this->bucket->uploadFromStream('b', $this->createStream('foobar')); - $this->bucket->uploadFromStream('c', $this->createStream('foobarbaz')); - - $fileDocument = $this->bucket->findOne( - ['length' => ['$lte' => 6]], - [ - 'projection' => [ - 'filename' => 1, - 'length' => 1, - '_id' => 0, - ], - 'sort' => ['length' => -1], - ] - ); - - $this->assertInstanceOf('MongoDB\Model\BSONDocument', $fileDocument); - $this->assertSameDocument(['filename' => 'b', 'length' => 6], $fileDocument); - } - - public function testGetBucketNameWithCustomValue() - { - $bucket = new Bucket($this->manager, $this->getDatabaseName(), ['bucketName' => 'custom_fs']); - - $this->assertEquals('custom_fs', $bucket->getBucketName()); - } - - public function testGetBucketNameWithDefaultValue() - { - $this->assertEquals('fs', $this->bucket->getBucketName()); - } - - public function testGetDatabaseName() - { - $this->assertEquals($this->getDatabaseName(), $this->bucket->getDatabaseName()); - } - - public function testGetFileDocumentForStreamUsesTypeMap() - { - $metadata = ['foo' => 'bar']; - $stream = $this->bucket->openUploadStream('filename', ['_id' => 1, 'metadata' => $metadata]); - - $fileDocument = $this->bucket->getFileDocumentForStream($stream); - - $this->assertInstanceOf('MongoDB\Model\BSONDocument', $fileDocument); - $this->assertInstanceOf('MongoDB\Model\BSONDocument', $fileDocument['metadata']); - $this->assertSame(['foo' => 'bar'], $fileDocument['metadata']->getArrayCopy()); - } - - public function testGetFileDocumentForStreamWithReadableStream() - { - $metadata = ['foo' => 'bar']; - $id = $this->bucket->uploadFromStream('filename', $this->createStream('foobar'), ['metadata' => $metadata]); - $stream = $this->bucket->openDownloadStream($id); - - $fileDocument = $this->bucket->getFileDocumentForStream($stream); - - $this->assertSameObjectID($id, $fileDocument->_id); - $this->assertSame('filename', $fileDocument->filename); - $this->assertSame(6, $fileDocument->length); - $this->assertSameDocument($metadata, $fileDocument->metadata); - } - - public function testGetFileDocumentForStreamWithWritableStream() - { - $metadata = ['foo' => 'bar']; - $stream = $this->bucket->openUploadStream('filename', ['_id' => 1, 'metadata' => $metadata]); - - $fileDocument = $this->bucket->getFileDocumentForStream($stream); - - $this->assertEquals(1, $fileDocument->_id); - $this->assertSame('filename', $fileDocument->filename); - $this->assertSameDocument($metadata, $fileDocument->metadata); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidGridFSStreamValues - */ - public function testGetFileDocumentForStreamShouldRequireGridFSStreamResource($stream) - { - $this->bucket->getFileDocumentForStream($stream); - } - - public function provideInvalidGridFSStreamValues() - { - return $this->wrapValuesForDataProvider(array_merge($this->getInvalidStreamValues(), [$this->createStream()])); - } - - public function testGetFileIdForStreamUsesTypeMap() - { - $stream = $this->bucket->openUploadStream('filename', ['_id' => ['x' => 1]]); - - $id = $this->bucket->getFileIdForStream($stream); - - $this->assertInstanceOf('MongoDB\Model\BSONDocument', $id); - $this->assertSame(['x' => 1], $id->getArrayCopy()); - } - - public function testGetFileIdForStreamWithReadableStream() - { - $id = $this->bucket->uploadFromStream('filename', $this->createStream('foobar')); - $stream = $this->bucket->openDownloadStream($id); - - $this->assertSameObjectID($id, $this->bucket->getFileIdForStream($stream)); - } - - public function testGetFileIdForStreamWithWritableStream() - { - $stream = $this->bucket->openUploadStream('filename', ['_id' => 1]); - - $this->assertEquals(1, $this->bucket->getFileIdForStream($stream)); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidGridFSStreamValues - */ - public function testGetFileIdForStreamShouldRequireGridFSStreamResource($stream) - { - $this->bucket->getFileIdForStream($stream); - } - - /** - * @dataProvider provideInputDataAndExpectedChunks - */ - public function testOpenDownloadStream($input) - { - $id = $this->bucket->uploadFromStream('filename', $this->createStream($input)); - - $this->assertStreamContents($input, $this->bucket->openDownloadStream($id)); - } - - /** - * @dataProvider provideInputDataAndExpectedChunks - */ - public function testOpenDownloadStreamAndMultipleReadOperations($input) - { - $id = $this->bucket->uploadFromStream('filename', $this->createStream($input)); - $stream = $this->bucket->openDownloadStream($id); - $buffer = ''; - - while (strlen($buffer) < strlen($input)) { - $expectedReadLength = min(4096, strlen($input) - strlen($buffer)); - $buffer .= $read = fread($stream, 4096); - - $this->assertInternalType('string', $read); - $this->assertEquals($expectedReadLength, strlen($read)); - } - - $this->assertTrue(fclose($stream)); - $this->assertEquals($input, $buffer); - } - - /** - * @expectedException MongoDB\GridFS\Exception\FileNotFoundException - */ - public function testOpenDownloadStreamShouldRequireFileToExist() - { - $this->bucket->openDownloadStream('nonexistent-id'); - } - - /** - * @expectedException MongoDB\GridFS\Exception\FileNotFoundException - */ - public function testOpenDownloadStreamByNameShouldRequireFilenameToExist() - { - $this->bucket->openDownloadStream('nonexistent-filename'); - } - - public function testOpenDownloadStreamByName() - { - $this->bucket->uploadFromStream('filename', $this->createStream('foo')); - $this->bucket->uploadFromStream('filename', $this->createStream('bar')); - $this->bucket->uploadFromStream('filename', $this->createStream('baz')); - - $this->assertStreamContents('baz', $this->bucket->openDownloadStreamByName('filename')); - $this->assertStreamContents('foo', $this->bucket->openDownloadStreamByName('filename', ['revision' => -3])); - $this->assertStreamContents('bar', $this->bucket->openDownloadStreamByName('filename', ['revision' => -2])); - $this->assertStreamContents('baz', $this->bucket->openDownloadStreamByName('filename', ['revision' => -1])); - $this->assertStreamContents('foo', $this->bucket->openDownloadStreamByName('filename', ['revision' => 0])); - $this->assertStreamContents('bar', $this->bucket->openDownloadStreamByName('filename', ['revision' => 1])); - $this->assertStreamContents('baz', $this->bucket->openDownloadStreamByName('filename', ['revision' => 2])); - } - - /** - * @expectedException MongoDB\GridFS\Exception\FileNotFoundException - * @dataProvider provideNonexistentFilenameAndRevision - */ - public function testOpenDownloadStreamByNameShouldRequireFilenameAndRevisionToExist($filename, $revision) - { - $this->bucket->uploadFromStream('filename', $this->createStream('foo')); - $this->bucket->uploadFromStream('filename', $this->createStream('bar')); - - $this->bucket->openDownloadStream($filename, ['revision' => $revision]); - } - - public function testOpenUploadStream() - { - $stream = $this->bucket->openUploadStream('filename'); - - fwrite($stream, 'foobar'); - fclose($stream); - - $this->assertStreamContents('foobar', $this->bucket->openDownloadStreamByName('filename')); - } - - /** - * @dataProvider provideInputDataAndExpectedChunks - */ - public function testOpenUploadStreamAndMultipleWriteOperations($input) - { - $stream = $this->bucket->openUploadStream('filename'); - $offset = 0; - - while ($offset < strlen($input)) { - $expectedWriteLength = min(4096, strlen($input) - $offset); - $writeLength = fwrite($stream, substr($input, $offset, 4096)); - $offset += $writeLength; - - $this->assertEquals($expectedWriteLength, $writeLength); - } - - $this->assertTrue(fclose($stream)); - $this->assertStreamContents($input, $this->bucket->openDownloadStreamByName('filename')); - } - - public function testRename() - { - $id = $this->bucket->uploadFromStream('a', $this->createStream('foo')); - $this->bucket->rename($id, 'b'); - - $fileDocument = $this->filesCollection->findOne( - ['_id' => $id], - ['projection' => ['filename' => 1, '_id' => 0]] - ); - - $this->assertSameDocument(['filename' => 'b'], $fileDocument); - $this->assertStreamContents('foo', $this->bucket->openDownloadStreamByName('b')); - } - - public function testRenameShouldNotRequireFileToBeModified() - { - $id = $this->bucket->uploadFromStream('a', $this->createStream('foo')); - $this->bucket->rename($id, 'a'); - - $fileDocument = $this->filesCollection->findOne( - ['_id' => $id], - ['projection' => ['filename' => 1, '_id' => 0]] - ); - - $this->assertSameDocument(['filename' => 'a'], $fileDocument); - $this->assertStreamContents('foo', $this->bucket->openDownloadStreamByName('a')); - } - - /** - * @expectedException MongoDB\GridFS\Exception\FileNotFoundException - */ - public function testRenameShouldRequireFileToExist() - { - $this->bucket->rename('nonexistent-id', 'b'); - } - - public function testUploadFromStream() - { - $options = [ - '_id' => 'custom-id', - 'chunkSizeBytes' => 2, - 'metadata' => ['foo' => 'bar'], - ]; - - $id = $this->bucket->uploadFromStream('filename', $this->createStream('foobar'), $options); - - $this->assertCollectionCount($this->filesCollection, 1); - $this->assertCollectionCount($this->chunksCollection, 3); - $this->assertSame('custom-id', $id); - - $fileDocument = $this->filesCollection->findOne(['_id' => $id]); - - $this->assertSameDocument(['foo' => 'bar'], $fileDocument['metadata']); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidStreamValues - */ - public function testUploadFromStreamShouldRequireSourceStream($source) - { - $this->bucket->uploadFromStream('filename', $source); - } - - public function testUploadingAnEmptyFile() - { - $id = $this->bucket->uploadFromStream('filename', $this->createStream('')); - $destination = $this->createStream(); - $this->bucket->downloadToStream($id, $destination); - - $this->assertStreamContents('', $destination); - $this->assertCollectionCount($this->filesCollection, 1); - $this->assertCollectionCount($this->chunksCollection, 0); - - $fileDocument = $this->filesCollection->findOne( - ['_id' => $id], - [ - 'projection' => [ - 'length' => 1, - 'md5' => 1, - '_id' => 0, - ], - ] - ); - - $expected = [ - 'length' => 0, - 'md5' => 'd41d8cd98f00b204e9800998ecf8427e', - ]; - - $this->assertSameDocument($expected, $fileDocument); - } - - public function testUploadingFirstFileCreatesIndexes() - { - $this->bucket->uploadFromStream('filename', $this->createStream('foo')); - - $this->assertIndexExists($this->filesCollection->getCollectionName(), 'filename_1_uploadDate_1'); - $this->assertIndexExists($this->chunksCollection->getCollectionName(), 'files_id_1_n_1', function(IndexInfo $info) { - $this->assertTrue($info->isUnique()); - }); - } - - /** - * Asserts that a collection with the given name does not exist on the - * server. - * - * @param string $collectionName - */ - private function assertCollectionDoesNotExist($collectionName) - { - $operation = new ListCollections($this->getDatabaseName()); - $collections = $operation->execute($this->getPrimaryServer()); - - $foundCollection = null; - - foreach ($collections as $collection) { - if ($collection->getName() === $collectionName) { - $foundCollection = $collection; - break; - } - } - - $this->assertNull($foundCollection, sprintf('Collection %s exists', $collectionName)); - } - - /** - * Asserts that an index with the given name exists for the collection. - * - * An optional $callback may be provided, which should take an IndexInfo - * argument as its first and only parameter. If an IndexInfo matching the - * given name is found, it will be passed to the callback, which may perform - * additional assertions. - * - * @param string $collectionName - * @param string $indexName - * @param callable $callback - */ - private function assertIndexExists($collectionName, $indexName, $callback = null) - { - if ($callback !== null && ! is_callable($callback)) { - throw new InvalidArgumentException('$callback is not a callable'); - } - - $operation = new ListIndexes($this->getDatabaseName(), $collectionName); - $indexes = $operation->execute($this->getPrimaryServer()); - - $foundIndex = null; - - foreach ($indexes as $index) { - if ($index->getName() === $indexName) { - $foundIndex = $index; - break; - } - } - - $this->assertNotNull($foundIndex, sprintf('Index %s does not exist', $indexName)); - - if ($callback !== null) { - call_user_func($callback, $foundIndex); - } - } - - /** - * Return a list of invalid stream values. - * - * @return array - */ - private function getInvalidStreamValues() - { - return [null, 123, 'foo', [], hash_init('md5')]; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/FunctionalTestCase.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/FunctionalTestCase.php deleted file mode 100644 index 83e4a70..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/FunctionalTestCase.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace MongoDB\Tests\GridFS; - -use MongoDB\Collection; -use MongoDB\GridFS\Bucket; -use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase; - -/** - * Base class for GridFS functional tests. - */ -abstract class FunctionalTestCase extends BaseFunctionalTestCase -{ - protected $bucket; - protected $chunksCollection; - protected $filesCollection; - - public function setUp() - { - parent::setUp(); - - $this->bucket = new Bucket($this->manager, $this->getDatabaseName()); - $this->bucket->drop(); - - $this->chunksCollection = new Collection($this->manager, $this->getDatabaseName(), 'fs.chunks'); - $this->filesCollection = new Collection($this->manager, $this->getDatabaseName(), 'fs.files'); - } - - /** - * Asserts that a variable is a stream containing the expected data. - * - * Note: this will seek to the beginning of the stream before reading. - * - * @param string $expectedContents - * @param resource $stream - */ - protected function assertStreamContents($expectedContents, $stream) - { - $this->assertInternalType('resource', $stream); - $this->assertSame('stream', get_resource_type($stream)); - $this->assertEquals($expectedContents, stream_get_contents($stream)); - } - - /** - * Creates an in-memory stream with the given data. - * - * @param string $data - * @return resource - */ - protected function createStream($data = '') - { - $stream = fopen('php://temp', 'w+b'); - fwrite($stream, $data); - rewind($stream); - - return $stream; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/ReadableStreamFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/ReadableStreamFunctionalTest.php deleted file mode 100644 index 8b7d320..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/ReadableStreamFunctionalTest.php +++ /dev/null @@ -1,180 +0,0 @@ -<?php - -namespace MongoDB\Tests\GridFS; - -use MongoDB\BSON\Binary; -use MongoDB\GridFS\CollectionWrapper; -use MongoDB\GridFS\ReadableStream; - -/** - * Functional tests for the internal ReadableStream class. - */ -class ReadableStreamFunctionalTest extends FunctionalTestCase -{ - private $collectionWrapper; - - public function setUp() - { - parent::setUp(); - - $this->collectionWrapper = new CollectionWrapper($this->manager, $this->getDatabaseName(), 'fs'); - - $this->filesCollection->insertMany([ - ['_id' => 'length-0', 'length' => 0, 'chunkSize' => 4], - ['_id' => 'length-0-with-empty-chunk', 'length' => 0, 'chunkSize' => 4], - ['_id' => 'length-2', 'length' => 2, 'chunkSize' => 4], - ['_id' => 'length-8', 'length' => 8, 'chunkSize' => 4], - ['_id' => 'length-10', 'length' => 10, 'chunkSize' => 4], - ]); - - $this->chunksCollection->insertMany([ - ['_id' => 1, 'files_id' => 'length-0-with-empty-chunk', 'n' => 0, 'data' => new Binary('', Binary::TYPE_GENERIC)], - ['_id' => 2, 'files_id' => 'length-2', 'n' => 0, 'data' => new Binary('ab', Binary::TYPE_GENERIC)], - ['_id' => 3, 'files_id' => 'length-8', 'n' => 0, 'data' => new Binary('abcd', Binary::TYPE_GENERIC)], - ['_id' => 4, 'files_id' => 'length-8', 'n' => 1, 'data' => new Binary('efgh', Binary::TYPE_GENERIC)], - ['_id' => 5, 'files_id' => 'length-10', 'n' => 0, 'data' => new Binary('abcd', Binary::TYPE_GENERIC)], - ['_id' => 6, 'files_id' => 'length-10', 'n' => 1, 'data' => new Binary('efgh', Binary::TYPE_GENERIC)], - ['_id' => 7, 'files_id' => 'length-10', 'n' => 2, 'data' => new Binary('ij', Binary::TYPE_GENERIC)], - ]); - } - - public function testValidConstructorFileDocument() - { - new ReadableStream($this->collectionWrapper, (object) ['_id' => null, 'chunkSize' => 1, 'length' => 0]); - } - - /** - * @expectedException MongoDB\GridFS\Exception\CorruptFileException - * @dataProvider provideInvalidConstructorFileDocuments - */ - public function testConstructorFileDocumentChecks($file) - { - new ReadableStream($this->collectionWrapper, $file); - } - - public function provideInvalidConstructorFileDocuments() - { - $options = []; - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = (object) ['_id' => 1, 'chunkSize' => $value, 'length' => 0]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = (object) ['_id' => 1, 'chunkSize' => 1, 'length' => $value]; - } - - $options[][] = (object) ['_id' => 1, 'chunkSize' => 0, 'length' => 0]; - $options[][] = (object) ['_id' => 1, 'chunkSize' => 1, 'length' => -1]; - $options[][] = (object) ['chunkSize' => 1, 'length' => 0]; - - return $options; - } - - /** - * @dataProvider provideFileIdAndExpectedBytes - */ - public function testReadBytes($fileId, $length, $expectedBytes) - { - $fileDocument = $this->collectionWrapper->findFileById($fileId); - $stream = new ReadableStream($this->collectionWrapper, $fileDocument); - - $this->assertSame($expectedBytes, $stream->readBytes($length)); - } - - public function provideFileIdAndExpectedBytes() - { - return [ - ['length-0', 0, ''], - ['length-0', 2, ''], - ['length-0-with-empty-chunk', 0, ''], - ['length-0-with-empty-chunk', 2, ''], - ['length-2', 0, ''], - ['length-2', 2, 'ab'], - ['length-2', 4, 'ab'], - ['length-8', 0, ''], - ['length-8', 2, 'ab'], - ['length-8', 4, 'abcd'], - ['length-8', 6, 'abcdef'], - ['length-8', 8, 'abcdefgh'], - ['length-8', 10, 'abcdefgh'], - ['length-10', 0, ''], - ['length-10', 2, 'ab'], - ['length-10', 4, 'abcd'], - ['length-10', 6, 'abcdef'], - ['length-10', 8, 'abcdefgh'], - ['length-10', 10, 'abcdefghij'], - ['length-10', 12, 'abcdefghij'], - ]; - } - - /** - * @dataProvider provideFileIdAndExpectedBytes - */ - public function testReadBytesCalledMultipleTimes($fileId, $length, $expectedBytes) - { - $fileDocument = $this->collectionWrapper->findFileById($fileId); - $stream = new ReadableStream($this->collectionWrapper, $fileDocument); - - for ($i = 0; $i < $length; $i++) { - $expectedByte = isset($expectedBytes[$i]) ? $expectedBytes[$i] : ''; - $this->assertSame($expectedByte, $stream->readBytes(1)); - } - } - - /** - * @expectedException MongoDB\GridFS\Exception\CorruptFileException - * @expectedExceptionMessage Chunk not found for index "2" - */ - public function testReadBytesWithMissingChunk() - { - $this->chunksCollection->deleteOne(['files_id' => 'length-10', 'n' => 2]); - - $fileDocument = $this->collectionWrapper->findFileById('length-10'); - $stream = new ReadableStream($this->collectionWrapper, $fileDocument); - - $stream->readBytes(10); - } - - /** - * @expectedException MongoDB\GridFS\Exception\CorruptFileException - * @expectedExceptionMessage Expected chunk to have index "1" but found "2" - */ - public function testReadBytesWithUnexpectedChunkIndex() - { - $this->chunksCollection->deleteOne(['files_id' => 'length-10', 'n' => 1]); - - $fileDocument = $this->collectionWrapper->findFileById('length-10'); - $stream = new ReadableStream($this->collectionWrapper, $fileDocument); - - $stream->readBytes(10); - } - - /** - * @expectedException MongoDB\GridFS\Exception\CorruptFileException - * @expectedExceptionMessage Expected chunk to have size "2" but found "1" - */ - public function testReadBytesWithUnexpectedChunkSize() - { - $this->chunksCollection->updateOne( - ['files_id' => 'length-10', 'n' => 2], - ['$set' => ['data' => new Binary('i', Binary::TYPE_GENERIC)]] - ); - - $fileDocument = $this->collectionWrapper->findFileById('length-10'); - $stream = new ReadableStream($this->collectionWrapper, $fileDocument); - - $stream->readBytes(10); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - */ - public function testReadBytesWithNegativeLength() - { - $fileDocument = $this->collectionWrapper->findFileById('length-0'); - $stream = new ReadableStream($this->collectionWrapper, $fileDocument); - - $stream->readBytes(-1); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/SpecFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/SpecFunctionalTest.php deleted file mode 100644 index 135c609..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/SpecFunctionalTest.php +++ /dev/null @@ -1,359 +0,0 @@ -<?php - -namespace MongoDB\Tests\GridFS; - -use MongoDB\Collection; -use MongoDB\BSON\Binary; -use MongoDB\BSON\ObjectId; -use MongoDB\BSON\UTCDateTime; -use MongoDB\Operation\BulkWrite; -use DateTime; -use Exception; -use IteratorIterator; -use LogicException; -use MultipleIterator; - -/** - * GridFS spec functional tests. - * - * @see https://github.com/mongodb/specifications/tree/master/source/gridfs/tests - */ -class SpecFunctionalTest extends FunctionalTestCase -{ - private $expectedChunksCollection; - private $expectedFilesCollection; - - public function setUp() - { - parent::setUp(); - - $this->expectedFilesCollection = new Collection($this->manager, $this->getDatabaseName(), 'expected.files'); - $this->expectedFilesCollection->drop(); - - $this->expectedChunksCollection = new Collection($this->manager, $this->getDatabaseName(), 'expected.chunks'); - $this->expectedChunksCollection->drop(); - } - - /** - * @dataProvider provideSpecificationTests - */ - public function testSpecification(array $initialData, array $test) - { - $this->setName(str_replace(' ', '_', $test['description'])); - $this->initializeData($initialData); - - if (isset($test['arrange'])) { - foreach ($test['arrange']['data'] as $dataModification) { - $this->executeDataModification($dataModification); - } - } - - try { - $result = $this->executeAct($test['act']); - } catch (Exception $e) { - $result = $e; - } - - if (isset($test['assert'])) { - $this->executeAssert($test['assert'], $result); - } - } - - public function provideSpecificationTests() - { - $testArgs = []; - - foreach (glob(__DIR__ . '/spec-tests/*.json') as $filename) { - $json = json_decode(file_get_contents($filename), true); - - foreach ($json['tests'] as $test) { - $testArgs[] = [$json['data'], $test]; - } - } - - return $testArgs; - } - - /** - * Assert that the collections contain equivalent documents. - * - * This method will resolve references within the expected collection's - * documents before comparing documents. Occurrences of "*result" in the - * expected collection's documents will be replaced with the actual result. - * Occurrences of "*actual" in the expected collection's documents will be - * replaced with the corresponding value in the actual collection's document - * being compared. - * - * @param Collection $expectedCollection - * @param Collection $actualCollection - * @param mixed $actualResult - */ - private function assertEquivalentCollections($expectedCollection, $actualCollection, $actualResult) - { - $mi = new MultipleIterator; - $mi->attachIterator(new IteratorIterator($expectedCollection->find())); - $mi->attachIterator(new IteratorIterator($actualCollection->find())); - - foreach ($mi as $documents) { - list($expectedDocument, $actualDocument) = $documents; - - foreach ($expectedDocument as $key => $value) { - if ( ! is_string($value)) { - continue; - } - - if ($value === '*result') { - $expectedDocument[$key] = $actualResult; - } - - if ( ! strncmp($value, '*actual_', 8)) { - $expectedDocument[$key] = $actualDocument[$key]; - } - } - - $this->assertSameDocument($expectedDocument, $actualDocument); - } - } - - /** - * Convert encoded types in the array and return the modified array. - * - * Nested arrays with "$oid" and "$date" keys will be converted to ObjectID - * and UTCDateTime instances, respectively. Nested arrays with "$hex" keys - * will be converted to a string or Binary object. - * - * @param param $data - * @param boolean $createBinary If true, convert "$hex" values to a Binary - * @return array - */ - private function convertTypes(array $data, $createBinary = true) - { - /* array_walk_recursive() only visits leaf nodes within the array, so we - * need to manually recurse. - */ - array_walk($data, function(&$value) use ($createBinary) { - if ( ! is_array($value)) { - return; - } - - if (isset($value['$oid'])) { - $value = new ObjectId($value['$oid']); - return; - } - - if (isset($value['$hex'])) { - $value = $createBinary - ? new Binary(hex2bin($value['$hex']), Binary::TYPE_GENERIC) - : hex2bin($value['$hex']); - - return; - } - - if (isset($value['$date'])) { - $value = new UTCDateTime(new DateTime($value['$date'])); - return; - } - - $value = $this->convertTypes($value, $createBinary); - }); - - return $data; - } - - /** - * Executes an "act" block. - * - * @param array $act - * @return mixed - * @throws LogicException if the operation is unsupported - */ - private function executeAct(array $act) - { - $act = $this->convertTypes($act, false); - - switch ($act['operation']) { - case 'delete': - return $this->bucket->delete($act['arguments']['id']); - - case 'download': - return stream_get_contents($this->bucket->openDownloadStream($act['arguments']['id'])); - - case 'download_by_name': - return stream_get_contents($this->bucket->openDownloadStreamByName( - $act['arguments']['filename'], - isset($act['arguments']['options']) ? $act['arguments']['options'] : [] - )); - - case 'upload': - return $this->bucket->uploadFromStream( - $act['arguments']['filename'], - $this->createStream($act['arguments']['source']), - isset($act['arguments']['options']) ? $act['arguments']['options'] : [] - ); - - default: - throw new LogicException('Unsupported act: ' . $act['operation']); - } - } - - /** - * Executes an "assert" block. - * - * @param array $assert - * @param mixed $actualResult - * @return mixed - * @throws LogicException if the operation is unsupported - */ - private function executeAssert(array $assert, $actualResult) - { - if (isset($assert['error'])) { - $this->assertInstanceOf($this->getExceptionClassForError($assert['error']), $actualResult); - } - - if (isset($assert['result'])) { - $this->executeAssertResult($assert['result'], $actualResult); - } - - if ( ! isset($assert['data'])) { - return; - } - - /* Since "*actual" may be used for an expected document's "_id", append - * a unique value to avoid duplicate key exceptions. - */ - array_walk_recursive($assert['data'], function(&$value) { - if ($value === '*actual') { - $value .= '_' . new ObjectId; - } - }); - - foreach ($assert['data'] as $dataModification) { - $this->executeDataModification($dataModification); - } - - $this->assertEquivalentCollections($this->expectedFilesCollection, $this->filesCollection, $actualResult); - $this->assertEquivalentCollections($this->expectedChunksCollection, $this->chunksCollection, $actualResult); - } - - /** - * Executes the "result" section of an "assert" block. - * - * @param mixed $expectedResult - * @param mixed $actualResult - * @throws LogicException if the result assertion is unsupported - */ - private function executeAssertResult($expectedResult, $actualResult) - { - if ($expectedResult === 'void') { - return $this->assertNull($actualResult); - } - - if ($expectedResult === '&result') { - // Do nothing; assertEquivalentCollections() will handle this - return; - } - - if (isset($expectedResult['$hex'])) { - return $this->assertSame(hex2bin($expectedResult['$hex']), $actualResult); - } - - throw new LogicException('Unsupported result assertion: ' . var_export($expectedResult, true)); - } - - /** - * Executes a data modification from an "arrange" or "assert" block. - * - * @param array $dataModification - * @return mixed - * @throws LogicException if the operation or collection is unsupported - */ - private function executeDataModification(array $dataModification) - { - foreach ($dataModification as $type => $collectionName) { - break; - } - - if ( ! in_array($collectionName, ['fs.files', 'fs.chunks', 'expected.files', 'expected.chunks'])) { - throw new LogicException('Unsupported collection: ' . $collectionName); - } - - $dataModification = $this->convertTypes($dataModification); - $operations = []; - - switch ($type) { - case 'delete': - foreach ($dataModification['deletes'] as $delete) { - $operations[] = [ ($delete['limit'] === 1 ? 'deleteOne' : 'deleteMany') => [ $delete['q'] ] ]; - } - - break; - - case 'insert': - foreach ($dataModification['documents'] as $document) { - $operations[] = [ 'insertOne' => [ $document ] ]; - } - - break; - - case 'update': - foreach ($dataModification['updates'] as $update) { - $operations[] = [ 'updateOne' => [ $update['q'], $update['u'] ] ]; - } - - break; - - default: - throw new LogicException('Unsupported arrangement: ' . $type); - } - - $bulk = new BulkWrite($this->getDatabaseName(), $collectionName, $operations); - - return $bulk->execute($this->getPrimaryServer()); - } - - /** - * Returns the exception class for the "error" section of an "assert" block. - * - * @param string $error - * @return string - * @throws LogicException if the error is unsupported - */ - private function getExceptionClassForError($error) - { - switch ($error) { - case 'FileNotFound': - case 'RevisionNotFound': - return 'MongoDB\GridFS\Exception\FileNotFoundException'; - - case 'ChunkIsMissing': - case 'ChunkIsWrongSize': - /* Although ReadableStream throws a CorruptFileException, the - * stream wrapper will convert it to a PHP error of type - * E_USER_WARNING. */ - return 'PHPUnit_Framework_Error_Warning'; - - default: - throw new LogicException('Unsupported error: ' . $error); - } - } - - /** - * Initializes data in the files and chunks collections. - * - * @param array $data - */ - private function initializeData(array $data) - { - $data = $this->convertTypes($data); - - if ( ! empty($data['files'])) { - $this->filesCollection->insertMany($data['files']); - $this->expectedFilesCollection->insertMany($data['files']); - } - - if ( ! empty($data['chunks'])) { - $this->chunksCollection->insertMany($data['chunks']); - $this->expectedChunksCollection->insertMany($data['chunks']); - } - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/StreamWrapperFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/StreamWrapperFunctionalTest.php deleted file mode 100644 index 4bad3ff..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/StreamWrapperFunctionalTest.php +++ /dev/null @@ -1,135 +0,0 @@ -<?php - -namespace MongoDB\Tests\GridFS; - -use MongoDB\BSON\Binary; -use MongoDB\BSON\UTCDateTime; - -/** - * Functional tests for the internal StreamWrapper class. - */ -class StreamWrapperFunctionalTest extends FunctionalTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->filesCollection->insertMany([ - ['_id' => 'length-10', 'length' => 10, 'chunkSize' => 4, 'uploadDate' => new UTCDateTime('1484202200000')], - ]); - - $this->chunksCollection->insertMany([ - ['_id' => 1, 'files_id' => 'length-10', 'n' => 0, 'data' => new Binary('abcd', Binary::TYPE_GENERIC)], - ['_id' => 2, 'files_id' => 'length-10', 'n' => 1, 'data' => new Binary('efgh', Binary::TYPE_GENERIC)], - ['_id' => 3, 'files_id' => 'length-10', 'n' => 2, 'data' => new Binary('ij', Binary::TYPE_GENERIC)], - ]); - } - - public function testReadableStreamClose() - { - $stream = $this->bucket->openDownloadStream('length-10'); - - $this->assertTrue(fclose($stream)); - } - - public function testReadableStreamEof() - { - $stream = $this->bucket->openDownloadStream('length-10'); - - $this->assertFalse(feof($stream)); - $this->assertStreamContents('abcdefghij', $stream); - $this->assertTrue(feof($stream)); - } - - public function testReadableStreamRead() - { - $stream = $this->bucket->openDownloadStream('length-10'); - - $this->assertSame('abc', fread($stream, 3)); - $this->assertSame('defghij', fread($stream, 10)); - $this->assertSame('', fread($stream, 3)); - } - - public function testReadableStreamStat() - { - $stream = $this->bucket->openDownloadStream('length-10'); - - $stat = fstat($stream); - $this->assertSame(0100444, $stat[2]); - $this->assertSame(0100444, $stat['mode']); - $this->assertSame(10, $stat[7]); - $this->assertSame(10, $stat['size']); - $this->assertSame(1484202200, $stat[9]); - $this->assertSame(1484202200, $stat['mtime']); - $this->assertSame(1484202200, $stat[10]); - $this->assertSame(1484202200, $stat['ctime']); - $this->assertSame(4, $stat[11]); - $this->assertSame(4, $stat['blksize']); - } - - public function testReadableStreamWrite() - { - $stream = $this->bucket->openDownloadStream('length-10'); - - $this->assertSame(0, fwrite($stream, 'foobar')); - } - - public function testWritableStreamClose() - { - $stream = $this->bucket->openUploadStream('filename'); - - $this->assertSame(6, fwrite($stream, 'foobar')); - $this->assertTrue(fclose($stream)); - - $this->assertStreamContents('foobar', $this->bucket->openDownloadStreamByName('filename')); - } - - public function testWritableStreamEof() - { - $stream = $this->bucket->openUploadStream('filename'); - - $this->assertFalse(feof($stream)); - $this->assertSame(6, fwrite($stream, 'foobar')); - $this->assertFalse(feof($stream)); - } - - public function testWritableStreamRead() - { - $stream = $this->bucket->openUploadStream('filename'); - - $this->assertSame('', fread($stream, 8192)); - $this->assertSame(6, fwrite($stream, 'foobar')); - $this->assertSame('', fread($stream, 8192)); - } - - public function testWritableStreamStat() - { - $currentTimestamp = time(); - $stream = $this->bucket->openUploadStream('filename', ['chunkSizeBytes' => 1024]); - - $stat = fstat($stream); - $this->assertSame(0100222, $stat[2]); - $this->assertSame(0100222, $stat['mode']); - $this->assertSame(0, $stat[7]); - $this->assertSame(0, $stat['size']); - $this->assertGreaterThanOrEqual($currentTimestamp, $stat[9]); - $this->assertGreaterThanOrEqual($currentTimestamp, $stat['mtime']); - $this->assertGreaterThanOrEqual($currentTimestamp, $stat[10]); - $this->assertGreaterThanOrEqual($currentTimestamp, $stat['ctime']); - $this->assertSame(1024, $stat[11]); - $this->assertSame(1024, $stat['blksize']); - - $this->assertSame(6, fwrite($stream, 'foobar')); - - $stat = fstat($stream); - $this->assertSame(6, $stat[7]); - $this->assertSame(6, $stat['size']); - } - - public function testWritableStreamWrite() - { - $stream = $this->bucket->openUploadStream('filename'); - - $this->assertSame(6, fwrite($stream, 'foobar')); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/WritableStreamFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/WritableStreamFunctionalTest.php deleted file mode 100644 index 6a1ce89..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/WritableStreamFunctionalTest.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php - -namespace MongoDB\Tests\GridFS; - -use MongoDB\GridFS\CollectionWrapper; -use MongoDB\GridFS\WritableStream; - -/** - * Functional tests for the internal WritableStream class. - */ -class WritableStreamFunctionalTest extends FunctionalTestCase -{ - private $collectionWrapper; - - public function setUp() - { - parent::setUp(); - - $this->collectionWrapper = new CollectionWrapper($this->manager, $this->getDatabaseName(), 'fs'); - } - - public function testValidConstructorOptions() - { - new WritableStream($this->collectionWrapper, 'filename', [ - '_id' => 'custom-id', - 'chunkSizeBytes' => 2, - 'metadata' => ['foo' => 'bar'], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new WritableStream($this->collectionWrapper, 'filename', $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['chunkSizeBytes' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['metadata' => $value]; - } - - return $options; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Expected "chunkSizeBytes" option to be >= 1, 0 given - */ - public function testConstructorShouldRequireChunkSizeBytesOptionToBePositive() - { - new WritableStream($this->collectionWrapper, 'filename', ['chunkSizeBytes' => 0]); - } - - public function testWriteBytesAlwaysUpdatesFileSize() - { - $stream = new WritableStream($this->collectionWrapper, 'filename', ['chunkSizeBytes' => 1024]); - - $this->assertSame(0, $stream->getSize()); - $this->assertSame(512, $stream->writeBytes(str_repeat('a', 512))); - $this->assertSame(512, $stream->getSize()); - $this->assertSame(512, $stream->writeBytes(str_repeat('a', 512))); - $this->assertSame(1024, $stream->getSize()); - $this->assertSame(512, $stream->writeBytes(str_repeat('a', 512))); - $this->assertSame(1536, $stream->getSize()); - - $stream->close(); - $this->assertSame(1536, $stream->getSize()); - } - - /** - * @dataProvider provideInputDataAndExpectedMD5 - */ - public function testWriteBytesCalculatesMD5($input, $expectedMD5) - { - $stream = new WritableStream($this->collectionWrapper, 'filename'); - $stream->writeBytes($input); - $stream->close(); - - $fileDocument = $this->filesCollection->findOne( - ['_id' => $stream->getFile()->_id], - ['projection' => ['md5' => 1, '_id' => 0]] - ); - - $this->assertSameDocument(['md5' => $expectedMD5], $fileDocument); - } - - public function provideInputDataAndExpectedMD5() - { - return [ - ['', 'd41d8cd98f00b204e9800998ecf8427e'], - ['foobar', '3858f62230ac3c915f300c664312c63f'], - [str_repeat('foobar', 43520), '88ff0e5fcb0acb27947d736b5d69cb73'], - [str_repeat('foobar', 43521), '8ff86511c95a06a611842ceb555d8454'], - [str_repeat('foobar', 87040), '45bfa1a9ec36728ee7338d15c5a30c13'], - [str_repeat('foobar', 87041), '95e78f624f8e745bcfd2d11691fa601e'], - ]; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/delete.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/delete.json deleted file mode 100644 index f1b9830..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/delete.json +++ /dev/null @@ -1,316 +0,0 @@ -{ - "data": { - "files": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "dd254cdc958e53abaa67da9f797125f5", - "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - } - ], - "chunks": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "files_id": { - "$oid": "000000000000000000000002" - }, - "n": 0, - "data": { - "$hex": "" - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$hex": "1122" - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 0, - "data": { - "$hex": "11223344" - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 1, - "data": { - "$hex": "55667788" - } - } - ] - }, - "tests": [ - { - "description": "Delete when length is 0", - "act": { - "operation": "delete", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - }, - "assert": { - "result": "void", - "data": [ - { - "delete": "expected.files", - "deletes": [ - { - "q": { - "_id": { - "$oid": "000000000000000000000001" - } - }, - "limit": 1 - } - ] - } - ] - } - }, - { - "description": "Delete when length is 0 and there is one extra empty chunk", - "act": { - "operation": "delete", - "arguments": { - "id": { - "$oid": "000000000000000000000002" - } - } - }, - "assert": { - "result": "void", - "data": [ - { - "delete": "expected.files", - "deletes": [ - { - "q": { - "_id": { - "$oid": "000000000000000000000002" - } - }, - "limit": 1 - } - ] - }, - { - "delete": "expected.chunks", - "deletes": [ - { - "q": { - "files_id": { - "$oid": "000000000000000000000002" - } - }, - "limit": 0 - } - ] - } - ] - } - }, - { - "description": "Delete when length is 8", - "act": { - "operation": "delete", - "arguments": { - "id": { - "$oid": "000000000000000000000004" - } - } - }, - "assert": { - "result": "void", - "data": [ - { - "delete": "expected.files", - "deletes": [ - { - "q": { - "_id": { - "$oid": "000000000000000000000004" - } - }, - "limit": 1 - } - ] - }, - { - "delete": "expected.chunks", - "deletes": [ - { - "q": { - "files_id": { - "$oid": "000000000000000000000004" - } - }, - "limit": 0 - } - ] - } - ] - } - }, - { - "description": "Delete when files entry does not exist", - "act": { - "operation": "delete", - "arguments": { - "id": { - "$oid": "000000000000000000000000" - } - } - }, - "assert": { - "error": "FileNotFound" - } - }, - { - "description": "Delete when files entry does not exist and there are orphaned chunks", - "arrange": { - "data": [ - { - "delete": "fs.files", - "deletes": [ - { - "q": { - "_id": { - "$oid": "000000000000000000000004" - } - }, - "limit": 1 - } - ] - } - ] - }, - "act": { - "operation": "delete", - "arguments": { - "id": { - "$oid": "000000000000000000000004" - } - } - }, - "assert": { - "error": "FileNotFound", - "data": [ - { - "delete": "expected.files", - "deletes": [ - { - "q": { - "_id": { - "$oid": "000000000000000000000004" - } - }, - "limit": 1 - } - ] - }, - { - "delete": "expected.chunks", - "deletes": [ - { - "q": { - "files_id": { - "$oid": "000000000000000000000004" - } - }, - "limit": 0 - } - ] - } - ] - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/download.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/download.json deleted file mode 100644 index f0bee2e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/download.json +++ /dev/null @@ -1,445 +0,0 @@ -{ - "data": { - "files": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "dd254cdc958e53abaa67da9f797125f5", - "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 10, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "57d83cd477bfb1ccd975ab33d827a92b", - "filename": "length-10", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - } - ], - "chunks": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "files_id": { - "$oid": "000000000000000000000002" - }, - "n": 0, - "data": { - "$hex": "" - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$hex": "1122" - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 0, - "data": { - "$hex": "11223344" - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 1, - "data": { - "$hex": "55667788" - } - }, - { - "_id": { - "$oid": "000000000000000000000005" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 0, - "data": { - "$hex": "11223344" - } - }, - { - "_id": { - "$oid": "000000000000000000000006" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1, - "data": { - "$hex": "55667788" - } - }, - { - "_id": { - "$oid": "000000000000000000000007" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 2, - "data": { - "$hex": "99aa" - } - } - ] - }, - "tests": [ - { - "description": "Download when length is zero", - "act": { - "operation": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - }, - "options": { - } - } - }, - "assert": { - "result": { - "$hex": "" - } - } - }, - { - "description": "Download when length is zero and there is one empty chunk", - "act": { - "operation": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000002" - }, - "options": { - } - } - }, - "assert": { - "result": { - "$hex": "" - } - } - }, - { - "description": "Download when there is one chunk", - "act": { - "operation": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000003" - }, - "options": { - } - } - }, - "assert": { - "result": { - "$hex": "1122" - } - } - }, - { - "description": "Download when there are two chunks", - "act": { - "operation": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000004" - }, - "options": { - } - } - }, - "assert": { - "result": { - "$hex": "1122334455667788" - } - } - }, - { - "description": "Download when there are three chunks", - "act": { - "operation": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - }, - "options": { - } - } - }, - "assert": { - "result": { - "$hex": "112233445566778899aa" - } - } - }, - { - "description": "Download when files entry does not exist", - "act": { - "operation": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000000" - }, - "options": { - } - } - }, - "assert": { - "error": "FileNotFound" - } - }, - { - "description": "Download when an intermediate chunk is missing", - "arrange": { - "data": [ - { - "delete": "fs.chunks", - "deletes": [ - { - "q": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1 - }, - "limit": 1 - } - ] - } - ] - }, - "act": { - "operation": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - } - }, - "assert": { - "error": "ChunkIsMissing" - } - }, - { - "description": "Download when final chunk is missing", - "arrange": { - "data": [ - { - "delete": "fs.chunks", - "deletes": [ - { - "q": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1 - }, - "limit": 1 - } - ] - } - ] - }, - "act": { - "operation": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - } - }, - "assert": { - "error": "ChunkIsMissing" - } - }, - { - "description": "Download when an intermediate chunk is the wrong size", - "arrange": { - "data": [ - { - "update": "fs.chunks", - "updates": [ - { - "q": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1 - }, - "u": { - "$set": { - "data": { - "$hex": "556677" - } - } - } - }, - { - "q": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 2 - }, - "u": { - "$set": { - "data": { - "$hex": "8899aa" - } - } - } - } - ] - } - ] - }, - "act": { - "operation": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - } - }, - "assert": { - "error": "ChunkIsWrongSize" - } - }, - { - "description": "Download when final chunk is the wrong size", - "arrange": { - "data": [ - { - "update": "fs.chunks", - "updates": [ - { - "q": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 2 - }, - "u": { - "$set": { - "data": { - "$hex": "99" - } - } - } - } - ] - } - ] - }, - "act": { - "operation": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - } - }, - "assert": { - "error": "ChunkIsWrongSize" - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/download_by_name.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/download_by_name.json deleted file mode 100644 index 7f4d46b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/download_by_name.json +++ /dev/null @@ -1,255 +0,0 @@ -{ - "data": { - "files": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "47ed733b8d10be225eceba344d533586", - "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-02T00:00:00.000Z" - }, - "md5": "b15835f133ff2e27c7cb28117bfae8f4", - "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-03T00:00:00.000Z" - }, - "md5": "eccbc87e4b5ce2fe28308fd9f2a7baf3", - "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-04T00:00:00.000Z" - }, - "md5": "f623e75af30e62bbd73d6df5b50bb7b5", - "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - }, - { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-05T00:00:00.000Z" - }, - "md5": "4c614360da93c0a041b22e537de151eb", - "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [ - - ], - "metadata": { - } - } - ], - "chunks": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "files_id": { - "$oid": "000000000000000000000001" - }, - "n": 0, - "data": { - "$hex": "11" - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000002" - }, - "n": 0, - "data": { - "$hex": "22" - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$hex": "33" - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 0, - "data": { - "$hex": "44" - } - }, - { - "_id": { - "$oid": "000000000000000000000005" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 0, - "data": { - "$hex": "55" - } - } - ] - }, - "tests": [ - { - "description": "Download_by_name when revision is 0", - "act": { - "operation": "download_by_name", - "arguments": { - "filename": "abc", - "options": { - "revision": 0 - } - } - }, - "assert": { - "result": { - "$hex": "11" - } - } - }, - { - "description": "Download_by_name when revision is 1", - "act": { - "operation": "download_by_name", - "arguments": { - "filename": "abc", - "options": { - "revision": 1 - } - } - }, - "assert": { - "result": { - "$hex": "22" - } - } - }, - { - "description": "Download_by_name when revision is -2", - "act": { - "operation": "download_by_name", - "arguments": { - "filename": "abc", - "options": { - "revision": -2 - } - } - }, - "assert": { - "result": { - "$hex": "44" - } - } - }, - { - "description": "Download_by_name when revision is -1", - "act": { - "operation": "download_by_name", - "arguments": { - "filename": "abc", - "options": { - "revision": -1 - } - } - }, - "assert": { - "result": { - "$hex": "55" - } - } - }, - { - "description": "Download_by_name when files entry does not exist", - "act": { - "operation": "download_by_name", - "arguments": { - "filename": "xyz" - } - }, - "assert": { - "error": "FileNotFound" - } - }, - { - "description": "Download_by_name when revision does not exist", - "act": { - "operation": "download_by_name", - "arguments": { - "filename": "abc", - "options": { - "revision": 999 - } - } - }, - "assert": { - "error": "RevisionNotFound" - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/upload.json b/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/upload.json deleted file mode 100644 index 95dfd79..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/GridFS/spec-tests/upload.json +++ /dev/null @@ -1,391 +0,0 @@ -{ - "data": { - "files": [ - - ], - "chunks": [ - - ] - }, - "tests": [ - { - "description": "Upload when length is 0", - "act": { - "operation": "upload", - "arguments": { - "filename": "filename", - "source": { - "$hex": "" - }, - "options": { - "chunkSizeBytes": 4 - } - } - }, - "assert": { - "result": "&result", - "data": [ - { - "insert": "expected.files", - "documents": [ - { - "_id": "*result", - "length": 0, - "chunkSize": 4, - "uploadDate": "*actual", - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "filename" - } - ] - } - ] - } - }, - { - "description": "Upload when length is 1", - "act": { - "operation": "upload", - "arguments": { - "filename": "filename", - "source": { - "$hex": "11" - }, - "options": { - "chunkSizeBytes": 4 - } - } - }, - "assert": { - "result": "&result", - "data": [ - { - "insert": "expected.files", - "documents": [ - { - "_id": "*result", - "length": 1, - "chunkSize": 4, - "uploadDate": "*actual", - "md5": "47ed733b8d10be225eceba344d533586", - "filename": "filename" - } - ] - }, - { - "insert": "expected.chunks", - "documents": [ - { - "_id": "*actual", - "files_id": "*result", - "n": 0, - "data": { - "$hex": "11" - } - } - ] - } - ] - } - }, - { - "description": "Upload when length is 3", - "act": { - "operation": "upload", - "arguments": { - "filename": "filename", - "source": { - "$hex": "112233" - }, - "options": { - "chunkSizeBytes": 4 - } - } - }, - "assert": { - "result": "&result", - "data": [ - { - "insert": "expected.files", - "documents": [ - { - "_id": "*result", - "length": 3, - "chunkSize": 4, - "uploadDate": "*actual", - "md5": "bafae3a174ab91fc70db7a6aa50f4f52", - "filename": "filename" - } - ] - }, - { - "insert": "expected.chunks", - "documents": [ - { - "_id": "*actual", - "files_id": "*result", - "n": 0, - "data": { - "$hex": "112233" - } - } - ] - } - ] - } - }, - { - "description": "Upload when length is 4", - "act": { - "operation": "upload", - "arguments": { - "filename": "filename", - "source": { - "$hex": "11223344" - }, - "options": { - "chunkSizeBytes": 4 - } - } - }, - "assert": { - "result": "&result", - "data": [ - { - "insert": "expected.files", - "documents": [ - { - "_id": "*result", - "length": 4, - "chunkSize": 4, - "uploadDate": "*actual", - "md5": "7e7c77cff5705d1f7574a25ef6662117", - "filename": "filename" - } - ] - }, - { - "insert": "expected.chunks", - "documents": [ - { - "_id": "*actual", - "files_id": "*result", - "n": 0, - "data": { - "$hex": "11223344" - } - } - ] - } - ] - } - }, - { - "description": "Upload when length is 5", - "act": { - "operation": "upload", - "arguments": { - "filename": "filename", - "source": { - "$hex": "1122334455" - }, - "options": { - "chunkSizeBytes": 4 - } - } - }, - "assert": { - "result": "&result", - "data": [ - { - "insert": "expected.files", - "documents": [ - { - "_id": "*result", - "length": 5, - "chunkSize": 4, - "uploadDate": "*actual", - "md5": "283d4fea5dded59cf837d3047328f5af", - "filename": "filename" - } - ] - }, - { - "insert": "expected.chunks", - "documents": [ - { - "_id": "*actual", - "files_id": "*result", - "n": 0, - "data": { - "$hex": "11223344" - } - }, - { - "_id": "*actual", - "files_id": "*result", - "n": 1, - "data": { - "$hex": "55" - } - } - ] - } - ] - } - }, - { - "description": "Upload when length is 8", - "act": { - "operation": "upload", - "arguments": { - "filename": "filename", - "source": { - "$hex": "1122334455667788" - }, - "options": { - "chunkSizeBytes": 4 - } - } - }, - "assert": { - "result": "&result", - "data": [ - { - "insert": "expected.files", - "documents": [ - { - "_id": "*result", - "length": 8, - "chunkSize": 4, - "uploadDate": "*actual", - "md5": "dd254cdc958e53abaa67da9f797125f5", - "filename": "filename" - } - ] - }, - { - "insert": "expected.chunks", - "documents": [ - { - "_id": "*actual", - "files_id": "*result", - "n": 0, - "data": { - "$hex": "11223344" - } - }, - { - "_id": "*actual", - "files_id": "*result", - "n": 1, - "data": { - "$hex": "55667788" - } - } - ] - } - ] - } - }, - { - "description": "Upload when contentType is provided", - "act": { - "operation": "upload", - "arguments": { - "filename": "filename", - "source": { - "$hex": "11" - }, - "options": { - "chunkSizeBytes": 4, - "contentType": "image/jpeg" - } - } - }, - "assert": { - "result": "&result", - "data": [ - { - "insert": "expected.files", - "documents": [ - { - "_id": "*result", - "length": 1, - "chunkSize": 4, - "uploadDate": "*actual", - "md5": "47ed733b8d10be225eceba344d533586", - "filename": "filename", - "contentType": "image/jpeg" - } - ] - }, - { - "insert": "expected.chunks", - "documents": [ - { - "_id": "*actual", - "files_id": "*result", - "n": 0, - "data": { - "$hex": "11" - } - } - ] - } - ] - } - }, - { - "description": "Upload when metadata is provided", - "act": { - "operation": "upload", - "arguments": { - "filename": "filename", - "source": { - "$hex": "11" - }, - "options": { - "chunkSizeBytes": 4, - "metadata": { - "x": 1 - } - } - } - }, - "assert": { - "result": "&result", - "data": [ - { - "insert": "expected.files", - "documents": [ - { - "_id": "*result", - "length": 1, - "chunkSize": 4, - "uploadDate": "*actual", - "md5": "47ed733b8d10be225eceba344d533586", - "filename": "filename", - "metadata": { - "x": 1 - } - } - ] - }, - { - "insert": "expected.chunks", - "documents": [ - { - "_id": "*actual", - "files_id": "*result", - "n": 0, - "data": { - "$hex": "11" - } - } - ] - } - ] - } - } - ] -} \ No newline at end of file diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/BSONArrayTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/BSONArrayTest.php deleted file mode 100644 index 9f4191e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/BSONArrayTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Model\BSONArray; -use MongoDB\Model\BSONDocument; - -class BSONArrayTest extends TestCase -{ - public function testBsonSerializeReindexesKeys() - { - $data = [0 => 'foo', 2 => 'bar']; - - $array = new BSONArray($data); - $this->assertSame($data, $array->getArrayCopy()); - $this->assertSame(['foo', 'bar'], $array->bsonSerialize()); - } - - public function testJsonSerialize() - { - $document = new BSONArray([ - 'foo', - new BSONArray(['foo' => 1, 'bar' => 2, 'baz' => 3]), - new BSONDocument(['foo' => 1, 'bar' => 2, 'baz' => 3]), - new BSONArray([new BSONArray([new BSONArray])]), - ]); - - $expectedJson = '["foo",[1,2,3],{"foo":1,"bar":2,"baz":3},[[[]]]]'; - - $this->assertSame($expectedJson, json_encode($document)); - } - - public function testJsonSerializeReindexesKeys() - { - $data = [0 => 'foo', 2 => 'bar']; - - $array = new BSONArray($data); - $this->assertSame($data, $array->getArrayCopy()); - $this->assertSame(['foo', 'bar'], $array->jsonSerialize()); - } - - public function testSetState() - { - $data = ['foo', 'bar']; - - $array = BSONArray::__set_state($data); - $this->assertInstanceOf('MongoDB\Model\BSONArray', $array); - $this->assertSame($data, $array->getArrayCopy()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/BSONDocumentTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/BSONDocumentTest.php deleted file mode 100644 index 2f13e2f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/BSONDocumentTest.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Model\BSONArray; -use MongoDB\Model\BSONDocument; -use ArrayObject; - -class BSONDocumentTest extends TestCase -{ - public function testConstructorDefaultsToPropertyAccess() - { - $document = new BSONDocument(['foo' => 'bar']); - $this->assertEquals(ArrayObject::ARRAY_AS_PROPS, $document->getFlags()); - $this->assertSame('bar', $document->foo); - } - - public function testBsonSerializeCastsToObject() - { - $data = [0 => 'foo', 2 => 'bar']; - - $document = new BSONDocument($data); - $this->assertSame($data, $document->getArrayCopy()); - $this->assertEquals((object) [0 => 'foo', 2 => 'bar'], $document->bsonSerialize()); - } - - public function testJsonSerialize() - { - $document = new BSONDocument([ - 'foo' => 'bar', - 'array' => new BSONArray([1, 2, 3]), - 'object' => new BSONDocument([1, 2, 3]), - 'nested' => new BSONDocument([new BSONDocument([new BSONDocument])]), - ]); - - $expectedJson = '{"foo":"bar","array":[1,2,3],"object":{"0":1,"1":2,"2":3},"nested":{"0":{"0":{}}}}'; - - $this->assertSame($expectedJson, json_encode($document)); - } - - public function testJsonSerializeCastsToObject() - { - $data = [0 => 'foo', 2 => 'bar']; - - $document = new BSONDocument($data); - $this->assertSame($data, $document->getArrayCopy()); - $this->assertEquals((object) [0 => 'foo', 2 => 'bar'], $document->jsonSerialize()); - } - - public function testSetState() - { - $data = ['foo' => 'bar']; - - $document = BSONDocument::__set_state($data); - $this->assertInstanceOf('MongoDB\Model\BSONDocument', $document); - $this->assertSame($data, $document->getArrayCopy()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/CollectionInfoTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/CollectionInfoTest.php deleted file mode 100644 index 4cef402..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/CollectionInfoTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Model\CollectionInfo; -use MongoDB\Tests\TestCase; - -class CollectionInfoTest extends TestCase -{ - public function testGetName() - { - $info = new CollectionInfo(['name' => 'foo']); - $this->assertSame('foo', $info->getName()); - } - - public function testGetOptions() - { - $info = new CollectionInfo(['name' => 'foo']); - $this->assertSame([], $info->getOptions()); - - $info = new CollectionInfo(['name' => 'foo', 'options' => ['capped' => true, 'size' => 1048576]]); - $this->assertSame(['capped' => true, 'size' => 1048576], $info->getOptions()); - } - - public function testCappedCollectionMethods() - { - $info = new CollectionInfo(['name' => 'foo']); - $this->assertFalse($info->isCapped()); - $this->assertNull($info->getCappedMax()); - $this->assertNull($info->getCappedSize()); - - $info = new CollectionInfo(['name' => 'foo', 'options' => ['capped' => true, 'size' => 1048576]]); - $this->assertTrue($info->isCapped()); - $this->assertNull($info->getCappedMax()); - $this->assertSame(1048576, $info->getCappedSize()); - - $info = new CollectionInfo(['name' => 'foo', 'options' => ['capped' => true, 'size' => 1048576, 'max' => 100]]); - $this->assertTrue($info->isCapped()); - $this->assertSame(100, $info->getCappedMax()); - $this->assertSame(1048576, $info->getCappedSize()); - } - - public function testDebugInfo() - { - $expectedInfo = [ - 'name' => 'foo', - 'options' => ['capped' => true, 'size' => 1048576], - ]; - - $info = new CollectionInfo($expectedInfo); - $this->assertSame($expectedInfo, $info->__debugInfo()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/DatabaseInfoTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/DatabaseInfoTest.php deleted file mode 100644 index 3e779c2..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/DatabaseInfoTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Model\DatabaseInfo; -use MongoDB\Tests\TestCase; - -class DatabaseInfoTest extends TestCase -{ - public function testGetName() - { - $info = new DatabaseInfo(['name' => 'foo']); - $this->assertSame('foo', $info->getName()); - } - - public function testGetSizeOnDisk() - { - $info = new DatabaseInfo(['sizeOnDisk' => 1048576]); - $this->assertSame(1048576, $info->getSizeOnDisk()); - } - - public function testIsEmpty() - { - $info = new DatabaseInfo(['empty' => false]); - $this->assertFalse($info->isEmpty()); - - $info = new DatabaseInfo(['empty' => true]); - $this->assertTrue($info->isEmpty()); - } - - public function testDebugInfo() - { - $expectedInfo = [ - 'name' => 'foo', - 'sizeOnDisk' => 1048576, - 'empty' => false, - ]; - - $info = new DatabaseInfo($expectedInfo); - $this->assertSame($expectedInfo, $info->__debugInfo()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/IndexInfoTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/IndexInfoTest.php deleted file mode 100644 index 1aa5f11..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/IndexInfoTest.php +++ /dev/null @@ -1,145 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Model\IndexInfo; -use MongoDB\Tests\TestCase; - -class IndexInfoTest extends TestCase -{ - public function testBasicIndex() - { - $info = new IndexInfo([ - 'v' => 1, - 'key' => ['x' => 1], - 'name' => 'x_1', - 'ns' => 'foo.bar', - ]); - - $this->assertSame(1, $info->getVersion()); - $this->assertSame(['x' => 1], $info->getKey()); - $this->assertSame('x_1', $info->getName()); - $this->assertSame('foo.bar', $info->getNamespace()); - $this->assertFalse($info->isSparse()); - $this->assertFalse($info->isTtl()); - $this->assertFalse($info->isUnique()); - } - - public function testSparseIndex() - { - $info = new IndexInfo([ - 'v' => 1, - 'key' => ['y' => 1], - 'name' => 'y_sparse', - 'ns' => 'foo.bar', - 'sparse' => true, - ]); - - $this->assertSame(1, $info->getVersion()); - $this->assertSame(['y' => 1], $info->getKey()); - $this->assertSame('y_sparse', $info->getName()); - $this->assertSame('foo.bar', $info->getNamespace()); - $this->assertTrue($info->isSparse()); - $this->assertFalse($info->isTtl()); - $this->assertFalse($info->isUnique()); - } - - public function testUniqueIndex() - { - $info = new IndexInfo([ - 'v' => 1, - 'key' => ['z' => 1], - 'name' => 'z_unique', - 'ns' => 'foo.bar', - 'unique' => true, - ]); - - $this->assertSame(1, $info->getVersion()); - $this->assertSame(['z' => 1], $info->getKey()); - $this->assertSame('z_unique', $info->getName()); - $this->assertSame('foo.bar', $info->getNamespace()); - $this->assertFalse($info->isSparse()); - $this->assertFalse($info->isTtl()); - $this->assertTrue($info->isUnique()); - } - - public function testTtlIndex() - { - $info = new IndexInfo([ - 'v' => 1, - 'key' => ['z' => 1], - 'name' => 'z_unique', - 'ns' => 'foo.bar', - 'expireAfterSeconds' => 100, - ]); - - $this->assertSame(1, $info->getVersion()); - $this->assertSame(['z' => 1], $info->getKey()); - $this->assertSame('z_unique', $info->getName()); - $this->assertSame('foo.bar', $info->getNamespace()); - $this->assertFalse($info->isSparse()); - $this->assertTrue($info->isTtl()); - $this->assertFalse($info->isUnique()); - $this->assertTrue(isset($info['expireAfterSeconds'])); - $this->assertSame(100, $info['expireAfterSeconds']); - } - - public function testDebugInfo() - { - $expectedInfo = [ - 'v' => 1, - 'key' => ['x' => 1], - 'name' => 'x_1', - 'ns' => 'foo.bar', - ]; - - $info = new IndexInfo($expectedInfo); - $this->assertSame($expectedInfo, $info->__debugInfo()); - } - - public function testImplementsArrayAccess() - { - $info = new IndexInfo([ - 'v' => 1, - 'key' => ['x' => 1], - 'name' => 'x_1', - 'ns' => 'foo.bar', - ]); - - $this->assertInstanceOf('ArrayAccess', $info); - $this->assertTrue(isset($info['name'])); - $this->assertSame('x_1', $info['name']); - } - - /** - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessage MongoDB\Model\IndexInfo is immutable - */ - public function testOffsetSetCannotBeCalled() - { - $info = new IndexInfo([ - 'v' => 1, - 'key' => ['x' => 1], - 'name' => 'x_1', - 'ns' => 'foo.bar', - ]); - - $info['v'] = 2; - } - - /** - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessage MongoDB\Model\IndexInfo is immutable - */ - public function testOffsetUnsetCannotBeCalled() - { - $info = new IndexInfo([ - 'v' => 1, - 'key' => ['x' => 1], - 'name' => 'x_1', - 'ns' => 'foo.bar', - ]); - - unset($info['v']); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/IndexInputTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/IndexInputTest.php deleted file mode 100644 index 35df36c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Model/IndexInputTest.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Model\IndexInput; -use MongoDB\Tests\TestCase; -use stdClass; - -class IndexInputTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - */ - public function testConstructorShouldRequireKey() - { - new IndexInput([]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - */ - public function testConstructorShouldRequireKeyToBeArrayOrObject() - { - new IndexInput(['key' => 'foo']); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidFieldOrderValues - */ - public function testConstructorShouldRequireKeyFieldOrderToBeNumericOrString($order) - { - new IndexInput(['key' => ['x' => $order]]); - } - - public function provideInvalidFieldOrderValues() - { - return $this->wrapValuesForDataProvider([true, [], new stdClass]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - */ - public function testConstructorShouldRequireNamespace() - { - new IndexInput(['key' => ['x' => 1]]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - */ - public function testConstructorShouldRequireNamespaceToBeString() - { - new IndexInput(['key' => ['x' => 1], 'ns' => 1]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - */ - public function testConstructorShouldRequireNameToBeString() - { - new IndexInput(['key' => ['x' => 1], 'ns' => 'foo.bar', 'name' => 1]); - } - - /** - * @dataProvider provideExpectedNameAndKey - */ - public function testNameGeneration($expectedName, array $key) - { - $this->assertSame($expectedName, (string) new IndexInput(['key' => $key, 'ns' => 'foo.bar'])); - } - - public function provideExpectedNameAndKey() - { - return [ - ['x_1', ['x' => 1]], - ['x_1_y_-1', ['x' => 1, 'y' => -1]], - ['loc_2dsphere', ['loc' => '2dsphere']], - ['loc_2dsphere_x_1', ['loc' => '2dsphere', 'x' => 1]], - ['doc_text', ['doc' => 'text']], - ]; - } - - public function testBsonSerialization() - { - $expected = [ - 'key' => ['x' => 1], - 'ns' => 'foo.bar', - 'name' => 'x_1', - ]; - - $indexInput = new IndexInput([ - 'key' => ['x' => 1], - 'ns' => 'foo.bar', - ]); - - $this->assertInstanceOf('MongoDB\BSON\Serializable', $indexInput); - $this->assertEquals($expected, $indexInput->bsonSerialize()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/AggregateFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/AggregateFunctionalTest.php deleted file mode 100644 index 5a61ffd..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/AggregateFunctionalTest.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Driver\BulkWrite; -use MongoDB\Operation\Aggregate; - -class AggregateFunctionalTest extends FunctionalTestCase -{ - private static $wireVersionForCursor = 2; - - /** - * @expectedException MongoDB\Driver\Exception\RuntimeException - */ - public function testUnrecognizedPipelineState() - { - $operation = new Aggregate($this->getDatabaseName(), $this->getCollectionName(), [['$foo' => 1]]); - $operation->execute($this->getPrimaryServer()); - } - - /** - * @dataProvider provideTypeMapOptionsAndExpectedDocument - */ - public function testTypeMapOption(array $typeMap = null, array $expectedDocuments) - { - $this->createFixtures(3); - - $pipeline = [['$match' => ['_id' => ['$ne' => 2]]]]; - $operation = new Aggregate($this->getDatabaseName(), $this->getCollectionName(), $pipeline, ['typeMap' => $typeMap]); - $results = iterator_to_array($operation->execute($this->getPrimaryServer())); - - $this->assertEquals($expectedDocuments, $results); - } - - public function provideTypeMapOptionsAndExpectedDocument() - { - return [ - [ - null, - [ - (object) ['_id' => 1, 'x' => (object) ['foo' => 'bar']], - (object) ['_id' => 3, 'x' => (object) ['foo' => 'bar']], - ], - ], - [ - ['root' => 'array', 'document' => 'array'], - [ - ['_id' => 1, 'x' => ['foo' => 'bar']], - ['_id' => 3, 'x' => ['foo' => 'bar']], - ], - ], - [ - ['root' => 'object', 'document' => 'array'], - [ - (object) ['_id' => 1, 'x' => ['foo' => 'bar']], - (object) ['_id' => 3, 'x' => ['foo' => 'bar']], - ], - ], - [ - ['root' => 'array', 'document' => 'stdClass'], - [ - ['_id' => 1, 'x' => (object) ['foo' => 'bar']], - ['_id' => 3, 'x' => (object) ['foo' => 'bar']], - ], - ], - ]; - } - - /** - * Create data fixtures. - * - * @param integer $n - */ - private function createFixtures($n) - { - $bulkWrite = new BulkWrite(['ordered' => true]); - - for ($i = 1; $i <= $n; $i++) { - $bulkWrite->insert([ - '_id' => $i, - 'x' => (object) ['foo' => 'bar'], - ]); - } - - $result = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - - $this->assertEquals($n, $result->getInsertedCount()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/AggregateTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/AggregateTest.php deleted file mode 100644 index e9ab490..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/AggregateTest.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\Aggregate; - -class AggregateTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage $pipeline is empty - */ - public function testConstructorPipelineArgumentMustNotBeEmpty() - { - new Aggregate($this->getDatabaseName(), $this->getCollectionName(), []); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage $pipeline is not a list (unexpected index: "1") - */ - public function testConstructorPipelineArgumentMustBeAList() - { - new Aggregate($this->getDatabaseName(), $this->getCollectionName(), [1 => ['$match' => ['x' => 1]]]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new Aggregate($this->getDatabaseName(), $this->getCollectionName(), [['$match' => ['x' => 1]]], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['allowDiskUse' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['batchSize' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['bypassDocumentValidation' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['collation' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['maxTimeMS' => $value]; - } - - foreach ($this->getInvalidReadConcernValues() as $value) { - $options[][] = ['readConcern' => $value]; - } - - foreach ($this->getInvalidReadPreferenceValues() as $value) { - $options[][] = ['readPreference' => $value]; - } - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['useCursor' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage "batchSize" option should not be used if "useCursor" is false - */ - public function testConstructorBatchSizeOptionRequiresUseCursor() - { - new Aggregate( - $this->getDatabaseName(), - $this->getCollectionName(), - [['$match' => ['x' => 1]]], - ['batchSize' => 100, 'useCursor' => false] - ); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage "typeMap" option should not be used if "useCursor" is false - */ - public function testConstructorTypeMapOptionRequiresUseCursor() - { - new Aggregate( - $this->getDatabaseName(), - $this->getCollectionName(), - [['$match' => ['x' => 1]]], - ['typeMap' => ['root' => 'array'], 'useCursor' => false] - ); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/BulkWriteFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/BulkWriteFunctionalTest.php deleted file mode 100644 index cbd5aac..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/BulkWriteFunctionalTest.php +++ /dev/null @@ -1,308 +0,0 @@ -<?php - -namespace MongoDB\Tests\Collection; - -use MongoDB\BulkWriteResult; -use MongoDB\Driver\BulkWrite as Bulk; -use MongoDB\Driver\WriteConcern; -use MongoDB\Model\BSONDocument; -use MongoDB\Operation\BulkWrite; - -class BulkWriteFunctionalTest extends FunctionalTestCase -{ - private $omitModifiedCount; - - public function setUp() - { - parent::setUp(); - - $this->omitModifiedCount = version_compare($this->getServerVersion(), '2.6.0', '<'); - } - - public function testInserts() - { - $ops = [ - ['insertOne' => [['_id' => 1, 'x' => 11]]], - ['insertOne' => [['x' => 22]]], - ['insertOne' => [(object) ['_id' => 'foo', 'x' => 33]]], - ['insertOne' => [new BSONDocument(['_id' => 'bar', 'x' => 44])]], - ]; - - $operation = new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), $ops); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\BulkWriteResult', $result); - $this->assertSame(4, $result->getInsertedCount()); - - $insertedIds = $result->getInsertedIds(); - $this->assertSame(1, $insertedIds[0]); - $this->assertInstanceOf('MongoDB\BSON\ObjectId', $insertedIds[1]); - $this->assertSame('foo', $insertedIds[2]); - $this->assertSame('bar', $insertedIds[3]); - - $expected = [ - ['_id' => 1, 'x' => 11], - ['_id' => $insertedIds[1], 'x' => 22], - ['_id' => 'foo', 'x' => 33], - ['_id' => 'bar', 'x' => 44], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testUpdates() - { - $this->createFixtures(4); - - $ops = [ - ['updateOne' => [['_id' => 2], ['$inc' => ['x' => 1]]]], - ['updateMany' => [['_id' => ['$gt' => 2]], ['$inc' => ['x' => -1]]]], - ['updateOne' => [['_id' => 5], ['$set' => ['x' => 55]], ['upsert' => true]]], - ['updateOne' => [['x' => 66], ['$set' => ['x' => 66]], ['upsert' => true]]], - ['updateMany' => [['x' => ['$gt' => 50]], ['$inc' => ['x' => 1]]]], - ]; - - $operation = new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), $ops); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\BulkWriteResult', $result); - $this->assertSame(5, $result->getMatchedCount()); - $this->omitModifiedCount or $this->assertSame(5, $result->getModifiedCount()); - $this->assertSame(2, $result->getUpsertedCount()); - - $upsertedIds = $result->getUpsertedIds(); - $this->assertSame(5, $upsertedIds[2]); - $this->assertInstanceOf('MongoDB\BSON\ObjectId', $upsertedIds[3]); - - $expected = [ - ['_id' => 1, 'x' => 11], - ['_id' => 2, 'x' => 23], - ['_id' => 3, 'x' => 32], - ['_id' => 4, 'x' => 43], - ['_id' => 5, 'x' => 56], - ['_id' => $upsertedIds[3], 'x' => 67], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testDeletes() - { - $this->createFixtures(4); - - $ops = [ - ['deleteOne' => [['_id' => 1]]], - ['deleteMany' => [['_id' => ['$gt' => 2]]]], - ]; - - $operation = new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), $ops); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\BulkWriteResult', $result); - $this->assertSame(3, $result->getDeletedCount()); - - $expected = [ - ['_id' => 2, 'x' => 22], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testMixedOrderedOperations() - { - $this->createFixtures(3); - - $ops = [ - ['updateOne' => [['_id' => ['$gt' => 1]], ['$inc' => ['x' => 1]]]], - ['updateMany' => [['_id' => ['$gt' => 1]], ['$inc' => ['x' => 1]]]], - ['insertOne' => [['_id' => 4, 'x' => 44]]], - ['deleteMany' => [['x' => ['$nin' => [24, 34]]]]], - ['replaceOne' => [['_id' => 4], ['_id' => 4, 'x' => 44], ['upsert' => true]]], - ]; - - $operation = new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), $ops); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\BulkWriteResult', $result); - - $this->assertSame(1, $result->getInsertedCount()); - $this->assertSame([2 => 4], $result->getInsertedIds()); - - $this->assertSame(3, $result->getMatchedCount()); - $this->omitModifiedCount or $this->assertSame(3, $result->getModifiedCount()); - $this->assertSame(1, $result->getUpsertedCount()); - $this->assertSame([4 => 4], $result->getUpsertedIds()); - - $this->assertSame(2, $result->getDeletedCount()); - - $expected = [ - ['_id' => 2, 'x' => 24], - ['_id' => 3, 'x' => 34], - ['_id' => 4, 'x' => 44], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testUnacknowledgedWriteConcern() - { - $ops = [['insertOne' => [['_id' => 1]]]]; - $options = ['writeConcern' => new WriteConcern(0)]; - $operation = new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), $ops, $options); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertFalse($result->isAcknowledged()); - - return $result; - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesDeletedCount(BulkWriteResult $result) - { - $result->getDeletedCount(); - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesInsertCount(BulkWriteResult $result) - { - $result->getInsertedCount(); - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesMatchedCount(BulkWriteResult $result) - { - $result->getMatchedCount(); - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesModifiedCount(BulkWriteResult $result) - { - $result->getModifiedCount(); - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesUpsertedCount(BulkWriteResult $result) - { - $result->getUpsertedCount(); - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesUpsertedIds(BulkWriteResult $result) - { - $result->getUpsertedIds(); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Unknown operation type "foo" in $operations[0] - */ - public function testUnknownOperation() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - ['foo' => [['_id' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Missing (first|second) argument for \$operations\[\d+\]\["\w+\"]/ - * @dataProvider provideOpsWithMissingArguments - */ - public function testMissingArguments(array $ops) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), $ops); - } - - public function provideOpsWithMissingArguments() - { - return [ - [[['insertOne' => []]]], - [[['updateOne' => []]]], - [[['updateOne' => [['_id' => 1]]]]], - [[['updateMany' => []]]], - [[['updateMany' => [['_id' => 1]]]]], - [[['replaceOne' => []]]], - [[['replaceOne' => [['_id' => 1]]]]], - [[['deleteOne' => []]]], - [[['deleteMany' => []]]], - ]; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $operations[0]["updateOne"][1] is not an update operator - */ - public function testUpdateOneRequiresUpdateOperators() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - ['updateOne' => [['_id' => 1], ['x' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $operations[0]["updateMany"][1] is not an update operator - */ - public function testUpdateManyRequiresUpdateOperators() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - ['updateMany' => [['_id' => ['$gt' => 1]], ['x' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $operations[0]["replaceOne"][1] is an update operator - */ - public function testReplaceOneRequiresReplacementDocument() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - ['replaceOne' => [['_id' => 1], ['$inc' => ['x' => 1]]]], - ]); - } - - /** - * Create data fixtures. - * - * @param integer $n - */ - private function createFixtures($n) - { - $bulkWrite = new Bulk(['ordered' => true]); - - for ($i = 1; $i <= $n; $i++) { - $bulkWrite->insert([ - '_id' => $i, - 'x' => (integer) ($i . $i), - ]); - } - - $result = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - - $this->assertEquals($n, $result->getInsertedCount()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/BulkWriteTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/BulkWriteTest.php deleted file mode 100644 index 7fc73b8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/BulkWriteTest.php +++ /dev/null @@ -1,432 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\BulkWrite; - -class BulkWriteTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage $operations is empty - */ - public function testOperationsMustNotBeEmpty() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), []); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage $operations is not a list (unexpected index: "1") - */ - public function testOperationsMustBeAList() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - 1 => [BulkWrite::INSERT_ONE => [['x' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Expected one element in $operation[0], actually: 2 - */ - public function testMultipleOperationsInOneElement() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [ - BulkWrite::INSERT_ONE => [['x' => 1]], - BulkWrite::DELETE_ONE => [['x' => 1]], - ], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Unknown operation type "foo" in $operations[0] - */ - public function testUnknownOperation() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - ['foo' => [['_id' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Missing first argument for $operations[0]["insertOne"] - */ - public function testInsertOneDocumentArgumentMissing() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::INSERT_ONE => []], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["insertOne"\]\[0\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testInsertOneDocumentArgumentTypeCheck($document) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::INSERT_ONE => [$document]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Missing first argument for $operations[0]["deleteMany"] - */ - public function testDeleteManyFilterArgumentMissing() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::DELETE_MANY => []], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["deleteMany"\]\[0\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testDeleteManyFilterArgumentTypeCheck($document) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::DELETE_MANY => [$document]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["deleteMany"\]\[1\]\["collation"\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testDeleteManyCollationOptionTypeCheck($collation) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::DELETE_MANY => [['x' => 1], ['collation' => $collation]]], - ]); - } - - public function provideInvalidDocumentValues() - { - return $this->wrapValuesForDataProvider($this->getInvalidDocumentValues()); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Missing first argument for $operations[0]["deleteOne"] - */ - public function testDeleteOneFilterArgumentMissing() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::DELETE_ONE => []], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["deleteOne"\]\[0\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testDeleteOneFilterArgumentTypeCheck($document) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::DELETE_ONE => [$document]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["deleteOne"\]\[1\]\["collation"\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testDeleteOneCollationOptionTypeCheck($collation) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::DELETE_ONE => [['x' => 1], ['collation' => $collation]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Missing first argument for $operations[0]["replaceOne"] - */ - public function testReplaceOneFilterArgumentMissing() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::REPLACE_ONE => []], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["replaceOne"\]\[0\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testReplaceOneFilterArgumentTypeCheck($filter) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::REPLACE_ONE => [$filter, ['y' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Missing second argument for $operations[0]["replaceOne"] - */ - public function testReplaceOneReplacementArgumentMissing() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::REPLACE_ONE => [['x' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["replaceOne"\]\[1\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testReplaceOneReplacementArgumentTypeCheck($replacement) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::REPLACE_ONE => [['x' => 1], $replacement]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $operations[0]["replaceOne"][1] is an update operator - */ - public function testReplaceOneReplacementArgumentRequiresNoOperators() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::REPLACE_ONE => [['_id' => 1], ['$inc' => ['x' => 1]]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["replaceOne"\]\[2\]\["collation"\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testReplaceOneCollationOptionTypeCheck($collation) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::REPLACE_ONE => [['x' => 1], ['y' => 1], ['collation' => $collation]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["replaceOne"\]\[2\]\["upsert"\] to have type "boolean" but found "[\w ]+"/ - * @dataProvider provideInvalidBooleanValues - */ - public function testReplaceOneUpsertOptionTypeCheck($upsert) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::REPLACE_ONE => [['x' => 1], ['y' => 1], ['upsert' => $upsert]]], - ]); - } - - public function provideInvalidBooleanValues() - { - return $this->wrapValuesForDataProvider($this->getInvalidBooleanValues()); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Missing first argument for $operations[0]["updateMany"] - */ - public function testUpdateManyFilterArgumentMissing() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_MANY => []], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["updateMany"\]\[0\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testUpdateManyFilterArgumentTypeCheck($filter) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_MANY => [$filter, ['$set' => ['x' => 1]]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Missing second argument for $operations[0]["updateMany"] - */ - public function testUpdateManyUpdateArgumentMissing() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_MANY => [['x' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["updateMany"\]\[1\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testUpdateManyUpdateArgumentTypeCheck($update) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_MANY => [['x' => 1], $update]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $operations[0]["updateMany"][1] is not an update operator - */ - public function testUpdateManyUpdateArgumentRequiresOperators() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_MANY => [['_id' => ['$gt' => 1]], ['x' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["updateMany"\]\[2\]\["collation"\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testUpdateManyCollationOptionTypeCheck($collation) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_MANY => [['x' => 1], ['$set' => ['x' => 1]], ['collation' => $collation]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["updateMany"\]\[2\]\["upsert"\] to have type "boolean" but found "[\w ]+"/ - * @dataProvider provideInvalidBooleanValues - */ - public function testUpdateManyUpsertOptionTypeCheck($upsert) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_MANY => [['x' => 1], ['$set' => ['x' => 1]], ['upsert' => $upsert]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Missing first argument for $operations[0]["updateOne"] - */ - public function testUpdateOneFilterArgumentMissing() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_ONE => []], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["updateOne"\]\[0\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testUpdateOneFilterArgumentTypeCheck($filter) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_ONE => [$filter, ['$set' => ['x' => 1]]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage Missing second argument for $operations[0]["updateOne"] - */ - public function testUpdateOneUpdateArgumentMissing() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_ONE => [['x' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["updateOne"\]\[1\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testUpdateOneUpdateArgumentTypeCheck($update) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_ONE => [['x' => 1], $update]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $operations[0]["updateOne"][1] is not an update operator - */ - public function testUpdateOneUpdateArgumentRequiresOperators() - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_ONE => [['_id' => 1], ['x' => 1]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["updateOne"\]\[2\]\["collation"\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testUpdateOneCollationOptionTypeCheck($collation) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_ONE => [['x' => 1], ['$set' => ['x' => 1]], ['collation' => $collation]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$operations\[0\]\["updateOne"\]\[2\]\["upsert"\] to have type "boolean" but found "[\w ]+"/ - * @dataProvider provideInvalidBooleanValues - */ - public function testUpdateOneUpsertOptionTypeCheck($upsert) - { - new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [ - [BulkWrite::UPDATE_ONE => [['x' => 1], ['$set' => ['x' => 1]], ['upsert' => $upsert]]], - ]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new BulkWrite( - $this->getDatabaseName(), - $this->getCollectionName(), - [[BulkWrite::INSERT_ONE => [['x' => 1]]]], - $options - ); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['bypassDocumentValidation' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['ordered' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CountTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CountTest.php deleted file mode 100644 index 1bd52d5..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CountTest.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\Count; - -class CountTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new Count($this->getDatabaseName(), $this->getCollectionName(), $filter); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new Count($this->getDatabaseName(), $this->getCollectionName(), [], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['collation' => $value]; - } - - foreach ($this->getInvalidHintValues() as $value) { - $options[][] = ['hint' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['limit' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['maxTimeMS' => $value]; - } - - foreach ($this->getInvalidReadConcernValues() as $value) { - $options[][] = ['readConcern' => $value]; - } - - foreach ($this->getInvalidReadPreferenceValues() as $value) { - $options[][] = ['readPreference' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['skip' => $value]; - } - - return $options; - } - - private function getInvalidHintValues() - { - return [123, 3.14, true]; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateCollectionTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateCollectionTest.php deleted file mode 100644 index 09cc553..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateCollectionTest.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\CreateCollection; - -class CreateCollectionTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new CreateCollection($this->getDatabaseName(), $this->getCollectionName(), $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['autoIndexId' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['capped' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['collation' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['flags' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['indexOptionDefaults' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['max' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['maxTimeMS' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['size' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['storageEngine' => $value]; - } - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - foreach ($this->getInvalidStringValues() as $value) { - $options[][] = ['validationAction' => $value]; - } - - foreach ($this->getInvalidStringValues() as $value) { - $options[][] = ['validationLevel' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['validator' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateIndexesFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateIndexesFunctionalTest.php deleted file mode 100644 index ba4a672..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateIndexesFunctionalTest.php +++ /dev/null @@ -1,195 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Model\IndexInfo; -use MongoDB\Operation\CreateIndexes; -use MongoDB\Operation\DropIndexes; -use MongoDB\Operation\ListIndexes; -use InvalidArgumentException; - -class CreateIndexesFunctionalTest extends FunctionalTestCase -{ - private static $wireVersionForCommand = 2; - - public function testCreateSparseUniqueIndex() - { - $indexes = [['key' => ['x' => 1], 'sparse' => true, 'unique' => true]]; - - $operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes); - $createdIndexNames = $operation->execute($this->getPrimaryServer()); - - $this->assertSame('x_1', $createdIndexNames[0]); - $this->assertIndexExists('x_1', function(IndexInfo $info) { - $this->assertTrue($info->isSparse()); - $this->assertTrue($info->isUnique()); - $this->assertFalse($info->isTtl()); - }); - } - - public function testCreateCompoundIndex() - { - $indexes = [['key' => ['y' => -1, 'z' => 1]]]; - - $operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes); - $createdIndexNames = $operation->execute($this->getPrimaryServer()); - - $this->assertSame('y_-1_z_1', $createdIndexNames[0]); - $this->assertIndexExists('y_-1_z_1', function(IndexInfo $info) { - $this->assertFalse($info->isSparse()); - $this->assertFalse($info->isUnique()); - $this->assertFalse($info->isTtl()); - }); - } - - public function testCreateGeospatialIndex() - { - $indexes = [['key' => ['g' => '2dsphere', 'z' => 1]]]; - - $operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes); - $createdIndexNames = $operation->execute($this->getPrimaryServer()); - - $this->assertSame('g_2dsphere_z_1', $createdIndexNames[0]); - $this->assertIndexExists('g_2dsphere_z_1', function(IndexInfo $info) { - $this->assertFalse($info->isSparse()); - $this->assertFalse($info->isUnique()); - $this->assertFalse($info->isTtl()); - }); - } - - public function testCreateTTLIndex() - { - $indexes = [['key' => ['t' => 1], 'expireAfterSeconds' => 0, 'name' => 'my_ttl']]; - - $operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes); - $createdIndexNames = $operation->execute($this->getPrimaryServer()); - - $this->assertSame('my_ttl', $createdIndexNames[0]); - $this->assertIndexExists('my_ttl', function(IndexInfo $info) { - $this->assertFalse($info->isSparse()); - $this->assertFalse($info->isUnique()); - $this->assertTrue($info->isTtl()); - }); - } - - public function testCreateIndexes() - { - $expectedNames = ['x_1', 'y_-1_z_1', 'g_2dsphere_z_1', 'my_ttl']; - - $indexes = [ - ['key' => ['x' => 1], 'sparse' => true, 'unique' => true], - ['key' => ['y' => -1, 'z' => 1]], - ['key' => ['g' => '2dsphere', 'z' => 1]], - ['key' => ['t' => 1], 'expireAfterSeconds' => 0, 'name' => 'my_ttl'], - ]; - - $operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes); - $createdIndexNames = $operation->execute($this->getPrimaryServer()); - - $this->assertSame($expectedNames, $createdIndexNames); - - $this->assertIndexExists('x_1', function(IndexInfo $info) { - $this->assertTrue($info->isSparse()); - $this->assertTrue($info->isUnique()); - $this->assertFalse($info->isTtl()); - }); - - $this->assertIndexExists('y_-1_z_1', function(IndexInfo $info) { - $this->assertFalse($info->isSparse()); - $this->assertFalse($info->isUnique()); - $this->assertFalse($info->isTtl()); - }); - - $this->assertIndexExists('g_2dsphere_z_1', function(IndexInfo $info) { - $this->assertFalse($info->isSparse()); - $this->assertFalse($info->isUnique()); - $this->assertFalse($info->isTtl()); - }); - - $this->assertIndexExists('my_ttl', function(IndexInfo $info) { - $this->assertFalse($info->isSparse()); - $this->assertFalse($info->isUnique()); - $this->assertTrue($info->isTtl()); - }); - } - - /** - * @expectedException MongoDB\Driver\Exception\RuntimeException - */ - public function testCreateConflictingIndexesWithCommand() - { - if ( ! \MongoDB\server_supports_feature($this->getPrimaryServer(), self::$wireVersionForCommand)) { - $this->markTestSkipped('createIndexes command is not supported'); - } - - $indexes = [ - ['key' => ['x' => 1], 'sparse' => true, 'unique' => false], - ['key' => ['x' => 1], 'sparse' => false, 'unique' => true], - ]; - - $operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes); - $createdIndexNames = $operation->execute($this->getPrimaryServer()); - } - - public function testCreateConflictingIndexesWithLegacyInsert() - { - if (\MongoDB\server_supports_feature($this->getPrimaryServer(), self::$wireVersionForCommand)) { - $this->markTestSkipped('Index creation does not use legacy insertion'); - } - - $indexes = [ - ['key' => ['x' => 1], 'sparse' => true, 'unique' => false], - ['key' => ['x' => 1], 'sparse' => false, 'unique' => true], - ]; - - $operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes); - $createdIndexNames = $operation->execute($this->getPrimaryServer()); - - /* When creating indexes with legacy insert operations, the server - * ignores conflicting index specifications and leaves the original - * index in place. - */ - $this->assertSame('x_1', $createdIndexNames[0]); - $this->assertIndexExists('x_1', function(IndexInfo $info) { - $this->assertTrue($info->isSparse()); - $this->assertFalse($info->isUnique()); - $this->assertFalse($info->isTtl()); - }); - } - - /** - * Asserts that an index with the given name exists for the collection. - * - * An optional $callback may be provided, which should take an IndexInfo - * argument as its first and only parameter. If an IndexInfo matching the - * given name is found, it will be passed to the callback, which may perform - * additional assertions. - * - * @param string $indexName - * @param callable $callback - */ - private function assertIndexExists($indexName, $callback = null) - { - if ($callback !== null && ! is_callable($callback)) { - throw new InvalidArgumentException('$callback is not a callable'); - } - - $operation = new ListIndexes($this->getDatabaseName(), $this->getCollectionName()); - $indexes = $operation->execute($this->getPrimaryServer()); - - $foundIndex = null; - - foreach ($indexes as $index) { - if ($index->getName() === $indexName) { - $foundIndex = $index; - break; - } - } - - $this->assertNotNull($foundIndex, sprintf('Index %s does not exist', $indexName)); - - if ($callback !== null) { - call_user_func($callback, $foundIndex); - } - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateIndexesTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateIndexesTest.php deleted file mode 100644 index a347fa7..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/CreateIndexesTest.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\CreateIndexes; - -class CreateIndexesTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage $indexes is not a list (unexpected index: "1") - */ - public function testConstructorIndexesArgumentMustBeAList() - { - new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), [1 => ['key' => ['x' => 1]]]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), [['key' => ['x' => 1]]], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage $indexes is empty - */ - public function testConstructorRequiresAtLeastOneIndex() - { - new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), []); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidIndexSpecificationTypes - */ - public function testConstructorRequiresIndexSpecificationsToBeAnArray($index) - { - new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), [$index]); - } - - public function provideInvalidIndexSpecificationTypes() - { - return $this->wrapValuesForDataProvider($this->getInvalidArrayValues()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DatabaseCommandTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DatabaseCommandTest.php deleted file mode 100644 index fddeb3a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DatabaseCommandTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\DatabaseCommand; - -class DatabaseCommandTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorCommandArgumentTypeCheck($command) - { - new DatabaseCommand($this->getDatabaseName(), $command); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new DatabaseCommand($this->getDatabaseName(), ['ping' => 1], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidReadPreferenceValues() as $value) { - $options[][] = ['readPreference' => $value]; - } - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DeleteFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DeleteFunctionalTest.php deleted file mode 100644 index 588083f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DeleteFunctionalTest.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php - -namespace MongoDB\Tests\Collection; - -use MongoDB\DeleteResult; -use MongoDB\Driver\BulkWrite; -use MongoDB\Driver\WriteConcern; -use MongoDB\Operation\Delete; - -class DeleteFunctionalTest extends FunctionalTestCase -{ - public function testDeleteOne() - { - $this->createFixtures(3); - - $filter = ['_id' => 1]; - - $operation = new Delete($this->getDatabaseName(), $this->getCollectionName(), $filter, 1); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\DeleteResult', $result); - $this->assertSame(1, $result->getDeletedCount()); - - $expected = [ - ['_id' => 2, 'x' => 22], - ['_id' => 3, 'x' => 33], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testDeleteMany() - { - $this->createFixtures(3); - - $filter = ['_id' => ['$gt' => 1]]; - - $operation = new Delete($this->getDatabaseName(), $this->getCollectionName(), $filter, 0); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\DeleteResult', $result); - $this->assertSame(2, $result->getDeletedCount()); - - $expected = [ - ['_id' => 1, 'x' => 11], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testUnacknowledgedWriteConcern() - { - $filter = ['_id' => 1]; - $options = ['writeConcern' => new WriteConcern(0)]; - - $operation = new Delete($this->getDatabaseName(), $this->getCollectionName(), $filter, 0, $options); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertFalse($result->isAcknowledged()); - - return $result; - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesDeletedCount(DeleteResult $result) - { - $result->getDeletedCount(); - } - - /** - * Create data fixtures. - * - * @param integer $n - */ - private function createFixtures($n) - { - $bulkWrite = new BulkWrite(['ordered' => true]); - - for ($i = 1; $i <= $n; $i++) { - $bulkWrite->insert([ - '_id' => $i, - 'x' => (integer) ($i . $i), - ]); - } - - $result = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - - $this->assertEquals($n, $result->getInsertedCount()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DeleteTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DeleteTest.php deleted file mode 100644 index 0af26dc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DeleteTest.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\Delete; - -class DeleteTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new Delete($this->getDatabaseName(), $this->getCollectionName(), $filter, 0); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage $limit must be 0 or 1 - * @dataProvider provideInvalidLimitValues - */ - public function testConstructorLimitArgumentMustBeOneOrZero($limit) - { - new Delete($this->getDatabaseName(), $this->getCollectionName(), [], $limit); - } - - public function provideInvalidLimitValues() - { - return $this->wrapValuesForDataProvider(array_merge($this->getInvalidIntegerValues(), [-1, 2])); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new Delete($this->getDatabaseName(), $this->getCollectionName(), [], 1, $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['collation' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DistinctTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DistinctTest.php deleted file mode 100644 index 8d6eec1..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DistinctTest.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\Distinct; - -class DistinctTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new Distinct($this->getDatabaseName(), $this->getCollectionName(), 'x', $filter); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new Distinct($this->getDatabaseName(), $this->getCollectionName(), 'x', [], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['collation' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['maxTimeMS' => $value]; - } - - foreach ($this->getInvalidReadConcernValues() as $value) { - $options[][] = ['readConcern' => $value]; - } - - foreach ($this->getInvalidReadPreferenceValues() as $value) { - $options[][] = ['readPreference' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropCollectionFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropCollectionFunctionalTest.php deleted file mode 100644 index 87e4ce2..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropCollectionFunctionalTest.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\DropCollection; -use MongoDB\Operation\InsertOne; -use MongoDB\Operation\ListCollections; - -class DropCollectionFunctionalTest extends FunctionalTestCase -{ - public function testDropExistingCollection() - { - $server = $this->getPrimaryServer(); - - $insertOne = new InsertOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1]); - $writeResult = $insertOne->execute($server); - $this->assertEquals(1, $writeResult->getInsertedCount()); - - $operation = new DropCollection($this->getDatabaseName(), $this->getCollectionName()); - $operation->execute($server); - - $this->assertCollectionDoesNotExist($this->getCollectionName()); - } - - /** - * @depends testDropExistingCollection - */ - public function testDropNonexistentCollection() - { - $this->assertCollectionDoesNotExist($this->getCollectionName()); - - $operation = new DropCollection($this->getDatabaseName(), $this->getCollectionName()); - $operation->execute($this->getPrimaryServer()); - } - - /** - * Asserts that a collection with the given name does not exist on the - * server. - * - * @param string $collectionName - */ - private function assertCollectionDoesNotExist($collectionName) - { - $operation = new ListCollections($this->getDatabaseName()); - $collections = $operation->execute($this->getPrimaryServer()); - - $foundCollection = null; - - foreach ($collections as $collection) { - if ($collection->getName() === $collectionName) { - $foundCollection = $collection; - break; - } - } - - $this->assertNull($foundCollection, sprintf('Collection %s exists', $collectionName)); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropCollectionTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropCollectionTest.php deleted file mode 100644 index 097fe9f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropCollectionTest.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\DropCollection; - -class DropCollectionTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new DropCollection($this->getDatabaseName(), $this->getCollectionName(), $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropDatabaseFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropDatabaseFunctionalTest.php deleted file mode 100644 index 0aada36..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropDatabaseFunctionalTest.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Driver\Server; -use MongoDB\Operation\DropDatabase; -use MongoDB\Operation\InsertOne; -use MongoDB\Operation\ListDatabases; - -class DropDatabaseFunctionalTest extends FunctionalTestCase -{ - public function testDropExistingDatabase() - { - $server = $this->getPrimaryServer(); - - $insertOne = new InsertOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1]); - $writeResult = $insertOne->execute($server); - $this->assertEquals(1, $writeResult->getInsertedCount()); - - $operation = new DropDatabase($this->getDatabaseName()); - $operation->execute($server); - - $this->assertDatabaseDoesNotExist($server, $this->getDatabaseName()); - } - - /** - * @depends testDropExistingDatabase - */ - public function testDropNonexistentDatabase() - { - $server = $this->getPrimaryServer(); - - $operation = new DropDatabase($this->getDatabaseName()); - $operation->execute($server); - - $this->assertDatabaseDoesNotExist($server, $this->getDatabaseName()); - - $operation = new DropDatabase($this->getDatabaseName()); - $operation->execute($server); - } - - /** - * Asserts that a database with the given name does not exist on the server. - * - * @param Server $server - * @param string $databaseName - */ - private function assertDatabaseDoesNotExist(Server $server, $databaseName) - { - $operation = new ListDatabases(); - $databases = $operation->execute($server); - - $foundDatabase = null; - - foreach ($databases as $database) { - if ($database->getName() === $databaseName) { - $foundDatabase = $database; - break; - } - } - - $this->assertNull($foundDatabase, sprintf('Database %s exists on the server', $databaseName)); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropDatabaseTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropDatabaseTest.php deleted file mode 100644 index 424cf31..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropDatabaseTest.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\DropDatabase; - -class DropDatabaseTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new DropDatabase($this->getDatabaseName(), $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropIndexesFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropIndexesFunctionalTest.php deleted file mode 100644 index 4afd8ab..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropIndexesFunctionalTest.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\CreateIndexes; -use MongoDB\Operation\DropIndexes; -use MongoDB\Operation\ListIndexes; -use InvalidArgumentException; - -class DropIndexesFunctionalTest extends FunctionalTestCase -{ - public function testDropOneIndexByName() - { - $indexes = [['key' => ['x' => 1]]]; - - $operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes); - $createdIndexNames = $operation->execute($this->getPrimaryServer()); - - $this->assertSame('x_1', $createdIndexNames[0]); - $this->assertIndexExists('x_1'); - - $operation = new DropIndexes($this->getDatabaseName(), $this->getCollectionName(), 'x_1'); - $this->assertCommandSucceeded($operation->execute($this->getPrimaryServer())); - - $operation = new ListIndexes($this->getDatabaseName(), $this->getCollectionName()); - $indexes = $operation->execute($this->getPrimaryServer()); - - foreach ($indexes as $index) { - if ($index->getName() === 'x_1') { - $this->fail('The "x_1" index should have been deleted'); - } - } - } - - public function testDropAllIndexesByWildcard() - { - $indexes = [ - ['key' => ['x' => 1]], - ['key' => ['y' => 1]], - ]; - - $operation = new CreateIndexes($this->getDatabaseName(), $this->getCollectionName(), $indexes); - $createdIndexNames = $operation->execute($this->getPrimaryServer()); - - $this->assertSame('x_1', $createdIndexNames[0]); - $this->assertSame('y_1', $createdIndexNames[1]); - $this->assertIndexExists('x_1'); - $this->assertIndexExists('y_1'); - - $operation = new DropIndexes($this->getDatabaseName(), $this->getCollectionName(), '*'); - $this->assertCommandSucceeded($operation->execute($this->getPrimaryServer())); - - $operation = new ListIndexes($this->getDatabaseName(), $this->getCollectionName()); - $indexes = $operation->execute($this->getPrimaryServer()); - - foreach ($indexes as $index) { - if ($index->getName() === 'x_1') { - $this->fail('The "x_1" index should have been deleted'); - } - - if ($index->getName() === 'y_1') { - $this->fail('The "y_1" index should have been deleted'); - } - } - } - - /** - * Asserts that an index with the given name exists for the collection. - * - * An optional $callback may be provided, which should take an IndexInfo - * argument as its first and only parameter. If an IndexInfo matching the - * given name is found, it will be passed to the callback, which may perform - * additional assertions. - * - * @param callable $callback - */ - private function assertIndexExists($indexName, $callback = null) - { - if ($callback !== null && ! is_callable($callback)) { - throw new InvalidArgumentException('$callback is not a callable'); - } - - $operation = new ListIndexes($this->getDatabaseName(), $this->getCollectionName()); - $indexes = $operation->execute($this->getPrimaryServer()); - - $foundIndex = null; - - foreach ($indexes as $index) { - if ($index->getName() === $indexName) { - $foundIndex = $index; - break; - } - } - - $this->assertNotNull($foundIndex, sprintf('Found %s index for the collection', $indexName)); - - if ($callback !== null) { - call_user_func($callback, $foundIndex); - } - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropIndexesTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropIndexesTest.php deleted file mode 100644 index dd1cf8e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/DropIndexesTest.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\DropIndexes; - -class DropIndexesTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - */ - public function testDropIndexShouldNotAllowEmptyIndexName() - { - new DropIndexes($this->getDatabaseName(), $this->getCollectionName(), ''); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new DropIndexes($this->getDatabaseName(), $this->getCollectionName(), '*', $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindAndModifyFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindAndModifyFunctionalTest.php deleted file mode 100644 index 36844ee..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindAndModifyFunctionalTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Driver\BulkWrite; -use MongoDB\Model\BSONDocument; -use MongoDB\Operation\FindAndModify; - -class FindAndModifyFunctionalTest extends FunctionalTestCase -{ - /** - * @dataProvider provideTypeMapOptionsAndExpectedDocument - */ - public function testTypeMapOption(array $typeMap = null, $expectedDocument) - { - $this->createFixtures(1); - - $operation = new FindAndModify( - $this->getDatabaseName(), - $this->getCollectionName(), - [ - 'remove' => true, - 'typeMap' => $typeMap, - ] - ); - $document = $operation->execute($this->getPrimaryServer()); - - $this->assertEquals($expectedDocument, $document); - } - - public function provideTypeMapOptionsAndExpectedDocument() - { - return [ - [ - null, - (object) ['_id' => 1, 'x' => (object) ['foo' => 'bar']], - ], - [ - ['root' => 'array', 'document' => 'array'], - ['_id' => 1, 'x' => ['foo' => 'bar']], - ], - [ - ['root' => 'object', 'document' => 'array'], - (object) ['_id' => 1, 'x' => ['foo' => 'bar']], - ], - [ - ['root' => 'array', 'document' => 'stdClass'], - ['_id' => 1, 'x' => (object) ['foo' => 'bar']], - ], - [ - ['root' => 'MongoDB\Model\BSONDocument', 'document' => 'object'], - new BSONDocument(['_id' => 1, 'x' => (object) ['foo' => 'bar']]), - ], - ]; - } - - /** - * Create data fixtures. - * - * @param integer $n - */ - private function createFixtures($n) - { - $bulkWrite = new BulkWrite(['ordered' => true]); - - for ($i = 1; $i <= $n; $i++) { - $bulkWrite->insert([ - '_id' => $i, - 'x' => (object) ['foo' => 'bar'], - ]); - } - - $result = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - - $this->assertEquals($n, $result->getInsertedCount()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindAndModifyTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindAndModifyTest.php deleted file mode 100644 index 9c8378d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindAndModifyTest.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\FindAndModify; - -class FindAndModifyTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new FindAndModify($this->getDatabaseName(), $this->getCollectionName(), $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['bypassDocumentValidation' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['collation' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['fields' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['maxTimeMS' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['new' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['query' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['remove' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['sort' => $value]; - } - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['update' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['upsert' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage The "remove" option must be true or an "update" document must be specified, but not both - */ - public function testConstructorUpdateAndRemoveOptionsAreMutuallyExclusive() - { - new FindAndModify($this->getDatabaseName(), $this->getCollectionName(), ['remove' => true, 'update' => []]); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindFunctionalTest.php deleted file mode 100644 index 4addf1d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindFunctionalTest.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Driver\BulkWrite; -use MongoDB\Operation\Find; - -class FindFunctionalTest extends FunctionalTestCase -{ - /** - * @dataProvider provideTypeMapOptionsAndExpectedDocuments - */ - public function testTypeMapOption(array $typeMap, array $expectedDocuments) - { - $this->createFixtures(3); - - $operation = new Find($this->getDatabaseName(), $this->getCollectionName(), [], ['typeMap' => $typeMap]); - $cursor = $operation->execute($this->getPrimaryServer()); - - $this->assertEquals($expectedDocuments, $cursor->toArray()); - } - - public function provideTypeMapOptionsAndExpectedDocuments() - { - return [ - [ - ['root' => 'array', 'document' => 'array'], - [ - ['_id' => 1, 'x' => ['foo' => 'bar']], - ['_id' => 2, 'x' => ['foo' => 'bar']], - ['_id' => 3, 'x' => ['foo' => 'bar']], - ], - ], - [ - ['root' => 'object', 'document' => 'array'], - [ - (object) ['_id' => 1, 'x' => ['foo' => 'bar']], - (object) ['_id' => 2, 'x' => ['foo' => 'bar']], - (object) ['_id' => 3, 'x' => ['foo' => 'bar']], - ], - ], - [ - ['root' => 'array', 'document' => 'stdClass'], - [ - ['_id' => 1, 'x' => (object) ['foo' => 'bar']], - ['_id' => 2, 'x' => (object) ['foo' => 'bar']], - ['_id' => 3, 'x' => (object) ['foo' => 'bar']], - ], - ], - ]; - } - - /** - * Create data fixtures. - * - * @param integer $n - */ - private function createFixtures($n) - { - $bulkWrite = new BulkWrite(['ordered' => true]); - - for ($i = 1; $i <= $n; $i++) { - $bulkWrite->insert([ - '_id' => $i, - 'x' => (object) ['foo' => 'bar'], - ]); - } - - $result = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - - $this->assertEquals($n, $result->getInsertedCount()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndDeleteTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndDeleteTest.php deleted file mode 100644 index af04067..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndDeleteTest.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\FindOneAndDelete; - -class FindOneAndDeleteTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new FindOneAndDelete($this->getDatabaseName(), $this->getCollectionName(), $filter); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new FindOneAndDelete($this->getDatabaseName(), $this->getCollectionName(), [], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['projection' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndReplaceTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndReplaceTest.php deleted file mode 100644 index 201b507..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndReplaceTest.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\FindOneAndReplace; - -class FindOneAndReplaceTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new FindOneAndReplace($this->getDatabaseName(), $this->getCollectionName(), $filter, []); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorReplacementArgumentTypeCheck($replacement) - { - new FindOneAndReplace($this->getDatabaseName(), $this->getCollectionName(), [], $replacement); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $replacement argument is an update operator - */ - public function testConstructorReplacementArgumentRequiresNoOperators() - { - new FindOneAndReplace($this->getDatabaseName(), $this->getCollectionName(), [], ['$set' => ['x' => 1]]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new FindOneAndReplace($this->getDatabaseName(), $this->getCollectionName(), [], [], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['projection' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['returnDocument' => $value]; - } - - return $options; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorReturnDocumentOptions - */ - public function testConstructorReturnDocumentOption($returnDocument) - { - new FindOneAndReplace($this->getDatabaseName(), $this->getCollectionName(), [], [], ['returnDocument' => $returnDocument]); - } - - public function provideInvalidConstructorReturnDocumentOptions() - { - return $this->wrapValuesForDataProvider([-1, 0, 3]); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndUpdateTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndUpdateTest.php deleted file mode 100644 index 317ed5c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneAndUpdateTest.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\FindOneAndUpdate; - -class FindOneAndUpdateTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new FindOneAndUpdate($this->getDatabaseName(), $this->getCollectionName(), $filter, []); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorUpdateArgumentTypeCheck($update) - { - new FindOneAndUpdate($this->getDatabaseName(), $this->getCollectionName(), [], $update); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $update argument is not an update operator - */ - public function testConstructorUpdateArgumentRequiresOperators() - { - new FindOneAndUpdate($this->getDatabaseName(), $this->getCollectionName(), [], []); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new FindOneAndUpdate($this->getDatabaseName(), $this->getCollectionName(), [], ['$set' => ['x' => 1]], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['projection' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['returnDocument' => $value]; - } - - return $options; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorReturnDocumentOptions - */ - public function testConstructorReturnDocumentOption($returnDocument) - { - new FindOneAndUpdate($this->getDatabaseName(), $this->getCollectionName(), [], [], ['returnDocument' => $returnDocument]); - } - - public function provideInvalidConstructorReturnDocumentOptions() - { - return $this->wrapValuesForDataProvider([-1, 0, 3]); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneFunctionalTest.php deleted file mode 100644 index 62fac82..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindOneFunctionalTest.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Driver\BulkWrite; -use MongoDB\Operation\FindOne; - -class FindOneFunctionalTest extends FunctionalTestCase -{ - /** - * @dataProvider provideTypeMapOptionsAndExpectedDocument - */ - public function testTypeMapOption(array $typeMap, $expectedDocument) - { - $this->createFixtures(1); - - $operation = new FindOne($this->getDatabaseName(), $this->getCollectionName(), [], ['typeMap' => $typeMap]); - $document = $operation->execute($this->getPrimaryServer()); - - $this->assertEquals($expectedDocument, $document); - } - - public function provideTypeMapOptionsAndExpectedDocument() - { - return [ - [ - ['root' => 'array', 'document' => 'array'], - ['_id' => 1, 'x' => ['foo' => 'bar']], - ], - [ - ['root' => 'object', 'document' => 'array'], - (object) ['_id' => 1, 'x' => ['foo' => 'bar']], - ], - [ - ['root' => 'array', 'document' => 'stdClass'], - ['_id' => 1, 'x' => (object) ['foo' => 'bar']], - ], - ]; - } - - /** - * Create data fixtures. - * - * @param integer $n - */ - private function createFixtures($n) - { - $bulkWrite = new BulkWrite(['ordered' => true]); - - for ($i = 1; $i <= $n; $i++) { - $bulkWrite->insert([ - '_id' => $i, - 'x' => (object) ['foo' => 'bar'], - ]); - } - - $result = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - - $this->assertEquals($n, $result->getInsertedCount()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindTest.php deleted file mode 100644 index dd55b7b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FindTest.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\Find; - -class FindTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new Find($this->getDatabaseName(), $this->getCollectionName(), $filter); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new Find($this->getDatabaseName(), $this->getCollectionName(), [], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['allowPartialResults' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['batchSize' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['collation' => $value]; - } - - foreach ($this->getInvalidStringValues() as $value) { - $options[][] = ['comment' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['cursorType' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['limit' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['maxTimeMS' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['modifiers' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['oplogReplay' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['projection' => $value]; - } - - foreach ($this->getInvalidReadConcernValues() as $value) { - $options[][] = ['readConcern' => $value]; - } - - foreach ($this->getInvalidReadPreferenceValues() as $value) { - $options[][] = ['readPreference' => $value]; - } - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['skip' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['sort' => $value]; - } - - foreach ($this->getInvalidArrayValues() as $value) { - $options[][] = ['typeMap' => $value]; - } - - return $options; - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorCursorTypeOptions - */ - public function testConstructorCursorTypeOption($cursorType) - { - new Find($this->getDatabaseName(), $this->getCollectionName(), [], ['cursorType' => $cursorType]); - } - - public function provideInvalidConstructorCursorTypeOptions() - { - return $this->wrapValuesForDataProvider([-1, 0, 4]); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FunctionalTestCase.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FunctionalTestCase.php deleted file mode 100644 index 146520a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/FunctionalTestCase.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Collection; -use MongoDB\Driver\ReadPreference; -use MongoDB\Operation\DropCollection; -use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase; - -/** - * Base class for Operation functional tests. - */ -abstract class FunctionalTestCase extends BaseFunctionalTestCase -{ - public function setUp() - { - parent::setUp(); - - $operation = new DropCollection($this->getDatabaseName(), $this->getCollectionName()); - $operation->execute($this->getPrimaryServer()); - } - - public function tearDown() - { - if ($this->hasFailed()) { - return; - } - - $operation = new DropCollection($this->getDatabaseName(), $this->getCollectionName()); - $operation->execute($this->getPrimaryServer()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertManyFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertManyFunctionalTest.php deleted file mode 100644 index fb7a535..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertManyFunctionalTest.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -namespace MongoDB\Tests\Collection; - -use MongoDB\InsertManyResult; -use MongoDB\Driver\WriteConcern; -use MongoDB\Model\BSONDocument; -use MongoDB\Operation\InsertMany; - -class InsertManyFunctionalTest extends FunctionalTestCase -{ - public function testInsertMany() - { - $documents = [ - ['_id' => 'foo', 'x' => 11], - ['x' => 22], - (object) ['_id' => 'bar', 'x' => 33], - new BSONDocument(['_id' => 'baz', 'x' => 44]), - ]; - - $operation = new InsertMany($this->getDatabaseName(), $this->getCollectionName(), $documents); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\InsertManyResult', $result); - $this->assertSame(4, $result->getInsertedCount()); - - $insertedIds = $result->getInsertedIds(); - $this->assertSame('foo', $insertedIds[0]); - $this->assertInstanceOf('MongoDB\BSON\ObjectId', $insertedIds[1]); - $this->assertSame('bar', $insertedIds[2]); - $this->assertSame('baz', $insertedIds[3]); - - $expected = [ - ['_id' => 'foo', 'x' => 11], - ['_id' => $insertedIds[1], 'x' => 22], - ['_id' => 'bar', 'x' => 33], - ['_id' => 'baz', 'x' => 44], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testUnacknowledgedWriteConcern() - { - $documents = [['x' => 11]]; - $options = ['writeConcern' => new WriteConcern(0)]; - - $operation = new InsertMany($this->getDatabaseName(), $this->getCollectionName(), $documents, $options); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertFalse($result->isAcknowledged()); - - return $result; - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesInsertedCount(InsertManyResult $result) - { - $result->getInsertedCount(); - } - - /** - * @depends testUnacknowledgedWriteConcern - */ - public function testUnacknowledgedWriteConcernAccessesInsertedId(InsertManyResult $result) - { - $this->assertInstanceOf('MongoDB\BSON\ObjectId', $result->getInsertedIds()[0]); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertManyTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertManyTest.php deleted file mode 100644 index 66fa4ba..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertManyTest.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\InsertMany; - -class InsertManyTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage $documents is empty - */ - public function testConstructorDocumentsMustNotBeEmpty() - { - new InsertMany($this->getDatabaseName(), $this->getCollectionName(), []); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage $documents is not a list (unexpected index: "1") - */ - public function testConstructorDocumentsMustBeAList() - { - new InsertMany($this->getDatabaseName(), $this->getCollectionName(), [1 => ['x' => 1]]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$documents\[0\] to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorDocumentsArgumentElementTypeChecks($document) - { - new InsertMany($this->getDatabaseName(), $this->getCollectionName(), [$document]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new InsertMany($this->getDatabaseName(), $this->getCollectionName(), [['x' => 1]], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['bypassDocumentValidation' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['ordered' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertOneFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertOneFunctionalTest.php deleted file mode 100644 index f7f362c..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertOneFunctionalTest.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -namespace MongoDB\Tests\Collection; - -use MongoDB\InsertOneResult; -use MongoDB\Driver\WriteConcern; -use MongoDB\Model\BSONDocument; -use MongoDB\Operation\InsertOne; - -class InsertOneFunctionalTest extends FunctionalTestCase -{ - /** - * @dataProvider provideDocumentWithExistingId - */ - public function testInsertOneWithExistingId($document) - { - $operation = new InsertOne($this->getDatabaseName(), $this->getCollectionName(), $document); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\InsertOneResult', $result); - $this->assertSame(1, $result->getInsertedCount()); - $this->assertSame('foo', $result->getInsertedId()); - - $expected = [ - ['_id' => 'foo', 'x' => 11], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function provideDocumentWithExistingId() - { - return [ - [['_id' => 'foo', 'x' => 11]], - [(object) ['_id' => 'foo', 'x' => 11]], - [new BSONDocument(['_id' => 'foo', 'x' => 11])], - ]; - } - - public function testInsertOneWithGeneratedId() - { - $document = ['x' => 11]; - - $operation = new InsertOne($this->getDatabaseName(), $this->getCollectionName(), $document); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\InsertOneResult', $result); - $this->assertSame(1, $result->getInsertedCount()); - $this->assertInstanceOf('MongoDB\BSON\ObjectId', $result->getInsertedId()); - - $expected = [ - ['_id' => $result->getInsertedId(), 'x' => 11], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testUnacknowledgedWriteConcern() - { - $document = ['x' => 11]; - $options = ['writeConcern' => new WriteConcern(0)]; - - $operation = new InsertOne($this->getDatabaseName(), $this->getCollectionName(), $document, $options); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertFalse($result->isAcknowledged()); - - return $result; - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesInsertedCount(InsertOneResult $result) - { - $result->getInsertedCount(); - } - - /** - * @depends testUnacknowledgedWriteConcern - */ - public function testUnacknowledgedWriteConcernAccessesInsertedId(InsertOneResult $result) - { - $this->assertInstanceOf('MongoDB\BSON\ObjectId', $result->getInsertedId()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertOneTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertOneTest.php deleted file mode 100644 index ba1ae90..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/InsertOneTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\InsertOne; - -class InsertOneTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorDocumentArgumentTypeCheck($document) - { - new InsertOne($this->getDatabaseName(), $this->getCollectionName(), $document); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new InsertOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['bypassDocumentValidation' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListCollectionsFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListCollectionsFunctionalTest.php deleted file mode 100644 index 4bdb507..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListCollectionsFunctionalTest.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\DropDatabase; -use MongoDB\Operation\InsertOne; -use MongoDB\Operation\ListCollections; - -class ListCollectionsFunctionalTest extends FunctionalTestCase -{ - public function testListCollectionsForNewlyCreatedDatabase() - { - $server = $this->getPrimaryServer(); - - $operation = new DropDatabase($this->getDatabaseName()); - $operation->execute($server); - - $insertOne = new InsertOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1]); - $writeResult = $insertOne->execute($server); - $this->assertEquals(1, $writeResult->getInsertedCount()); - - $operation = new ListCollections($this->getDatabaseName(), ['filter' => ['name' => $this->getCollectionName()]]); - // Convert the CollectionInfoIterator to an array since we cannot rewind its cursor - $collections = iterator_to_array($operation->execute($server)); - - $this->assertCount(1, $collections); - - foreach ($collections as $collection) { - $this->assertInstanceOf('MongoDB\Model\CollectionInfo', $collection); - $this->assertEquals($this->getCollectionName(), $collection->getName()); - } - } - - public function testListCollectionsForNonexistentDatabase() - { - $server = $this->getPrimaryServer(); - - $operation = new DropDatabase($this->getDatabaseName()); - $operation->execute($server); - - $operation = new ListCollections($this->getDatabaseName()); - $collections = $operation->execute($server); - - $this->assertCount(0, $collections); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListDatabasesTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListDatabasesTest.php deleted file mode 100644 index 302676d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListDatabasesTest.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\ListDatabases; - -class ListDatabasesTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new ListDatabases($options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['maxTimeMS' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListIndexesFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListIndexesFunctionalTest.php deleted file mode 100644 index a6cd325..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListIndexesFunctionalTest.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\DropCollection; -use MongoDB\Operation\InsertOne; -use MongoDB\Operation\ListIndexes; - -class ListIndexesFunctionalTest extends FunctionalTestCase -{ - public function testListIndexesForNewlyCreatedCollection() - { - $operation = new DropCollection($this->getDatabaseName(), $this->getCollectionName()); - $operation->execute($this->getPrimaryServer()); - - $insertOne = new InsertOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1]); - $writeResult = $insertOne->execute($this->getPrimaryServer()); - $this->assertEquals(1, $writeResult->getInsertedCount()); - - $operation = new ListIndexes($this->getDatabaseName(), $this->getCollectionName()); - $indexes = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\Model\IndexInfoIterator', $indexes); - - // Convert the CursorInfoIterator to an array since we cannot rewind its cursor - $indexes = iterator_to_array($indexes); - - $this->assertCount(1, $indexes); - - foreach ($indexes as $index) { - $this->assertInstanceOf('MongoDB\Model\IndexInfo', $index); - $this->assertEquals(['_id' => 1], $index->getKey()); - } - } - - public function testListIndexesForNonexistentCollection() - { - $operation = new DropCollection($this->getDatabaseName(), $this->getCollectionName()); - $operation->execute($this->getPrimaryServer()); - - $operation = new ListIndexes($this->getDatabaseName(), $this->getCollectionName()); - $indexes = $operation->execute($this->getPrimaryServer()); - - $this->assertCount(0, $indexes); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListIndexesTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListIndexesTest.php deleted file mode 100644 index c6f6ea7..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ListIndexesTest.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\ListIndexes; - -class ListIndexesTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new ListIndexes($this->getDatabaseName(), $this->getCollectionName(), $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidIntegerValues() as $value) { - $options[][] = ['maxTimeMS' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ReplaceOneTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ReplaceOneTest.php deleted file mode 100644 index 3b70b83..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/ReplaceOneTest.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Model\BSONDocument; -use MongoDB\Operation\ReplaceOne; - -class ReplaceOneTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new ReplaceOne($this->getDatabaseName(), $this->getCollectionName(), $filter, ['y' => 1]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorReplacementArgumentTypeCheck($replacement) - { - new ReplaceOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $replacement); - } - - /** - * @dataProvider provideReplacementDocuments - */ - public function testConstructorReplacementArgument($replacement) - { - new ReplaceOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $replacement); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $replacement argument is an update operator - * @dataProvider provideUpdateDocuments - */ - public function testConstructorReplacementArgumentRequiresNoOperators($replacement) - { - new ReplaceOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $replacement); - } - - public function provideReplacementDocuments() - { - return $this->wrapValuesForDataProvider([ - ['y' => 1], - (object) ['y' => 1], - new BSONDocument(['y' => 1]), - ]); - } - - public function provideUpdateDocuments() - { - return $this->wrapValuesForDataProvider([ - ['$set' => ['y' => 1]], - (object) ['$set' => ['y' => 1]], - new BSONDocument(['$set' => ['y' => 1]]), - ]); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/TestCase.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/TestCase.php deleted file mode 100644 index 2de8b0e..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/TestCase.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Tests\TestCase as BaseTestCase; - -/** - * Base class for Operation unit tests. - */ -abstract class TestCase extends BaseTestCase -{ -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateFunctionalTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateFunctionalTest.php deleted file mode 100644 index 1a5013a..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateFunctionalTest.php +++ /dev/null @@ -1,199 +0,0 @@ -<?php - -namespace MongoDB\Tests\Collection; - -use MongoDB\UpdateResult; -use MongoDB\Driver\BulkWrite; -use MongoDB\Driver\WriteConcern; -use MongoDB\Operation\Update; - -class UpdateFunctionalTest extends FunctionalTestCase -{ - private $omitModifiedCount; - - public function setUp() - { - parent::setUp(); - - $this->omitModifiedCount = version_compare($this->getServerVersion(), '2.6.0', '<'); - } - - public function testUpdateOne() - { - $this->createFixtures(3); - - $filter = ['_id' => ['$gt' => 1]]; - $update = ['$inc' => ['x' => 1]]; - - $operation = new Update($this->getDatabaseName(), $this->getCollectionName(), $filter, $update); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\UpdateResult', $result); - $this->assertSame(1, $result->getMatchedCount()); - $this->omitModifiedCount or $this->assertSame(1, $result->getModifiedCount()); - $this->assertSame(0, $result->getUpsertedCount()); - $this->assertNull($result->getUpsertedId()); - - $expected = [ - ['_id' => 1, 'x' => 11], - ['_id' => 2, 'x' => 23], - ['_id' => 3, 'x' => 33], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testUpdateMany() - { - $this->createFixtures(3); - - $filter = ['_id' => ['$gt' => 1]]; - $update = ['$inc' => ['x' => 1]]; - $options = ['multi' => true]; - - $operation = new Update($this->getDatabaseName(), $this->getCollectionName(), $filter, $update, $options); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\UpdateResult', $result); - $this->assertSame(2, $result->getMatchedCount()); - $this->omitModifiedCount or $this->assertSame(2, $result->getModifiedCount()); - $this->assertSame(0, $result->getUpsertedCount()); - $this->assertNull($result->getUpsertedId()); - - $expected = [ - ['_id' => 1, 'x' => 11], - ['_id' => 2, 'x' => 23], - ['_id' => 3, 'x' => 34], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testUpdateManyWithExistingId() - { - $this->createFixtures(3); - - $filter = ['_id' => 5]; - $update = ['$set' => ['x' => 55]]; - $options = ['upsert' => true]; - - $operation = new Update($this->getDatabaseName(), $this->getCollectionName(), $filter, $update, $options); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\UpdateResult', $result); - $this->assertSame(0, $result->getMatchedCount()); - $this->omitModifiedCount or $this->assertSame(0, $result->getModifiedCount()); - $this->assertSame(1, $result->getUpsertedCount()); - $this->assertSame(5, $result->getUpsertedId()); - - $expected = [ - ['_id' => 1, 'x' => 11], - ['_id' => 2, 'x' => 22], - ['_id' => 3, 'x' => 33], - ['_id' => 5, 'x' => 55], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testUpdateManyWithGeneratedId() - { - $this->createFixtures(3); - - $filter = ['x' => 66]; - $update = ['$set' => ['x' => 66]]; - $options = ['upsert' => true]; - - $operation = new Update($this->getDatabaseName(), $this->getCollectionName(), $filter, $update, $options); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertInstanceOf('MongoDB\UpdateResult', $result); - $this->assertSame(0, $result->getMatchedCount()); - $this->omitModifiedCount or $this->assertSame(0, $result->getModifiedCount()); - $this->assertSame(1, $result->getUpsertedCount()); - $this->assertInstanceOf('MongoDB\BSON\ObjectId', $result->getUpsertedId()); - - $expected = [ - ['_id' => 1, 'x' => 11], - ['_id' => 2, 'x' => 22], - ['_id' => 3, 'x' => 33], - ['_id' => $result->getUpsertedId(), 'x' => 66], - ]; - - $this->assertSameDocuments($expected, $this->collection->find()); - } - - public function testUnacknowledgedWriteConcern() - { - $filter = ['_id' => 1]; - $update = ['$set' => ['x' => 1]]; - $options = ['writeConcern' => new WriteConcern(0)]; - $operation = new Update($this->getDatabaseName(), $this->getCollectionName(), $filter, $update, $options); - $result = $operation->execute($this->getPrimaryServer()); - - $this->assertFalse($result->isAcknowledged()); - - return $result; - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesMatchedCount(UpdateResult $result) - { - $result->getMatchedCount(); - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesModifiedCount(UpdateResult $result) - { - $result->getModifiedCount(); - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesUpsertedCount(UpdateResult $result) - { - $result->getUpsertedCount(); - } - - /** - * @depends testUnacknowledgedWriteConcern - * @expectedException MongoDB\Exception\BadMethodCallException - * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ - */ - public function testUnacknowledgedWriteConcernAccessesUpsertedId(UpdateResult $result) - { - $result->getUpsertedId(); - } - - /** - * Create data fixtures. - * - * @param integer $n - */ - private function createFixtures($n) - { - $bulkWrite = new BulkWrite(['ordered' => true]); - - for ($i = 1; $i <= $n; $i++) { - $bulkWrite->insert([ - '_id' => $i, - 'x' => (integer) ($i . $i), - ]); - } - - $result = $this->manager->executeBulkWrite($this->getNamespace(), $bulkWrite); - - $this->assertEquals($n, $result->getInsertedCount()); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateManyTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateManyTest.php deleted file mode 100644 index acf816d..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateManyTest.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Model\BSONDocument; -use MongoDB\Operation\UpdateMany; - -class UpdateManyTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new UpdateMany($this->getDatabaseName(), $this->getCollectionName(), $filter, ['$set' => ['x' => 1]]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorUpdateArgumentTypeCheck($update) - { - new UpdateMany($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $update); - } - - /** - * @dataProvider provideUpdateDocuments - */ - public function testConstructorUpdateArgument($update) - { - new UpdateMany($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $update); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $update argument is not an update operator - * @dataProvider provideReplacementDocuments - */ - public function testConstructorUpdateArgumentRequiresOperators($replacement) - { - new UpdateMany($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $replacement); - } - - public function provideReplacementDocuments() - { - return $this->wrapValuesForDataProvider([ - ['y' => 1], - (object) ['y' => 1], - new BSONDocument(['y' => 1]), - ]); - } - - public function provideUpdateDocuments() - { - return $this->wrapValuesForDataProvider([ - ['$set' => ['y' => 1]], - (object) ['$set' => ['y' => 1]], - new BSONDocument(['$set' => ['y' => 1]]), - ]); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateOneTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateOneTest.php deleted file mode 100644 index cdddcc8..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateOneTest.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Model\BSONDocument; -use MongoDB\Operation\UpdateOne; - -class UpdateOneTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new UpdateOne($this->getDatabaseName(), $this->getCollectionName(), $filter, ['$set' => ['x' => 1]]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorUpdateArgumentTypeCheck($update) - { - new UpdateOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $update); - } - - /** - * @dataProvider provideUpdateDocuments - */ - public function testConstructorUpdateArgument($update) - { - new UpdateOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $update); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessage First key in $update argument is not an update operator - * @dataProvider provideReplacementDocuments - */ - public function testConstructorUpdateArgumentRequiresOperators($replacement) - { - new UpdateOne($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $replacement); - } - - public function provideReplacementDocuments() - { - return $this->wrapValuesForDataProvider([ - ['y' => 1], - (object) ['y' => 1], - new BSONDocument(['y' => 1]), - ]); - } - - public function provideUpdateDocuments() - { - return $this->wrapValuesForDataProvider([ - ['$set' => ['y' => 1]], - (object) ['$set' => ['y' => 1]], - new BSONDocument(['$set' => ['y' => 1]]), - ]); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateTest.php deleted file mode 100644 index 49fee8f..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/Operation/UpdateTest.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -namespace MongoDB\Tests\Operation; - -use MongoDB\Operation\Update; - -class UpdateTest extends TestCase -{ - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$filter to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorFilterArgumentTypeCheck($filter) - { - new Update($this->getDatabaseName(), $this->getCollectionName(), $filter, ['$set' => ['x' => 1]]); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @expectedExceptionMessageRegExp /Expected \$update to have type "array or object" but found "[\w ]+"/ - * @dataProvider provideInvalidDocumentValues - */ - public function testConstructorUpdateArgumentTypeCheck($update) - { - new Update($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], $update); - } - - /** - * @expectedException MongoDB\Exception\InvalidArgumentException - * @dataProvider provideInvalidConstructorOptions - */ - public function testConstructorOptionTypeChecks(array $options) - { - new Update($this->getDatabaseName(), $this->getCollectionName(), ['x' => 1], ['y' => 1], $options); - } - - public function provideInvalidConstructorOptions() - { - $options = []; - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['bypassDocumentValidation' => $value]; - } - - foreach ($this->getInvalidDocumentValues() as $value) { - $options[][] = ['collation' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['multi' => $value]; - } - - foreach ($this->getInvalidBooleanValues() as $value) { - $options[][] = ['upsert' => $value]; - } - - foreach ($this->getInvalidWriteConcernValues() as $value) { - $options[][] = ['writeConcern' => $value]; - } - - return $options; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/PedantryTest.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/PedantryTest.php deleted file mode 100644 index 1dd07dc..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/PedantryTest.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use RecursiveDirectoryIterator; -use RecursiveIteratorIterator; -use ReflectionClass; -use ReflectionMethod; -use RegexIterator; - -/** - * Pedantic tests that have nothing to do with functional correctness. - */ -class PedantryTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider provideProjectClassNames - */ - public function testMethodsAreOrderedAlphabeticallyByVisibility($className) - { - $class = new ReflectionClass($className); - $methods = $class->getMethods(); - - $methods = array_filter( - $methods, - function(ReflectionMethod $method) use ($class) { - return $method->getDeclaringClass() == $class; - } - ); - - $getSortValue = function(ReflectionMethod $method) { - if ($method->getModifiers() & ReflectionMethod::IS_PRIVATE) { - return '2' . $method->getName(); - } - if ($method->getModifiers() & ReflectionMethod::IS_PROTECTED) { - return '1' . $method->getName(); - } - if ($method->getModifiers() & ReflectionMethod::IS_PUBLIC) { - return '0' . $method->getName(); - } - }; - - $sortedMethods = $methods; - usort( - $sortedMethods, - function(ReflectionMethod $a, ReflectionMethod $b) use ($getSortValue) { - return strcasecmp($getSortValue($a), $getSortValue($b)); - } - ); - - $methods = array_map(function(ReflectionMethod $method) { return $method->getName(); }, $methods); - $sortedMethods = array_map(function(ReflectionMethod $method) { return $method->getName(); }, $sortedMethods); - - $this->assertEquals($sortedMethods, $methods); - } - - public function provideProjectClassNames() - { - $classNames = []; - $srcDir = realpath(__DIR__ . '/../src/'); - - $files = new RegexIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($srcDir)), '/\.php$/i'); - - foreach ($files as $file) { - if ($file->getFilename() === 'functions.php') { - continue; - } - - /* autoload.php added downstream (e.g. Fedora) */ - if ($file->getFilename() === 'autoload.php') { - continue; - } - - $classNames[][] = 'MongoDB\\' . str_replace(DIRECTORY_SEPARATOR, '\\', substr($file->getRealPath(), strlen($srcDir) + 1, -4)); - } - - return $classNames; - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/TestCase.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/TestCase.php deleted file mode 100644 index 6ebaa3b..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/TestCase.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php - -namespace MongoDB\Tests; - -use MongoDB\Driver\ReadConcern; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\WriteConcern; -use ReflectionClass; -use stdClass; - -abstract class TestCase extends \PHPUnit_Framework_TestCase -{ - public function provideInvalidDocumentValues() - { - return $this->wrapValuesForDataProvider($this->getInvalidDocumentValues()); - } - - /** - * Return the test collection name. - * - * @return string - */ - protected function getCollectionName() - { - $class = new ReflectionClass($this); - - return sprintf('%s.%s', $class->getShortName(), hash('crc32b', $this->getName())); - } - - /** - * Return the test database name. - * - * @return string - */ - protected function getDatabaseName() - { - return getenv('MONGODB_DATABASE') ?: 'phplib_test'; - } - - /** - * Return a list of invalid array values. - * - * @return array - */ - protected function getInvalidArrayValues() - { - return [123, 3.14, 'foo', true, new stdClass]; - } - - /** - * Return a list of invalid boolean values. - * - * @return array - */ - protected function getInvalidBooleanValues() - { - return [123, 3.14, 'foo', [], new stdClass]; - } - - /** - * Return a list of invalid document values. - * - * @return array - */ - protected function getInvalidDocumentValues() - { - return [123, 3.14, 'foo', true]; - } - - /** - * Return a list of invalid integer values. - * - * @return array - */ - protected function getInvalidIntegerValues() - { - return [3.14, 'foo', true, [], new stdClass]; - } - - /** - * Return a list of invalid ReadPreference values. - * - * @return array - */ - protected function getInvalidReadConcernValues() - { - return [123, 3.14, 'foo', true, [], new stdClass, new ReadPreference(ReadPreference::RP_PRIMARY), new WriteConcern(1)]; - } - - /** - * Return a list of invalid ReadPreference values. - * - * @return array - */ - protected function getInvalidReadPreferenceValues() - { - return [123, 3.14, 'foo', true, [], new stdClass, new ReadConcern, new WriteConcern(1)]; - } - - /** - * Return a list of invalid string values. - * - * @return array - */ - protected function getInvalidStringValues() - { - return [123, 3.14, true, [], new stdClass]; - } - - /** - * Return a list of invalid WriteConcern values. - * - * @return array - */ - protected function getInvalidWriteConcernValues() - { - return [123, 3.14, 'foo', true, [], new stdClass, new ReadConcern, new ReadPreference(ReadPreference::RP_PRIMARY)]; - } - - /** - * Return the test namespace. - * - * @return string - */ - protected function getNamespace() - { - return sprintf('%s.%s', $this->getDatabaseName(), $this->getCollectionName()); - } - - /** - * Return the connection URI. - * - * @return string - */ - protected function getUri() - { - return getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1:27017'; - } - - /** - * Wrap a list of values for use as a single-argument data provider. - * - * @param array $values List of values - * @return array - */ - protected function wrapValuesForDataProvider(array $values) - { - return array_map(function($value) { return [$value]; }, $values); - } -} diff --git a/boilerplate/test/src/vendor/mongodb/mongodb/tests/bootstrap.php b/boilerplate/test/src/vendor/mongodb/mongodb/tests/bootstrap.php deleted file mode 100644 index fd711e0..0000000 --- a/boilerplate/test/src/vendor/mongodb/mongodb/tests/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -if (file_exists(__DIR__ . '/../vendor/autoload.php')) { - // Dependencies were installed with Composer and this is the main project - $loader = require_once __DIR__ . '/../vendor/autoload.php'; -} elseif (file_exists(__DIR__ . '/../../../../autoload.php')) { - // We're installed as a dependency in another project's `vendor` directory - $loader = require_once __DIR__ . '/../../../../autoload.php'; -} else { - throw new Exception('Can\'t find autoload.php. Did you install dependencies with Composer?'); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.gitattributes b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.gitattributes deleted file mode 100644 index 33b8efd..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.gitattributes +++ /dev/null @@ -1,9 +0,0 @@ -*.crt -crlf -*.key -crlf -*.srl -crlf -*.pub -crlf -*.priv -crlf -*.txt -crlf - -# ignore /notes in the git-generated distributed .zip archive -/notes export-ignore diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.github/ISSUE_TEMPLATE.md b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 5db6524..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,19 +0,0 @@ -<!-- Please fill in this template according to your issue. --> - -| Q | A -| ------------------- | ----- -| Bug report? | yes/no -| Feature request? | yes/no -| RFC? | yes/no -| How used? | Standalone/Symfony/3party -| Swiftmailer version | x.y.z -| PHP version | x.y.z - -### Observed behaviour -<!-- What does the code do? --> - -### Expected behaviour -<!-- What should the code do? --> - -### Example -<!-- Example to reproduce the issue. --> diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.github/PULL_REQUEST_TEMPLATE.md b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 4b39510..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,14 +0,0 @@ -<!-- Please fill in this template according to the PR you're about to submit. --> - -| Q | A -| ------------- | --- -| Bug fix? | yes/no -| New feature? | yes/no -| Doc update? | yes/no -| BC breaks? | yes/no -| Deprecations? | yes/no -| Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> -| License | MIT - - -<!-- Replace this comment by the description of your issue. --> diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.gitignore b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.gitignore deleted file mode 100644 index 20d389a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/.php_cs.cache -/.phpunit -/build/* -/composer.lock -/phpunit.xml -/tests/acceptance.conf.php -/tests/smoke.conf.php -/vendor/ diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.php_cs.dist b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.php_cs.dist deleted file mode 100644 index f18d65d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.php_cs.dist +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -return PhpCsFixer\Config::create() - ->setRules(array( - '@Symfony' => true, - '@Symfony:risky' => true, - 'array_syntax' => array('syntax' => 'long'), - 'no_unreachable_default_argument_value' => false, - 'braces' => array('allow_single_line_closure' => true), - 'heredoc_to_nowdoc' => false, - 'phpdoc_annotation_without_dot' => false, - )) - ->setRiskyAllowed(true) - ->setFinder(PhpCsFixer\Finder::create()->in(__DIR__)) -; diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.travis.yml b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.travis.yml deleted file mode 100644 index fc24d05..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: php - -sudo: false - -before_script: - - cp tests/acceptance.conf.php.default tests/acceptance.conf.php - - cp tests/smoke.conf.php.default tests/smoke.conf.php - - composer self-update - - composer update --no-interaction --prefer-source - - gem install mime-types -v 2.99.1 - - gem install mailcatcher - - mailcatcher --smtp-port 4456 - -script: ./vendor/bin/simple-phpunit - -matrix: - include: - - php: 5.3 - - php: 5.4 - - php: 5.5 - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: hhvm - allow_failures: - - php: hhvm - fast_finish: true - -cache: - directories: - - .phpunit diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/CHANGES b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/CHANGES deleted file mode 100644 index 07fa342..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/CHANGES +++ /dev/null @@ -1,272 +0,0 @@ -Changelog -========= - -5.4.9 (2018-01-23) ------------------- - - * no changes, last version of the 5.x series - -5.4.8 (2017-05-01) ------------------- - - * fixed encoding inheritance in addPart() - * fixed sorting MIME children when their types are equal - -5.4.7 (2017-04-20) ------------------- - - * fixed NTLMAuthenticator clobbering bcmath scale - -5.4.6 (2017-02-13) ------------------- - - * removed exceptions thrown in destructors as they lead to fatal errors - * switched to use sha256 by default in DKIM as per the RFC - * fixed an 'Undefined variable: pipes' PHP notice - * fixed long To headers when using the mail transport - * fixed NTLMAuthenticator when no domain is passed with the username - * prevented fatal error during unserialization of a message - * fixed a PHP warning when sending a message that has a length of a multiple of 8192 - -5.4.5 (2016-12-29) ------------------- - - * SECURITY FIX: fixed CVE-2016-10074 by disallowing potentially unsafe shell characters - - Prior to 5.4.5, the mail transport (Swift_Transport_MailTransport) was vulnerable to passing - arbitrary shell arguments if the "From", "ReturnPath" or "Sender" header came - from a non-trusted source, potentially allowing Remote Code Execution - * deprecated the mail transport - -5.4.4 (2016-11-23) ------------------- - - * reverted escaping command-line args to mail (PHP mail() function already does it) - -5.4.3 (2016-07-08) ------------------- - - * fixed SimpleHeaderSet::has()/get() when the 0 index is removed - * removed the need to have mcrypt installed - * fixed broken MIME header encoding with quotes/colons and non-ascii chars - * allowed mail transport send for messages without To header - * fixed PHP 7 support - -5.4.2 (2016-05-01) ------------------- - - * fixed support for IPv6 sockets - * added auto-retry when sending messages from the memory spool - * fixed consecutive read calls in Swift_ByteStream_FileByteStream - * added support for iso-8859-15 encoding - * fixed PHP mail extra params on missing reversePath - * added methods to set custom stream context options - * fixed charset changes in QpContentEncoderProxy - * added return-path header to the ignoredHeaders list of DKIMSigner - * fixed crlf for subject using mail - * fixed add soft line break only when necessary - * fixed escaping command-line args to mail - -5.4.1 (2015-06-06) ------------------- - - * made Swiftmailer exceptions confirm to PHP base exception constructor signature - * fixed MAIL FROM & RCPT TO headers to be RFC compliant - -5.4.0 (2015-03-14) ------------------- - - * added the possibility to add extra certs to PKCS#7 signature - * fix base64 encoding with streams - * added a new RESULT_SPOOLED status for SpoolTransport - * fixed getBody() on attachments when called more than once - * removed dots from generated filenames in filespool - -5.3.1 (2014-12-05) ------------------- - - * fixed cloning of messages with attachments - -5.3.0 (2014-10-04) ------------------- - - * fixed cloning when using signers - * reverted removal of Swift_Encoding - * drop support for PHP 5.2.x - -5.2.2 (2014-09-20) ------------------- - - * fixed Japanese support - * fixed the memory spool when the message changes when in the pool - * added support for cloning messages - * fixed PHP warning in the redirect plugin - * changed the way to and cc-ed email are sent to only use one transaction - -5.2.1 (2014-06-13) ------------------- - - * SECURITY FIX: fixed CLI escaping when using sendmail as a transport - - Prior to 5.2.1, the sendmail transport (Swift_Transport_SendmailTransport) - was vulnerable to an arbitrary shell execution if the "From" header came - from a non-trusted source and no "Return-Path" is configured. - - * fixed parameter in DKIMSigner - * fixed compatibility with PHP < 5.4 - -5.2.0 (2014-05-08) ------------------- - - * fixed Swift_ByteStream_FileByteStream::read() to match to the specification - * fixed from-charset and to-charset arguments in mbstring_convert_encoding() usages - * fixed infinite loop in StreamBuffer - * fixed NullTransport to return the number of ignored emails instead of 0 - * Use phpunit and mockery for unit testing (realityking) - -5.1.0 (2014-03-18) ------------------- - - * fixed data writing to stream when sending large messages - * added support for libopendkim (https://github.com/xdecock/php-opendkim) - * merged SignedMessage and Message - * added Gmail XOAuth2 authentication - * updated the list of known mime types - * added NTLM authentication - -5.0.3 (2013-12-03) ------------------- - - * fixed double-dot bug - * fixed DKIM signer - -5.0.2 (2013-08-30) ------------------- - - * handled correct exception type while reading IoBuffer output - -5.0.1 (2013-06-17) ------------------- - - * changed the spool to only start the transport when a mail has to be sent - * fixed compatibility with PHP 5.2 - * fixed LICENSE file - -5.0.0 (2013-04-30) ------------------- - - * changed the license from LGPL to MIT - -4.3.1 (2013-04-11) ------------------- - - * removed usage of the native QP encoder when the charset is not UTF-8 - * fixed usage of uniqid to avoid collisions - * made a performance improvement when tokenizing large headers - * fixed usage of the PHP native QP encoder on PHP 5.4.7+ - -4.3.0 (2013-01-08) ------------------- - - * made the temporary directory configurable via the TMPDIR env variable - * added S/MIME signer and encryption support - -4.2.2 (2012-10-25) ------------------- - - * added the possibility to throttle messages per second in ThrottlerPlugin (mostly for Amazon SES) - * switched mime.qpcontentencoder to automatically use the PHP native encoder on PHP 5.4.7+ - * allowed specifying a whitelist with regular expressions in RedirectingPlugin - -4.2.1 (2012-07-13) ------------------- - - * changed the coding standards to PSR-1/2 - * fixed issue with autoloading - * added NativeQpContentEncoder to enhance performance (for PHP 5.3+) - -4.2.0 (2012-06-29) ------------------- - - * added documentation about how to use the Japanese support introduced in 4.1.8 - * added a way to override the default configuration in a lazy way - * changed the PEAR init script to lazy-load the initialization - * fixed a bug when calling Swift_Preferences before anything else (regression introduced in 4.1.8) - -4.1.8 (2012-06-17) ------------------- - - * added Japanese iso-2022-jp support - * changed the init script to lazy-load the initialization - * fixed docblocks (@id) which caused some problems with libraries parsing the dobclocks - * fixed Swift_Mime_Headers_IdentificationHeader::setId() when passed an array of ids - * fixed encoding of email addresses in headers - * added replacements setter to the Decorator plugin - -4.1.7 (2012-04-26) ------------------- - - * fixed QpEncoder safeMapShareId property - -4.1.6 (2012-03-23) ------------------- - - * reduced the size of serialized Messages - -4.1.5 (2012-01-04) ------------------- - - * enforced Swift_Spool::queueMessage() to return a Boolean - * made an optimization to the memory spool: start the transport only when required - * prevented stream_socket_client() from generating an error and throw a Swift_TransportException instead - * fixed a PHP warning when calling to mail() when safe_mode is off - * many doc tweaks - -4.1.4 (2011-12-16) ------------------- - - * added a memory spool (Swift_MemorySpool) - * fixed too many opened files when sending emails with attachments - -4.1.3 (2011-10-27) ------------------- - - * added STARTTLS support - * added missing @return tags on fluent methods - * added a MessageLogger plugin that logs all sent messages - * added composer.json - -4.1.2 (2011-09-13) ------------------- - - * fixed wrong detection of magic_quotes_runtime - * fixed fatal errors when no To or Subject header has been set - * fixed charset on parameter header continuations - * added documentation about how to install Swiftmailer from the PEAR channel - * fixed various typos and markup problem in the documentation - * fixed warning when cache directory does not exist - * fixed "slashes are escaped" bug - * changed require_once() to require() in autoload - -4.1.1 (2011-07-04) ------------------- - - * added missing file in PEAR package - -4.1.0 (2011-06-30) ------------------- - - * documentation has been converted to ReST - -4.1.0 RC1 (2011-06-17) ----------------------- - -New features: - - * changed the Decorator Plugin to allow replacements in all headers - * added Swift_Mime_Grammar and Swift_Validate to validate an email address - * modified the autoloader to lazy-initialize Swiftmailer - * removed Swift_Mailer::batchSend() - * added NullTransport - * added new plugins: RedirectingPlugin and ImpersonatePlugin - * added a way to send messages asynchronously (Spool) diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/LICENSE b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/LICENSE deleted file mode 100644 index 485f1d6..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2016 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/README b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/README deleted file mode 100644 index 52c0757..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/README +++ /dev/null @@ -1,15 +0,0 @@ -Swift Mailer ------------- - -Swift Mailer is a component based mailing solution for PHP 5. -It is released under the MIT license. - -Homepage: https://swiftmailer.symfony.com/ -Documentation: https://swiftmailer.symfony.com/docs/introduction.html -Bugs: https://github.com/swiftmailer/swiftmailer/issues -Repository: https://github.com/swiftmailer/swiftmailer - -Swift Mailer is highly object-oriented by design and lends itself -to use in complex web application with a great deal of flexibility. - -For full details on usage, see the documentation. diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/VERSION b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/VERSION deleted file mode 100644 index 1842f65..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/VERSION +++ /dev/null @@ -1 +0,0 @@ -Swift-5.4.9 diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/composer.json b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/composer.json deleted file mode 100644 index 44a1050..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "swiftmailer/swiftmailer", - "type": "library", - "description": "Swiftmailer, free feature-rich PHP mailer", - "keywords": ["mail","mailer","email"], - "homepage": "https://swiftmailer.symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Chris Corbyn" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "mockery/mockery": "~0.9.1", - "symfony/phpunit-bridge": "~3.2" - }, - "autoload": { - "files": ["lib/swift_required.php"] - }, - "autoload-dev": { - "psr-0": { - "Swift_": "tests/unit" - } - }, - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/headers.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/headers.rst deleted file mode 100644 index 2c11c18..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/headers.rst +++ /dev/null @@ -1,739 +0,0 @@ -Message Headers -=============== - -Sometimes you'll want to add your own headers to a message or modify/remove -headers that are already present. You work with the message's HeaderSet to do -this. - -Header Basics -------------- - -All MIME entities in Swift Mailer -- including the message itself -- -store their headers in a single object called a HeaderSet. This HeaderSet is -retrieved with the ``getHeaders()`` method. - -As mentioned in the previous chapter, everything that forms a part of a message -in Swift Mailer is a MIME entity that is represented by an instance of -``Swift_Mime_MimeEntity``. This includes -- most notably -- the message object -itself, attachments, MIME parts and embedded images. Each of these MIME entities -consists of a body and a set of headers that describe the body. - -For all of the "standard" headers in these MIME entities, such as the -``Content-Type``, there are named methods for working with them, such as -``setContentType()`` and ``getContentType()``. This is because headers are a -moderately complex area of the library. Each header has a slightly different -required structure that it must meet in order to comply with the standards that -govern email (and that are checked by spam blockers etc). - -You fetch the HeaderSet from a MIME entity like so: - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - // Fetch the HeaderSet from a Message object - $headers = $message->getHeaders(); - - $attachment = Swift_Attachment::fromPath('document.pdf'); - - // Fetch the HeaderSet from an attachment object - $headers = $attachment->getHeaders(); - -The job of the HeaderSet is to contain and manage instances of Header objects. -Depending upon the MIME entity the HeaderSet came from, the contents of the -HeaderSet will be different, since an attachment for example has a different -set of headers to those in a message. - -You can find out what the HeaderSet contains with a quick loop, dumping out -the names of the headers: - -.. code-block:: php - - foreach ($headers->getAll() as $header) { - printf("%s<br />\n", $header->getFieldName()); - } - - /* - Content-Transfer-Encoding - Content-Type - MIME-Version - Date - Message-ID - From - Subject - To - */ - -You can also dump out the rendered HeaderSet by calling its ``toString()`` -method: - -.. code-block:: php - - echo $headers->toString(); - - /* - Message-ID: <1234869991.499a9ee7f1d5e@swift.generated> - Date: Tue, 17 Feb 2009 22:26:31 +1100 - Subject: Awesome subject! - From: sender@example.org - To: recipient@example.org - MIME-Version: 1.0 - Content-Type: text/plain; charset=utf-8 - Content-Transfer-Encoding: quoted-printable - */ - -Where the complexity comes in is when you want to modify an existing header. -This complexity comes from the fact that each header can be of a slightly -different type (such as a Date header, or a header that contains email -addresses, or a header that has key-value parameters on it!). Each header in the -HeaderSet is an instance of ``Swift_Mime_Header``. They all have common -functionality, but knowing exactly what type of header you're working with will -allow you a little more control. - -You can determine the type of header by comparing the return value of its -``getFieldType()`` method with the constants ``TYPE_TEXT``, -``TYPE_PARAMETERIZED``, ``TYPE_DATE``, ``TYPE_MAILBOX``, ``TYPE_ID`` and -``TYPE_PATH`` which are defined in ``Swift_Mime_Header``. - - -.. code-block:: php - - foreach ($headers->getAll() as $header) { - switch ($header->getFieldType()) { - case Swift_Mime_Header::TYPE_TEXT: $type = 'text'; - break; - case Swift_Mime_Header::TYPE_PARAMETERIZED: $type = 'parameterized'; - break; - case Swift_Mime_Header::TYPE_MAILBOX: $type = 'mailbox'; - break; - case Swift_Mime_Header::TYPE_DATE: $type = 'date'; - break; - case Swift_Mime_Header::TYPE_ID: $type = 'ID'; - break; - case Swift_Mime_Header::TYPE_PATH: $type = 'path'; - break; - } - printf("%s: is a %s header<br />\n", $header->getFieldName(), $type); - } - - /* - Content-Transfer-Encoding: is a text header - Content-Type: is a parameterized header - MIME-Version: is a text header - Date: is a date header - Message-ID: is a ID header - From: is a mailbox header - Subject: is a text header - To: is a mailbox header - */ - -Headers can be removed from the set, modified within the set, or added to the -set. - -The following sections show you how to work with the HeaderSet and explain the -details of each implementation of ``Swift_Mime_Header`` that may -exist within the HeaderSet. - -Header Types ------------- - -Because all headers are modeled on different data (dates, addresses, text!) -there are different types of Header in Swift Mailer. Swift Mailer attempts to -categorize all possible MIME headers into more general groups, defined by a -small number of classes. - -Text Headers -~~~~~~~~~~~~ - -Text headers are the simplest type of Header. They contain textual information -with no special information included within it -- for example the Subject -header in a message. - -There's nothing particularly interesting about a text header, though it is -probably the one you'd opt to use if you need to add a custom header to a -message. It represents text just like you'd think it does. If the text -contains characters that are not permitted in a message header (such as new -lines, or non-ascii characters) then the header takes care of encoding the -text so that it can be used. - -No header -- including text headers -- in Swift Mailer is vulnerable to -header-injection attacks. Swift Mailer breaks any attempt at header injection by -encoding the dangerous data into a non-dangerous form. - -It's easy to add a new text header to a HeaderSet. You do this by calling the -HeaderSet's ``addTextHeader()`` method. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addTextHeader('Your-Header-Name', 'the header value'); - -Changing the value of an existing text header is done by calling it's -``setValue()`` method. - -.. code-block:: php - - $subject = $message->getHeaders()->get('Subject'); - - $subject->setValue('new subject'); - -When output via ``toString()``, a text header produces something like the -following: - -.. code-block:: php - - $subject = $message->getHeaders()->get('Subject'); - - $subject->setValue('amazing subject line'); - - echo $subject->toString(); - - /* - - Subject: amazing subject line - - */ - -If the header contains any characters that are outside of the US-ASCII range -however, they will be encoded. This is nothing to be concerned about since -mail clients will decode them back. - -.. code-block:: php - - $subject = $message->getHeaders()->get('Subject'); - - $subject->setValue('contains – dash'); - - echo $subject->toString(); - - /* - - Subject: contains =?utf-8?Q?=E2=80=93?= dash - - */ - -Parameterized Headers -~~~~~~~~~~~~~~~~~~~~~ - -Parameterized headers are text headers that contain key-value parameters -following the textual content. The Content-Type header of a message is a -parameterized header since it contains charset information after the content -type. - -The parameterized header type is a special type of text header. It extends the -text header by allowing additional information to follow it. All of the methods -from text headers are available in addition to the methods described here. - -Adding a parameterized header to a HeaderSet is done by using the -``addParameterizedHeader()`` method which takes a text value like -``addTextHeader()`` but it also accepts an associative array of -key-value parameters. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addParameterizedHeader( - 'Header-Name', 'header value', - array('foo' => 'bar') - ); - -To change the text value of the header, call it's ``setValue()`` method just as -you do with text headers. - -To change the parameters in the header, call the header's ``setParameters()`` -method or the ``setParameter()`` method (note the pluralization). - -.. code-block:: php - - $type = $message->getHeaders()->get('Content-Type'); - - // setParameters() takes an associative array - $type->setParameters(array( - 'name' => 'file.txt', - 'charset' => 'iso-8859-1' - )); - - // setParameter() takes two args for $key and $value - $type->setParameter('charset', 'iso-8859-1'); - -When output via ``toString()``, a parameterized header produces something like -the following: - -.. code-block:: php - - $type = $message->getHeaders()->get('Content-Type'); - - $type->setValue('text/html'); - $type->setParameter('charset', 'utf-8'); - - echo $type->toString(); - - /* - - Content-Type: text/html; charset=utf-8 - - */ - -If the header contains any characters that are outside of the US-ASCII range -however, they will be encoded, just like they are for text headers. This is -nothing to be concerned about since mail clients will decode them back. -Likewise, if the parameters contain any non-ascii characters they will be -encoded so that they can be transmitted safely. - -.. code-block:: php - - $attachment = Swift_Attachment::newInstance(); - - $disp = $attachment->getHeaders()->get('Content-Disposition'); - - $disp->setValue('attachment'); - $disp->setParameter('filename', 'report–may.pdf'); - - echo $disp->toString(); - - /* - - Content-Disposition: attachment; filename*=utf-8''report%E2%80%93may.pdf - - */ - -Date Headers -~~~~~~~~~~~~ - -Date headers contains an RFC 2822 formatted date (i.e. what PHP's ``date('r')`` -returns). They are used anywhere a date or time is needed to be presented as a -message header. - -The data on which a date header is modeled is simply a UNIX timestamp such as -that returned by ``time()`` or ``strtotime()``. The timestamp is used to create -a correctly structured RFC 2822 formatted date such as -``Tue, 17 Feb 2009 22:26:31 +1100``. - -The obvious place this header type is used is in the ``Date:`` header of the -message itself. - -It's easy to add a new date header to a HeaderSet. You do this by calling -the HeaderSet's ``addDateHeader()`` method. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addDateHeader('Your-Header-Name', strtotime('3 days ago')); - -Changing the value of an existing date header is done by calling it's -``setTimestamp()`` method. - -.. code-block:: php - - $date = $message->getHeaders()->get('Date'); - - $date->setTimestamp(time()); - -When output via ``toString()``, a date header produces something like the -following: - -.. code-block:: php - - $date = $message->getHeaders()->get('Date'); - - echo $date->toString(); - - /* - - Date: Wed, 18 Feb 2009 13:35:02 +1100 - - */ - -Mailbox (e-mail address) Headers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Mailbox headers contain one or more email addresses, possibly with -personalized names attached to them. The data on which they are modeled is -represented by an associative array of email addresses and names. - -Mailbox headers are probably the most complex header type to understand in -Swift Mailer because they accept their input as an array which can take various -forms, as described in the previous chapter. - -All of the headers that contain e-mail addresses in a message -- with the -exception of ``Return-Path:`` which has a stricter syntax -- use this header -type. That is, ``To:``, ``From:`` etc. - -You add a new mailbox header to a HeaderSet by calling the HeaderSet's -``addMailboxHeader()`` method. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addMailboxHeader('Your-Header-Name', array( - 'person1@example.org' => 'Person Name One', - 'person2@example.org', - 'person3@example.org', - 'person4@example.org' => 'Another named person' - )); - -Changing the value of an existing mailbox header is done by calling it's -``setNameAddresses()`` method. - -.. code-block:: php - - $to = $message->getHeaders()->get('To'); - - $to->setNameAddresses(array( - 'joe@example.org' => 'Joe Bloggs', - 'john@example.org' => 'John Doe', - 'no-name@example.org' - )); - -If you don't wish to concern yourself with the complicated accepted input -formats accepted by ``setNameAddresses()`` as described in the previous chapter -and you only want to set one or more addresses (not names) then you can just -use the ``setAddresses()`` method instead. - -.. code-block:: php - - $to = $message->getHeaders()->get('To'); - - $to->setAddresses(array( - 'joe@example.org', - 'john@example.org', - 'no-name@example.org' - )); - -.. note:: - - Both methods will accept the above input format in practice. - -If all you want to do is set a single address in the header, you can use a -string as the input parameter to ``setAddresses()`` and/or -``setNameAddresses()``. - -.. code-block:: php - - $to = $message->getHeaders()->get('To'); - - $to->setAddresses('joe-bloggs@example.org'); - -When output via ``toString()``, a mailbox header produces something like the -following: - -.. code-block:: php - - $to = $message->getHeaders()->get('To'); - - $to->setNameAddresses(array( - 'person1@example.org' => 'Name of Person', - 'person2@example.org', - 'person3@example.org' => 'Another Person' - )); - - echo $to->toString(); - - /* - - To: Name of Person <person1@example.org>, person2@example.org, Another Person - <person3@example.org> - - */ - -ID Headers -~~~~~~~~~~ - -ID headers contain identifiers for the entity (or the message). The most -notable ID header is the Message-ID header on the message itself. - -An ID that exists inside an ID header looks more-or-less less like an email -address. For example, ``<1234955437.499becad62ec2@example.org>``. -The part to the left of the @ sign is usually unique, based on the current time -and some random factor. The part on the right is usually a domain name. - -Any ID passed to the header's ``setId()`` method absolutely MUST conform to -this structure, otherwise you'll get an Exception thrown at you by Swift Mailer -(a ``Swift_RfcComplianceException``). This is to ensure that the generated -email complies with relevant RFC documents and therefore is less likely to be -blocked as spam. - -It's easy to add a new ID header to a HeaderSet. You do this by calling -the HeaderSet's ``addIdHeader()`` method. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addIdHeader('Your-Header-Name', '123456.unqiue@example.org'); - -Changing the value of an existing ID header is done by calling its -``setId()`` method:: - - $msgId = $message->getHeaders()->get('Message-ID'); - - $msgId->setId(time() . '.' . uniqid('thing') . '@example.org'); - -When output via ``toString()``, an ID header produces something like the -following: - -.. code-block:: php - - $msgId = $message->getHeaders()->get('Message-ID'); - - echo $msgId->toString(); - - /* - - Message-ID: <1234955437.499becad62ec2@example.org> - - */ - -Path Headers -~~~~~~~~~~~~ - -Path headers are like very-restricted mailbox headers. They contain a single -email address with no associated name. The Return-Path header of a message is -a path header. - -You add a new path header to a HeaderSet by calling the HeaderSet's -``addPathHeader()`` method. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $headers = $message->getHeaders(); - - $headers->addPathHeader('Your-Header-Name', 'person@example.org'); - -Changing the value of an existing path header is done by calling its -``setAddress()`` method. - -.. code-block:: php - - $return = $message->getHeaders()->get('Return-Path'); - - $return->setAddress('my-address@example.org'); - -When output via ``toString()``, a path header produces something like the -following: - -.. code-block:: php - - $return = $message->getHeaders()->get('Return-Path'); - - $return->setAddress('person@example.org'); - - echo $return->toString(); - - /* - - Return-Path: <person@example.org> - - */ - -Header Operations ------------------ - -Working with the headers in a message involves knowing how to use the methods -on the HeaderSet and on the individual Headers within the HeaderSet. - -Adding new Headers -~~~~~~~~~~~~~~~~~~ - -New headers can be added to the HeaderSet by using one of the provided -``add..Header()`` methods. - -To add a header to a MIME entity (such as the message): - -Get the HeaderSet from the entity by via its ``getHeaders()`` method. - -* Add the header to the HeaderSet by calling one of the ``add..Header()`` - methods. - -The added header will appear in the message when it is sent. - -.. code-block:: php - - // Adding a custom header to a message - $message = Swift_Message::newInstance(); - $headers = $message->getHeaders(); - $headers->addTextHeader('X-Mine', 'something here'); - - // Adding a custom header to an attachment - $attachment = Swift_Attachment::fromPath('/path/to/doc.pdf'); - $attachment->getHeaders()->addDateHeader('X-Created-Time', time()); - -Retrieving Headers -~~~~~~~~~~~~~~~~~~ - -Headers are retrieved through the HeaderSet's ``get()`` and ``getAll()`` -methods. - -To get a header, or several headers from a MIME entity: - -* Get the HeaderSet from the entity by via its ``getHeaders()`` method. - -* Get the header(s) from the HeaderSet by calling either ``get()`` or - ``getAll()``. - -When using ``get()`` a single header is returned that matches the name (case -insensitive) that is passed to it. When using ``getAll()`` with a header name, -an array of headers with that name are returned. Calling ``getAll()`` with no -arguments returns an array of all headers present in the entity. - -.. note:: - - It's valid for some headers to appear more than once in a message (e.g. - the Received header). For this reason ``getAll()`` exists to fetch all - headers with a specified name. In addition, ``get()`` accepts an optional - numerical index, starting from zero to specify which header you want more - specifically. - -.. note:: - - If you want to modify the contents of the header and you don't know for - sure what type of header it is then you may need to check the type by - calling its ``getFieldType()`` method. - - .. code-block:: php - - $headers = $message->getHeaders(); - - // Get the To: header - $toHeader = $headers->get('To'); - - // Get all headers named "X-Foo" - $fooHeaders = $headers->getAll('X-Foo'); - - // Get the second header named "X-Foo" - $foo = $headers->get('X-Foo', 1); - - // Get all headers that are present - $all = $headers->getAll(); - -Check if a Header Exists -~~~~~~~~~~~~~~~~~~~~~~~~ - -You can check if a named header is present in a HeaderSet by calling its -``has()`` method. - -To check if a header exists: - -* Get the HeaderSet from the entity by via its ``getHeaders()`` method. - -* Call the HeaderSet's ``has()`` method specifying the header you're looking - for. - -If the header exists, ``true`` will be returned or ``false`` if not. - -.. note:: - - It's valid for some headers to appear more than once in a message (e.g. - the Received header). For this reason ``has()`` accepts an optional - numerical index, starting from zero to specify which header you want to - check more specifically. - - .. code-block:: php - - $headers = $message->getHeaders(); - - // Check if the To: header exists - if ($headers->has('To')) { - echo 'To: exists'; - } - - // Check if an X-Foo header exists twice (i.e. check for the 2nd one) - if ($headers->has('X-Foo', 1)) { - echo 'Second X-Foo header exists'; - } - -Removing Headers -~~~~~~~~~~~~~~~~ - -Removing a Header from the HeaderSet is done by calling the HeaderSet's -``remove()`` or ``removeAll()`` methods. - -To remove an existing header: - -* Get the HeaderSet from the entity by via its ``getHeaders()`` method. - -* Call the HeaderSet's ``remove()`` or ``removeAll()`` methods specifying the - header you want to remove. - -When calling ``remove()`` a single header will be removed. When calling -``removeAll()`` all headers with the given name will be removed. If no headers -exist with the given name, no errors will occur. - -.. note:: - - It's valid for some headers to appear more than once in a message (e.g. - the Received header). For this reason ``remove()`` accepts an optional - numerical index, starting from zero to specify which header you want to - check more specifically. For the same reason, ``removeAll()`` exists to - remove all headers that have the given name. - - .. code-block:: php - - $headers = $message->getHeaders(); - - // Remove the Subject: header - $headers->remove('Subject'); - - // Remove all X-Foo headers - $headers->removeAll('X-Foo'); - - // Remove only the second X-Foo header - $headers->remove('X-Foo', 1); - -Modifying a Header's Content -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To change a Header's content you should know what type of header it is and then -call it's appropriate setter method. All headers also have a -``setFieldBodyModel()`` method that accepts a mixed parameter and delegates to -the correct setter. - -To modify an existing header: - -* Get the HeaderSet from the entity by via its ``getHeaders()`` method. - -* Get the Header by using the HeaderSet's ``get()``. - -* Call the Header's appropriate setter method or call the header's - ``setFieldBodyModel()`` method. - -The header will be updated inside the HeaderSet and the changes will be seen -when the message is sent. - -.. code-block:: php - - $headers = $message->getHeaders(); - - // Change the Subject: header - $subj = $headers->get('Subject'); - $subj->setValue('new subject here'); - - // Change the To: header - $to = $headers->get('To'); - $to->setNameAddresses(array( - 'person@example.org' => 'Person', - 'thing@example.org' - )); - - // Using the setFieldBodyModel() just delegates to the correct method - // So here to calls setNameAddresses() - $to->setFieldBodyModel(array( - 'person@example.org' => 'Person', - 'thing@example.org' - )); diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/help-resources.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/help-resources.rst deleted file mode 100644 index 4208935..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/help-resources.rst +++ /dev/null @@ -1,44 +0,0 @@ -Getting Help -============ - -There are a number of ways you can get help when using Swift Mailer, depending -upon the nature of your problem. For bug reports and feature requests create a -new ticket in GitHub. For general advice ask on the Google Group -(swiftmailer). - -Submitting Bugs & Feature Requests ----------------------------------- - -Bugs and feature requests should be posted on GitHub. - -If you post a bug or request a feature in the forum, or on the Google Group -you will most likely be asked to create a ticket in `GitHub`_ since it is -simply not feasible to manage such requests from a number of a different -sources. - -When you go to GitHub you will be asked to create a username and password -before you can create a ticket. This is free and takes very little time. - -When you create your ticket, do not assign it to any milestones. A developer -will assess your ticket and re-assign it as needed. - -If your ticket is reporting a bug present in the current version, which was -not present in the previous version please include the tag "regression" in -your ticket. - -GitHub will update you when work is performed on your ticket. - -Ask on the Google Group ------------------------ - -You can seek advice at Google Groups, within the "swiftmailer" `group`_. - -You can post messages to this group if you want help, or there's something you -wish to discuss with the developers and with other users. - -This is probably the fastest way to get help since it is primarily email-based -for most users, though bug reports should not be posted here since they may -not be resolved. - -.. _`GitHub`: https://github.com/swiftmailer/swiftmailer/issues -.. _`group`: http://groups.google.com/group/swiftmailer diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/including-the-files.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/including-the-files.rst deleted file mode 100644 index 978dca2..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/including-the-files.rst +++ /dev/null @@ -1,46 +0,0 @@ -Including Swift Mailer (Autoloading) -==================================== - -If you are using Composer, Swift Mailer will be automatically autoloaded. - -If not, you can use the built-in autoloader by requiring the -``swift_required.php`` file:: - - require_once '/path/to/swift-mailer/lib/swift_required.php'; - - /* rest of code goes here */ - -If you want to override the default Swift Mailer configuration, call the -``init()`` method on the ``Swift`` class and pass it a valid PHP callable (a -PHP function name, a PHP 5.3 anonymous function, ...):: - - require_once '/path/to/swift-mailer/lib/swift_required.php'; - - function swiftmailer_configurator() { - // configure Swift Mailer - - Swift_DependencyContainer::getInstance()->... - Swift_Preferences::getInstance()->... - } - - Swift::init('swiftmailer_configurator'); - - /* rest of code goes here */ - -The advantage of using the ``init()`` method is that your code will be -executed only if you use Swift Mailer in your script. - -.. note:: - - While Swift Mailer's autoloader is designed to play nicely with other - autoloaders, sometimes you may have a need to avoid using Swift Mailer's - autoloader and use your own instead. Include the ``swift_init.php`` - instead of the ``swift_required.php`` if you need to do this. The very - minimum include is the ``swift_init.php`` file since Swift Mailer will not - work without the dependency injection this file sets up: - - .. code-block:: php - - require_once '/path/to/swift-mailer/lib/swift_init.php'; - - /* rest of code goes here */ diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/index.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/index.rst deleted file mode 100644 index a1a0a92..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/index.rst +++ /dev/null @@ -1,16 +0,0 @@ -Swiftmailer -=========== - -.. toctree:: - :maxdepth: 2 - - introduction - overview - installing - help-resources - including-the-files - messages - headers - sending - plugins - japanese diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/installing.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/installing.rst deleted file mode 100644 index 557211d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/installing.rst +++ /dev/null @@ -1,89 +0,0 @@ -Installing the Library -====================== - -Installing with Composer ------------------------- - -The recommended way to install Swiftmailer is via Composer: - -.. code-block:: bash - - $ php composer.phar require swiftmailer/swiftmailer @stable - -Installing from Git -------------------- - -It's possible to download and install Swift Mailer directly from github.com if -you want to keep up-to-date with ease. - -Swift Mailer's source code is kept in a git repository at github.com so you -can get the source directly from the repository. - -.. note:: - - You do not need to have git installed to use Swift Mailer from GitHub. If - you don't have git installed, go to `GitHub`_ and click the "Download" - button. - -Cloning the Repository -~~~~~~~~~~~~~~~~~~~~~~ - -The repository can be cloned from git://github.com/swiftmailer/swiftmailer.git -using the ``git clone`` command. - -You will need to have ``git`` installed before you can use the -``git clone`` command. - -To clone the repository: - -* Open your favorite terminal environment (command line). - -* Move to the directory you want to clone to. - -* Run the command ``git clone git://github.com/swiftmailer/swiftmailer.git - swiftmailer``. - -The source code will be downloaded into a directory called "swiftmailer". - -The example shows the process on a UNIX-like system such as Linux, BSD or Mac -OS X. - -.. code-block:: bash - - $ cd source_code/ - $ git clone git://github.com/swiftmailer/swiftmailer.git swiftmailer - Initialized empty Git repository in /Users/chris/source_code/swiftmailer/.git/ - remote: Counting objects: 6815, done. - remote: Compressing objects: 100% (2761/2761), done. - remote: Total 6815 (delta 3641), reused 6326 (delta 3286) - Receiving objects: 100% (6815/6815), 4.35 MiB | 162 KiB/s, done. - Resolving deltas: 100% (3641/3641), done. - Checking out files: 100% (1847/1847), done. - $ cd swiftmailer/ - $ ls - CHANGES LICENSE ... - $ - -Troubleshooting ---------------- - -Swift Mailer does not work when used with function overloading as implemented -by ``mbstring`` (``mbstring.func_overload`` set to ``2``). A workaround is to -temporarily change the internal encoding to ``ASCII`` when sending an email: - -.. code-block:: php - - if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) - { - $mbEncoding = mb_internal_encoding(); - mb_internal_encoding('ASCII'); - } - - // Create your message and send it with Swift Mailer - - if (isset($mbEncoding)) - { - mb_internal_encoding($mbEncoding); - } - -.. _`GitHub`: http://github.com/swiftmailer/swiftmailer diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/introduction.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/introduction.rst deleted file mode 100644 index a85336b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/introduction.rst +++ /dev/null @@ -1,135 +0,0 @@ -Introduction -============ - -Swift Mailer is a component-based library for sending e-mails from PHP -applications. - -Organization of this Book -------------------------- - -This book has been written so that those who need information quickly are able -to find what they need, and those who wish to learn more advanced topics can -read deeper into each chapter. - -The book begins with an overview of Swift Mailer, discussing what's included -in the package and preparing you for the remainder of the book. - -It is possible to read this user guide just like any other book (from -beginning to end). Each chapter begins with a discussion of the contents it -contains, followed by a short code sample designed to give you a head start. -As you get further into a chapter you will learn more about Swift Mailer's -capabilities, but often you will be able to head directly to the topic you -wish to learn about. - -Throughout this book you will be presented with code samples, which most -people should find ample to implement Swift Mailer appropriately in their own -projects. We will also use diagrams where appropriate, and where we believe -readers may find it helpful we will discuss some related theory, including -reference to certain documents you are able to find online. - -Code Samples ------------- - -Code samples presented in this book will be displayed on a different colored -background in a monospaced font. Samples are not to be taken as copy & paste -code snippets. - -Code examples are used through the book to clarify what is written in text. -They will sometimes be usable as-is, but they should always be taken as -outline/pseudo code only. - -A code sample will look like this:: - - class AClass - { - ... - } - - // A Comment - $obj = new AClass($arg1, $arg2, ... ); - - /* A note about another way of doing something - $obj = AClass::newInstance($arg1, $arg2, ... ); - - */ - -The presence of 3 dots ``...`` in a code sample indicates that we have left -out a chunk of the code for brevity, they are not actually part of the code. - -We will often place multi-line comments ``/* ... */`` in the code so that we -can show alternative ways of achieving the same result. - -You should read the code examples given and try to understand them. They are -kept concise so that you are not overwhelmed with information. - -History of Swift Mailer ------------------------ - -Swift Mailer began back in 2005 as a one-class project for sending mail over -SMTP. It has since grown into the flexible component-based library that is in -development today. - -Chris Corbyn first posted Swift Mailer on a web forum asking for comments from -other developers. It was never intended as a fully supported open source -project, but members of the forum began to adopt it and make use of it. - -Very quickly feature requests were coming for the ability to add attachments -and use SMTP authentication, along with a number of other "obvious" missing -features. Considering the only alternative was PHPMailer it seemed like a good -time to bring some fresh tools to the table. Chris began working towards a -more component based, PHP5-like approach unlike the existing single-class, -legacy PHP4 approach taken by PHPMailer. - -Members of the forum offered a lot of advice and critique on the code as he -worked through this project and released versions 2 and 3 of the library in -2005 and 2006, which by then had been broken down into smaller classes -offering more flexibility and supporting plugins. To this day the Swift Mailer -team still receive a lot of feature requests from users both on the forum and -in by email. - -Until 2008 Chris was the sole developer of Swift Mailer, but entering 2009 he -gained the support of two experienced developers well-known to him: Paul -Annesley and Christopher Thompson. This has been an extremely welcome change. - -As of September 2009, Chris handed over the maintenance of Swift Mailer to -Fabien Potencier. - -Now 2009 and in its fourth major version Swift Mailer is more object-oriented -and flexible than ever, both from a usability standpoint and from a -development standpoint. - -By no means is Swift Mailer ready to call "finished". There are still many -features that can be added to the library along with the constant refactoring -that happens behind the scenes. - -It's a Library! ---------------- - -Swift Mailer is not an application - it's a library. - -To most experienced developers this is probably an obvious point to make, but -it's certainly worth mentioning. Many people often contact us having gotten -the completely wrong end of the stick in terms of what Swift Mailer is -actually for. - -It's not an application. It does not have a graphical user interface. It -cannot be opened in your web browser directly. - -It's a library (or a framework if you like). It provides a whole lot of -classes that do some very complicated things, so that you don't have to. You -"use" Swift Mailer within an application so that your application can have the -ability to send emails. - -The component-based structure of the library means that you are free to -implement it in a number of different ways and that you can pick and choose -what you want to use. - -An application on the other hand (such as a blog or a forum) is already "put -together" in a particular way, (usually) provides a graphical user interface -and most likely doesn't offer a great deal of integration with your own -application. - -Embrace the structure of the library and use the components it offers to your -advantage. Learning what the components do, rather than blindly copying and -pasting existing code will put you in a great position to build a powerful -application! diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/japanese.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/japanese.rst deleted file mode 100644 index 34afa7b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/japanese.rst +++ /dev/null @@ -1,22 +0,0 @@ -Using Swift Mailer for Japanese Emails -====================================== - -To send emails in Japanese, you need to tweak the default configuration. - -After requiring the Swift Mailer autoloader (by including the -``swift_required.php`` file), call the ``Swift::init()`` method with the -following code:: - - require_once '/path/to/swift-mailer/lib/swift_required.php'; - - Swift::init(function () { - Swift_DependencyContainer::getInstance() - ->register('mime.qpheaderencoder') - ->asAliasOf('mime.base64headerencoder'); - - Swift_Preferences::getInstance()->setCharset('iso-2022-jp'); - }); - - /* rest of code goes here */ - -That's all! diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/messages.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/messages.rst deleted file mode 100644 index b058b77..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/messages.rst +++ /dev/null @@ -1,1058 +0,0 @@ -Creating Messages -================= - -Creating messages in Swift Mailer is done by making use of the various MIME -entities provided with the library. Complex messages can be quickly created -with very little effort. - -Quick Reference for Creating a Message ---------------------------------------- - -You can think of creating a Message as being similar to the steps you perform -when you click the Compose button in your mail client. You give it a subject, -specify some recipients, add any attachments and write your message. - -To create a Message: - -* Call the ``newInstance()`` method of ``Swift_Message``. - -* Set your sender address (``From:``) with ``setFrom()`` or ``setSender()``. - -* Set a subject line with ``setSubject()``. - -* Set recipients with ``setTo()``, ``setCc()`` and/or ``setBcc()``. - -* Set a body with ``setBody()``. - -* Add attachments with ``attach()``. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the message - $message = Swift_Message::newInstance() - - // Give the message a subject - ->setSubject('Your subject') - - // Set the From address with an associative array - ->setFrom(array('john@doe.com' => 'John Doe')) - - // Set the To addresses with an associative array - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - - // Give it a body - ->setBody('Here is the message itself') - - // And optionally an alternative body - ->addPart('<q>Here is the message itself</q>', 'text/html') - - // Optionally add any attachments - ->attach(Swift_Attachment::fromPath('my-document.pdf')) - ; - -Message Basics --------------- - -A message is a container for anything you want to send to somebody else. There -are several basic aspects of a message that you should know. - -An e-mail message is made up of several relatively simple entities that are -combined in different ways to achieve different results. All of these entities -have the same fundamental outline but serve a different purpose. The Message -itself can be defined as a MIME entity, an Attachment is a MIME entity, all -MIME parts are MIME entities -- and so on! - -The basic units of each MIME entity -- be it the Message itself, or an -Attachment -- are its Headers and its body: - -.. code-block:: text - - Header-Name: A header value - Other-Header: Another value - - The body content itself - -The Headers of a MIME entity, and its body must conform to some strict -standards defined by various RFC documents. Swift Mailer ensures that these -specifications are followed by using various types of object, including -Encoders and different Header types to generate the entity. - -The Structure of a Message -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Of all of the MIME entities, a message -- ``Swift_Message`` -is the largest and most complex. It has many properties that can be updated -and it can contain other MIME entities -- attachments for example -- -nested inside it. - -A Message has a lot of different Headers which are there to present -information about the message to the recipients' mail client. Most of these -headers will be familiar to the majority of users, but we'll list the basic -ones. Although it's possible to work directly with the Headers of a Message -(or other MIME entity), the standard Headers have accessor methods provided to -abstract away the complex details for you. For example, although the Date on a -message is written with a strict format, you only need to pass a UNIX -timestamp to ``setDate()``. - -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| Header | Description | Accessors | -+===============================+====================================================================================================================================+=============================================+ -| ``Message-ID`` | Identifies this message with a unique ID, usually containing the domain name and time generated | ``getId()`` / ``setId()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Return-Path`` | Specifies where bounces should go (Swift Mailer reads this for other uses) | ``getReturnPath()`` / ``setReturnPath()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``From`` | Specifies the address of the person who the message is from. This can be multiple addresses if multiple people wrote the message. | ``getFrom()`` / ``setFrom()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Sender`` | Specifies the address of the person who physically sent the message (higher precedence than ``From:``) | ``getSender()`` / ``setSender()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``To`` | Specifies the addresses of the intended recipients | ``getTo()`` / ``setTo()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Cc`` | Specifies the addresses of recipients who will be copied in on the message | ``getCc()`` / ``setCc()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Bcc`` | Specifies the addresses of recipients who the message will be blind-copied to. Other recipients will not be aware of these copies. | ``getBcc()`` / ``setBcc()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Reply-To`` | Specifies the address where replies are sent to | ``getReplyTo()`` / ``setReplyTo()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Subject`` | Specifies the subject line that is displayed in the recipients' mail client | ``getSubject()`` / ``setSubject()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Date`` | Specifies the date at which the message was sent | ``getDate()`` / ``setDate()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Content-Type`` | Specifies the format of the message (usually text/plain or text/html) | ``getContentType()`` / ``setContentType()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Content-Transfer-Encoding`` | Specifies the encoding scheme in the message | ``getEncoder()`` / ``setEncoder()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ - -Working with a Message Object -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Although there are a lot of available methods on a message object, you only -need to make use of a small subset of them. Usually you'll use -``setSubject()``, ``setTo()`` and -``setFrom()`` before setting the body of your message with -``setBody()``. - -Calling methods is simple. You just call them like functions, but using the -object operator "``->``" to do so. If you've created -a message object and called it ``$message`` then you'd set a -subject on it like so: - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - $message = Swift_Message::newInstance(); - $message->setSubject('My subject'); - -All MIME entities (including a message) have a ``toString()`` -method that you can call if you want to take a look at what is going to be -sent. For example, if you ``echo -$message->toString();`` you would see something like this: - -.. code-block:: bash - - Message-ID: <1230173678.4952f5eeb1432@swift.generated> - Date: Thu, 25 Dec 2008 13:54:38 +1100 - Subject: Example subject - From: Chris Corbyn <chris@w3style.co.uk> - To: Receiver Name <recipient@example.org> - MIME-Version: 1.0 - Content-Type: text/plain; charset=utf-8 - Content-Transfer-Encoding: quoted-printable - - Here is the message - -We'll take a closer look at the methods you use to create your message in the -following sections. - -Adding Content to Your Message ------------------------------- - -Rich content can be added to messages in Swift Mailer with relative ease by -calling methods such as ``setSubject()``, ``setBody()``, ``addPart()`` and -``attach()``. - -Setting the Subject Line -~~~~~~~~~~~~~~~~~~~~~~~~ - -The subject line, displayed in the recipients' mail client can be set with the -``setSubject()`` method, or as a parameter to ``Swift_Message::newInstance()``. - -To set the subject of your Message: - -* Call the ``setSubject()`` method of the Message, or specify it at the time - you create the message. - - .. code-block:: php - - // Pass it as a parameter when you create the message - $message = Swift_Message::newInstance('My amazing subject'); - - // Or set it after like this - $message->setSubject('My amazing subject'); - -Setting the Body Content -~~~~~~~~~~~~~~~~~~~~~~~~ - -The body of the message -- seen when the user opens the message -- -is specified by calling the ``setBody()`` method. If an alternative body is to -be included ``addPart()`` can be used. - -The body of a message is the main part that is read by the user. Often people -want to send a message in HTML format (``text/html``), other -times people want to send in plain text (``text/plain``), or -sometimes people want to send both versions and allow the recipient to choose -how they view the message. - -As a rule of thumb, if you're going to send a HTML email, always include a -plain-text equivalent of the same content so that users who prefer to read -plain text can do so. - -To set the body of your Message: - -* Call the ``setBody()`` method of the Message, or specify it at the time you - create the message. - -* Add any alternative bodies with ``addPart()``. - -If the recipient's mail client offers preferences for displaying text vs. HTML -then the mail client will present that part to the user where available. In -other cases the mail client will display the "best" part it can - usually HTML -if you've included HTML. - -.. code-block:: php - - // Pass it as a parameter when you create the message - $message = Swift_Message::newInstance('Subject here', 'My amazing body'); - - // Or set it after like this - $message->setBody('My <em>amazing</em> body', 'text/html'); - - // Add alternative parts with addPart() - $message->addPart('My amazing body in plain text', 'text/plain'); - -Attaching Files ---------------- - -Attachments are downloadable parts of a message and can be added by calling -the ``attach()`` method on the message. You can add attachments that exist on -disk, or you can create attachments on-the-fly. - -Attachments are actually an interesting area of Swift Mailer and something -that could put a lot of power at your fingertips if you grasp the concept -behind the way a message is held together. - -Although we refer to files sent over e-mails as "attachments" -- because -they're attached to the message -- lots of other parts of the message are -actually "attached" even if we don't refer to these parts as attachments. - -File attachments are created by the ``Swift_Attachment`` class -and then attached to the message via the ``attach()`` method on -it. For all of the "every day" MIME types such as all image formats, word -documents, PDFs and spreadsheets you don't need to explicitly set the -content-type of the attachment, though it would do no harm to do so. For less -common formats you should set the content-type -- which we'll cover in a -moment. - -Attaching Existing Files -~~~~~~~~~~~~~~~~~~~~~~~~ - -Files that already exist, either on disk or at a URL can be attached to a -message with just one line of code, using ``Swift_Attachment::fromPath()``. - -You can attach files that exist locally, or if your PHP installation has -``allow_url_fopen`` turned on you can attach files from other -websites. - -To attach an existing file: - -* Create an attachment with ``Swift_Attachment::fromPath()``. - -* Add the attachment to the message with ``attach()``. - -The attachment will be presented to the recipient as a downloadable file with -the same filename as the one you attached. - -.. code-block:: php - - // Create the attachment - // * Note that you can technically leave the content-type parameter out - $attachment = Swift_Attachment::fromPath('/path/to/image.jpg', 'image/jpeg'); - - // Attach it to the message - $message->attach($attachment); - - // The two statements above could be written in one line instead - $message->attach(Swift_Attachment::fromPath('/path/to/image.jpg')); - - // You can attach files from a URL if allow_url_fopen is on in php.ini - $message->attach(Swift_Attachment::fromPath('http://site.tld/logo.png')); - -Setting the Filename -~~~~~~~~~~~~~~~~~~~~ - -Usually you don't need to explicitly set the filename of an attachment because -the name of the attached file will be used by default, but if you want to set -the filename you use the ``setFilename()`` method of the Attachment. - -To change the filename of an attachment: - -* Call its ``setFilename()`` method. - -The attachment will be attached in the normal way, but meta-data sent inside -the email will rename the file to something else. - -.. code-block:: php - - // Create the attachment and call its setFilename() method - $attachment = Swift_Attachment::fromPath('/path/to/image.jpg') - ->setFilename('cool.jpg'); - - // Because there's a fluid interface, you can do this in one statement - $message->attach( - Swift_Attachment::fromPath('/path/to/image.jpg')->setFilename('cool.jpg') - ); - -Attaching Dynamic Content -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Files that are generated at runtime, such as PDF documents or images created -via GD can be attached directly to a message without writing them out to disk. -Use the standard ``Swift_Attachment::newInstance()`` method. - -To attach dynamically created content: - -* Create your content as you normally would. - -* Create an attachment with ``Swift_Attachment::newInstance()``, specifying - the source data of your content along with a name and the content-type. - -* Add the attachment to the message with ``attach()``. - -The attachment will be presented to the recipient as a downloadable file -with the filename and content-type you specify. - -.. note:: - - If you would usually write the file to disk anyway you should just attach - it with ``Swift_Attachment::fromPath()`` since this will use less memory: - - .. code-block:: php - - // Create your file contents in the normal way, but don't write them to disk - $data = create_my_pdf_data(); - - // Create the attachment with your data - $attachment = Swift_Attachment::newInstance($data, 'my-file.pdf', 'application/pdf'); - - // Attach it to the message - $message->attach($attachment); - - - // You can alternatively use method chaining to build the attachment - $attachment = Swift_Attachment::newInstance() - ->setFilename('my-file.pdf') - ->setContentType('application/pdf') - ->setBody($data) - ; - -Changing the Disposition -~~~~~~~~~~~~~~~~~~~~~~~~ - -Attachments just appear as files that can be saved to the Desktop if desired. -You can make attachment appear inline where possible by using the -``setDisposition()`` method of an attachment. - -To make an attachment appear inline: - -* Call its ``setDisposition()`` method. - -The attachment will be displayed within the email viewing window if the mail -client knows how to display it. - -.. note:: - - If you try to create an inline attachment for a non-displayable file type - such as a ZIP file, the mail client should just present the attachment as - normal: - - .. code-block:: php - - // Create the attachment and call its setDisposition() method - $attachment = Swift_Attachment::fromPath('/path/to/image.jpg') - ->setDisposition('inline'); - - - // Because there's a fluid interface, you can do this in one statement - $message->attach( - Swift_Attachment::fromPath('/path/to/image.jpg')->setDisposition('inline') - ); - -Embedding Inline Media Files -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Often people want to include an image or other content inline with a HTML -message. It's easy to do this with HTML linking to remote resources, but this -approach is usually blocked by mail clients. Swift Mailer allows you to embed -your media directly into the message. - -Mail clients usually block downloads from remote resources because this -technique was often abused as a mean of tracking who opened an email. If -you're sending a HTML email and you want to include an image in the message -another approach you can take is to embed the image directly. - -Swift Mailer makes embedding files into messages extremely streamlined. You -embed a file by calling the ``embed()`` method of the message, -which returns a value you can use in a ``src`` or -``href`` attribute in your HTML. - -Just like with attachments, it's possible to embed dynamically generated -content without having an existing file available. - -The embedded files are sent in the email as a special type of attachment that -has a unique ID used to reference them within your HTML attributes. On mail -clients that do not support embedded files they may appear as attachments. - -Although this is commonly done for images, in theory it will work for any -displayable (or playable) media type. Support for other media types (such as -video) is dependent on the mail client however. - -Embedding Existing Files -........................ - -Files that already exist, either on disk or at a URL can be embedded in a -message with just one line of code, using ``Swift_EmbeddedFile::fromPath()``. - -You can embed files that exist locally, or if your PHP installation has -``allow_url_fopen`` turned on you can embed files from other websites. - -To embed an existing file: - -* Create a message object with ``Swift_Message::newInstance()``. - -* Set the body as HTML, and embed a file at the correct point in the message with ``embed()``. - -The file will be displayed with the message inline with the HTML wherever its ID -is used as a ``src`` attribute. - -.. note:: - - ``Swift_Image`` and ``Swift_EmbeddedFile`` are just aliases of one - another. ``Swift_Image`` exists for semantic purposes. - -.. note:: - - You can embed files in two stages if you prefer. Just capture the return - value of ``embed()`` in a variable and use that as the ``src`` attribute. - - .. code-block:: php - - // Create the message - $message = Swift_Message::newInstance('My subject'); - - // Set the body - $message->setBody( - '<html>' . - ' <head></head>' . - ' <body>' . - ' Here is an image <img src="' . // Embed the file - $message->embed(Swift_Image::fromPath('image.png')) . - '" alt="Image" />' . - ' Rest of message' . - ' </body>' . - '</html>', - 'text/html' // Mark the content-type as HTML - ); - - // You can embed files from a URL if allow_url_fopen is on in php.ini - $message->setBody( - '<html>' . - ' <head></head>' . - ' <body>' . - ' Here is an image <img src="' . - $message->embed(Swift_Image::fromPath('http://site.tld/logo.png')) . - '" alt="Image" />' . - ' Rest of message' . - ' </body>' . - '</html>', - 'text/html' - ); - - - // If placing the embed() code inline becomes cumbersome - // it's easy to do this in two steps - $cid = $message->embed(Swift_Image::fromPath('image.png')); - - $message->setBody( - '<html>' . - ' <head></head>' . - ' <body>' . - ' Here is an image <img src="' . $cid . '" alt="Image" />' . - ' Rest of message' . - ' </body>' . - '</html>', - 'text/html' // Mark the content-type as HTML - ); - -Embedding Dynamic Content -......................... - -Images that are generated at runtime, such as images created via GD can be -embedded directly to a message without writing them out to disk. Use the -standard ``Swift_Image::newInstance()`` method. - -To embed dynamically created content: - -* Create a message object with ``Swift_Message::newInstance()``. - -* Set the body as HTML, and embed a file at the correct point in the message - with ``embed()``. You will need to specify a filename and a content-type. - -The file will be displayed with the message inline with the HTML wherever its ID -is used as a ``src`` attribute. - -.. note:: - - ``Swift_Image`` and ``Swift_EmbeddedFile`` are just aliases of one - another. ``Swift_Image`` exists for semantic purposes. - -.. note:: - - You can embed files in two stages if you prefer. Just capture the return - value of ``embed()`` in a variable and use that as the ``src`` attribute. - - .. code-block:: php - - // Create your file contents in the normal way, but don't write them to disk - $img_data = create_my_image_data(); - - // Create the message - $message = Swift_Message::newInstance('My subject'); - - // Set the body - $message->setBody( - '<html>' . - ' <head></head>' . - ' <body>' . - ' Here is an image <img src="' . // Embed the file - $message->embed(Swift_Image::newInstance($img_data, 'image.jpg', 'image/jpeg')) . - '" alt="Image" />' . - ' Rest of message' . - ' </body>' . - '</html>', - 'text/html' // Mark the content-type as HTML - ); - - - // If placing the embed() code inline becomes cumbersome - // it's easy to do this in two steps - $cid = $message->embed(Swift_Image::newInstance($img_data, 'image.jpg', 'image/jpeg')); - - $message->setBody( - '<html>' . - ' <head></head>' . - ' <body>' . - ' Here is an image <img src="' . $cid . '" alt="Image" />' . - ' Rest of message' . - ' </body>' . - '</html>', - 'text/html' // Mark the content-type as HTML - ); - -Adding Recipients to Your Message ---------------------------------- - -Recipients are specified within the message itself via ``setTo()``, ``setCc()`` -and ``setBcc()``. Swift Mailer reads these recipients from the message when it -gets sent so that it knows where to send the message to. - -Message recipients are one of three types: - -* ``To:`` recipients -- the primary recipients (required) - -* ``Cc:`` recipients -- receive a copy of the message (optional) - -* ``Bcc:`` recipients -- hidden from other recipients (optional) - -Each type can contain one, or several addresses. It's possible to list only -the addresses of the recipients, or you can personalize the address by -providing the real name of the recipient. - -Make sure to add only valid email addresses as recipients. If you try to add an -invalid email address with ``setTo()``, ``setCc()`` or ``setBcc()``, Swift -Mailer will throw a ``Swift_RfcComplianceException``. - -If you add recipients automatically based on a data source that may contain -invalid email addresses, you can prevent possible exceptions by validating the -addresses using ``Swift_Validate::email($email)`` and only adding addresses -that validate. Another way would be to wrap your ``setTo()``, ``setCc()`` and -``setBcc()`` calls in a try-catch block and handle the -``Swift_RfcComplianceException`` in the catch block. - -.. sidebar:: Syntax for Addresses - - If you only wish to refer to a single email address (for example your - ``From:`` address) then you can just use a string. - - .. code-block:: php - - $message->setFrom('some@address.tld'); - - If you want to include a name then you must use an associative array. - - .. code-block:: php - - $message->setFrom(array('some@address.tld' => 'The Name')); - - If you want to include multiple addresses then you must use an array. - - .. code-block:: php - - $message->setTo(array('some@address.tld', 'other@address.tld')); - - You can mix personalized (addresses with a name) and non-personalized - addresses in the same list by mixing the use of associative and - non-associative array syntax. - - .. code-block:: php - - $message->setTo(array( - 'recipient-with-name@example.org' => 'Recipient Name One', - 'no-name@example.org', // Note that this is not a key-value pair - 'named-recipient@example.org' => 'Recipient Name Two' - )); - -Setting ``To:`` Recipients -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``To:`` recipients are required in a message and are set with the -``setTo()`` or ``addTo()`` methods of the message. - -To set ``To:`` recipients, create the message object using either -``new Swift_Message( ... )`` or ``Swift_Message::newInstance( ... )``, -then call the ``setTo()`` method with a complete array of addresses, or use the -``addTo()`` method to iteratively add recipients. - -The ``setTo()`` method accepts input in various formats as described earlier in -this chapter. The ``addTo()`` method takes either one or two parameters. The -first being the email address and the second optional parameter being the name -of the recipient. - -``To:`` recipients are visible in the message headers and will be -seen by the other recipients. - -.. note:: - - Multiple calls to ``setTo()`` will not add new recipients -- each - call overrides the previous calls. If you want to iteratively add - recipients, use the ``addTo()`` method. - - .. code-block:: php - - // Using setTo() to set all recipients in one go - $message->setTo(array( - 'person1@example.org', - 'person2@otherdomain.org' => 'Person 2 Name', - 'person3@example.org', - 'person4@example.org', - 'person5@example.org' => 'Person 5 Name' - )); - - // Using addTo() to add recipients iteratively - $message->addTo('person1@example.org'); - $message->addTo('person2@example.org', 'Person 2 Name'); - -Setting ``Cc:`` Recipients -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``Cc:`` recipients are set with the ``setCc()`` or ``addCc()`` methods of the -message. - -To set ``Cc:`` recipients, create the message object using either -``new Swift_Message( ... )`` or ``Swift_Message::newInstance( ... )``, then call -the ``setCc()`` method with a complete array of addresses, or use the -``addCc()`` method to iteratively add recipients. - -The ``setCc()`` method accepts input in various formats as described earlier in -this chapter. The ``addCc()`` method takes either one or two parameters. The -first being the email address and the second optional parameter being the name -of the recipient. - -``Cc:`` recipients are visible in the message headers and will be -seen by the other recipients. - -.. note:: - - Multiple calls to ``setCc()`` will not add new recipients -- each - call overrides the previous calls. If you want to iteratively add Cc: - recipients, use the ``addCc()`` method. - - .. code-block:: php - - // Using setCc() to set all recipients in one go - $message->setCc(array( - 'person1@example.org', - 'person2@otherdomain.org' => 'Person 2 Name', - 'person3@example.org', - 'person4@example.org', - 'person5@example.org' => 'Person 5 Name' - )); - - // Using addCc() to add recipients iteratively - $message->addCc('person1@example.org'); - $message->addCc('person2@example.org', 'Person 2 Name'); - -Setting ``Bcc:`` Recipients -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``Bcc:`` recipients receive a copy of the message without anybody else knowing -it, and are set with the ``setBcc()`` or ``addBcc()`` methods of the message. - -To set ``Bcc:`` recipients, create the message object using either ``new -Swift_Message( ... )`` or ``Swift_Message::newInstance( ... )``, then call the -``setBcc()`` method with a complete array of addresses, or use -the ``addBcc()`` method to iteratively add recipients. - -The ``setBcc()`` method accepts input in various formats as described earlier in -this chapter. The ``addBcc()`` method takes either one or two parameters. The -first being the email address and the second optional parameter being the name -of the recipient. - -Only the individual ``Bcc:`` recipient will see their address in the message -headers. Other recipients (including other ``Bcc:`` recipients) will not see the -address. - -.. note:: - - Multiple calls to ``setBcc()`` will not add new recipients -- each - call overrides the previous calls. If you want to iteratively add Bcc: - recipients, use the ``addBcc()`` method. - - .. code-block:: php - - // Using setBcc() to set all recipients in one go - $message->setBcc(array( - 'person1@example.org', - 'person2@otherdomain.org' => 'Person 2 Name', - 'person3@example.org', - 'person4@example.org', - 'person5@example.org' => 'Person 5 Name' - )); - - // Using addBcc() to add recipients iteratively - $message->addBcc('person1@example.org'); - $message->addBcc('person2@example.org', 'Person 2 Name'); - -Specifying Sender Details -------------------------- - -An email must include information about who sent it. Usually this is managed -by the ``From:`` address, however there are other options. - -The sender information is contained in three possible places: - -* ``From:`` -- the address(es) of who wrote the message (required) - -* ``Sender:`` -- the address of the single person who sent the message - (optional) - -* ``Return-Path:`` -- the address where bounces should go to (optional) - -You must always include a ``From:`` address by using ``setFrom()`` on the -message. Swift Mailer will use this as the default ``Return-Path:`` unless -otherwise specified. - -The ``Sender:`` address exists because the person who actually sent the email -may not be the person who wrote the email. It has a higher precedence than the -``From:`` address and will be used as the ``Return-Path:`` unless otherwise -specified. - -Setting the ``From:`` Address -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A ``From:`` address is required and is set with the ``setFrom()`` method of the -message. ``From:`` addresses specify who actually wrote the email, and usually who sent it. - -What most people probably don't realise is that you can have more than one -``From:`` address if more than one person wrote the email -- for example if an -email was put together by a committee. - -To set the ``From:`` address(es): - -* Call the ``setFrom()`` method on the Message. - -The ``From:`` address(es) are visible in the message headers and -will be seen by the recipients. - -.. note:: - - If you set multiple ``From:`` addresses then you absolutely must set a - ``Sender:`` address to indicate who physically sent the message. - - .. code-block:: php - - // Set a single From: address - $message->setFrom('your@address.tld'); - - // Set a From: address including a name - $message->setFrom(array('your@address.tld' => 'Your Name')); - - // Set multiple From: addresses if multiple people wrote the email - $message->setFrom(array( - 'person1@example.org' => 'Sender One', - 'person2@example.org' => 'Sender Two' - )); - -Setting the ``Sender:`` Address -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A ``Sender:`` address specifies who sent the message and is set with the -``setSender()`` method of the message. - -To set the ``Sender:`` address: - -* Call the ``setSender()`` method on the Message. - -The ``Sender:`` address is visible in the message headers and will be seen by -the recipients. - -This address will be used as the ``Return-Path:`` unless otherwise specified. - -.. note:: - - If you set multiple ``From:`` addresses then you absolutely must set a - ``Sender:`` address to indicate who physically sent the message. - -You must not set more than one sender address on a message because it's not -possible for more than one person to send a single message. - -.. code-block:: php - - $message->setSender('your@address.tld'); - -Setting the ``Return-Path:`` (Bounce) Address -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The ``Return-Path:`` address specifies where bounce notifications should -be sent and is set with the ``setReturnPath()`` method of the message. - -You can only have one ``Return-Path:`` and it must not include -a personal name. - -To set the ``Return-Path:`` address: - -* Call the ``setReturnPath()`` method on the Message. - -Bounce notifications will be sent to this address. - -.. code-block:: php - - $message->setReturnPath('bounces@address.tld'); - - -Signed/Encrypted Message ------------------------- - -To increase the integrity/security of a message it is possible to sign and/or -encrypt an message using one or multiple signers. - -S/MIME -~~~~~~ - -S/MIME can sign and/or encrypt a message using the OpenSSL extension. - -When signing a message, the signer creates a signature of the entire content of the message (including attachments). - -The certificate and private key must be PEM encoded, and can be either created using for example OpenSSL or -obtained at an official Certificate Authority (CA). - -**The recipient must have the CA certificate in the list of trusted issuers in order to verify the signature.** - -**Make sure the certificate supports emailProtection.** - -When using OpenSSL this can done by the including the *-addtrust emailProtection* parameter when creating the certificate. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $smimeSigner = Swift_Signers_SMimeSigner::newInstance(); - $smimeSigner->setSignCertificate('/path/to/certificate.pem', '/path/to/private-key.pem'); - $message->attachSigner($smimeSigner); - -When the private key is secured using a passphrase use the following instead. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $smimeSigner = Swift_Signers_SMimeSigner::newInstance(); - $smimeSigner->setSignCertificate('/path/to/certificate.pem', array('/path/to/private-key.pem', 'passphrase')); - $message->attachSigner($smimeSigner); - -By default the signature is added as attachment, -making the message still readable for mailing agents not supporting signed messages. - -Storing the message as binary is also possible but not recommended. - -.. code-block:: php - - $smimeSigner->setSignCertificate('/path/to/certificate.pem', '/path/to/private-key.pem', PKCS7_BINARY); - -When encrypting the message (also known as enveloping), the entire message (including attachments) -is encrypted using a certificate, and the recipient can then decrypt the message using corresponding private key. - -Encrypting ensures nobody can read the contents of the message without the private key. - -Normally the recipient provides a certificate for encrypting and keeping the decryption key private. - -Using both signing and encrypting is also possible. - -.. code-block:: php - - $message = Swift_Message::newInstance(); - - $smimeSigner = Swift_Signers_SMimeSigner::newInstance(); - $smimeSigner->setSignCertificate('/path/to/sign-certificate.pem', '/path/to/private-key.pem'); - $smimeSigner->setEncryptCertificate('/path/to/encrypt-certificate.pem'); - $message->attachSigner($smimeSigner); - -The used encryption cipher can be set as the second parameter of setEncryptCertificate() - -See http://php.net/manual/openssl.ciphers for a list of supported ciphers. - -By default the message is first signed and then encrypted, this can be changed by adding. - -.. code-block:: php - - $smimeSigner->setSignThenEncrypt(false); - -**Changing this is not recommended as most mail agents don't support this none-standard way.** - -Only when having trouble with sign then encrypt method, this should be changed. - -Requesting a Read Receipt -------------------------- - -It is possible to request a read-receipt to be sent to an address when the -email is opened. To request a read receipt set the address with -``setReadReceiptTo()``. - -To request a read receipt: - -* Set the address you want the receipt to be sent to with the - ``setReadReceiptTo()`` method on the Message. - -When the email is opened, if the mail client supports it a notification will be sent to this address. - -.. note:: - - Read receipts won't work for the majority of recipients since many mail - clients auto-disable them. Those clients that will send a read receipt - will make the user aware that one has been requested. - - .. code-block:: php - - $message->setReadReceiptTo('your@address.tld'); - -Setting the Character Set -------------------------- - -The character set of the message (and it's MIME parts) is set with the -``setCharset()`` method. You can also change the global default of UTF-8 by -working with the ``Swift_Preferences`` class. - -Swift Mailer will default to the UTF-8 character set unless otherwise -overridden. UTF-8 will work in most instances since it includes all of the -standard US keyboard characters in addition to most international characters. - -It is absolutely vital however that you know what character set your message -(or it's MIME parts) are written in otherwise your message may be received -completely garbled. - -There are two places in Swift Mailer where you can change the character set: - -* In the ``Swift_Preferences`` class - -* On each individual message and/or MIME part - -To set the character set of your Message: - -* Change the global UTF-8 setting by calling - ``Swift_Preferences::setCharset()``; or - -* Call the ``setCharset()`` method on the message or the MIME part. - - .. code-block:: php - - // Approach 1: Change the global setting (suggested) - Swift_Preferences::getInstance()->setCharset('iso-8859-2'); - - // Approach 2: Call the setCharset() method of the message - $message = Swift_Message::newInstance() - ->setCharset('iso-8859-2'); - - // Approach 3: Specify the charset when setting the body - $message->setBody('My body', 'text/html', 'iso-8859-2'); - - // Approach 4: Specify the charset for each part added - $message->addPart('My part', 'text/plain', 'iso-8859-2'); - -Setting the Line Length ------------------------ - -The length of lines in a message can be changed by using the ``setMaxLineLength()`` method on the message. It should be kept to less than -1000 characters. - -Swift Mailer defaults to using 78 characters per line in a message. This is -done for historical reasons and so that the message can be easily viewed in -plain-text terminals. - -To change the maximum length of lines in your Message: - -* Call the ``setMaxLineLength()`` method on the Message. - -Lines that are longer than the line length specified will be wrapped between -words. - -.. note:: - - You should never set a maximum length longer than 1000 characters - according to RFC 2822. Doing so could have unspecified side-effects such - as truncating parts of your message when it is transported between SMTP - servers. - - .. code-block:: php - - $message->setMaxLineLength(1000); - -Setting the Message Priority ----------------------------- - -You can change the priority of the message with ``setPriority()``. Setting the -priority will not change the way your email is sent -- it is purely an -indicative setting for the recipient. - -The priority of a message is an indication to the recipient what significance -it has. Swift Mailer allows you to set the priority by calling the -``setPriority`` method. This method takes an integer value between 1 and 5: - -* `Swift_Mime_SimpleMessage::PRIORITY_HIGHEST`: 1 -* `Swift_Mime_SimpleMessage::PRIORITY_HIGH`: 2 -* `Swift_Mime_SimpleMessage::PRIORITY_NORMAL`: 3 -* `Swift_Mime_SimpleMessage::PRIORITY_LOW`: 4 -* `Swift_Mime_SimpleMessage::PRIORITY_LOWEST`: 5 - -To set the message priority: - -* Set the priority as an integer between 1 and 5 with the ``setPriority()`` - method on the Message. - -.. code-block:: php - - // Indicate "High" priority - $message->setPriority(2); - - // Or use the constant to be more explicit - $message->setPriority(Swift_Mime_SimpleMessage::PRIORITY_HIGH); diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/overview.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/overview.rst deleted file mode 100644 index ebfe008..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/overview.rst +++ /dev/null @@ -1,159 +0,0 @@ -Library Overview -================ - -Most features (and more) of your every day mail client software are provided -by Swift Mailer, using object-oriented PHP code as the interface. - -In this chapter we will take a short tour of the various components, which put -together form the Swift Mailer library as a whole. You will learn key -terminology used throughout the rest of this book and you will gain a little -understanding of the classes you will work with as you integrate Swift Mailer -into your application. - -This chapter is intended to prepare you for the information contained in the -subsequent chapters of this book. You may choose to skip this chapter if you -are fairly technically minded, though it is likely to save you some time in -the long run if you at least read between the lines here. - -System Requirements -------------------- - -The basic requirements to operate Swift Mailer are extremely minimal and -easily achieved. Historically, Swift Mailer has supported both PHP 4 and PHP 5 -by following a parallel development workflow. Now in it's fourth major -version, and Swift Mailer operates on servers running PHP 5.3.3 or higher. - -The library aims to work with as many PHP 5 projects as possible: - -* PHP 5.3.3 or higher, with the SPL extension (standard) - -* Limited network access to connect to remote SMTP servers - -* 8 MB or more memory limit (Swift Mailer uses around 2 MB) - -Component Breakdown -------------------- - -Swift Mailer is made up of many classes. Each of these classes can be grouped -into a general "component" group which describes the task it is designed to -perform. - -We'll take a brief look at the components which form Swift Mailer in this -section of the book. - -The Mailer -~~~~~~~~~~ - -The mailer class, ``Swift_Mailer`` is the central class in the library where -all of the other components meet one another. ``Swift_Mailer`` acts as a sort -of message dispatcher, communicating with the underlying Transport to deliver -your Message to all intended recipients. - -If you were to dig around in the source code for Swift Mailer you'd notice -that ``Swift_Mailer`` itself is pretty bare. It delegates to other objects for -most tasks and in theory, if you knew the internals of Swift Mailer well you -could by-pass this class entirely. We wouldn't advise doing such a thing -however -- there are reasons this class exists: - -* for consistency, regardless of the Transport used - -* to provide abstraction from the internals in the event internal API changes - are made - -* to provide convenience wrappers around aspects of the internal API - -An instance of ``Swift_Mailer`` is created by the developer before sending any -Messages. - -Transports -~~~~~~~~~~ - -Transports are the classes in Swift Mailer that are responsible for -communicating with a service in order to deliver a Message. There are several -types of Transport in Swift Mailer, all of which implement the Swift_Transport -interface and offer underlying start(), stop() and send() methods. - -Typically you will not need to know how a Transport works under-the-surface, -you will only need to know how to create an instance of one, and which one to -use for your environment. - -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ -| Class | Features | Pros/cons | -+=================================+=============================================================================================+===============================================================================================================================================+ -| ``Swift_SmtpTransport`` | Sends messages over SMTP; Supports Authentication; Supports Encryption | Very portable; Pleasingly predictable results; Provides good feedback | -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ -| ``Swift_SendmailTransport`` | Communicates with a locally installed ``sendmail`` executable (Linux/UNIX) | Quick time-to-run; Provides less-accurate feedback than SMTP; Requires ``sendmail`` installation | -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ -| ``Swift_LoadBalancedTransport`` | Cycles through a collection of the other Transports to manage load-reduction | Provides graceful fallback if one Transport fails (e.g. an SMTP server is down); Keeps the load on remote services down by spreading the work | -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ -| ``Swift_FailoverTransport`` | Works in conjunction with a collection of the other Transports to provide high-availability | Provides graceful fallback if one Transport fails (e.g. an SMTP server is down) | -+---------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ - -MIME Entities -~~~~~~~~~~~~~ - -Everything that forms part of a Message is called a MIME Entity. All MIME -entities in Swift Mailer share a common set of features. There are various -types of MIME entity that serve different purposes such as Attachments and -MIME parts. - -An e-mail message is made up of several relatively simple entities that are -combined in different ways to achieve different results. All of these entities -have the same fundamental outline but serve a different purpose. The Message -itself can be defined as a MIME entity, an Attachment is a MIME entity, all -MIME parts are MIME entities -- and so on! - -The basic units of each MIME entity -- be it the Message itself, or an -Attachment -- are its Headers and its body: - -.. code-block:: text - - Other-Header: Another value - - The body content itself - -The Headers of a MIME entity, and its body must conform to some strict -standards defined by various RFC documents. Swift Mailer ensures that these -specifications are followed by using various types of object, including -Encoders and different Header types to generate the entity. - -Each MIME component implements the base ``Swift_Mime_MimeEntity`` interface, -which offers methods for retrieving Headers, adding new Headers, changing the -Encoder, updating the body and so on! - -All MIME entities have one Header in common -- the Content-Type Header, -updated with the entity's ``setContentType()`` method. - -Encoders -~~~~~~~~ - -Encoders are used to transform the content of Messages generated in Swift -Mailer into a format that is safe to send across the internet and that -conforms to RFC specifications. - -Generally speaking you will not need to interact with the Encoders in Swift -Mailer -- the correct settings will be handled by the library itself. -However they are probably worth a brief mention in the event that you do want -to play with them. - -Both the Headers and the body of all MIME entities (including the Message -itself) use Encoders to ensure the data they contain can be sent over the -internet without becoming corrupted or misinterpreted. - -There are two types of Encoder: Base64 and Quoted-Printable. - -Plugins -~~~~~~~ - -Plugins exist to extend, or modify the behaviour of Swift Mailer. They respond -to Events that are fired within the Transports during sending. - -There are a number of Plugins provided as part of the base Swift Mailer -package and they all follow a common interface to respond to Events fired -within the library. Interfaces are provided to "listen" to each type of Event -fired and to act as desired when a listened-to Event occurs. - -Although several plugins are provided with Swift Mailer out-of-the-box, the -Events system has been specifically designed to make it easy for experienced -object-oriented developers to write their own plugins in order to achieve -goals that may not be possible with the base library. diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/plugins.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/plugins.rst deleted file mode 100644 index 6cec6be..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/plugins.rst +++ /dev/null @@ -1,385 +0,0 @@ -Plugins -======= - -Plugins are provided with Swift Mailer and can be used to extend the behavior -of the library in situations where using simple class inheritance would be more complex. - -AntiFlood Plugin ----------------- - -Many SMTP servers have limits on the number of messages that may be sent -during any single SMTP connection. The AntiFlood plugin provides a way to stay -within this limit while still managing a large number of emails. - -A typical limit for a single connection is 100 emails. If the server you -connect to imposes such a limit, it expects you to disconnect after that -number of emails has been sent. You could manage this manually within a loop, -but the AntiFlood plugin provides the necessary wrapper code so that you don't -need to worry about this logic. - -Regardless of limits imposed by the server, it's usually a good idea to be -conservative with the resources of the SMTP server. Sending will become -sluggish if the server is being over-used so using the AntiFlood plugin will -not be a bad idea even if no limits exist. - -The AntiFlood plugin's logic is basically to disconnect and the immediately -re-connect with the SMTP server every X number of emails sent, where X is a -number you specify to the plugin. - -You can also specify a time period in seconds that Swift Mailer should pause -for between the disconnect/re-connect process. It's a good idea to pause for a -short time (say 30 seconds every 100 emails) simply to give the SMTP server a -chance to process its queue and recover some resources. - -Using the AntiFlood Plugin -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The AntiFlood Plugin -- like all plugins -- is added with the Mailer class's -``registerPlugin()`` method. It takes two constructor parameters: the number of -emails to pause after, and optionally the number of seconds to pause for. - -To use the AntiFlood plugin: - -* Create an instance of the Mailer using any Transport you choose. - -* Create an instance of the ``Swift_Plugins_AntiFloodPlugin`` class, passing - in one or two constructor parameters. - -* Register the plugin using the Mailer's ``registerPlugin()`` method. - -* Continue using Swift Mailer to send messages as normal. - -When Swift Mailer sends messages it will count the number of messages that -have been sent since the last re-connect. Once the number hits your specified -threshold it will disconnect and re-connect, optionally pausing for a -specified amount of time. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Mailer using any Transport - $mailer = Swift_Mailer::newInstance( - Swift_SmtpTransport::newInstance('smtp.example.org', 25) - ); - - // Use AntiFlood to re-connect after 100 emails - $mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(100)); - - // And specify a time in seconds to pause for (30 secs) - $mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(100, 30)); - - // Continue sending as normal - for ($lotsOfRecipients as $recipient) { - ... - - $mailer->send( ... ); - } - -Throttler Plugin ----------------- - -If your SMTP server has restrictions in place to limit the rate at which you -send emails, then your code will need to be aware of this rate-limiting. The -Throttler plugin makes Swift Mailer run at a rate-limited speed. - -Many shared hosts don't open their SMTP servers as a free-for-all. Usually -they have policies in place (probably to discourage spammers) that only allow -you to send a fixed number of emails per-hour/day. - -The Throttler plugin supports two modes of rate-limiting and with each, you -will need to do that math to figure out the values you want. The plugin can -limit based on the number of emails per minute, or the number of -bytes-transferred per-minute. - -Using the Throttler Plugin -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The Throttler Plugin -- like all plugins -- is added with the Mailer class' -``registerPlugin()`` method. It has two required constructor parameters that -tell it how to do its rate-limiting. - -To use the Throttler plugin: - -* Create an instance of the Mailer using any Transport you choose. - -* Create an instance of the ``Swift_Plugins_ThrottlerPlugin`` class, passing - the number of emails, or bytes you wish to limit by, along with the mode - you're using. - -* Register the plugin using the Mailer's ``registerPlugin()`` method. - -* Continue using Swift Mailer to send messages as normal. - -When Swift Mailer sends messages it will keep track of the rate at which sending -messages is occurring. If it realises that sending is happening too fast, it -will cause your program to ``sleep()`` for enough time to average out the rate. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Mailer using any Transport - $mailer = Swift_Mailer::newInstance( - Swift_SmtpTransport::newInstance('smtp.example.org', 25) - ); - - // Rate limit to 100 emails per-minute - $mailer->registerPlugin(new Swift_Plugins_ThrottlerPlugin( - 100, Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE - )); - - // Rate limit to 10MB per-minute - $mailer->registerPlugin(new Swift_Plugins_ThrottlerPlugin( - 1024 * 1024 * 10, Swift_Plugins_ThrottlerPlugin::BYTES_PER_MINUTE - )); - - // Continue sending as normal - for ($lotsOfRecipients as $recipient) { - ... - - $mailer->send( ... ); - } - -Logger Plugin -------------- - -The Logger plugins helps with debugging during the process of sending. It can -help to identify why an SMTP server is rejecting addresses, or any other -hard-to-find problems that may arise. - -The Logger plugin comes in two parts. There's the plugin itself, along with -one of a number of possible Loggers that you may choose to use. For example, -the logger may output messages directly in realtime, or it may capture -messages in an array. - -One other notable feature is the way in which the Logger plugin changes -Exception messages. If Exceptions are being thrown but the error message does -not provide conclusive information as to the source of the problem (such as an -ambiguous SMTP error) the Logger plugin includes the entire SMTP transcript in -the error message so that debugging becomes a simpler task. - -There are a few available Loggers included with Swift Mailer, but writing your -own implementation is incredibly simple and is achieved by creating a short -class that implements the ``Swift_Plugins_Logger`` interface. - -* ``Swift_Plugins_Loggers_ArrayLogger``: Keeps a collection of log messages - inside an array. The array content can be cleared or dumped out to the - screen. - -* ``Swift_Plugins_Loggers_EchoLogger``: Prints output to the screen in - realtime. Handy for very rudimentary debug output. - -Using the Logger Plugin -~~~~~~~~~~~~~~~~~~~~~~~ - -The Logger Plugin -- like all plugins -- is added with the Mailer class' -``registerPlugin()`` method. It accepts an instance of ``Swift_Plugins_Logger`` -in its constructor. - -To use the Logger plugin: - -* Create an instance of the Mailer using any Transport you choose. - -* Create an instance of the a Logger implementation of - ``Swift_Plugins_Logger``. - -* Create an instance of the ``Swift_Plugins_LoggerPlugin`` class, passing the - created Logger instance to its constructor. - -* Register the plugin using the Mailer's ``registerPlugin()`` method. - -* Continue using Swift Mailer to send messages as normal. - -* Dump the contents of the log with the logger's ``dump()`` method. - -When Swift Mailer sends messages it will keep a log of all the interactions -with the underlying Transport being used. Depending upon the Logger that has -been used the behaviour will differ, but all implementations offer a way to -get the contents of the log. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Mailer using any Transport - $mailer = Swift_Mailer::newInstance( - Swift_SmtpTransport::newInstance('smtp.example.org', 25) - ); - - // To use the ArrayLogger - $logger = new Swift_Plugins_Loggers_ArrayLogger(); - $mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger)); - - // Or to use the Echo Logger - $logger = new Swift_Plugins_Loggers_EchoLogger(); - $mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger)); - - // Continue sending as normal - for ($lotsOfRecipients as $recipient) { - ... - - $mailer->send( ... ); - } - - // Dump the log contents - // NOTE: The EchoLogger dumps in realtime so dump() does nothing for it - echo $logger->dump(); - -Decorator Plugin ----------------- - -Often there's a need to send the same message to multiple recipients, but with -tiny variations such as the recipient's name being used inside the message -body. The Decorator plugin aims to provide a solution for allowing these small -differences. - -The decorator plugin works by intercepting the sending process of Swift -Mailer, reading the email address in the To: field and then looking up a set -of replacements for a template. - -While the use of this plugin is simple, it is probably the most commonly -misunderstood plugin due to the way in which it works. The typical mistake -users make is to try registering the plugin multiple times (once for each -recipient) -- inside a loop for example. This is incorrect. - -The Decorator plugin should be registered just once, but containing the list -of all recipients prior to sending. It will use this list of recipients to -find the required replacements during sending. - -Using the Decorator Plugin -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To use the Decorator plugin, simply create an associative array of replacements -based on email addresses and then use the mailer's ``registerPlugin()`` method -to add the plugin. - -First create an associative array of replacements based on the email addresses -you'll be sending the message to. - -.. note:: - - The replacements array becomes a 2-dimensional array whose keys are the - email addresses and whose values are an associative array of replacements - for that email address. The curly braces used in this example can be any - type of syntax you choose, provided they match the placeholders in your - email template. - - .. code-block:: php - - $replacements = array(); - foreach ($users as $user) { - $replacements[$user['email']] = array( - '{username}'=>$user['username'], - '{password}'=>$user['password'] - ); - } - -Now create an instance of the Decorator plugin using this array of replacements -and then register it with the Mailer. Do this only once! - -.. code-block:: php - - $decorator = new Swift_Plugins_DecoratorPlugin($replacements); - - $mailer->registerPlugin($decorator); - -When you create your message, replace elements in the body (and/or the subject -line) with your placeholders. - -.. code-block:: php - - $message = Swift_Message::newInstance() - ->setSubject('Important notice for {username}') - ->setBody( - "Hello {username}, we have reset your password to {password}\n" . - "Please log in and change it at your earliest convenience." - ) - ; - - foreach ($users as $user) { - $message->addTo($user['email']); - } - -When you send this message to each of your recipients listed in your -``$replacements`` array they will receive a message customized for just -themselves. For example, the message used above when received may appear like -this to one user: - -.. code-block:: text - - Subject: Important notice for smilingsunshine2009 - - Hello smilingsunshine2009, we have reset your password to rainyDays - Please log in and change it at your earliest convenience. - -While another use may receive the message as: - -.. code-block:: text - - Subject: Important notice for billy-bo-bob - - Hello billy-bo-bob, we have reset your password to dancingOctopus - Please log in and change it at your earliest convenience. - -While the decorator plugin provides a means to solve this problem, there are -various ways you could tackle this problem without the need for a plugin. -We're trying to come up with a better way ourselves and while we have several -(obvious) ideas we don't quite have the perfect solution to go ahead and -implement it. Watch this space. - -Providing Your Own Replacements Lookup for the Decorator -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Filling an array with replacements may not be the best solution for providing -replacement information to the decorator. If you have a more elegant algorithm -that performs replacement lookups on-the-fly you may provide your own -implementation. - -Providing your own replacements lookup implementation for the Decorator is -simply a matter of passing an instance of ``Swift_Plugins_Decorator_Replacements`` to the decorator plugin's constructor, -rather than passing in an array. - -The Replacements interface is very simple to implement since it has just one -method: ``getReplacementsFor($address)``. - -Imagine you want to look up replacements from a database on-the-fly, you might -provide an implementation that does this. You need to create a small class. - -.. code-block:: php - - class DbReplacements implements Swift_Plugins_Decorator_Replacements { - public function getReplacementsFor($address) { - global $db; // Your PDO instance with a connection to your database - $query = $db->prepare( - "SELECT * FROM `users` WHERE `email` = ?" - ); - - $query->execute([$address]); - - if ($row = $query->fetch(PDO::FETCH_ASSOC)) { - return array( - '{username}'=>$row['username'], - '{password}'=>$row['password'] - ); - } - } - } - -Now all you need to do is pass an instance of your class into the Decorator -plugin's constructor instead of passing an array. - -.. code-block:: php - - $decorator = new Swift_Plugins_DecoratorPlugin(new DbReplacements()); - - $mailer->registerPlugin($decorator); - -For each message sent, the plugin will call your class' ``getReplacementsFor()`` -method to find the array of replacements it needs. - -.. note:: - - If your lookup algorithm is case sensitive, you should transform the - ``$address`` argument as appropriate -- for example by passing it - through ``strtolower()``. diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/sending.rst b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/sending.rst deleted file mode 100644 index f340404..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/sending.rst +++ /dev/null @@ -1,571 +0,0 @@ -Sending Messages -================ - -Quick Reference for Sending a Message -------------------------------------- - -Sending a message is very straightforward. You create a Transport, use it to -create the Mailer, then you use the Mailer to send the message. - -To send a Message: - -* Create a Transport from one of the provided Transports -- - ``Swift_SmtpTransport``, ``Swift_SendmailTransport`` - or one of the aggregate Transports. - -* Create an instance of the ``Swift_Mailer`` class, using the Transport as - it's constructor parameter. - -* Create a Message. - -* Send the message via the ``send()`` method on the Mailer object. - -.. caution:: - - The ``Swift_SmtpTransport`` and ``Swift_SendmailTransport`` transports use - ``proc_*`` PHP functions, which might not be available on your PHP - installation. You can easily check if that's the case by running the - following PHP script: ``<?php echo function_exists('proc_open') ? "Yep, - that will work" : "Sorry, that won't work";`` - -When using ``send()`` the message will be sent just like it would be sent if you -used your mail client. An integer is returned which includes the number of -successful recipients. If none of the recipients could be sent to then zero will -be returned, which equates to a boolean ``false``. If you set two ``To:`` -recipients and three ``Bcc:`` recipients in the message and all of the -recipients are delivered to successfully then the value 5 will be returned. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25) - ->setUsername('your username') - ->setPassword('your password') - ; - - /* - You could alternatively use a different transport such as Sendmail: - - // Sendmail - $transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs'); - */ - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - - // Create a message - $message = Swift_Message::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself') - ; - - // Send the message - $result = $mailer->send($message); - -Transport Types -~~~~~~~~~~~~~~~ - -A Transport is the component which actually does the sending. You need to -provide a Transport object to the Mailer class and there are several possible -options. - -Typically you will not need to know how a Transport works under-the-surface, -you will only need to know how to create an instance of one, and which one to -use for your environment. - -The SMTP Transport -.................. - -The SMTP Transport sends messages over the (standardized) Simple Message -Transfer Protocol. It can deal with encryption and authentication. - -The SMTP Transport, ``Swift_SmtpTransport`` is without doubt the most commonly -used Transport because it will work on 99% of web servers (I just made that -number up, but you get the idea). All the server needs is the ability to -connect to a remote (or even local) SMTP server on the correct port number -(usually 25). - -SMTP servers often require users to authenticate with a username and password -before any mail can be sent to other domains. This is easily achieved using -Swift Mailer with the SMTP Transport. - -SMTP is a protocol -- in other words it's a "way" of communicating a job -to be done (i.e. sending a message). The SMTP protocol is the fundamental -basis on which messages are delivered all over the internet 7 days a week, 365 -days a year. For this reason it's the most "direct" method of sending messages -you can use and it's the one that will give you the most power and feedback -(such as delivery failures) when using Swift Mailer. - -Because SMTP is generally run as a remote service (i.e. you connect to it over -the network/internet) it's extremely portable from server-to-server. You can -easily store the SMTP server address and port number in a configuration file -within your application and adjust the settings accordingly if the code is -moved or if the SMTP server is changed. - -Some SMTP servers -- Google for example -- use encryption for security reasons. -Swift Mailer supports using both SSL and TLS encryption settings. - -Using the SMTP Transport -^^^^^^^^^^^^^^^^^^^^^^^^ - -The SMTP Transport is easy to use. Most configuration options can be set with -the constructor. - -To use the SMTP Transport you need to know which SMTP server your code needs -to connect to. Ask your web host if you're not sure. Lots of people ask me who -to connect to -- I really can't answer that since it's a setting that's -extremely specific to your hosting environment. - -To use the SMTP Transport: - -* Call ``Swift_SmtpTransport::newInstance()`` with the SMTP server name and - optionally with a port number (defaults to 25). - -* Use the returned object to create the Mailer. - -A connection to the SMTP server will be established upon the first call to -``send()``. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - - /* - It's also possible to use multiple method calls - - $transport = Swift_SmtpTransport::newInstance() - ->setHost('smtp.example.org') - ->setPort(25) - ; - */ - -Encrypted SMTP -^^^^^^^^^^^^^^ - -You can use SSL or TLS encryption with the SMTP Transport by specifying it as -a parameter or with a method call. - -To use encryption with the SMTP Transport: - -* Pass the encryption setting as a third parameter to - ``Swift_SmtpTransport::newInstance()``; or - -* Call the ``setEncryption()`` method on the Transport. - -A connection to the SMTP server will be established upon the first call to -``send()``. The connection will be initiated with the correct encryption -settings. - -.. note:: - - For SSL or TLS encryption to work your PHP installation must have - appropriate OpenSSL transports wrappers. You can check if "tls" and/or - "ssl" are present in your PHP installation by using the PHP function - ``stream_get_transports()`` - - .. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SmtpTransport::newInstance('smtp.example.org', 587, 'ssl'); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - - /* - It's also possible to use multiple method calls - - $transport = Swift_SmtpTransport::newInstance() - ->setHost('smtp.example.org') - ->setPort(587) - ->setEncryption('ssl') - ; - */ - -SMTP with a Username and Password -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Some servers require authentication. You can provide a username and password -with ``setUsername()`` and ``setPassword()`` methods. - -To use a username and password with the SMTP Transport: - -* Create the Transport with ``Swift_SmtpTransport::newInstance()``. - -* Call the ``setUsername()`` and ``setPassword()`` methods on the Transport. - -Your username and password will be used to authenticate upon first connect -when ``send()`` are first used on the Mailer. - -If authentication fails, an Exception of type ``Swift_TransportException`` will -be thrown. - -.. note:: - - If you need to know early whether or not authentication has failed and an - Exception is going to be thrown, call the ``start()`` method on the - created Transport. - - .. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport the call setUsername() and setPassword() - $transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25) - ->setUsername('username') - ->setPassword('password') - ; - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - -The Sendmail Transport -...................... - -The Sendmail Transport sends messages by communicating with a locally -installed MTA -- such as ``sendmail``. - -The Sendmail Transport, ``Swift_SendmailTransport`` does not directly connect to -any remote services. It is designed for Linux servers that have ``sendmail`` -installed. The Transport starts a local ``sendmail`` process and sends messages -to it. Usually the ``sendmail`` process will respond quickly as it spools your -messages to disk before sending them. - -The Transport is named the Sendmail Transport for historical reasons -(``sendmail`` was the "standard" UNIX tool for sending e-mail for years). It -will send messages using other transfer agents such as Exim or Postfix despite -its name, provided they have the relevant sendmail wrappers so that they can be -started with the correct command-line flags. - -It's a common misconception that because the Sendmail Transport returns a -result very quickly it must therefore deliver messages to recipients quickly --- this is not true. It's not slow by any means, but it's certainly not -faster than SMTP when it comes to getting messages to the intended recipients. -This is because sendmail itself sends the messages over SMTP once they have -been quickly spooled to disk. - -The Sendmail Transport has the potential to be just as smart of the SMTP -Transport when it comes to notifying Swift Mailer about which recipients were -rejected, but in reality the majority of locally installed ``sendmail`` -instances are not configured well enough to provide any useful feedback. As such -Swift Mailer may report successful deliveries where they did in fact fail before -they even left your server. - -You can run the Sendmail Transport in two different modes specified by command -line flags: - -* "``-bs``" runs in SMTP mode so theoretically it will act like the SMTP - Transport - -* "``-t``" runs in piped mode with no feedback, but theoretically faster, - though not advised - -You can think of the Sendmail Transport as a sort of asynchronous SMTP Transport --- though if you have problems with delivery failures you should try using the -SMTP Transport instead. Swift Mailer isn't doing the work here, it's simply -passing the work to somebody else (i.e. ``sendmail``). - -Using the Sendmail Transport -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -To use the Sendmail Transport you simply need to call -``Swift_SendmailTransport::newInstance()`` with the command as a parameter. - -To use the Sendmail Transport you need to know where ``sendmail`` or another MTA -exists on the server. Swift Mailer uses a default value of -``/usr/sbin/sendmail``, which should work on most systems. - -You specify the entire command as a parameter (i.e. including the command line -flags). Swift Mailer supports operational modes of "``-bs``" (default) and -"``-t``". - -.. note:: - - If you run sendmail in "``-t``" mode you will get no feedback as to whether - or not sending has succeeded. Use "``-bs``" unless you have a reason not to. - -To use the Sendmail Transport: - -* Call ``Swift_SendmailTransport::newInstance()`` with the command, including - the correct command line flags. The default is to use ``/usr/sbin/sendmail - -bs`` if this is not specified. - -* Use the returned object to create the Mailer. - -A sendmail process will be started upon the first call to ``send()``. If the -process cannot be started successfully an Exception of type -``Swift_TransportException`` will be thrown. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SendmailTransport::newInstance('/usr/sbin/exim -bs'); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - -The Mail Transport -.................. - -The Mail Transport sends messages by delegating to PHP's internal -``mail()`` function. - -In my experience -- and others' -- the ``mail()`` function is not particularly -predictable, or helpful. - -Quite notably, the ``mail()`` function behaves entirely differently between -Linux and Windows servers. On linux it uses ``sendmail``, but on Windows it uses -SMTP. - -In order for the ``mail()`` function to even work at all ``php.ini`` needs to be -configured correctly, specifying the location of sendmail or of an SMTP server. - -The problem with ``mail()`` is that it "tries" to simplify things to the point -that it actually makes things more complex due to poor interface design. The -developers of Swift Mailer have gone to a lot of effort to make the Mail -Transport work with a reasonable degree of consistency. - -Serious drawbacks when using this Transport are: - -* Unpredictable message headers - -* Lack of feedback regarding delivery failures - -* Lack of support for several plugins that require real-time delivery feedback - -It's a last resort, and we say that with a passion! - -Available Methods for Sending Messages -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The Mailer class offers two methods for sending Messages -- ``send()``. -Each behaves in a slightly different way. - -When a message is sent in Swift Mailer, the Mailer class communicates with -whichever Transport class you have chosen to use. - -Each recipient in the message should either be accepted or rejected by the -Transport. For example, if the domain name on the email address is not -reachable the SMTP Transport may reject the address because it cannot process -it. Whichever method you use -- ``send()`` -- Swift Mailer will return -an integer indicating the number of accepted recipients. - -.. note:: - - It's possible to find out which recipients were rejected -- we'll cover that - later in this chapter. - -Using the ``send()`` Method -........................... - -The ``send()`` method of the ``Swift_Mailer`` class sends a message using -exactly the same logic as your Desktop mail client would use. Just pass it a -Message and get a result. - -To send a Message with ``send()``: - -* Create a Transport from one of the provided Transports -- - ``Swift_SmtpTransport``, ``Swift_SendmailTransport``, - or one of the aggregate Transports. - -* Create an instance of the ``Swift_Mailer`` class, using the Transport as - it's constructor parameter. - -* Create a Message. - -* Send the message via the ``send()`` method on the Mailer object. - -The message will be sent just like it would be sent if you used your mail -client. An integer is returned which includes the number of successful -recipients. If none of the recipients could be sent to then zero will be -returned, which equates to a boolean ``false``. If you set two -``To:`` recipients and three ``Bcc:`` recipients in the message and all of the -recipients are delivered to successfully then the value 5 will be returned. - -.. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SmtpTransport::newInstance('localhost', 25); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - - // Create a message - $message = Swift_Message::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself') - ; - - // Send the message - $numSent = $mailer->send($message); - - printf("Sent %d messages\n", $numSent); - - /* Note that often that only the boolean equivalent of the - return value is of concern (zero indicates FALSE) - - if ($mailer->send($message)) - { - echo "Sent\n"; - } - else - { - echo "Failed\n"; - } - - */ - -Sending Emails in Batch -....................... - -If you want to send a separate message to each recipient so that only their -own address shows up in the ``To:`` field, follow the following recipe: - -* Create a Transport from one of the provided Transports -- - ``Swift_SmtpTransport``, ``Swift_SendmailTransport``, - or one of the aggregate Transports. - -* Create an instance of the ``Swift_Mailer`` class, using the Transport as - it's constructor parameter. - -* Create a Message. - -* Iterate over the recipients and send message via the ``send()`` method on - the Mailer object. - -Each recipient of the messages receives a different copy with only their own -email address on the ``To:`` field. - -Make sure to add only valid email addresses as recipients. If you try to add an -invalid email address with ``setTo()``, ``setCc()`` or ``setBcc()``, Swift -Mailer will throw a ``Swift_RfcComplianceException``. - -If you add recipients automatically based on a data source that may contain -invalid email addresses, you can prevent possible exceptions by validating the -addresses using ``Swift_Validate::email($email)`` and only adding addresses -that validate. Another way would be to wrap your ``setTo()``, ``setCc()`` and -``setBcc()`` calls in a try-catch block and handle the -``Swift_RfcComplianceException`` in the catch block. - -Handling invalid addresses properly is especially important when sending emails -in large batches since a single invalid address might cause an unhandled -exception and stop the execution or your script early. - -.. note:: - - In the following example, two emails are sent. One to each of - ``receiver@domain.org`` and ``other@domain.org``. These recipients will - not be aware of each other. - - .. code-block:: php - - require_once 'lib/swift_required.php'; - - // Create the Transport - $transport = Swift_SmtpTransport::newInstance('localhost', 25); - - // Create the Mailer using your created Transport - $mailer = Swift_Mailer::newInstance($transport); - - // Create a message - $message = Swift_Message::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setBody('Here is the message itself') - ; - - // Send the message - $failedRecipients = array(); - $numSent = 0; - $to = array('receiver@domain.org', 'other@domain.org' => 'A name'); - - foreach ($to as $address => $name) - { - if (is_int($address)) { - $message->setTo($name); - } else { - $message->setTo(array($address => $name)); - } - - $numSent += $mailer->send($message, $failedRecipients); - } - - printf("Sent %d messages\n", $numSent); - -Finding out Rejected Addresses -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -It's possible to get a list of addresses that were rejected by the Transport -by using a by-reference parameter to ``send()``. - -As Swift Mailer attempts to send the message to each address given to it, if a -recipient is rejected it will be added to the array. You can pass an existing -array, otherwise one will be created by-reference. - -Collecting the list of recipients that were rejected can be useful in -circumstances where you need to "prune" a mailing list for example when some -addresses cannot be delivered to. - -Getting Failures By-reference -............................. - -Collecting delivery failures by-reference with the ``send()`` method is as -simple as passing a variable name to the method call. - -To get failed recipients by-reference: - -* Pass a by-reference variable name to the ``send()`` method of the Mailer - class. - -If the Transport rejects any of the recipients, the culprit addresses will be -added to the array provided by-reference. - -.. note:: - - If the variable name does not yet exist, it will be initialized as an - empty array and then failures will be added to that array. If the variable - already exists it will be type-cast to an array and failures will be added - to it. - - .. code-block:: php - - $mailer = Swift_Mailer::newInstance( ... ); - - $message = Swift_Message::newInstance( ... ) - ->setFrom( ... ) - ->setTo(array( - 'receiver@bad-domain.org' => 'Receiver Name', - 'other@domain.org' => 'A name', - 'other-receiver@bad-domain.org' => 'Other Name' - )) - ->setBody( ... ) - ; - - // Pass a variable name to the send() method - if (!$mailer->send($message, $failures)) - { - echo "Failures:"; - print_r($failures); - } - - /* - Failures: - Array ( - 0 => receiver@bad-domain.org, - 1 => other-receiver@bad-domain.org - ) - */ diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/uml/Encoders.graffle b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/uml/Encoders.graffle deleted file mode 100644 index f895752b70947592db74b6a3b8a6bd135a9fd150..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3503 zcmb2|=3oE;W`?)1xxu%0i2dW)e`q?t_1#Dhm7l6*)63LZGH!ZvdplKcpR9i@P)NUT z?kz6G+b`?)PkQ?!)NF!SM{~N@+lc2czFu6c{PM)T|BuU(IL&W-^*LU*nOQo){lK<| zJU-Q5(w=WB-?RMPpO0nL|Lxn;=ia;j-2KoMBU`08@p5zKm9)&=o3`0@Zq$yOHg9CP zo-bFwJI~>9hFQPeI}Yn)r)BGBpZ!^L@50QG!v$(S7qaK=J}0s}rO-?H_F}GHM#(o9 zQkrfA-(2X=zRdAnUjEzo$475(b37wmvr2zMbrS!Fw{??kmo_f*{lKw1|6pBl<?fJ$ znX}vcGN#OLnxU+Ex3siu^Vau*)5U)3o=rSF^Tx9irD>OsN$#zF{_60;*37=|vlj+9 z$tkU6eCl$du2?dC!nYoaw+HQw`&}}H%G+k2{?M0q|3%#KjWXs!9Np3!XQuZ*Rta9I z`dY2y%^6eow3s6S-=uGd9{9c_Yt2Q|5^i@cy=%JDI_hIjSzgOY+OAui@?1;inU>9j zcYdYKYE%2dLyQD3%dbh~D{a~w>Bg|-o5G_1EG+TNFSqiv-dA8z2<H;>T*P$v!nqr! zwhJHc2<Nt5U6fH3>>a<vd*7ObgEKhtS;|hX3N-LJ-ri?8J7IRp!7Xc8EyES}&C0Cc zc_;HmSK3CWcWHIpl~;l5{CuU`KdLlJyx4R6m%>6JSBaK+GRG1-%bZtEyWMs0NMQF? z5zWO%UCzn=(wO;jML{9sK25Hy6-C+M4!Tz+>|gFB=$+ZX_Kr*Gf|NsR=E@z#tuM<? zD&_63Ik<9Faqr~Te%41_*}K;n`*XNfz7)E=gU@+#C2vS%^B1w;IhUT4b$KjZK07Qi zOCeaX^V$g$p6+J{*YXAiW~;xO$Jx1Qn~>1a(1{$Xp?5?>0$L6#$T+ETUsh*Rc<}I@ zrK3vcRmMP#9Ddn#KfF4ewUzxA&QV_&bRlq}RLP#U*yLwI;mLX%jQXBTyW(IZt}dzR z(VFr#a$(8OhhL7!C0|$BmHU8K!sVw-@w*B&&xocsJM*73wJlK+^%R<7;yTqtAbNj4 zTe97wBIP&C$4?dQ$TcYrostrzZEi71_13IaK{>L8tk+Ii*k9*7xGq*SYU1@9YbJ$D zK1?Z1{lVy)D(rAYi|s)W%a&^rP3JjRJX-nJnepo7^*UV|>1JmiXYO1Rcwy1aT{Z=2 z-wr&!dTe|CtRrlauK)IF*9a?`#!mS4*Lr=J@l79-V-fQoG4lUj_-vzR)sJZ(O6(J- zn=Q>NysA^j9hY$a&-CoeOKz#$R2R|v_(Ssf@`QlhnJI<BCl#z??>3&euw~5>mnfC2 zLyeuem-sGua_Eb{X_&GhvZzY-SNq+bN1H;wJ1}PowY*w)AWw89>!w<(*6%B#`@TBv zx>OlyU-EV5asQu>BQv#L%Gar%W>TKMe2q)YseRsU8`j^R_ws+bk9!G=Ywck}nYnD4 zlf>>+Z`S@Ly!F7h?f))p<lMRGm-7Yrs^ZI^e>o?w*)6B$P|?3u`pknLzst2UH!Mxm z`c-}ZD6`7xzZ1JRp3PggMsiuW*46p1-YxLYOJ%+AU(w~CYv4^*#gqG2G{m}G6c;p& zcbQZpDEUJvWOl5`i|&BQd|&oU-M+2UA8s<;L+IBr0gn9<Ps+a?pYVpSl=;8WBK{Zg z^}C(B7f65k$eQZ=M(%R;@z^K347YzfuPY@Q9s2Z}>;%)@!i8%N7|)XU$TP*PKRwFy ze8{x)plY3`b04@GPrmv;>vhVrS78o;hK{`koIj5j#+UwGC2&aTkJcVBBbBcw-b~r- zaewEt2epj{Lvl2yl)O`DOAE}pQt;YhoA2(5d)t2hUQzx2Yx5VK1mCqDQP#KCEzsz> zyYSX6pEB|6vh{0EtcsraenW5UWec<Xj}JCmDm;Fk^mzW!{uM%hG&)~Rk~iHj@r#D1 zsqM8d5v5goRGhay>X}g}s*!R;Ctmet*IQ$SjZgir32uF(;2?QOOZjTjCau$E`Q7%1 z<pTK&IQW`3O}xML!<@G@mQv?S_bkc_-&Qi`mETR96sz0bud)i=cONL>%dBp)ogI@H zUeI>vYEy#0LZ8E(RtL+Om50n)%=V^EI@Ig8`Q(#-N7pI)7_3!l?Ad64_{;LCO)m`< ziw^|fYIfCXd%SD2W};Vcz4cGF_N-;L3HMf8oO*JkuyBs=w4-ii(kW-de;<~0iA=Sf zZT7-V@4NScZ7x~fPoC<0Uw_rA{>|bICwZ8&+g6JIihtv@KR-3_u*Rc>PqXaLavPR* z+oo&(+oJdTwz7|3&SYD=1=E73f7=qCcq8f^!;_x&Npb&8tQjQLx0rtDnjBW>BNSfd zbID|>;`SFSlrlFw`O$T4k&w}v*d4+DJhI<Bn0EA{@*HV_`U8@}4Q!tyHCSaQuL_** zK6lr?713`$%+>hc5v|IuB)QzHWd)DJ*M*JqIi2kePLY+m5VdJVMiIB>A~nsN<KHX& zcsnk=YEE4(lPi5DLR5A7RR4}G5}P{~m0j<=x5nk|T3Ivk3tG?C`aUn;$6S{%#UNeU z^VW&GDNC+u>wJ~UyL!E#-&Z?M<)si;uV?D^sm5l1cgdwYUON5Y_%9Fdv;9+_A2)mb zRN8sM)DKtqp0m7}pkDm$;sv+73yL9^lYRU353)Y+^e9&CT3FDh;da}hYh{1)6*~s~ z>+B7c_WKrzsz%(9n`n6Z68{{AU$={|t5}pWe7OG4On27)Wu39{*;04r^R~Y!NvN;R zIJ?Ji>md%;1>dzM^jq>xep7kq-!{vcm%2FR^qrg4I+<$Qndi&LAKl*c`0uW1^VltC zFKx-5ckHvm=2?ILoPK?(`FpWQWU#29ljjss-^n|FTc(CGgnx^gkm@zXW1=*NsNRLs z3KLeA_pknR$mi+CSg|SchoVoWP3YhH{2mw6?A^>?UPSCxPy8#<u%OM0aSC@lJ45Jc zUB{UF;XB2Czn$X1xAsl4Xn>G_bdumRm6P*57P)y(%Dz8izGn@;>C&hoZZD6i3%F8! zgH+${j7gp%?{qu%&$emIPl_F~eW$NyUL6&7_^$0XiH(iBt2e|&ubRGIdw)%>p^1Rd zL&4vxd|S_7KJ2w8QDwuus|{ikH+62&xRx)mGIHamH5Ci0BPMG3buEgJ^b>Ivk#)W2 z61=hQrlW7yRQ03#mxXQ@Y7Ap_n_}|p9V^p*o>bx3{Y!3rUj6K_@3%iyQj2OV)^<4b zW~6?8v*y>^X<N5n=l=HX(|(`c%5!16-}vesx=><!XqzTe`??1YUG}H;`x)~ky?#-n zD*7w#snx&9JL2ws-w^uI+NRcv@BZiG_a3bD>i^5+zq79XId@h4bHmpkn_PdJzkRJ} z&%=`Lw#-=R%*z+5H)hx=^cA$S=KE|u7q{KAM}>2(%eP;?S`P%HY@3p~t$JTv`@)ed zF829+)y`*+&##`~QZ4=E`n_l^S)){ie>vPMG8kWUZs(d`R1<$wF7+(q-&A{zP0?>x zN;%)Ub8N-)f~9|6xaaO-{T6JI`T11Nd?V>)2kd9(s~ovC@$cj>0bggYk!(G8hVh%9 z>|-hScS$iNDogBV&Z`tno}7P=WuM;jUmWf?9{*m$!a675Am7_dosyn2ca*P-o*__E zKJ9<^$1TrGUa}a9$-SD^zF5oRs`!@7MF&>AGH&Kxt=y+sJWW2r?v-%g#mDN(2lo81 z{975H{c&>V^YSh+#l~k1d>4*JEV%ZoH1P2=?QhL?n+z*E_8dP~)MKa?`A|V4)I4(P z?%T_AH<XwE-ddBy|3P>8@elj{-JK`6-1bNMGu7D*JB;u6+z{PWySQ5Rn8DGshjWsJ z4>578Nxq$#-RCnq`EYYA<A<EGcx~1fPg~^G=6<S)JU+|!&6z*jFWB2&djV>j&FYO0 z*~BR`>)w@1;y3T;bn8n9KkPlAcl6oyl`~iUdh(^qJwDnnV|#^4vHQ=WGlBP}TE5vh z^+CU`T=Sho_hpq!Qgogbcv{Z>@N>zGz#Vgfl;X^sp6*n=A0YCw#A*F<Tc5|4`pdVT zOKb6E*);i(K`{HS<Fn_*S$u9+nAde*`kkHVSD!<tdE1XTt@XbB$LjDO!#R@|`hP!M zEO@%UfbH3Y+8qsHpBK)PR}y4+CFf8bAS6(u>$zUl_Xn>NL(!Yp?o%ZC4?j3}W2x}= zzQ=L8Z`Sb5zIngi;{ihxfBRAs)l<LS&mHs=EIQ;rz5fGa?)&Wba?^V6pDc1-d0(&2 zwuE2CY0gRZyS|gEn<S<c{=WRsByHNvoXPd<@BeT4_m7A1-~Gm~PoM0)Jnf&=kJn48 zP4fEB>oxMMxBH(dxtQ;-t;Oz^_+#Pk?IUxg?paQ%w*B(_y8e9orf(;oFE0D8J=JpG zwr6w8GlLc7{F-a#KT=#7x32Qap_AMEd*=8Y{&eH~%Rgs*4Gq=bJvh|+?~+=NG23^K zrLW(6PgyeQ?)Hwq*F{~kH!QW|Jh@@v()}0a`M*6R)2n^sf^B-#T%Y42Z~09k<mcSH z_9*YwslEhN<Ar}-OqJfv<+iTlTy3>ceoeW0N!YveX5GW=#`_N(+sAJE>(mvCFa4)& z0?e&rrcL>G>9G5j{GBrj%T@Moxo5dJ(=%qiZ}o#S-I{xii({h%S91DXyrL9UelX8} zf7jB(O>NG>TqYaa{zo2*IG*pyBE+88wAR=Bs5|F!^KVt*|DBuP7~k&FS}wldY4Uk_ z7yS<!t}_Bv{#`j7e>NrmeM5lL9FKh#=Ts*9Ug+qL&_5_2zg&#<$nCfPnJw>$_5Ys2 GzyJUP4A;5< diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/uml/Mime.graffle b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/uml/Mime.graffle deleted file mode 100644 index e1e33cbf16ea45d29ad48eb9b2f37959292881b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5575 zcmb2|=3oE;W`?)1*~PcbuKknw&$aL81<!k>DGV$Xo|oU8*mQZv>l=A%RBo>;FUt^| zbR%GiQ&8cax&OYidc<nn%L$&wVtArQxzmQh@zET1em*|_xW9jIp9tM|Nui|X{qp4- zSm$Y7dHr+SW8S)|UkiUfYyJ4;{rc~5fA3$cT>ks^(TzrBa}9#@>}2N6E19xfpO5d> z<Bi_@e0{szPaS=EGBrH0R7OT-zHR6{zQq}TK0SEw?Afx^!j)m?<qHpfc%by*xJgHz ze`KnDMB_BsoBlUbC*7Jp>u}#KKmDq`-=ADfull{~Zugw^U#{$0dayJ7a{hY0AAx0; zJ}Ox)IGFw6Rl>K@u$I`{FCzt4e@YJeyk~+ai`f59PeLVF-%N|&EVk{>#OFLr^+tJf zH|N{4hwXnKbnQ_%d+@?3HZE!0ldjARXWwi!Ion@pf9`)n&c#1X7biIJr#-ix_WdfC z^}g5a#f>lDsxg^wKHTlC7pwa>XVR&2%;^tw@(Q(ntKSGe5dU&fx6pLk(@Q@yF>Z~i zoA{$x?fLG>6R(%eZJb{Hz~K7<;g_d3UQM1JwJ!Xsk?3amJ;{A*I?`tMFc`!!{9tlq zT{vA}&yi)H%sCiO++|&_@|9tEy7l1$oKyScWA0boRC4#TC|i5`sr7u@gr(*|bwNMe zw@C!Ief)6Zy|3Gq?oFpms<~9YJ3LDA(|__RZb9{CKK~Z}zn$srpY!6sJeaR_<(sJN z<Ne>J+6$)0W;N}<6l=A1!Q-ez$DgMcnlAgcMe}Eny8B9{&EJ$|m*=NxNnM|^|G-T7 zi!WE^JdORO>m@qle!<0?M|tB}1Lfl)<6a#3|MeJi2gj~gKW*<PE%(V$yMOqk>F>^x z4d0)K-v7Sn#jU-snpf9VJZ^ayy5D?D(*!q%O7FYtO_BmWJdXF-biB8(^IwH%fV5zd zDTl__AJenToo=d6-X#^?SSwnqES2!zx#JQ4*$46*4}TnH_~RU!EO@oY)u7Lnqr){K z^WVaQ5iXZ!o|t~`Ufd<OmZ_`b<TdUphW>NRw+`#C<(z4CIbh@36G3W<)e>DxdzhbV zZx%Yb+07(no2%%zBU94jPI%dd>zq%k?-IT!_<QY_zYd)huF1EGfBEU#O}sd@+46$U zKHb$xooc0Pv#0+%BWQI0vT>;Y)LGiUg3gO;S4Z8w$$T%IC#R@1-1nQTq-3dn-m}_} zx~NaR!l_g8<EBNLhl_6CFyr-ok*Ssb&d>L6S>bYP*R(g>dbh(jwk}<Np<5^afmqxV zqg|!by_d?BD_ts&G1uLwWAxtXcH)m~e(NR+&1<wcP%NUaaXqo#<b=qaudlc-IH|Q= zxDoy%ocFcE>9Q;@#bSG|4~rg{Z5FyOx-4dSz*BbfUlacq%5wkWF{zW-!2ITYRz91V z<z%gzd*XW9XWaKX*|JIM`dtq^{H%2EMYH}TXV)KmHvLBC)~dSe8V}=YKd#9TipZPR zw8z@s>fib0-_`FXKV5oA?#9))nkBV`g*9bUWQ6#2d>o!7B$^56gm8)p>9DYHU%PVp z2cwO*-INNYP3wK?ebtpd-#>Zy)^mwPJvFoK_TNf2mASV`Gx>-~YKglpx8qU%=~<F@ zR?D83tWkA;Bve?+zk7}Frfyzcz4GT%*VW!%I<0)`^<?>jb5+-U`}IymW?O8z=ewV? z4wgM!HS6~B<o&uccT7DWq1EBb+M_yEeu`<!SzYUW&kYSu``g!B@7uHechb*q@>UmZ zOKqZF8B}`f?!L2pW6Seyw#=E&C%o(Xbo)XNlm403^L$g!Zce|^vSHmejyvHT(rVMM zW-2=K1Sw2-J@w3siF=d7uKb@P$5)hWS)cS)K|@Z;evh^7$2OCK8y~J}%j~VlFUdDP z9Jf%sC{cde<7sh%Df8TK8BMEh4gdUM9b0OwZi7@)RMv{C;m#|zG6XyOs_JGu2nwBZ zQgBIbsI>mgAHOTB%AT7FPCS0;h;QY;B$q>KPtM$9>HWf#5g}Cl^5^ZY=lKV-%+DLh zciu>?n6koRnUHc?{EZIrw+bp}j~MOjQrwth9r5j0p?PzvsqTCSlkGJfv(tYT={oOH zcP;Vf%P2{7J)F*ceEx)cCTs7^o@TuE?2a=g2V>H*bo(V&zFpNI<)$lQedNltbq9^Y zSy|MQQurE;7<*Uf+I5Fs-E-Wz%J@~aF;C&$ERJiJLIZBEUG`{YH1F)Gd8RGGW<eV2 zvU?ZpxbAY%W6gCp|6ui)vpqqfEIz5ip(asx4sZ7jW#PSGr}M#xS!L@M{`JdhZ|sTw zU1SvWIqce=l^d>q?>@3{M^@IAOF^Zkx~fqxn{-S{Hiv2`x4$Y~@upSYD)5zW-_FGh zTQ~xL+V?d0g{+yax&PoSlN~O%58QHlB6Q(T9An^(r7U~)G@YB<C1G-DWrxYjkSV7* zUq|~{$i)WVUS<|=Es%3n!FYcDhKa(?QaepPmG1RD8Fgaq@0&@L0f}4=M|oDB?JXA# z+ceX)p~u@h#Lwirs$w$RbdCjSMM^s_Xgw_IowGvLH7x&xp}&sXmICp`s>1mRBBGN7 z7aC1-x)8y2ZgIt<&h(k$D=XxtuKe!vC4f8RUs=$(Pi99pJ@DJOCQ@KEWAs^`wB}3i zRV=SbSzfbFchSGm+j(-s4=#tzXQQV-)BQPh#-CM_w?vfiv7WXKwS0Yxr@hH#O+jeJ zBdd!n4A=U@Rjt@_T24LYT&5IYo?>xOxlP!CnOph_lkeVXa@YEeA2@24zev<!TB>BX zPwAEQw>EQ=fJ0Ubr}=0xX3k7gj{SaNiuT;1sGY|$pDq*);+6lr=B~+&tLD2lKc2c` z$5Ka;;FT=fd@lGLQ4-pylC+k8W1Z}Ko2bNt%jPceb5qZ_#-DWE^w_-#U0x^aloGs_ z{a@j8zb1pl`r6FESypD8ztdmr+V@Z3TNGE$i>)F%{?&xKuZU{oZQy2k((M#oGC3!w zOsd?r%b44lDVjl|SEZ_L&MdD*+rO>URE`mRJtg*e&9S^Q0i7%LHgL~8dqmgLaq5n( z*Eq9+4ZOEhYSp)XduVdsVQcUb207g|X_q;dvnUvFvplgWH9hBlVBJ$0zb^`&*RP+M zb2ukTx!u<?Cr{P?`8xh3GYh>N8n^hRsjs+x-;-(9j?@FSM-3b*t7MtQIZkXW*}5@A z+~Q2fimg`)j<O_+T5<56&2bD~_3-g(#XFW>=FK|3-Fp=aUrkA?Dk^;`IPpqe@0E9# zBrC4exgWkD#WBr9)z@cM-qTOKra!s5SFGPq!2M!#n_I|->k*%tQ(IeepO{Y5IVxV7 ztEqT@*Q}Nt^Wt33yz{y<uT;&vlJVx!S%a0POkyHA>7k3K$uq4H`@bSNK=%KN%vB{$ zHm`O~(%PWECX8ntTli(iH7~DPtq|JzyQ5-vf6klMsV~dSVtgw;>6lhV@2Kpa?Q*VH zHUIXxM{53Wir%>Tm1s{%&q@5P=6TcZ;;i)FMq9hTba%cGx3>LPQS)p5yPvI}f)dZa z&eFHM@UHCk-0koC&hI*X-2a@P|GB>D{jqfxdouRV=j!UzZ#f{cZ-e@6n}&({ULFmC zS3aIok2m2+US9p_Z~Xth$;E!jGk(6&n!Ww=kvOYEc|UsE1b^3g?GO4cS^cT&^nTm^ zrPI&Z&Oaz@UHIbm_O}KrQ&%23p>MO}M&-Yok5)fwae9_|{=9}3hdXOXj+)@KjnXfL zIl8WA?R?zRFA<Qvvda1SVxzg6=k(`g+G!=sICkiZY4Xi4p3E;7^&Fd266mt)#H=dI zo&TCw-rn3YRWtFEv0~NcV#&N8^ERE@!>uiK&a3z4_az>$VwPPI>}PrCb15xe=;7kX z0uLXBpK7*^_Oq`2TwkwU`%PQ0r(gfo<CbaWbE|spo{N_IKg-O<a&q?f8++gW>gHxS z*%*0x^5&hVmw3AbKUCW3m#=vJwQA9u2)}n5rVH(v=lN-IW}u;_f!_0-DcTc_X0kdY z-aq7~aI)@jn^n$&G@}>|cgvFn+Yc3(|EemJz5HBX#Qf%$)CqG`b~OERKELU=$VCa& zuG;>(9qV;=Dt)&!5B=pQ;AUg;bkF_t^7%3{k@tTr41UEc@mqBA`h!LL+O{3O-jJYw zZq-&LR>PI^7u<iaI!UYL>Cd0ZoJ&s1i1bTouW%|%W-VNMeY@eh)va0=-(5JgvgOJl z_iKmda!aOIU7GbPb@uE>Qr=A3&(|3pExj7CS$KD_lSkAqrnNuplzQ*%<y*CkMTaw@ zNPJ?}g&^LIX|s1`KHi(LFUs1M?~;f2<CCjGGo}dDF4^?iO3yxjo6nlJ+7iN+q7_#- zHS01y)j632H>(AjUNzyhQ{kSuXaBw1)3e^*)H$>v=;%aGu5+ia{EaSInA5>OE9%jc z2QdQXQ#enpT%FRCo!;cB^7Gv1gL7vb@oQhrvem*mTOmu)vVQ7{tzqra#sb`&X3eJA zx*-dHamFn?slzs1{Y|^TD^{kWyj?<<&3O{9d%ez;Y}|6yWJ1UiiMFhX4Ob3aH4)%k z-I%s^FK6J}34)Ui>{hH^DrYrWJLBD+l6;#Rdl?@x%NB7cEKqLhOw4dFEe-W)pVOJG zsT1d!Xu2p|E9c#wkQ-mMb=W2d^e|rJ5nfr7oG<uw>obA%>z1q+Ro;{N=q>+;`%Cv_ zF))QXvj|M~RpLqDShXQax7BsErcS_WQLz<4iRNoJuraVm@uW1aoGo>v$%tw1H9Or4 zF`kLM9a@r&jEUaOvqEmUheb`Ck)iut@JiUF-CXYjd8XVhlQR|9@ZYm9UPEt9lhjtF zk_TDAs!ZN1mkV0YU+_gYw>;uH?-D7kV;53lM5K?gwS5)xZO)c%;$HZvy7iDOt5QI< zv-{lR0ig^N*G+!Q94PGOrLZnJdi~UmaucSO@J)9PT2s99bI|j!YnFmHB0G&1Ze@&E zxas7_T<?g**FHHgY>>K^vDDbHcZF_{g5t_=RtuJAbuvjW%M)@AHceU4_Rk_)WOkQ% z-}EHGjDi>QG>hX;pV({a_Rdh1Ptr)`VYSoJqFKiyO>XQ+jacXNL?uIMxuyZfzS%i> z6*}A3_NK&~Vp-jJX12+kH!7<SxjC)&VbZO<ELC}VrLfzgNosPhuP2<I7R~E*Nkt>` z(TW10i-8(7MIZ0{h{%hdt>{-_-XZL_=N9k0$*08cs1`;k7e3k@z~MP(*}_cTZ8@P) z+f@9LgqE)}UX+;9du%grR?8Eg6;q5?MnCkio}^+_w|vjVB_}8J)p*Xj<}qu=zJTZ2 zTUk~7x~B;8rujL{+MeQ<WTb93f77%*zDd7k7b&OgEX-}OmbBiOS}erIcSS8&{pGpo zS2BCAbRK-P<oJPN=O>x94X$PBo7^Y;Wth+=)fsWAUrjK(x8v%zw+(FzHx%10$}E0; ztoOFvy#tqaJ&p0dbJleE3x~sJ!k(MGJ+9BYQLt{C`|jgMzCTy$GS!}$)A;Y&#@tuB ztF$Kw7b&fr=BrXXZTHMhm0L3pv}zVO_egu5UNYJ5(k9bOo64s>j{AMzr8o8g=Vz&$ zI{{MLQ&N*QZAx-eQz>U!dWSQw**evzpG)>j<_zAlL$7zWgrA&y?f6{1H5nQ@g;`%d z&C>hK?(s;)tWfBW=;J##BJ!eVEBf9#w<l@M?91YUy>3pcV>Bl$$?RS7@<`g;hhHLp zD>WK#k+?ipSUT&mQE$T%|E5dJg`-QJwRq1IzR6V_RIc_+nE6sl$kcl^C+A!{F~_bV z(Rq=bvE?FfMQv^kO$);h`<i^34|lE-UEnGDWU8{KVPD8155~3-1&^P`7rVCApGa^w zExMz=Ifu=-NT5z6!o2lGby?i3N2Rkimu1}acK9`;^!`l#?S6N6UfFVb?z~LrX?Lbd z2QX&TKHtKpv3A<0|2OBHIJ9Kqv8~%YSL~fH(CC&p?L})#R@2+`iThHrzE)P1T{rfa zuFiFT*QbeAyCbjO=azlBBk1dbg(q2_^{=ga%AmYz{%mc>PrJC=l~PP{*SV$GX;_9w zKaP0|?>goD`+B%RHlaSe`gq*=`ww?Y-|YONbJCz)xLo+kERMv8eMvfsIo1NxD(0Ip zr<A^l3x8gA-^Sc{T3~O{N52Q*KUw1Uo#vhWv~BCer`CIfB?Z##v`eML9A}+a5hD3Z zMe?ed<kWzWth7%@=FG17{7Gqrk&xFUO~;d0q}z9uwFMrv<a;FCzOQz7iPERZ`Awho zx0=*=-Szr0WmnXXE5BBXKYO`s!bFwjhLT*)3v8{vYBjp=c(^2Br$Uoc!x`Og)AhfH zCq%w&oLKI0Nq$#nl+?30wgq{s+zX1UU4%|~IZ1}UWl?25W}WV``oli1?cK~WUO@+R zyv`fi@8zty6U+X2v+(g{4_Ds*?ekpwaqFy!lm5MEIrr5`zgy8Z(q-QUwvu(_M_=zh z$=f$0q5Wn_mqci1yZAKk#U1zVKB*6|diQI3&vLz%-_xWo{ZzKtnwPmD<H?_k>Bq$X z^?W+)eXJ_U(~pyjN%%*q$PDrQ3HI-;o$5+noSnNUb=HBX2mXtSVl7JdoKKxQyMDv_ zHI43z+fTHwDb{bF;uiVv$(2i+Pm1l_U4LuuiJxANm)AVH`6asXsK{IG`}17tZvRUb zTDDt(OYMt-tFF%b)uLq<yQa8{-4SV-d~j07s*<hG8;uM0G)Z`ESl_T{#>pL5COMsd zCTp;_yGrNv?#UCUEB;PRlvpV=J$dzUy;*DHuWk~zC_1z;`)*pa@$Opa7>gzI<Jr?w zBX1luO7&g+W^(H#J58pU*6;M&Wv(uZX^`^|`tflIhvT~ilTKR%8S;rIc$&@<dF*Mq zNF>Rtwc;wr)Z^1?+zoxxC(rn?b<?5=E1T|F&39S%_+pO1<t>5jVG$xvzTVqk*>TMH zWA*B49@kiPtt?;04qxxu4|DW|qiov5O<p|y`(-E3)B8Wa{dsG<?{%nHjv&J^?uIyr zH3~n1j_P-=`ortQQ1n7Ne2P^6^5sYaMn>s%F7NGCL^NDBTAf)U8E|j^C#Jiam**VG zyOC_4^7pUh9`?<hy*lPoj{Oy~Z$Is9-}UFBwYEodHJ3zM>1Wlb>d5r8-W>P;TkrpS z^zR!d)35W+-@i}ZUMKy(>c{JoPd{$3wfWD$vFG2H?%UEOH}Ze~Vg6HF@%P)}+iB0O zk1x6Hy1(Y<-^-F2^J}c~;_DKP^6hq;&z(Pg<)I`C-&?g_zc0Sqx{D)<YnCi?vg6{! z(zoI{@5FQz3mxyCbWi*$zo#R)t+s!4%&~VDyH-Dmi<sfAn?38MlUg~G@C~D{`&X_1 zc2AP0e8b}1|0>F*_BOnzSg>$f?Yo`Z%bml^SXR&AeCodb&W%u`qO%Weo=vX&RBM@J z{Aq{eov$;_{1NJ_<*(@BHZGDl&ThXUr)<ZX9l!Y%ZPT`i2K3!6{wZ0lFX5~G>erKs zZS}!?FXws+Y+&DL(x^E*>P)Sk$&0A#+%I4D`n4}pT^c#%$CDcu3j)>Nxw4#L755B_ zXi~L_V!5#)lljV|0|}efztD;(tMS#0x9Qloyjk_YobV)xns*0Z8B~;PJof7J^^d#X g_ZzK^Ib)wTYyS_K-9FNB@Bi|%$i}$V)-W;v07XNq;Q#;t diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/uml/Transports.graffle b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/doc/uml/Transports.graffle deleted file mode 100644 index 5670e2b65ada6e01406334a4b462f58e8f48f4fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3061 zcmb2|=3oE;W`?)1(dD;xh}E^lKb+hi`Em}6&iw|H$&s9%(pEbS8da9-)*5VM@bB?W z37quuRlWTr-XCg=3pEw5WSg2USlhjHuYK*UNqfKluX%C%P<V&U>C%5Um{<$F8~Ps3 zns)hb^6Onc^S1B#`rNVZzy0y)SDzjK)oHLnm!JFV>&2U+LT}vC72{`TmKN(iel~ew zU0AjWYmnQ<ilU9GIbRLr-iUTDzPMsR@XDr#-&QUNU!z>kAXsOk-1>GB53BI(=q0lj ze2FMNv3^<VgXWsN|9p0GGEz5wah?C--jUVEDgUkeOZcP=ONlZ?D}nFbllv#@EXg~4 z!BF#)nnvX;Pj`>y@<qSp+@4J1_u%HvyT5VQ30Xd_=}#_KFDbV&Q_;Pr-`A@2$zhd9 zgOuk@eZNyYujG=xU-*;$;$h}o3EsrQNpV-_uHO}2nk(+hdThHiM~|9)d+4#O?r**U zH&i$63ajW&zM221Pob_qjknl@=Wg3&9*$RLYme;rdlFN9qns~y_3I^8GE1y%Cgkyy zG>3@lhhGz7ovdGy&{xVc*>{@D#y#3zyB!2oHmG}67kU2BXIM027k8A$66WJ8ugYz* zS@>$vx5bms6y;PhN7wh<|GA`@b+P^*#S7j>(t&M`?{Ap4)xLPJ#K^bG(YLf?{#hfN zRquH2&gQ95sCmLCdwDirwMEl?lfavTCV{{ADc4NavStd{=k8uIXMfgfIpylb%lQ{r z=6PCOx8^o~$n5w0cg3XykK6AwbgNixU&qgwwocYPMLjmStMqcjrF@mu3CyqkuBT18 zd!WC}<oFi-<|lorw-d8WD%Y@k$h%r;ule-IC@ef9bMl-xfAht2Kdebjesb^Nb3N-{ z6VrTp$`|n(CinBrk&rhJi(Ghao4~t<Y40kg{hx36g2{7gR9p5AE6-ILQy*+L&zZbF z$n#8nc4-Xz<860eb*$|(-(<7?s$rGYCk3(A;Eej#84G^ie(!Q=!46NC``ZLeR6}!1 z1zY(3Uf9+?A*M4Vdx7%iR{0QLmH*5NKgHMj=ucYmWBMi!{Y`JWPl(351l9<KesT54 ztGd{rzi4X5iM@Asm6zDK?3#O?y?3g}!qgHMM;(zm|A@3j@AErlmwmOdt4N&3;#8pX z=S-2p^?m*e^FFa#XDt*I_T?%4q;{iht-+gJ?<UP(<U6k^-X+{*t;+-7N&D4JDkiO4 zWu$C7r$F4f<>xln-LC`|&M0g*@S5^IZ;n)M>V&C$j-L&=5-rcUNJjPL-Mn+_$kE=J zBA>5(yy~^*V{PHp%TH26{NuvDdO0YqVl|of>gUT<DtlMFik(0I>Kr*2v6<YwGgijm zIJfNHw$6Wor{-PT$NBwHhC>m{q&M29_BVKWY>5ig{2%1P<Q8P<c;Lp_n3k5084)w4 zU+}g1c=Jq-Sv7-XPmigJpm0*QXVdhv$!R&o9pB9+&sTL>rkoMgk}uEp)ulzfn=5eU zIxUHxtDf*LayfQ#!MiTjm5Uex?g_qd_tot56zLG&azvc%XX2f-phwpgJlqa+-x5sw zGQ0QwCHqy$D;7(C*sk}p@z2&zDJ$<NE4zlj(({@ry7}^JGtEZ5qce8RQCbx^>u<{L z<wug6-^QJK^H2RoZIPg<vvqyuk_Y-rcL@Y1{NT3hi%H4bFZivc?Y`pLJ#tKJckDj? zswgmdQ=+gado`nrQ}vCTlHA<R{EJ>rXWSSR6>z&WcZIdRWOk6wN83$jg85`0o;zIQ z&HG8bvQ#iAq*S*3#_OhivSwTR?mw6%v?YO+vxYs=HO1mYoULE>Q=a9<b>BY!kUV-T z_^x4YM;L$idFIg0R8{d+KkB{-F<3Y0OgBGteqF}Q`L>@or`LTm{kB>E>6<HC<crEq zEi$=$Q!{+ane+dA`us%q7`ZRk>S|;QXm4MVv*@sMu#wVS!I$ENCBN2nU7heo^~}5* zzpuQ}o}K<JEA89N`Ng(>=P;_w&<R)HIdL*Ok8IVwHS3i3zRzX%oWFlh=F_iylK&^q zdt0<;flG@>z2A(}7Wolhp6l1$nre99jEQXc-MaZEIrEyYavUjRF}g8-|Ah5wUp)45 zOj>4c@b$vJNO$|}F18O7lT_=j9SM4Hbh_HAO=m8-L{()5DO#vb6}fk5iBe|Imp3xU zX6g9Pi~XCDEBTe#d%i>Rs_+?lp;xAd@6SoyBXu?Ul&12(3BhhbY4aVJv&xv>PA@yd z@_GIv>$H>&6V(H+<g`w+OpCi<C>;H0&D82NuR8M^KenFvVf_6})vk1=gb#m}P0fE? zI(3*mgU4`=g=d<j^Rl|BrC*wtq{Z&@Tz7<j(g*7`uPZlm$TF*D3iHoddGp|dp1!{> zR?mvpsVQx@Qs9l&-X|KdUCnQ8^hC3ByPlreWxQ`|TTQpg*DGH?v;=%T@!b5MS;SnE z^4VV&I6PGP@$!h_g~tv1T$7aeWRrEvX9rEzye|-bc+-KZw`Q7`gzUmyW3N5uGTEx& zRdU>O-G@Kx9CXC5Y^vwjG3966{EOdD-M>{?dA&ZB({zg0=~W9|Le{WsnVF@Lxs+*v z-FzS3>!G~iTb@nP6l?7A_fpLip4;H%=JkAH(7DBeXO=COOMGB|WP)x^_@?s##ca+s zUpf>Qt`2y={~G&Rp`2Xbk3pZ(&vGVYNpsFfVw)kEkY|t($M?}qAuTC!<FbxOsr4N% zFRx#)rL#eEy3v6%48@ZrpH(zht^F2U6LZlkIOgV_w<4C+*2iBTotks`nY($e&hbOj z{QliMlCw?!_J4t||Ngj2{NNYcoB6a;?yK(cda({W$tAO|gucjsR`H>3@A>0PB$)3% z3*S^cxgdJo=bsX5ZSFeUcTk&Y>o(8uq;J}!>>88hLi2V9Z|!BC_QtTI$LrsrkW1MK zMb!osJavB-oeR6S*gojni^TE=@e7ml<~yIiygT3pd-$y8FCU{WdAxi4>{GW*p5Ff( zkDqDZ*t;-ah0`x#TBw7eyp8##Vg`vd72;J>Ew+8x<K6B&>Cg4mmoC418rs{sX=n1p ziC1T)T-CqjG$%9Zl;7US414aaGdFNpSl{k^kSFpn+wXX<Yu@a(vTFM+J}>6(JSJ;0 zS@BrXFTsiXHrlM7+vg$1{^h}hu(@YS?lB#_kyWb{p=u_(FmCgay}R<9=ky($miH-M zfNxfwO-q#f_PqwX=E^TSKU?}^&$o+vrkk)$60e&7@mA1&DaIv7Uq5-h==0-VR`+7p z%2^Ik5BLn@#n0(H?=#==vd{MVZoVV_6ThE$U{)pYXi32Yk=L_Rru}?;xO?Xbb+0)$ z+IJfKO6-&VZ%|v5f288E=8T`W{KHg^$k>Y|^-1#@PVZ`;@z~AfiG1-Bch@sZA1gik zA;?u+oFww>$3r&ZmPxGfI|DL{btcR#uGf4rBli@~mlLiZl#e@2uyir%Q#MXZW}9}# zP1tPS2f@}(P2(f!X9F^GJo!Z~mTYSIsGPZ}PtDlvbx}v|>Bf_X4?T91eJS_a;OkWD zs;*<gA6u{9ZC|vkHF9lY!wrk;Ta)kdD^~NRo4iOftbMld&(7?qxrHh>BN@F_BN-C> z_1<c7Stn!$2-E}}xx_7g_~>$$Hm40&6P0`$ias8a+;#Z!oCA3t+vO*I-1k{5!EE2e zrOPg5I^5|#HnDr-ZTstiB6pMz2ps!ls`<I=)tMy|+keD={?h#Sqgcm>diQV3Z>_9e z@u&7n`P#xu)^B3ty0tRy*KO#{n_6S8zy9FzxZhun*{Qs|D!ldP6uUe1yY>q3XKz<; z@2yt){O+7w=>6j>oh;_Ey|rtW{qrm8Y?GMV=Guf56R9(Ld;P)+G}?~zY-;A-{3Dw^ z_>6)0ilq;&6Vk6ts#^Zf<inC>p<E^c4N5B)1a#UrOkDT&)T?iC4;{?!9(<iyV)Nmv z=#{hH$Lr?s$DWkTIp(EdTfNaaVtM*H%{jkojC}V=*KX4LKHE{Y|KKV82RFD6ES^7e zg7g2Mv(=yZ`b{@}_wQD-`jKq{OKzO)i>=%ILg>r2BA@aj?O$FAC|(lW$jXzSY4~-I z!<8$yS3Y?0c%|ktlf=I0(?|9i^xJn$is0Pov7x;=sY0Z<j`jEnN7tKzUS3I;Gkt#k z@%+M7mfT>e+hTRWOF?6)i-PN9RX5G~G27>7q^l_Xj`)7~^#QeC1rz?;CvQyiKU>eh F000z{=*|ED diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php deleted file mode 100644 index cf3c3df..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * General utility class in Swift Mailer, not to be instantiated. - * - * - * @author Chris Corbyn - */ -abstract class Swift -{ - /** Swift Mailer Version number generated during dist release process */ - const VERSION = '@SWIFT_VERSION_NUMBER@'; - - public static $initialized = false; - public static $inits = array(); - - /** - * Registers an initializer callable that will be called the first time - * a SwiftMailer class is autoloaded. - * - * This enables you to tweak the default configuration in a lazy way. - * - * @param mixed $callable A valid PHP callable that will be called when autoloading the first Swift class - */ - public static function init($callable) - { - self::$inits[] = $callable; - } - - /** - * Internal autoloader for spl_autoload_register(). - * - * @param string $class - */ - public static function autoload($class) - { - // Don't interfere with other autoloaders - if (0 !== strpos($class, 'Swift_')) { - return; - } - - $path = __DIR__ . 'Swift.php/' .str_replace('_', '/', $class).'.php'; - - if (!file_exists($path)) { - return; - } - - require $path; - - if (self::$inits && !self::$initialized) { - self::$initialized = true; - foreach (self::$inits as $init) { - call_user_func($init); - } - } - } - - /** - * Configure autoloading using Swift Mailer. - * - * This is designed to play nicely with other autoloaders. - * - * @param mixed $callable A valid PHP callable that will be called when autoloading the first Swift class - */ - public static function registerAutoload($callable = null) - { - if (null !== $callable) { - self::$inits[] = $callable; - } - spl_autoload_register(array('Swift', 'autoload')); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php deleted file mode 100644 index a95bccf..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Attachment class for attaching files to a {@link Swift_Mime_Message}. - * - * @author Chris Corbyn - */ -class Swift_Attachment extends Swift_Mime_Attachment -{ - /** - * Create a new Attachment. - * - * Details may be optionally provided to the constructor. - * - * @param string|Swift_OutputByteStream $data - * @param string $filename - * @param string $contentType - */ - public function __construct($data = null, $filename = null, $contentType = null) - { - call_user_func_array( - array($this, 'Swift_Mime_Attachment::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('mime.attachment') - ); - - $this->setBody($data); - $this->setFilename($filename); - if ($contentType) { - $this->setContentType($contentType); - } - } - - /** - * Create a new Attachment. - * - * @param string|Swift_OutputByteStream $data - * @param string $filename - * @param string $contentType - * - * @return Swift_Mime_Attachment - */ - public static function newInstance($data = null, $filename = null, $contentType = null) - { - return new self($data, $filename, $contentType); - } - - /** - * Create a new Attachment from a filesystem path. - * - * @param string $path - * @param string $contentType optional - * - * @return Swift_Mime_Attachment - */ - public static function fromPath($path, $contentType = null) - { - return self::newInstance()->setFile( - new Swift_ByteStream_FileByteStream($path), - $contentType - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php deleted file mode 100644 index a7b0e3a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php +++ /dev/null @@ -1,181 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Provides the base functionality for an InputStream supporting filters. - * - * @author Chris Corbyn - */ -abstract class Swift_ByteStream_AbstractFilterableInputStream implements Swift_InputByteStream, Swift_Filterable -{ - /** - * Write sequence. - */ - protected $_sequence = 0; - - /** - * StreamFilters. - * - * @var Swift_StreamFilter[] - */ - private $_filters = array(); - - /** - * A buffer for writing. - */ - private $_writeBuffer = ''; - - /** - * Bound streams. - * - * @var Swift_InputByteStream[] - */ - private $_mirrors = array(); - - /** - * Commit the given bytes to the storage medium immediately. - * - * @param string $bytes - */ - abstract protected function _commit($bytes); - - /** - * Flush any buffers/content with immediate effect. - */ - abstract protected function _flush(); - - /** - * Add a StreamFilter to this InputByteStream. - * - * @param Swift_StreamFilter $filter - * @param string $key - */ - public function addFilter(Swift_StreamFilter $filter, $key) - { - $this->_filters[$key] = $filter; - } - - /** - * Remove an already present StreamFilter based on its $key. - * - * @param string $key - */ - public function removeFilter($key) - { - unset($this->_filters[$key]); - } - - /** - * Writes $bytes to the end of the stream. - * - * @param string $bytes - * - * @throws Swift_IoException - * - * @return int - */ - public function write($bytes) - { - $this->_writeBuffer .= $bytes; - foreach ($this->_filters as $filter) { - if ($filter->shouldBuffer($this->_writeBuffer)) { - return; - } - } - $this->_doWrite($this->_writeBuffer); - - return ++$this->_sequence; - } - - /** - * For any bytes that are currently buffered inside the stream, force them - * off the buffer. - * - * @throws Swift_IoException - */ - public function commit() - { - $this->_doWrite($this->_writeBuffer); - } - - /** - * Attach $is to this stream. - * - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - * - * @param Swift_InputByteStream $is - */ - public function bind(Swift_InputByteStream $is) - { - $this->_mirrors[] = $is; - } - - /** - * Remove an already bound stream. - * - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - * - * @param Swift_InputByteStream $is - */ - public function unbind(Swift_InputByteStream $is) - { - foreach ($this->_mirrors as $k => $stream) { - if ($is === $stream) { - if ($this->_writeBuffer !== '') { - $stream->write($this->_writeBuffer); - } - unset($this->_mirrors[$k]); - } - } - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - * - * @throws Swift_IoException - */ - public function flushBuffers() - { - if ($this->_writeBuffer !== '') { - $this->_doWrite($this->_writeBuffer); - } - $this->_flush(); - - foreach ($this->_mirrors as $stream) { - $stream->flushBuffers(); - } - } - - /** Run $bytes through all filters */ - private function _filter($bytes) - { - foreach ($this->_filters as $filter) { - $bytes = $filter->filter($bytes); - } - - return $bytes; - } - - /** Just write the bytes to the stream */ - private function _doWrite($bytes) - { - $this->_commit($this->_filter($bytes)); - - foreach ($this->_mirrors as $stream) { - $stream->write($bytes); - } - - $this->_writeBuffer = ''; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php deleted file mode 100644 index ef05a6d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php +++ /dev/null @@ -1,182 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Allows reading and writing of bytes to and from an array. - * - * @author Chris Corbyn - */ -class Swift_ByteStream_ArrayByteStream implements Swift_InputByteStream, Swift_OutputByteStream -{ - /** - * The internal stack of bytes. - * - * @var string[] - */ - private $_array = array(); - - /** - * The size of the stack. - * - * @var int - */ - private $_arraySize = 0; - - /** - * The internal pointer offset. - * - * @var int - */ - private $_offset = 0; - - /** - * Bound streams. - * - * @var Swift_InputByteStream[] - */ - private $_mirrors = array(); - - /** - * Create a new ArrayByteStream. - * - * If $stack is given the stream will be populated with the bytes it contains. - * - * @param mixed $stack of bytes in string or array form, optional - */ - public function __construct($stack = null) - { - if (is_array($stack)) { - $this->_array = $stack; - $this->_arraySize = count($stack); - } elseif (is_string($stack)) { - $this->write($stack); - } else { - $this->_array = array(); - } - } - - /** - * Reads $length bytes from the stream into a string and moves the pointer - * through the stream by $length. - * - * If less bytes exist than are requested the - * remaining bytes are given instead. If no bytes are remaining at all, boolean - * false is returned. - * - * @param int $length - * - * @return string - */ - public function read($length) - { - if ($this->_offset == $this->_arraySize) { - return false; - } - - // Don't use array slice - $end = $length + $this->_offset; - $end = $this->_arraySize < $end ? $this->_arraySize : $end; - $ret = ''; - for (; $this->_offset < $end; ++$this->_offset) { - $ret .= $this->_array[$this->_offset]; - } - - return $ret; - } - - /** - * Writes $bytes to the end of the stream. - * - * @param string $bytes - */ - public function write($bytes) - { - $to_add = str_split($bytes); - foreach ($to_add as $value) { - $this->_array[] = $value; - } - $this->_arraySize = count($this->_array); - - foreach ($this->_mirrors as $stream) { - $stream->write($bytes); - } - } - - /** - * Not used. - */ - public function commit() - { - } - - /** - * Attach $is to this stream. - * - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - * - * @param Swift_InputByteStream $is - */ - public function bind(Swift_InputByteStream $is) - { - $this->_mirrors[] = $is; - } - - /** - * Remove an already bound stream. - * - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - * - * @param Swift_InputByteStream $is - */ - public function unbind(Swift_InputByteStream $is) - { - foreach ($this->_mirrors as $k => $stream) { - if ($is === $stream) { - unset($this->_mirrors[$k]); - } - } - } - - /** - * Move the internal read pointer to $byteOffset in the stream. - * - * @param int $byteOffset - * - * @return bool - */ - public function setReadPointer($byteOffset) - { - if ($byteOffset > $this->_arraySize) { - $byteOffset = $this->_arraySize; - } elseif ($byteOffset < 0) { - $byteOffset = 0; - } - - $this->_offset = $byteOffset; - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - */ - public function flushBuffers() - { - $this->_offset = 0; - $this->_array = array(); - $this->_arraySize = 0; - - foreach ($this->_mirrors as $stream) { - $stream->flushBuffers(); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php deleted file mode 100644 index 9ed8523..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php +++ /dev/null @@ -1,231 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Allows reading and writing of bytes to and from a file. - * - * @author Chris Corbyn - */ -class Swift_ByteStream_FileByteStream extends Swift_ByteStream_AbstractFilterableInputStream implements Swift_FileStream -{ - /** The internal pointer offset */ - private $_offset = 0; - - /** The path to the file */ - private $_path; - - /** The mode this file is opened in for writing */ - private $_mode; - - /** A lazy-loaded resource handle for reading the file */ - private $_reader; - - /** A lazy-loaded resource handle for writing the file */ - private $_writer; - - /** If magic_quotes_runtime is on, this will be true */ - private $_quotes = false; - - /** If stream is seekable true/false, or null if not known */ - private $_seekable = null; - - /** - * Create a new FileByteStream for $path. - * - * @param string $path - * @param bool $writable if true - */ - public function __construct($path, $writable = false) - { - if (empty($path)) { - throw new Swift_IoException('The path cannot be empty'); - } - $this->_path = $path; - $this->_mode = $writable ? 'w+b' : 'rb'; - - if (function_exists('get_magic_quotes_runtime') && @get_magic_quotes_runtime() == 1) { - $this->_quotes = true; - } - } - - /** - * Get the complete path to the file. - * - * @return string - */ - public function getPath() - { - return $this->_path; - } - - /** - * Reads $length bytes from the stream into a string and moves the pointer - * through the stream by $length. - * - * If less bytes exist than are requested the - * remaining bytes are given instead. If no bytes are remaining at all, boolean - * false is returned. - * - * @param int $length - * - * @throws Swift_IoException - * - * @return string|bool - */ - public function read($length) - { - $fp = $this->_getReadHandle(); - if (!feof($fp)) { - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 0); - } - $bytes = fread($fp, $length); - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 1); - } - $this->_offset = ftell($fp); - - // If we read one byte after reaching the end of the file - // feof() will return false and an empty string is returned - if ($bytes === '' && feof($fp)) { - $this->_resetReadHandle(); - - return false; - } - - return $bytes; - } - - $this->_resetReadHandle(); - - return false; - } - - /** - * Move the internal read pointer to $byteOffset in the stream. - * - * @param int $byteOffset - * - * @return bool - */ - public function setReadPointer($byteOffset) - { - if (isset($this->_reader)) { - $this->_seekReadStreamToPosition($byteOffset); - } - $this->_offset = $byteOffset; - } - - /** Just write the bytes to the file */ - protected function _commit($bytes) - { - fwrite($this->_getWriteHandle(), $bytes); - $this->_resetReadHandle(); - } - - /** Not used */ - protected function _flush() - { - } - - /** Get the resource for reading */ - private function _getReadHandle() - { - if (!isset($this->_reader)) { - $pointer = @fopen($this->_path, 'rb'); - if (!$pointer) { - throw new Swift_IoException( - 'Unable to open file for reading ['.$this->_path.']' - ); - } - $this->_reader = $pointer; - if ($this->_offset != 0) { - $this->_getReadStreamSeekableStatus(); - $this->_seekReadStreamToPosition($this->_offset); - } - } - - return $this->_reader; - } - - /** Get the resource for writing */ - private function _getWriteHandle() - { - if (!isset($this->_writer)) { - if (!$this->_writer = fopen($this->_path, $this->_mode)) { - throw new Swift_IoException( - 'Unable to open file for writing ['.$this->_path.']' - ); - } - } - - return $this->_writer; - } - - /** Force a reload of the resource for reading */ - private function _resetReadHandle() - { - if (isset($this->_reader)) { - fclose($this->_reader); - $this->_reader = null; - } - } - - /** Check if ReadOnly Stream is seekable */ - private function _getReadStreamSeekableStatus() - { - $metas = stream_get_meta_data($this->_reader); - $this->_seekable = $metas['seekable']; - } - - /** Streams in a readOnly stream ensuring copy if needed */ - private function _seekReadStreamToPosition($offset) - { - if ($this->_seekable === null) { - $this->_getReadStreamSeekableStatus(); - } - if ($this->_seekable === false) { - $currentPos = ftell($this->_reader); - if ($currentPos < $offset) { - $toDiscard = $offset - $currentPos; - fread($this->_reader, $toDiscard); - - return; - } - $this->_copyReadStream(); - } - fseek($this->_reader, $offset, SEEK_SET); - } - - /** Copy a readOnly Stream to ensure seekability */ - private function _copyReadStream() - { - if ($tmpFile = fopen('php://temp/maxmemory:4096', 'w+b')) { - /* We have opened a php:// Stream Should work without problem */ - } elseif (function_exists('sys_get_temp_dir') && is_writable(sys_get_temp_dir()) && ($tmpFile = tmpfile())) { - /* We have opened a tmpfile */ - } else { - throw new Swift_IoException('Unable to copy the file to make it seekable, sys_temp_dir is not writable, php://memory not available'); - } - $currentPos = ftell($this->_reader); - fclose($this->_reader); - $source = fopen($this->_path, 'rb'); - if (!$source) { - throw new Swift_IoException('Unable to open file for copying ['.$this->_path.']'); - } - fseek($tmpFile, 0, SEEK_SET); - while (!feof($source)) { - fwrite($tmpFile, fread($source, 4096)); - } - fseek($tmpFile, $currentPos, SEEK_SET); - fclose($source); - $this->_reader = $tmpFile; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php deleted file mode 100644 index 1c9a80c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/* -* This file is part of SwiftMailer. -* (c) 2004-2009 Chris Corbyn -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ - -/** - * @author Romain-Geissler - */ -class Swift_ByteStream_TemporaryFileByteStream extends Swift_ByteStream_FileByteStream -{ - public function __construct() - { - $filePath = tempnam(sys_get_temp_dir(), 'FileByteStream'); - - if ($filePath === false) { - throw new Swift_IoException('Failed to retrieve temporary file name.'); - } - - parent::__construct($filePath, true); - } - - public function getContent() - { - if (($content = file_get_contents($this->getPath())) === false) { - throw new Swift_IoException('Failed to get temporary file content.'); - } - - return $content; - } - - public function __destruct() - { - if (file_exists($this->getPath())) { - @unlink($this->getPath()); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php deleted file mode 100644 index 4267adb..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Analyzes characters for a specific character set. - * - * @author Chris Corbyn - * @author Xavier De Cock <xdecock@gmail.com> - */ -interface Swift_CharacterReader -{ - const MAP_TYPE_INVALID = 0x01; - const MAP_TYPE_FIXED_LEN = 0x02; - const MAP_TYPE_POSITIONS = 0x03; - - /** - * Returns the complete character map. - * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars - * - * @return int - */ - public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars); - - /** - * Returns the mapType, see constants. - * - * @return int - */ - public function getMapType(); - - /** - * Returns an integer which specifies how many more bytes to read. - * - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * - * @param int[] $bytes - * @param int $size - * - * @return int - */ - public function validateByteSequence($bytes, $size); - - /** - * Returns the number of bytes which should be read to start each character. - * - * For fixed width character sets this should be the number of octets-per-character. - * For multibyte character sets this will probably be 1. - * - * @return int - */ - public function getInitialByteSize(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php deleted file mode 100644 index 6a18e1d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Provides fixed-width byte sizes for reading fixed-width character sets. - * - * @author Chris Corbyn - * @author Xavier De Cock <xdecock@gmail.com> - */ -class Swift_CharacterReader_GenericFixedWidthReader implements Swift_CharacterReader -{ - /** - * The number of bytes in a single character. - * - * @var int - */ - private $_width; - - /** - * Creates a new GenericFixedWidthReader using $width bytes per character. - * - * @param int $width - */ - public function __construct($width) - { - $this->_width = $width; - } - - /** - * Returns the complete character map. - * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars - * - * @return int - */ - public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars) - { - $strlen = strlen($string); - // % and / are CPU intensive, so, maybe find a better way - $ignored = $strlen % $this->_width; - $ignoredChars = $ignored ? substr($string, -$ignored) : ''; - $currentMap = $this->_width; - - return ($strlen - $ignored) / $this->_width; - } - - /** - * Returns the mapType. - * - * @return int - */ - public function getMapType() - { - return self::MAP_TYPE_FIXED_LEN; - } - - /** - * Returns an integer which specifies how many more bytes to read. - * - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * - * @param string $bytes - * @param int $size - * - * @return int - */ - public function validateByteSequence($bytes, $size) - { - $needed = $this->_width - $size; - - return $needed > -1 ? $needed : -1; - } - - /** - * Returns the number of bytes which should be read to start each character. - * - * @return int - */ - public function getInitialByteSize() - { - return $this->_width; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php deleted file mode 100644 index 67da48f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Analyzes US-ASCII characters. - * - * @author Chris Corbyn - */ -class Swift_CharacterReader_UsAsciiReader implements Swift_CharacterReader -{ - /** - * Returns the complete character map. - * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param string $ignoredChars - * - * @return int - */ - public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars) - { - $strlen = strlen($string); - $ignoredChars = ''; - for ($i = 0; $i < $strlen; ++$i) { - if ($string[$i] > "\x07F") { - // Invalid char - $currentMap[$i + $startOffset] = $string[$i]; - } - } - - return $strlen; - } - - /** - * Returns mapType. - * - * @return int mapType - */ - public function getMapType() - { - return self::MAP_TYPE_INVALID; - } - - /** - * Returns an integer which specifies how many more bytes to read. - * - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * - * @param string $bytes - * @param int $size - * - * @return int - */ - public function validateByteSequence($bytes, $size) - { - $byte = reset($bytes); - if (1 == count($bytes) && $byte >= 0x00 && $byte <= 0x7F) { - return 0; - } - - return -1; - } - - /** - * Returns the number of bytes which should be read to start each character. - * - * @return int - */ - public function getInitialByteSize() - { - return 1; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php deleted file mode 100644 index 22746bd..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php +++ /dev/null @@ -1,176 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Analyzes UTF-8 characters. - * - * @author Chris Corbyn - * @author Xavier De Cock <xdecock@gmail.com> - */ -class Swift_CharacterReader_Utf8Reader implements Swift_CharacterReader -{ - /** Pre-computed for optimization */ - private static $length_map = array( - // N=0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x0N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x1N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x2N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x3N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x4N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x5N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x6N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x7N - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x8N - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x9N - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xAN - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xBN - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xCN - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xDN - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xEN - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0, // 0xFN - ); - - private static $s_length_map = array( - "\x00" => 1, "\x01" => 1, "\x02" => 1, "\x03" => 1, "\x04" => 1, "\x05" => 1, "\x06" => 1, "\x07" => 1, - "\x08" => 1, "\x09" => 1, "\x0a" => 1, "\x0b" => 1, "\x0c" => 1, "\x0d" => 1, "\x0e" => 1, "\x0f" => 1, - "\x10" => 1, "\x11" => 1, "\x12" => 1, "\x13" => 1, "\x14" => 1, "\x15" => 1, "\x16" => 1, "\x17" => 1, - "\x18" => 1, "\x19" => 1, "\x1a" => 1, "\x1b" => 1, "\x1c" => 1, "\x1d" => 1, "\x1e" => 1, "\x1f" => 1, - "\x20" => 1, "\x21" => 1, "\x22" => 1, "\x23" => 1, "\x24" => 1, "\x25" => 1, "\x26" => 1, "\x27" => 1, - "\x28" => 1, "\x29" => 1, "\x2a" => 1, "\x2b" => 1, "\x2c" => 1, "\x2d" => 1, "\x2e" => 1, "\x2f" => 1, - "\x30" => 1, "\x31" => 1, "\x32" => 1, "\x33" => 1, "\x34" => 1, "\x35" => 1, "\x36" => 1, "\x37" => 1, - "\x38" => 1, "\x39" => 1, "\x3a" => 1, "\x3b" => 1, "\x3c" => 1, "\x3d" => 1, "\x3e" => 1, "\x3f" => 1, - "\x40" => 1, "\x41" => 1, "\x42" => 1, "\x43" => 1, "\x44" => 1, "\x45" => 1, "\x46" => 1, "\x47" => 1, - "\x48" => 1, "\x49" => 1, "\x4a" => 1, "\x4b" => 1, "\x4c" => 1, "\x4d" => 1, "\x4e" => 1, "\x4f" => 1, - "\x50" => 1, "\x51" => 1, "\x52" => 1, "\x53" => 1, "\x54" => 1, "\x55" => 1, "\x56" => 1, "\x57" => 1, - "\x58" => 1, "\x59" => 1, "\x5a" => 1, "\x5b" => 1, "\x5c" => 1, "\x5d" => 1, "\x5e" => 1, "\x5f" => 1, - "\x60" => 1, "\x61" => 1, "\x62" => 1, "\x63" => 1, "\x64" => 1, "\x65" => 1, "\x66" => 1, "\x67" => 1, - "\x68" => 1, "\x69" => 1, "\x6a" => 1, "\x6b" => 1, "\x6c" => 1, "\x6d" => 1, "\x6e" => 1, "\x6f" => 1, - "\x70" => 1, "\x71" => 1, "\x72" => 1, "\x73" => 1, "\x74" => 1, "\x75" => 1, "\x76" => 1, "\x77" => 1, - "\x78" => 1, "\x79" => 1, "\x7a" => 1, "\x7b" => 1, "\x7c" => 1, "\x7d" => 1, "\x7e" => 1, "\x7f" => 1, - "\x80" => 0, "\x81" => 0, "\x82" => 0, "\x83" => 0, "\x84" => 0, "\x85" => 0, "\x86" => 0, "\x87" => 0, - "\x88" => 0, "\x89" => 0, "\x8a" => 0, "\x8b" => 0, "\x8c" => 0, "\x8d" => 0, "\x8e" => 0, "\x8f" => 0, - "\x90" => 0, "\x91" => 0, "\x92" => 0, "\x93" => 0, "\x94" => 0, "\x95" => 0, "\x96" => 0, "\x97" => 0, - "\x98" => 0, "\x99" => 0, "\x9a" => 0, "\x9b" => 0, "\x9c" => 0, "\x9d" => 0, "\x9e" => 0, "\x9f" => 0, - "\xa0" => 0, "\xa1" => 0, "\xa2" => 0, "\xa3" => 0, "\xa4" => 0, "\xa5" => 0, "\xa6" => 0, "\xa7" => 0, - "\xa8" => 0, "\xa9" => 0, "\xaa" => 0, "\xab" => 0, "\xac" => 0, "\xad" => 0, "\xae" => 0, "\xaf" => 0, - "\xb0" => 0, "\xb1" => 0, "\xb2" => 0, "\xb3" => 0, "\xb4" => 0, "\xb5" => 0, "\xb6" => 0, "\xb7" => 0, - "\xb8" => 0, "\xb9" => 0, "\xba" => 0, "\xbb" => 0, "\xbc" => 0, "\xbd" => 0, "\xbe" => 0, "\xbf" => 0, - "\xc0" => 2, "\xc1" => 2, "\xc2" => 2, "\xc3" => 2, "\xc4" => 2, "\xc5" => 2, "\xc6" => 2, "\xc7" => 2, - "\xc8" => 2, "\xc9" => 2, "\xca" => 2, "\xcb" => 2, "\xcc" => 2, "\xcd" => 2, "\xce" => 2, "\xcf" => 2, - "\xd0" => 2, "\xd1" => 2, "\xd2" => 2, "\xd3" => 2, "\xd4" => 2, "\xd5" => 2, "\xd6" => 2, "\xd7" => 2, - "\xd8" => 2, "\xd9" => 2, "\xda" => 2, "\xdb" => 2, "\xdc" => 2, "\xdd" => 2, "\xde" => 2, "\xdf" => 2, - "\xe0" => 3, "\xe1" => 3, "\xe2" => 3, "\xe3" => 3, "\xe4" => 3, "\xe5" => 3, "\xe6" => 3, "\xe7" => 3, - "\xe8" => 3, "\xe9" => 3, "\xea" => 3, "\xeb" => 3, "\xec" => 3, "\xed" => 3, "\xee" => 3, "\xef" => 3, - "\xf0" => 4, "\xf1" => 4, "\xf2" => 4, "\xf3" => 4, "\xf4" => 4, "\xf5" => 4, "\xf6" => 4, "\xf7" => 4, - "\xf8" => 5, "\xf9" => 5, "\xfa" => 5, "\xfb" => 5, "\xfc" => 6, "\xfd" => 6, "\xfe" => 0, "\xff" => 0, - ); - - /** - * Returns the complete character map. - * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars - * - * @return int - */ - public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars) - { - if (!isset($currentMap['i']) || !isset($currentMap['p'])) { - $currentMap['p'] = $currentMap['i'] = array(); - } - - $strlen = strlen($string); - $charPos = count($currentMap['p']); - $foundChars = 0; - $invalid = false; - for ($i = 0; $i < $strlen; ++$i) { - $char = $string[$i]; - $size = self::$s_length_map[$char]; - if ($size == 0) { - /* char is invalid, we must wait for a resync */ - $invalid = true; - continue; - } else { - if ($invalid == true) { - /* We mark the chars as invalid and start a new char */ - $currentMap['p'][$charPos + $foundChars] = $startOffset + $i; - $currentMap['i'][$charPos + $foundChars] = true; - ++$foundChars; - $invalid = false; - } - if (($i + $size) > $strlen) { - $ignoredChars = substr($string, $i); - break; - } - for ($j = 1; $j < $size; ++$j) { - $char = $string[$i + $j]; - if ($char > "\x7F" && $char < "\xC0") { - // Valid - continue parsing - } else { - /* char is invalid, we must wait for a resync */ - $invalid = true; - continue 2; - } - } - /* Ok we got a complete char here */ - $currentMap['p'][$charPos + $foundChars] = $startOffset + $i + $size; - $i += $j - 1; - ++$foundChars; - } - } - - return $foundChars; - } - - /** - * Returns mapType. - * - * @return int mapType - */ - public function getMapType() - { - return self::MAP_TYPE_POSITIONS; - } - - /** - * Returns an integer which specifies how many more bytes to read. - * - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * - * @param string $bytes - * @param int $size - * - * @return int - */ - public function validateByteSequence($bytes, $size) - { - if ($size < 1) { - return -1; - } - $needed = self::$length_map[$bytes[0]] - $size; - - return $needed > -1 ? $needed : -1; - } - - /** - * Returns the number of bytes which should be read to start each character. - * - * @return int - */ - public function getInitialByteSize() - { - return 1; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php deleted file mode 100644 index 15b6c69..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A factory for creating CharacterReaders. - * - * @author Chris Corbyn - */ -interface Swift_CharacterReaderFactory -{ - /** - * Returns a CharacterReader suitable for the charset applied. - * - * @param string $charset - * - * @return Swift_CharacterReader - */ - public function getReaderFor($charset); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php deleted file mode 100644 index 9171a0b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php +++ /dev/null @@ -1,124 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Standard factory for creating CharacterReaders. - * - * @author Chris Corbyn - */ -class Swift_CharacterReaderFactory_SimpleCharacterReaderFactory implements Swift_CharacterReaderFactory -{ - /** - * A map of charset patterns to their implementation classes. - * - * @var array - */ - private static $_map = array(); - - /** - * Factories which have already been loaded. - * - * @var Swift_CharacterReaderFactory[] - */ - private static $_loaded = array(); - - /** - * Creates a new CharacterReaderFactory. - */ - public function __construct() - { - $this->init(); - } - - public function __wakeup() - { - $this->init(); - } - - public function init() - { - if (count(self::$_map) > 0) { - return; - } - - $prefix = 'Swift_CharacterReader_'; - - $singleByte = array( - 'class' => $prefix.'GenericFixedWidthReader', - 'constructor' => array(1), - ); - - $doubleByte = array( - 'class' => $prefix.'GenericFixedWidthReader', - 'constructor' => array(2), - ); - - $fourBytes = array( - 'class' => $prefix.'GenericFixedWidthReader', - 'constructor' => array(4), - ); - - // Utf-8 - self::$_map['utf-?8'] = array( - 'class' => $prefix.'Utf8Reader', - 'constructor' => array(), - ); - - //7-8 bit charsets - self::$_map['(us-)?ascii'] = $singleByte; - self::$_map['(iso|iec)-?8859-?[0-9]+'] = $singleByte; - self::$_map['windows-?125[0-9]'] = $singleByte; - self::$_map['cp-?[0-9]+'] = $singleByte; - self::$_map['ansi'] = $singleByte; - self::$_map['macintosh'] = $singleByte; - self::$_map['koi-?7'] = $singleByte; - self::$_map['koi-?8-?.+'] = $singleByte; - self::$_map['mik'] = $singleByte; - self::$_map['(cork|t1)'] = $singleByte; - self::$_map['v?iscii'] = $singleByte; - - //16 bits - self::$_map['(ucs-?2|utf-?16)'] = $doubleByte; - - //32 bits - self::$_map['(ucs-?4|utf-?32)'] = $fourBytes; - - // Fallback - self::$_map['.*'] = $singleByte; - } - - /** - * Returns a CharacterReader suitable for the charset applied. - * - * @param string $charset - * - * @return Swift_CharacterReader - */ - public function getReaderFor($charset) - { - $charset = trim(strtolower($charset)); - foreach (self::$_map as $pattern => $spec) { - $re = '/^'.$pattern.'$/D'; - if (preg_match($re, $charset)) { - if (!array_key_exists($pattern, self::$_loaded)) { - $reflector = new ReflectionClass($spec['class']); - if ($reflector->getConstructor()) { - $reader = $reflector->newInstanceArgs($spec['constructor']); - } else { - $reader = $reflector->newInstance(); - } - self::$_loaded[$pattern] = $reader; - } - - return self::$_loaded[$pattern]; - } - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php deleted file mode 100644 index 717924f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An abstract means of reading and writing data in terms of characters as opposed - * to bytes. - * - * Classes implementing this interface may use a subsystem which requires less - * memory than working with large strings of data. - * - * @author Chris Corbyn - */ -interface Swift_CharacterStream -{ - /** - * Set the character set used in this CharacterStream. - * - * @param string $charset - */ - public function setCharacterSet($charset); - - /** - * Set the CharacterReaderFactory for multi charset support. - * - * @param Swift_CharacterReaderFactory $factory - */ - public function setCharacterReaderFactory(Swift_CharacterReaderFactory $factory); - - /** - * Overwrite this character stream using the byte sequence in the byte stream. - * - * @param Swift_OutputByteStream $os output stream to read from - */ - public function importByteStream(Swift_OutputByteStream $os); - - /** - * Import a string a bytes into this CharacterStream, overwriting any existing - * data in the stream. - * - * @param string $string - */ - public function importString($string); - - /** - * Read $length characters from the stream and move the internal pointer - * $length further into the stream. - * - * @param int $length - * - * @return string - */ - public function read($length); - - /** - * Read $length characters from the stream and return a 1-dimensional array - * containing there octet values. - * - * @param int $length - * - * @return int[] - */ - public function readBytes($length); - - /** - * Write $chars to the end of the stream. - * - * @param string $chars - */ - public function write($chars); - - /** - * Move the internal pointer to $charOffset in the stream. - * - * @param int $charOffset - */ - public function setPointer($charOffset); - - /** - * Empty the stream and reset the internal pointer. - */ - public function flushContents(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php deleted file mode 100644 index 7213a40..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php +++ /dev/null @@ -1,293 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A CharacterStream implementation which stores characters in an internal array. - * - * @author Chris Corbyn - */ -class Swift_CharacterStream_ArrayCharacterStream implements Swift_CharacterStream -{ - /** A map of byte values and their respective characters */ - private static $_charMap; - - /** A map of characters and their derivative byte values */ - private static $_byteMap; - - /** The char reader (lazy-loaded) for the current charset */ - private $_charReader; - - /** A factory for creating CharacterReader instances */ - private $_charReaderFactory; - - /** The character set this stream is using */ - private $_charset; - - /** Array of characters */ - private $_array = array(); - - /** Size of the array of character */ - private $_array_size = array(); - - /** The current character offset in the stream */ - private $_offset = 0; - - /** - * Create a new CharacterStream with the given $chars, if set. - * - * @param Swift_CharacterReaderFactory $factory for loading validators - * @param string $charset used in the stream - */ - public function __construct(Swift_CharacterReaderFactory $factory, $charset) - { - self::_initializeMaps(); - $this->setCharacterReaderFactory($factory); - $this->setCharacterSet($charset); - } - - /** - * Set the character set used in this CharacterStream. - * - * @param string $charset - */ - public function setCharacterSet($charset) - { - $this->_charset = $charset; - $this->_charReader = null; - } - - /** - * Set the CharacterReaderFactory for multi charset support. - * - * @param Swift_CharacterReaderFactory $factory - */ - public function setCharacterReaderFactory(Swift_CharacterReaderFactory $factory) - { - $this->_charReaderFactory = $factory; - } - - /** - * Overwrite this character stream using the byte sequence in the byte stream. - * - * @param Swift_OutputByteStream $os output stream to read from - */ - public function importByteStream(Swift_OutputByteStream $os) - { - if (!isset($this->_charReader)) { - $this->_charReader = $this->_charReaderFactory - ->getReaderFor($this->_charset); - } - - $startLength = $this->_charReader->getInitialByteSize(); - while (false !== $bytes = $os->read($startLength)) { - $c = array(); - for ($i = 0, $len = strlen($bytes); $i < $len; ++$i) { - $c[] = self::$_byteMap[$bytes[$i]]; - } - $size = count($c); - $need = $this->_charReader - ->validateByteSequence($c, $size); - if ($need > 0 && - false !== $bytes = $os->read($need)) { - for ($i = 0, $len = strlen($bytes); $i < $len; ++$i) { - $c[] = self::$_byteMap[$bytes[$i]]; - } - } - $this->_array[] = $c; - ++$this->_array_size; - } - } - - /** - * Import a string a bytes into this CharacterStream, overwriting any existing - * data in the stream. - * - * @param string $string - */ - public function importString($string) - { - $this->flushContents(); - $this->write($string); - } - - /** - * Read $length characters from the stream and move the internal pointer - * $length further into the stream. - * - * @param int $length - * - * @return string - */ - public function read($length) - { - if ($this->_offset == $this->_array_size) { - return false; - } - - // Don't use array slice - $arrays = array(); - $end = $length + $this->_offset; - for ($i = $this->_offset; $i < $end; ++$i) { - if (!isset($this->_array[$i])) { - break; - } - $arrays[] = $this->_array[$i]; - } - $this->_offset += $i - $this->_offset; // Limit function calls - $chars = false; - foreach ($arrays as $array) { - $chars .= implode('', array_map('chr', $array)); - } - - return $chars; - } - - /** - * Read $length characters from the stream and return a 1-dimensional array - * containing there octet values. - * - * @param int $length - * - * @return int[] - */ - public function readBytes($length) - { - if ($this->_offset == $this->_array_size) { - return false; - } - $arrays = array(); - $end = $length + $this->_offset; - for ($i = $this->_offset; $i < $end; ++$i) { - if (!isset($this->_array[$i])) { - break; - } - $arrays[] = $this->_array[$i]; - } - $this->_offset += ($i - $this->_offset); // Limit function calls - - return call_user_func_array('array_merge', $arrays); - } - - /** - * Write $chars to the end of the stream. - * - * @param string $chars - */ - public function write($chars) - { - if (!isset($this->_charReader)) { - $this->_charReader = $this->_charReaderFactory->getReaderFor( - $this->_charset); - } - - $startLength = $this->_charReader->getInitialByteSize(); - - $fp = fopen('php://memory', 'w+b'); - fwrite($fp, $chars); - unset($chars); - fseek($fp, 0, SEEK_SET); - - $buffer = array(0); - $buf_pos = 1; - $buf_len = 1; - $has_datas = true; - do { - $bytes = array(); - // Buffer Filing - if ($buf_len - $buf_pos < $startLength) { - $buf = array_splice($buffer, $buf_pos); - $new = $this->_reloadBuffer($fp, 100); - if ($new) { - $buffer = array_merge($buf, $new); - $buf_len = count($buffer); - $buf_pos = 0; - } else { - $has_datas = false; - } - } - if ($buf_len - $buf_pos > 0) { - $size = 0; - for ($i = 0; $i < $startLength && isset($buffer[$buf_pos]); ++$i) { - ++$size; - $bytes[] = $buffer[$buf_pos++]; - } - $need = $this->_charReader->validateByteSequence( - $bytes, $size); - if ($need > 0) { - if ($buf_len - $buf_pos < $need) { - $new = $this->_reloadBuffer($fp, $need); - - if ($new) { - $buffer = array_merge($buffer, $new); - $buf_len = count($buffer); - } - } - for ($i = 0; $i < $need && isset($buffer[$buf_pos]); ++$i) { - $bytes[] = $buffer[$buf_pos++]; - } - } - $this->_array[] = $bytes; - ++$this->_array_size; - } - } while ($has_datas); - - fclose($fp); - } - - /** - * Move the internal pointer to $charOffset in the stream. - * - * @param int $charOffset - */ - public function setPointer($charOffset) - { - if ($charOffset > $this->_array_size) { - $charOffset = $this->_array_size; - } elseif ($charOffset < 0) { - $charOffset = 0; - } - $this->_offset = $charOffset; - } - - /** - * Empty the stream and reset the internal pointer. - */ - public function flushContents() - { - $this->_offset = 0; - $this->_array = array(); - $this->_array_size = 0; - } - - private function _reloadBuffer($fp, $len) - { - if (!feof($fp) && ($bytes = fread($fp, $len)) !== false) { - $buf = array(); - for ($i = 0, $len = strlen($bytes); $i < $len; ++$i) { - $buf[] = self::$_byteMap[$bytes[$i]]; - } - - return $buf; - } - - return false; - } - - private static function _initializeMaps() - { - if (!isset(self::$_charMap)) { - self::$_charMap = array(); - for ($byte = 0; $byte < 256; ++$byte) { - self::$_charMap[$byte] = chr($byte); - } - self::$_byteMap = array_flip(self::$_charMap); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php deleted file mode 100644 index 58bd140..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php +++ /dev/null @@ -1,267 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A CharacterStream implementation which stores characters in an internal array. - * - * @author Xavier De Cock <xdecock@gmail.com> - */ -class Swift_CharacterStream_NgCharacterStream implements Swift_CharacterStream -{ - /** - * The char reader (lazy-loaded) for the current charset. - * - * @var Swift_CharacterReader - */ - private $_charReader; - - /** - * A factory for creating CharacterReader instances. - * - * @var Swift_CharacterReaderFactory - */ - private $_charReaderFactory; - - /** - * The character set this stream is using. - * - * @var string - */ - private $_charset; - - /** - * The data's stored as-is. - * - * @var string - */ - private $_datas = ''; - - /** - * Number of bytes in the stream. - * - * @var int - */ - private $_datasSize = 0; - - /** - * Map. - * - * @var mixed - */ - private $_map; - - /** - * Map Type. - * - * @var int - */ - private $_mapType = 0; - - /** - * Number of characters in the stream. - * - * @var int - */ - private $_charCount = 0; - - /** - * Position in the stream. - * - * @var int - */ - private $_currentPos = 0; - - /** - * Constructor. - * - * @param Swift_CharacterReaderFactory $factory - * @param string $charset - */ - public function __construct(Swift_CharacterReaderFactory $factory, $charset) - { - $this->setCharacterReaderFactory($factory); - $this->setCharacterSet($charset); - } - - /* -- Changing parameters of the stream -- */ - - /** - * Set the character set used in this CharacterStream. - * - * @param string $charset - */ - public function setCharacterSet($charset) - { - $this->_charset = $charset; - $this->_charReader = null; - $this->_mapType = 0; - } - - /** - * Set the CharacterReaderFactory for multi charset support. - * - * @param Swift_CharacterReaderFactory $factory - */ - public function setCharacterReaderFactory(Swift_CharacterReaderFactory $factory) - { - $this->_charReaderFactory = $factory; - } - - /** - * @see Swift_CharacterStream::flushContents() - */ - public function flushContents() - { - $this->_datas = null; - $this->_map = null; - $this->_charCount = 0; - $this->_currentPos = 0; - $this->_datasSize = 0; - } - - /** - * @see Swift_CharacterStream::importByteStream() - * - * @param Swift_OutputByteStream $os - */ - public function importByteStream(Swift_OutputByteStream $os) - { - $this->flushContents(); - $blocks = 512; - $os->setReadPointer(0); - while (false !== ($read = $os->read($blocks))) { - $this->write($read); - } - } - - /** - * @see Swift_CharacterStream::importString() - * - * @param string $string - */ - public function importString($string) - { - $this->flushContents(); - $this->write($string); - } - - /** - * @see Swift_CharacterStream::read() - * - * @param int $length - * - * @return string - */ - public function read($length) - { - if ($this->_currentPos >= $this->_charCount) { - return false; - } - $ret = false; - $length = $this->_currentPos + $length > $this->_charCount ? $this->_charCount - $this->_currentPos : $length; - switch ($this->_mapType) { - case Swift_CharacterReader::MAP_TYPE_FIXED_LEN: - $len = $length * $this->_map; - $ret = substr($this->_datas, - $this->_currentPos * $this->_map, - $len); - $this->_currentPos += $length; - break; - - case Swift_CharacterReader::MAP_TYPE_INVALID: - $ret = ''; - for (; $this->_currentPos < $length; ++$this->_currentPos) { - if (isset($this->_map[$this->_currentPos])) { - $ret .= '?'; - } else { - $ret .= $this->_datas[$this->_currentPos]; - } - } - break; - - case Swift_CharacterReader::MAP_TYPE_POSITIONS: - $end = $this->_currentPos + $length; - $end = $end > $this->_charCount ? $this->_charCount : $end; - $ret = ''; - $start = 0; - if ($this->_currentPos > 0) { - $start = $this->_map['p'][$this->_currentPos - 1]; - } - $to = $start; - for (; $this->_currentPos < $end; ++$this->_currentPos) { - if (isset($this->_map['i'][$this->_currentPos])) { - $ret .= substr($this->_datas, $start, $to - $start).'?'; - $start = $this->_map['p'][$this->_currentPos]; - } else { - $to = $this->_map['p'][$this->_currentPos]; - } - } - $ret .= substr($this->_datas, $start, $to - $start); - break; - } - - return $ret; - } - - /** - * @see Swift_CharacterStream::readBytes() - * - * @param int $length - * - * @return int[] - */ - public function readBytes($length) - { - $read = $this->read($length); - if ($read !== false) { - $ret = array_map('ord', str_split($read, 1)); - - return $ret; - } - - return false; - } - - /** - * @see Swift_CharacterStream::setPointer() - * - * @param int $charOffset - */ - public function setPointer($charOffset) - { - if ($this->_charCount < $charOffset) { - $charOffset = $this->_charCount; - } - $this->_currentPos = $charOffset; - } - - /** - * @see Swift_CharacterStream::write() - * - * @param string $chars - */ - public function write($chars) - { - if (!isset($this->_charReader)) { - $this->_charReader = $this->_charReaderFactory->getReaderFor( - $this->_charset); - $this->_map = array(); - $this->_mapType = $this->_charReader->getMapType(); - } - $ignored = ''; - $this->_datas .= $chars; - $this->_charCount += $this->_charReader->getCharPositions(substr($this->_datas, $this->_datasSize), $this->_datasSize, $this->_map, $ignored); - if ($ignored !== false) { - $this->_datasSize = strlen($this->_datas) - strlen($ignored); - } else { - $this->_datasSize = strlen($this->_datas); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php deleted file mode 100644 index 4ae5bac..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2009 Fabien Potencier <fabien.potencier@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Base class for Spools (implements time and message limits). - * - * @author Fabien Potencier - */ -abstract class Swift_ConfigurableSpool implements Swift_Spool -{ - /** The maximum number of messages to send per flush */ - private $_message_limit; - - /** The time limit per flush */ - private $_time_limit; - - /** - * Sets the maximum number of messages to send per flush. - * - * @param int $limit - */ - public function setMessageLimit($limit) - { - $this->_message_limit = (int) $limit; - } - - /** - * Gets the maximum number of messages to send per flush. - * - * @return int The limit - */ - public function getMessageLimit() - { - return $this->_message_limit; - } - - /** - * Sets the time limit (in seconds) per flush. - * - * @param int $limit The limit - */ - public function setTimeLimit($limit) - { - $this->_time_limit = (int) $limit; - } - - /** - * Gets the time limit (in seconds) per flush. - * - * @return int The limit - */ - public function getTimeLimit() - { - return $this->_time_limit; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php deleted file mode 100644 index befec9a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php +++ /dev/null @@ -1,373 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Dependency Injection container. - * - * @author Chris Corbyn - */ -class Swift_DependencyContainer -{ - /** Constant for literal value types */ - const TYPE_VALUE = 0x0001; - - /** Constant for new instance types */ - const TYPE_INSTANCE = 0x0010; - - /** Constant for shared instance types */ - const TYPE_SHARED = 0x0100; - - /** Constant for aliases */ - const TYPE_ALIAS = 0x1000; - - /** Singleton instance */ - private static $_instance = null; - - /** The data container */ - private $_store = array(); - - /** The current endpoint in the data container */ - private $_endPoint; - - /** - * Constructor should not be used. - * - * Use {@link getInstance()} instead. - */ - public function __construct() - { - } - - /** - * Returns a singleton of the DependencyContainer. - * - * @return self - */ - public static function getInstance() - { - if (!isset(self::$_instance)) { - self::$_instance = new self(); - } - - return self::$_instance; - } - - /** - * List the names of all items stored in the Container. - * - * @return array - */ - public function listItems() - { - return array_keys($this->_store); - } - - /** - * Test if an item is registered in this container with the given name. - * - * @see register() - * - * @param string $itemName - * - * @return bool - */ - public function has($itemName) - { - return array_key_exists($itemName, $this->_store) - && isset($this->_store[$itemName]['lookupType']); - } - - /** - * Lookup the item with the given $itemName. - * - * @see register() - * - * @param string $itemName - * - * @throws Swift_DependencyException If the dependency is not found - * - * @return mixed - */ - public function lookup($itemName) - { - if (!$this->has($itemName)) { - throw new Swift_DependencyException( - 'Cannot lookup dependency "'.$itemName.'" since it is not registered.' - ); - } - - switch ($this->_store[$itemName]['lookupType']) { - case self::TYPE_ALIAS: - return $this->_createAlias($itemName); - case self::TYPE_VALUE: - return $this->_getValue($itemName); - case self::TYPE_INSTANCE: - return $this->_createNewInstance($itemName); - case self::TYPE_SHARED: - return $this->_createSharedInstance($itemName); - } - } - - /** - * Create an array of arguments passed to the constructor of $itemName. - * - * @param string $itemName - * - * @return array - */ - public function createDependenciesFor($itemName) - { - $args = array(); - if (isset($this->_store[$itemName]['args'])) { - $args = $this->_resolveArgs($this->_store[$itemName]['args']); - } - - return $args; - } - - /** - * Register a new dependency with $itemName. - * - * This method returns the current DependencyContainer instance because it - * requires the use of the fluid interface to set the specific details for the - * dependency. - * - * @see asNewInstanceOf(), asSharedInstanceOf(), asValue() - * - * @param string $itemName - * - * @return $this - */ - public function register($itemName) - { - $this->_store[$itemName] = array(); - $this->_endPoint = &$this->_store[$itemName]; - - return $this; - } - - /** - * Specify the previously registered item as a literal value. - * - * {@link register()} must be called before this will work. - * - * @param mixed $value - * - * @return $this - */ - public function asValue($value) - { - $endPoint = &$this->_getEndPoint(); - $endPoint['lookupType'] = self::TYPE_VALUE; - $endPoint['value'] = $value; - - return $this; - } - - /** - * Specify the previously registered item as an alias of another item. - * - * @param string $lookup - * - * @return $this - */ - public function asAliasOf($lookup) - { - $endPoint = &$this->_getEndPoint(); - $endPoint['lookupType'] = self::TYPE_ALIAS; - $endPoint['ref'] = $lookup; - - return $this; - } - - /** - * Specify the previously registered item as a new instance of $className. - * - * {@link register()} must be called before this will work. - * Any arguments can be set with {@link withDependencies()}, - * {@link addConstructorValue()} or {@link addConstructorLookup()}. - * - * @see withDependencies(), addConstructorValue(), addConstructorLookup() - * - * @param string $className - * - * @return $this - */ - public function asNewInstanceOf($className) - { - $endPoint = &$this->_getEndPoint(); - $endPoint['lookupType'] = self::TYPE_INSTANCE; - $endPoint['className'] = $className; - - return $this; - } - - /** - * Specify the previously registered item as a shared instance of $className. - * - * {@link register()} must be called before this will work. - * - * @param string $className - * - * @return $this - */ - public function asSharedInstanceOf($className) - { - $endPoint = &$this->_getEndPoint(); - $endPoint['lookupType'] = self::TYPE_SHARED; - $endPoint['className'] = $className; - - return $this; - } - - /** - * Specify a list of injected dependencies for the previously registered item. - * - * This method takes an array of lookup names. - * - * @see addConstructorValue(), addConstructorLookup() - * - * @param array $lookups - * - * @return $this - */ - public function withDependencies(array $lookups) - { - $endPoint = &$this->_getEndPoint(); - $endPoint['args'] = array(); - foreach ($lookups as $lookup) { - $this->addConstructorLookup($lookup); - } - - return $this; - } - - /** - * Specify a literal (non looked up) value for the constructor of the - * previously registered item. - * - * @see withDependencies(), addConstructorLookup() - * - * @param mixed $value - * - * @return $this - */ - public function addConstructorValue($value) - { - $endPoint = &$this->_getEndPoint(); - if (!isset($endPoint['args'])) { - $endPoint['args'] = array(); - } - $endPoint['args'][] = array('type' => 'value', 'item' => $value); - - return $this; - } - - /** - * Specify a dependency lookup for the constructor of the previously - * registered item. - * - * @see withDependencies(), addConstructorValue() - * - * @param string $lookup - * - * @return $this - */ - public function addConstructorLookup($lookup) - { - $endPoint = &$this->_getEndPoint(); - if (!isset($this->_endPoint['args'])) { - $endPoint['args'] = array(); - } - $endPoint['args'][] = array('type' => 'lookup', 'item' => $lookup); - - return $this; - } - - /** Get the literal value with $itemName */ - private function _getValue($itemName) - { - return $this->_store[$itemName]['value']; - } - - /** Resolve an alias to another item */ - private function _createAlias($itemName) - { - return $this->lookup($this->_store[$itemName]['ref']); - } - - /** Create a fresh instance of $itemName */ - private function _createNewInstance($itemName) - { - $reflector = new ReflectionClass($this->_store[$itemName]['className']); - if ($reflector->getConstructor()) { - return $reflector->newInstanceArgs( - $this->createDependenciesFor($itemName) - ); - } - - return $reflector->newInstance(); - } - - /** Create and register a shared instance of $itemName */ - private function _createSharedInstance($itemName) - { - if (!isset($this->_store[$itemName]['instance'])) { - $this->_store[$itemName]['instance'] = $this->_createNewInstance($itemName); - } - - return $this->_store[$itemName]['instance']; - } - - /** Get the current endpoint in the store */ - private function &_getEndPoint() - { - if (!isset($this->_endPoint)) { - throw new BadMethodCallException( - 'Component must first be registered by calling register()' - ); - } - - return $this->_endPoint; - } - - /** Get an argument list with dependencies resolved */ - private function _resolveArgs(array $args) - { - $resolved = array(); - foreach ($args as $argDefinition) { - switch ($argDefinition['type']) { - case 'lookup': - $resolved[] = $this->_lookupRecursive($argDefinition['item']); - break; - case 'value': - $resolved[] = $argDefinition['item']; - break; - } - } - - return $resolved; - } - - /** Resolve a single dependency with an collections */ - private function _lookupRecursive($item) - { - if (is_array($item)) { - $collection = array(); - foreach ($item as $k => $v) { - $collection[$k] = $this->_lookupRecursive($v); - } - - return $collection; - } - - return $this->lookup($item); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php deleted file mode 100644 index 799d38d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * DependencyException gets thrown when a requested dependency is missing. - * - * @author Chris Corbyn - */ -class Swift_DependencyException extends Swift_SwiftException -{ - /** - * Create a new DependencyException with $message. - * - * @param string $message - */ - public function __construct($message) - { - parent::__construct($message); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/EmbeddedFile.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/EmbeddedFile.php deleted file mode 100644 index d8c72ad..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/EmbeddedFile.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An embedded file, in a multipart message. - * - * @author Chris Corbyn - */ -class Swift_EmbeddedFile extends Swift_Mime_EmbeddedFile -{ - /** - * Create a new EmbeddedFile. - * - * Details may be optionally provided to the constructor. - * - * @param string|Swift_OutputByteStream $data - * @param string $filename - * @param string $contentType - */ - public function __construct($data = null, $filename = null, $contentType = null) - { - call_user_func_array( - array($this, 'Swift_Mime_EmbeddedFile::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('mime.embeddedfile') - ); - - $this->setBody($data); - $this->setFilename($filename); - if ($contentType) { - $this->setContentType($contentType); - } - } - - /** - * Create a new EmbeddedFile. - * - * @param string|Swift_OutputByteStream $data - * @param string $filename - * @param string $contentType - * - * @return Swift_Mime_EmbeddedFile - */ - public static function newInstance($data = null, $filename = null, $contentType = null) - { - return new self($data, $filename, $contentType); - } - - /** - * Create a new EmbeddedFile from a filesystem path. - * - * @param string $path - * - * @return Swift_Mime_EmbeddedFile - */ - public static function fromPath($path) - { - return self::newInstance()->setFile( - new Swift_ByteStream_FileByteStream($path) - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php deleted file mode 100644 index 2073abc..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Interface for all Encoder schemes. - * - * @author Chris Corbyn - */ -interface Swift_Encoder extends Swift_Mime_CharsetObserver -{ - /** - * Encode a given string to produce an encoded string. - * - * @param string $string - * @param int $firstLineOffset if first line needs to be shorter - * @param int $maxLineLength - 0 indicates the default length for this encoding - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Base64Encoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Base64Encoder.php deleted file mode 100644 index 0e7b2a1..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Base64Encoder.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles Base 64 Encoding in Swift Mailer. - * - * @author Chris Corbyn - */ -class Swift_Encoder_Base64Encoder implements Swift_Encoder -{ - /** - * Takes an unencoded string and produces a Base64 encoded string from it. - * - * Base64 encoded strings have a maximum line length of 76 characters. - * If the first line needs to be shorter, indicate the difference with - * $firstLineOffset. - * - * @param string $string to encode - * @param int $firstLineOffset - * @param int $maxLineLength optional, 0 indicates the default of 76 bytes - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - if (0 >= $maxLineLength || 76 < $maxLineLength) { - $maxLineLength = 76; - } - - $encodedString = base64_encode($string); - $firstLine = ''; - - if (0 != $firstLineOffset) { - $firstLine = substr( - $encodedString, 0, $maxLineLength - $firstLineOffset - )."\r\n"; - $encodedString = substr( - $encodedString, $maxLineLength - $firstLineOffset - ); - } - - return $firstLine.trim(chunk_split($encodedString, $maxLineLength, "\r\n")); - } - - /** - * Does nothing. - */ - public function charsetChanged($charset) - { - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php deleted file mode 100644 index edec10c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php +++ /dev/null @@ -1,300 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles Quoted Printable (QP) Encoding in Swift Mailer. - * - * Possibly the most accurate RFC 2045 QP implementation found in PHP. - * - * @author Chris Corbyn - */ -class Swift_Encoder_QpEncoder implements Swift_Encoder -{ - /** - * The CharacterStream used for reading characters (as opposed to bytes). - * - * @var Swift_CharacterStream - */ - protected $_charStream; - - /** - * A filter used if input should be canonicalized. - * - * @var Swift_StreamFilter - */ - protected $_filter; - - /** - * Pre-computed QP for HUGE optimization. - * - * @var string[] - */ - protected static $_qpMap = array( - 0 => '=00', 1 => '=01', 2 => '=02', 3 => '=03', 4 => '=04', - 5 => '=05', 6 => '=06', 7 => '=07', 8 => '=08', 9 => '=09', - 10 => '=0A', 11 => '=0B', 12 => '=0C', 13 => '=0D', 14 => '=0E', - 15 => '=0F', 16 => '=10', 17 => '=11', 18 => '=12', 19 => '=13', - 20 => '=14', 21 => '=15', 22 => '=16', 23 => '=17', 24 => '=18', - 25 => '=19', 26 => '=1A', 27 => '=1B', 28 => '=1C', 29 => '=1D', - 30 => '=1E', 31 => '=1F', 32 => '=20', 33 => '=21', 34 => '=22', - 35 => '=23', 36 => '=24', 37 => '=25', 38 => '=26', 39 => '=27', - 40 => '=28', 41 => '=29', 42 => '=2A', 43 => '=2B', 44 => '=2C', - 45 => '=2D', 46 => '=2E', 47 => '=2F', 48 => '=30', 49 => '=31', - 50 => '=32', 51 => '=33', 52 => '=34', 53 => '=35', 54 => '=36', - 55 => '=37', 56 => '=38', 57 => '=39', 58 => '=3A', 59 => '=3B', - 60 => '=3C', 61 => '=3D', 62 => '=3E', 63 => '=3F', 64 => '=40', - 65 => '=41', 66 => '=42', 67 => '=43', 68 => '=44', 69 => '=45', - 70 => '=46', 71 => '=47', 72 => '=48', 73 => '=49', 74 => '=4A', - 75 => '=4B', 76 => '=4C', 77 => '=4D', 78 => '=4E', 79 => '=4F', - 80 => '=50', 81 => '=51', 82 => '=52', 83 => '=53', 84 => '=54', - 85 => '=55', 86 => '=56', 87 => '=57', 88 => '=58', 89 => '=59', - 90 => '=5A', 91 => '=5B', 92 => '=5C', 93 => '=5D', 94 => '=5E', - 95 => '=5F', 96 => '=60', 97 => '=61', 98 => '=62', 99 => '=63', - 100 => '=64', 101 => '=65', 102 => '=66', 103 => '=67', 104 => '=68', - 105 => '=69', 106 => '=6A', 107 => '=6B', 108 => '=6C', 109 => '=6D', - 110 => '=6E', 111 => '=6F', 112 => '=70', 113 => '=71', 114 => '=72', - 115 => '=73', 116 => '=74', 117 => '=75', 118 => '=76', 119 => '=77', - 120 => '=78', 121 => '=79', 122 => '=7A', 123 => '=7B', 124 => '=7C', - 125 => '=7D', 126 => '=7E', 127 => '=7F', 128 => '=80', 129 => '=81', - 130 => '=82', 131 => '=83', 132 => '=84', 133 => '=85', 134 => '=86', - 135 => '=87', 136 => '=88', 137 => '=89', 138 => '=8A', 139 => '=8B', - 140 => '=8C', 141 => '=8D', 142 => '=8E', 143 => '=8F', 144 => '=90', - 145 => '=91', 146 => '=92', 147 => '=93', 148 => '=94', 149 => '=95', - 150 => '=96', 151 => '=97', 152 => '=98', 153 => '=99', 154 => '=9A', - 155 => '=9B', 156 => '=9C', 157 => '=9D', 158 => '=9E', 159 => '=9F', - 160 => '=A0', 161 => '=A1', 162 => '=A2', 163 => '=A3', 164 => '=A4', - 165 => '=A5', 166 => '=A6', 167 => '=A7', 168 => '=A8', 169 => '=A9', - 170 => '=AA', 171 => '=AB', 172 => '=AC', 173 => '=AD', 174 => '=AE', - 175 => '=AF', 176 => '=B0', 177 => '=B1', 178 => '=B2', 179 => '=B3', - 180 => '=B4', 181 => '=B5', 182 => '=B6', 183 => '=B7', 184 => '=B8', - 185 => '=B9', 186 => '=BA', 187 => '=BB', 188 => '=BC', 189 => '=BD', - 190 => '=BE', 191 => '=BF', 192 => '=C0', 193 => '=C1', 194 => '=C2', - 195 => '=C3', 196 => '=C4', 197 => '=C5', 198 => '=C6', 199 => '=C7', - 200 => '=C8', 201 => '=C9', 202 => '=CA', 203 => '=CB', 204 => '=CC', - 205 => '=CD', 206 => '=CE', 207 => '=CF', 208 => '=D0', 209 => '=D1', - 210 => '=D2', 211 => '=D3', 212 => '=D4', 213 => '=D5', 214 => '=D6', - 215 => '=D7', 216 => '=D8', 217 => '=D9', 218 => '=DA', 219 => '=DB', - 220 => '=DC', 221 => '=DD', 222 => '=DE', 223 => '=DF', 224 => '=E0', - 225 => '=E1', 226 => '=E2', 227 => '=E3', 228 => '=E4', 229 => '=E5', - 230 => '=E6', 231 => '=E7', 232 => '=E8', 233 => '=E9', 234 => '=EA', - 235 => '=EB', 236 => '=EC', 237 => '=ED', 238 => '=EE', 239 => '=EF', - 240 => '=F0', 241 => '=F1', 242 => '=F2', 243 => '=F3', 244 => '=F4', - 245 => '=F5', 246 => '=F6', 247 => '=F7', 248 => '=F8', 249 => '=F9', - 250 => '=FA', 251 => '=FB', 252 => '=FC', 253 => '=FD', 254 => '=FE', - 255 => '=FF', - ); - - protected static $_safeMapShare = array(); - - /** - * A map of non-encoded ascii characters. - * - * @var string[] - */ - protected $_safeMap = array(); - - /** - * Creates a new QpEncoder for the given CharacterStream. - * - * @param Swift_CharacterStream $charStream to use for reading characters - * @param Swift_StreamFilter $filter if input should be canonicalized - */ - public function __construct(Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null) - { - $this->_charStream = $charStream; - if (!isset(self::$_safeMapShare[$this->getSafeMapShareId()])) { - $this->initSafeMap(); - self::$_safeMapShare[$this->getSafeMapShareId()] = $this->_safeMap; - } else { - $this->_safeMap = self::$_safeMapShare[$this->getSafeMapShareId()]; - } - $this->_filter = $filter; - } - - public function __sleep() - { - return array('_charStream', '_filter'); - } - - public function __wakeup() - { - if (!isset(self::$_safeMapShare[$this->getSafeMapShareId()])) { - $this->initSafeMap(); - self::$_safeMapShare[$this->getSafeMapShareId()] = $this->_safeMap; - } else { - $this->_safeMap = self::$_safeMapShare[$this->getSafeMapShareId()]; - } - } - - protected function getSafeMapShareId() - { - return get_class($this); - } - - protected function initSafeMap() - { - foreach (array_merge( - array(0x09, 0x20), range(0x21, 0x3C), range(0x3E, 0x7E)) as $byte) { - $this->_safeMap[$byte] = chr($byte); - } - } - - /** - * Takes an unencoded string and produces a QP encoded string from it. - * - * QP encoded strings have a maximum line length of 76 characters. - * If the first line needs to be shorter, indicate the difference with - * $firstLineOffset. - * - * @param string $string to encode - * @param int $firstLineOffset, optional - * @param int $maxLineLength, optional 0 indicates the default of 76 chars - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($maxLineLength > 76 || $maxLineLength <= 0) { - $maxLineLength = 76; - } - - $thisLineLength = $maxLineLength - $firstLineOffset; - - $lines = array(); - $lNo = 0; - $lines[$lNo] = ''; - $currentLine = &$lines[$lNo++]; - $size = $lineLen = 0; - - $this->_charStream->flushContents(); - $this->_charStream->importString($string); - - // Fetching more than 4 chars at one is slower, as is fetching fewer bytes - // Conveniently 4 chars is the UTF-8 safe number since UTF-8 has up to 6 - // bytes per char and (6 * 4 * 3 = 72 chars per line) * =NN is 3 bytes - while (false !== $bytes = $this->_nextSequence()) { - // If we're filtering the input - if (isset($this->_filter)) { - // If we can't filter because we need more bytes - while ($this->_filter->shouldBuffer($bytes)) { - // Then collect bytes into the buffer - if (false === $moreBytes = $this->_nextSequence(1)) { - break; - } - - foreach ($moreBytes as $b) { - $bytes[] = $b; - } - } - // And filter them - $bytes = $this->_filter->filter($bytes); - } - - $enc = $this->_encodeByteSequence($bytes, $size); - - $i = strpos($enc, '=0D=0A'); - $newLineLength = $lineLen + ($i === false ? $size : $i); - - if ($currentLine && $newLineLength >= $thisLineLength) { - $lines[$lNo] = ''; - $currentLine = &$lines[$lNo++]; - $thisLineLength = $maxLineLength; - $lineLen = 0; - } - - $currentLine .= $enc; - - if ($i === false) { - $lineLen += $size; - } else { - // 6 is the length of '=0D=0A'. - $lineLen = $size - strrpos($enc, '=0D=0A') - 6; - } - } - - return $this->_standardize(implode("=\r\n", $lines)); - } - - /** - * Updates the charset used. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->_charStream->setCharacterSet($charset); - } - - /** - * Encode the given byte array into a verbatim QP form. - * - * @param int[] $bytes - * @param int $size - * - * @return string - */ - protected function _encodeByteSequence(array $bytes, &$size) - { - $ret = ''; - $size = 0; - foreach ($bytes as $b) { - if (isset($this->_safeMap[$b])) { - $ret .= $this->_safeMap[$b]; - ++$size; - } else { - $ret .= self::$_qpMap[$b]; - $size += 3; - } - } - - return $ret; - } - - /** - * Get the next sequence of bytes to read from the char stream. - * - * @param int $size number of bytes to read - * - * @return int[] - */ - protected function _nextSequence($size = 4) - { - return $this->_charStream->readBytes($size); - } - - /** - * Make sure CRLF is correct and HT/SPACE are in valid places. - * - * @param string $string - * - * @return string - */ - protected function _standardize($string) - { - $string = str_replace(array("\t=0D=0A", ' =0D=0A', '=0D=0A'), - array("=09\r\n", "=20\r\n", "\r\n"), $string - ); - switch ($end = ord(substr($string, -1))) { - case 0x09: - case 0x20: - $string = substr_replace($string, self::$_qpMap[$end], -1); - } - - return $string; - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->_charStream = clone $this->_charStream; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php deleted file mode 100644 index b0215e8..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles RFC 2231 specified Encoding in Swift Mailer. - * - * @author Chris Corbyn - */ -class Swift_Encoder_Rfc2231Encoder implements Swift_Encoder -{ - /** - * A character stream to use when reading a string as characters instead of bytes. - * - * @var Swift_CharacterStream - */ - private $_charStream; - - /** - * Creates a new Rfc2231Encoder using the given character stream instance. - * - * @param Swift_CharacterStream - */ - public function __construct(Swift_CharacterStream $charStream) - { - $this->_charStream = $charStream; - } - - /** - * Takes an unencoded string and produces a string encoded according to - * RFC 2231 from it. - * - * @param string $string - * @param int $firstLineOffset - * @param int $maxLineLength optional, 0 indicates the default of 75 bytes - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - $lines = array(); - $lineCount = 0; - $lines[] = ''; - $currentLine = &$lines[$lineCount++]; - - if (0 >= $maxLineLength) { - $maxLineLength = 75; - } - - $this->_charStream->flushContents(); - $this->_charStream->importString($string); - - $thisLineLength = $maxLineLength - $firstLineOffset; - - while (false !== $char = $this->_charStream->read(4)) { - $encodedChar = rawurlencode($char); - if (0 != strlen($currentLine) - && strlen($currentLine.$encodedChar) > $thisLineLength) { - $lines[] = ''; - $currentLine = &$lines[$lineCount++]; - $thisLineLength = $maxLineLength; - } - $currentLine .= $encodedChar; - } - - return implode("\r\n", $lines); - } - - /** - * Updates the charset used. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->_charStream->setCharacterSet($charset); - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->_charStream = clone $this->_charStream; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoding.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoding.php deleted file mode 100644 index 2458787..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoding.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Provides quick access to each encoding type. - * - * @author Chris Corbyn - */ -class Swift_Encoding -{ - /** - * Get the Encoder that provides 7-bit encoding. - * - * @return Swift_Mime_ContentEncoder - */ - public static function get7BitEncoding() - { - return self::_lookup('mime.7bitcontentencoder'); - } - - /** - * Get the Encoder that provides 8-bit encoding. - * - * @return Swift_Mime_ContentEncoder - */ - public static function get8BitEncoding() - { - return self::_lookup('mime.8bitcontentencoder'); - } - - /** - * Get the Encoder that provides Quoted-Printable (QP) encoding. - * - * @return Swift_Mime_ContentEncoder - */ - public static function getQpEncoding() - { - return self::_lookup('mime.qpcontentencoder'); - } - - /** - * Get the Encoder that provides Base64 encoding. - * - * @return Swift_Mime_ContentEncoder - */ - public static function getBase64Encoding() - { - return self::_lookup('mime.base64contentencoder'); - } - - private static function _lookup($key) - { - return Swift_DependencyContainer::getInstance()->lookup($key); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php deleted file mode 100644 index 674e6b5..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Generated when a command is sent over an SMTP connection. - * - * @author Chris Corbyn - */ -class Swift_Events_CommandEvent extends Swift_Events_EventObject -{ - /** - * The command sent to the server. - * - * @var string - */ - private $_command; - - /** - * An array of codes which a successful response will contain. - * - * @var int[] - */ - private $_successCodes = array(); - - /** - * Create a new CommandEvent for $source with $command. - * - * @param Swift_Transport $source - * @param string $command - * @param array $successCodes - */ - public function __construct(Swift_Transport $source, $command, $successCodes = array()) - { - parent::__construct($source); - $this->_command = $command; - $this->_successCodes = $successCodes; - } - - /** - * Get the command which was sent to the server. - * - * @return string - */ - public function getCommand() - { - return $this->_command; - } - - /** - * Get the numeric response codes which indicate success for this command. - * - * @return int[] - */ - public function getSuccessCodes() - { - return $this->_successCodes; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php deleted file mode 100644 index 7545404..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Listens for Transports to send commands to the server. - * - * @author Chris Corbyn - */ -interface Swift_Events_CommandListener extends Swift_Events_EventListener -{ - /** - * Invoked immediately following a command being sent. - * - * @param Swift_Events_CommandEvent $evt - */ - public function commandSent(Swift_Events_CommandEvent $evt); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/Event.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/Event.php deleted file mode 100644 index 720b156..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/Event.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * The minimum interface for an Event. - * - * @author Chris Corbyn - */ -interface Swift_Events_Event -{ - /** - * Get the source object of this event. - * - * @return object - */ - public function getSource(); - - /** - * Prevent this Event from bubbling any further up the stack. - * - * @param bool $cancel, optional - */ - public function cancelBubble($cancel = true); - - /** - * Returns true if this Event will not bubble any further up the stack. - * - * @return bool - */ - public function bubbleCancelled(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php deleted file mode 100644 index aac36aa..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Interface for the EventDispatcher which handles the event dispatching layer. - * - * @author Chris Corbyn - */ -interface Swift_Events_EventDispatcher -{ - /** - * Create a new SendEvent for $source and $message. - * - * @param Swift_Transport $source - * @param Swift_Mime_Message - * - * @return Swift_Events_SendEvent - */ - public function createSendEvent(Swift_Transport $source, Swift_Mime_Message $message); - - /** - * Create a new CommandEvent for $source and $command. - * - * @param Swift_Transport $source - * @param string $command That will be executed - * @param array $successCodes That are needed - * - * @return Swift_Events_CommandEvent - */ - public function createCommandEvent(Swift_Transport $source, $command, $successCodes = array()); - - /** - * Create a new ResponseEvent for $source and $response. - * - * @param Swift_Transport $source - * @param string $response - * @param bool $valid If the response is valid - * - * @return Swift_Events_ResponseEvent - */ - public function createResponseEvent(Swift_Transport $source, $response, $valid); - - /** - * Create a new TransportChangeEvent for $source. - * - * @param Swift_Transport $source - * - * @return Swift_Events_TransportChangeEvent - */ - public function createTransportChangeEvent(Swift_Transport $source); - - /** - * Create a new TransportExceptionEvent for $source. - * - * @param Swift_Transport $source - * @param Swift_TransportException $ex - * - * @return Swift_Events_TransportExceptionEvent - */ - public function createTransportExceptionEvent(Swift_Transport $source, Swift_TransportException $ex); - - /** - * Bind an event listener to this dispatcher. - * - * @param Swift_Events_EventListener $listener - */ - public function bindEventListener(Swift_Events_EventListener $listener); - - /** - * Dispatch the given Event to all suitable listeners. - * - * @param Swift_Events_EventObject $evt - * @param string $target method - */ - public function dispatchEvent(Swift_Events_EventObject $evt, $target); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventListener.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventListener.php deleted file mode 100644 index 5129095..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventListener.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An identity interface which all EventListeners must extend. - * - * @author Chris Corbyn - */ -interface Swift_Events_EventListener -{ -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventObject.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventObject.php deleted file mode 100644 index 90694a9..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventObject.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A base Event which all Event classes inherit from. - * - * @author Chris Corbyn - */ -class Swift_Events_EventObject implements Swift_Events_Event -{ - /** The source of this Event */ - private $_source; - - /** The state of this Event (should it bubble up the stack?) */ - private $_bubbleCancelled = false; - - /** - * Create a new EventObject originating at $source. - * - * @param object $source - */ - public function __construct($source) - { - $this->_source = $source; - } - - /** - * Get the source object of this event. - * - * @return object - */ - public function getSource() - { - return $this->_source; - } - - /** - * Prevent this Event from bubbling any further up the stack. - * - * @param bool $cancel, optional - */ - public function cancelBubble($cancel = true) - { - $this->_bubbleCancelled = $cancel; - } - - /** - * Returns true if this Event will not bubble any further up the stack. - * - * @return bool - */ - public function bubbleCancelled() - { - return $this->_bubbleCancelled; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php deleted file mode 100644 index 2e92ba9..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Generated when a response is received on a SMTP connection. - * - * @author Chris Corbyn - */ -class Swift_Events_ResponseEvent extends Swift_Events_EventObject -{ - /** - * The overall result. - * - * @var bool - */ - private $_valid; - - /** - * The response received from the server. - * - * @var string - */ - private $_response; - - /** - * Create a new ResponseEvent for $source and $response. - * - * @param Swift_Transport $source - * @param string $response - * @param bool $valid - */ - public function __construct(Swift_Transport $source, $response, $valid = false) - { - parent::__construct($source); - $this->_response = $response; - $this->_valid = $valid; - } - - /** - * Get the response which was received from the server. - * - * @return string - */ - public function getResponse() - { - return $this->_response; - } - - /** - * Get the success status of this Event. - * - * @return bool - */ - public function isValid() - { - return $this->_valid; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php deleted file mode 100644 index c40919d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Listens for responses from a remote SMTP server. - * - * @author Chris Corbyn - */ -interface Swift_Events_ResponseListener extends Swift_Events_EventListener -{ - /** - * Invoked immediately following a response coming back. - * - * @param Swift_Events_ResponseEvent $evt - */ - public function responseReceived(Swift_Events_ResponseEvent $evt); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendEvent.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendEvent.php deleted file mode 100644 index 10da808..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendEvent.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Generated when a message is being sent. - * - * @author Chris Corbyn - */ -class Swift_Events_SendEvent extends Swift_Events_EventObject -{ - /** Sending has yet to occur */ - const RESULT_PENDING = 0x0001; - - /** Email is spooled, ready to be sent */ - const RESULT_SPOOLED = 0x0011; - - /** Sending was successful */ - const RESULT_SUCCESS = 0x0010; - - /** Sending worked, but there were some failures */ - const RESULT_TENTATIVE = 0x0100; - - /** Sending failed */ - const RESULT_FAILED = 0x1000; - - /** - * The Message being sent. - * - * @var Swift_Mime_Message - */ - private $_message; - - /** - * Any recipients which failed after sending. - * - * @var string[] - */ - private $_failedRecipients = array(); - - /** - * The overall result as a bitmask from the class constants. - * - * @var int - */ - private $_result; - - /** - * Create a new SendEvent for $source and $message. - * - * @param Swift_Transport $source - * @param Swift_Mime_Message $message - */ - public function __construct(Swift_Transport $source, Swift_Mime_Message $message) - { - parent::__construct($source); - $this->_message = $message; - $this->_result = self::RESULT_PENDING; - } - - /** - * Get the Transport used to send the Message. - * - * @return Swift_Transport - */ - public function getTransport() - { - return $this->getSource(); - } - - /** - * Get the Message being sent. - * - * @return Swift_Mime_Message - */ - public function getMessage() - { - return $this->_message; - } - - /** - * Set the array of addresses that failed in sending. - * - * @param array $recipients - */ - public function setFailedRecipients($recipients) - { - $this->_failedRecipients = $recipients; - } - - /** - * Get an recipient addresses which were not accepted for delivery. - * - * @return string[] - */ - public function getFailedRecipients() - { - return $this->_failedRecipients; - } - - /** - * Set the result of sending. - * - * @param int $result - */ - public function setResult($result) - { - $this->_result = $result; - } - - /** - * Get the result of this Event. - * - * The return value is a bitmask from - * {@see RESULT_PENDING, RESULT_SUCCESS, RESULT_TENTATIVE, RESULT_FAILED} - * - * @return int - */ - public function getResult() - { - return $this->_result; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php deleted file mode 100644 index d922e1b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Listens for Messages being sent from within the Transport system. - * - * @author Chris Corbyn - */ -interface Swift_Events_SendListener extends Swift_Events_EventListener -{ - /** - * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt); - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php deleted file mode 100644 index e8aca75..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php +++ /dev/null @@ -1,156 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * The EventDispatcher which handles the event dispatching layer. - * - * @author Chris Corbyn - */ -class Swift_Events_SimpleEventDispatcher implements Swift_Events_EventDispatcher -{ - /** A map of event types to their associated listener types */ - private $_eventMap = array(); - - /** Event listeners bound to this dispatcher */ - private $_listeners = array(); - - /** Listeners queued to have an Event bubbled up the stack to them */ - private $_bubbleQueue = array(); - - /** - * Create a new EventDispatcher. - */ - public function __construct() - { - $this->_eventMap = array( - 'Swift_Events_CommandEvent' => 'Swift_Events_CommandListener', - 'Swift_Events_ResponseEvent' => 'Swift_Events_ResponseListener', - 'Swift_Events_SendEvent' => 'Swift_Events_SendListener', - 'Swift_Events_TransportChangeEvent' => 'Swift_Events_TransportChangeListener', - 'Swift_Events_TransportExceptionEvent' => 'Swift_Events_TransportExceptionListener', - ); - } - - /** - * Create a new SendEvent for $source and $message. - * - * @param Swift_Transport $source - * @param Swift_Mime_Message - * - * @return Swift_Events_SendEvent - */ - public function createSendEvent(Swift_Transport $source, Swift_Mime_Message $message) - { - return new Swift_Events_SendEvent($source, $message); - } - - /** - * Create a new CommandEvent for $source and $command. - * - * @param Swift_Transport $source - * @param string $command That will be executed - * @param array $successCodes That are needed - * - * @return Swift_Events_CommandEvent - */ - public function createCommandEvent(Swift_Transport $source, $command, $successCodes = array()) - { - return new Swift_Events_CommandEvent($source, $command, $successCodes); - } - - /** - * Create a new ResponseEvent for $source and $response. - * - * @param Swift_Transport $source - * @param string $response - * @param bool $valid If the response is valid - * - * @return Swift_Events_ResponseEvent - */ - public function createResponseEvent(Swift_Transport $source, $response, $valid) - { - return new Swift_Events_ResponseEvent($source, $response, $valid); - } - - /** - * Create a new TransportChangeEvent for $source. - * - * @param Swift_Transport $source - * - * @return Swift_Events_TransportChangeEvent - */ - public function createTransportChangeEvent(Swift_Transport $source) - { - return new Swift_Events_TransportChangeEvent($source); - } - - /** - * Create a new TransportExceptionEvent for $source. - * - * @param Swift_Transport $source - * @param Swift_TransportException $ex - * - * @return Swift_Events_TransportExceptionEvent - */ - public function createTransportExceptionEvent(Swift_Transport $source, Swift_TransportException $ex) - { - return new Swift_Events_TransportExceptionEvent($source, $ex); - } - - /** - * Bind an event listener to this dispatcher. - * - * @param Swift_Events_EventListener $listener - */ - public function bindEventListener(Swift_Events_EventListener $listener) - { - foreach ($this->_listeners as $l) { - // Already loaded - if ($l === $listener) { - return; - } - } - $this->_listeners[] = $listener; - } - - /** - * Dispatch the given Event to all suitable listeners. - * - * @param Swift_Events_EventObject $evt - * @param string $target method - */ - public function dispatchEvent(Swift_Events_EventObject $evt, $target) - { - $this->_prepareBubbleQueue($evt); - $this->_bubble($evt, $target); - } - - /** Queue listeners on a stack ready for $evt to be bubbled up it */ - private function _prepareBubbleQueue(Swift_Events_EventObject $evt) - { - $this->_bubbleQueue = array(); - $evtClass = get_class($evt); - foreach ($this->_listeners as $listener) { - if (array_key_exists($evtClass, $this->_eventMap) - && ($listener instanceof $this->_eventMap[$evtClass])) { - $this->_bubbleQueue[] = $listener; - } - } - } - - /** Bubble $evt up the stack calling $target() on each listener */ - private function _bubble(Swift_Events_EventObject $evt, $target) - { - if (!$evt->bubbleCancelled() && $listener = array_shift($this->_bubbleQueue)) { - $listener->$target($evt); - $this->_bubble($evt, $target); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php deleted file mode 100644 index a8972fd..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Generated when the state of a Transport is changed (i.e. stopped/started). - * - * @author Chris Corbyn - */ -class Swift_Events_TransportChangeEvent extends Swift_Events_EventObject -{ - /** - * Get the Transport. - * - * @return Swift_Transport - */ - public function getTransport() - { - return $this->getSource(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php deleted file mode 100644 index 253165d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Listens for changes within the Transport system. - * - * @author Chris Corbyn - */ -interface Swift_Events_TransportChangeListener extends Swift_Events_EventListener -{ - /** - * Invoked just before a Transport is started. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt); - - /** - * Invoked immediately after the Transport is started. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function transportStarted(Swift_Events_TransportChangeEvent $evt); - - /** - * Invoked just before a Transport is stopped. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt); - - /** - * Invoked immediately after the Transport is stopped. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function transportStopped(Swift_Events_TransportChangeEvent $evt); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionEvent.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionEvent.php deleted file mode 100644 index f87154f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionEvent.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Generated when a TransportException is thrown from the Transport system. - * - * @author Chris Corbyn - */ -class Swift_Events_TransportExceptionEvent extends Swift_Events_EventObject -{ - /** - * The Exception thrown. - * - * @var Swift_TransportException - */ - private $_exception; - - /** - * Create a new TransportExceptionEvent for $transport. - * - * @param Swift_Transport $transport - * @param Swift_TransportException $ex - */ - public function __construct(Swift_Transport $transport, Swift_TransportException $ex) - { - parent::__construct($transport); - $this->_exception = $ex; - } - - /** - * Get the TransportException thrown. - * - * @return Swift_TransportException - */ - public function getException() - { - return $this->_exception; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php deleted file mode 100644 index cc3c099..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Listens for Exceptions thrown from within the Transport system. - * - * @author Chris Corbyn - */ -interface Swift_Events_TransportExceptionListener extends Swift_Events_EventListener -{ - /** - * Invoked as a TransportException is thrown in the Transport system. - * - * @param Swift_Events_TransportExceptionEvent $evt - */ - public function exceptionThrown(Swift_Events_TransportExceptionEvent $evt); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FailoverTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FailoverTransport.php deleted file mode 100644 index 9951c59..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FailoverTransport.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Contains a list of redundant Transports so when one fails, the next is used. - * - * @author Chris Corbyn - */ -class Swift_FailoverTransport extends Swift_Transport_FailoverTransport -{ - /** - * Creates a new FailoverTransport with $transports. - * - * @param Swift_Transport[] $transports - */ - public function __construct($transports = array()) - { - call_user_func_array( - array($this, 'Swift_Transport_FailoverTransport::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.failover') - ); - - $this->setTransports($transports); - } - - /** - * Create a new FailoverTransport instance. - * - * @param Swift_Transport[] $transports - * - * @return self - */ - public static function newInstance($transports = array()) - { - return new self($transports); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php deleted file mode 100644 index c82c5db..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php +++ /dev/null @@ -1,208 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2009 Fabien Potencier <fabien.potencier@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages on the filesystem. - * - * @author Fabien Potencier - * @author Xavier De Cock <xdecock@gmail.com> - */ -class Swift_FileSpool extends Swift_ConfigurableSpool -{ - /** The spool directory */ - private $_path; - - /** - * File WriteRetry Limit. - * - * @var int - */ - private $_retryLimit = 10; - - /** - * Create a new FileSpool. - * - * @param string $path - * - * @throws Swift_IoException - */ - public function __construct($path) - { - $this->_path = $path; - - if (!file_exists($this->_path)) { - if (!mkdir($this->_path, 0777, true)) { - throw new Swift_IoException(sprintf('Unable to create path "%s".', $this->_path)); - } - } - } - - /** - * Tests if this Spool mechanism has started. - * - * @return bool - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Spool mechanism. - */ - public function start() - { - } - - /** - * Stops this Spool mechanism. - */ - public function stop() - { - } - - /** - * Allow to manage the enqueuing retry limit. - * - * Default, is ten and allows over 64^20 different fileNames - * - * @param int $limit - */ - public function setRetryLimit($limit) - { - $this->_retryLimit = $limit; - } - - /** - * Queues a message. - * - * @param Swift_Mime_Message $message The message to store - * - * @throws Swift_IoException - * - * @return bool - */ - public function queueMessage(Swift_Mime_Message $message) - { - $ser = serialize($message); - $fileName = $this->_path.'/'.$this->getRandomString(10); - for ($i = 0; $i < $this->_retryLimit; ++$i) { - /* We try an exclusive creation of the file. This is an atomic operation, it avoid locking mechanism */ - $fp = @fopen($fileName.'.message', 'x'); - if (false !== $fp) { - if (false === fwrite($fp, $ser)) { - return false; - } - - return fclose($fp); - } else { - /* The file already exists, we try a longer fileName */ - $fileName .= $this->getRandomString(1); - } - } - - throw new Swift_IoException(sprintf('Unable to create a file for enqueuing Message in "%s".', $this->_path)); - } - - /** - * Execute a recovery if for any reason a process is sending for too long. - * - * @param int $timeout in second Defaults is for very slow smtp responses - */ - public function recover($timeout = 900) - { - foreach (new DirectoryIterator($this->_path) as $file) { - $file = $file->getRealPath(); - - if (substr($file, -16) == '.message.sending') { - $lockedtime = filectime($file); - if ((time() - $lockedtime) > $timeout) { - rename($file, substr($file, 0, -8)); - } - } - } - } - - /** - * Sends messages using the given transport instance. - * - * @param Swift_Transport $transport A transport instance - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent e-mail's - */ - public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) - { - $directoryIterator = new DirectoryIterator($this->_path); - - /* Start the transport only if there are queued files to send */ - if (!$transport->isStarted()) { - foreach ($directoryIterator as $file) { - if (substr($file->getRealPath(), -8) == '.message') { - $transport->start(); - break; - } - } - } - - $failedRecipients = (array) $failedRecipients; - $count = 0; - $time = time(); - foreach ($directoryIterator as $file) { - $file = $file->getRealPath(); - - if (substr($file, -8) != '.message') { - continue; - } - - /* We try a rename, it's an atomic operation, and avoid locking the file */ - if (rename($file, $file.'.sending')) { - $message = unserialize(file_get_contents($file.'.sending')); - - $count += $transport->send($message, $failedRecipients); - - unlink($file.'.sending'); - } else { - /* This message has just been catched by another process */ - continue; - } - - if ($this->getMessageLimit() && $count >= $this->getMessageLimit()) { - break; - } - - if ($this->getTimeLimit() && (time() - $time) >= $this->getTimeLimit()) { - break; - } - } - - return $count; - } - - /** - * Returns a random string needed to generate a fileName for the queue. - * - * @param int $count - * - * @return string - */ - protected function getRandomString($count) - { - // This string MUST stay FS safe, avoid special chars - $base = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-'; - $ret = ''; - $strlen = strlen($base); - for ($i = 0; $i < $count; ++$i) { - $ret .= $base[((int) rand(0, $strlen - 1))]; - } - - return $ret; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php deleted file mode 100644 index 0b24db1..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An OutputByteStream which specifically reads from a file. - * - * @author Chris Corbyn - */ -interface Swift_FileStream extends Swift_OutputByteStream -{ - /** - * Get the complete path to the file. - * - * @return string - */ - public function getPath(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Filterable.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Filterable.php deleted file mode 100644 index 6b75b52..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Filterable.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Allows StreamFilters to operate on a stream. - * - * @author Chris Corbyn - */ -interface Swift_Filterable -{ - /** - * Add a new StreamFilter, referenced by $key. - * - * @param Swift_StreamFilter $filter - * @param string $key - */ - public function addFilter(Swift_StreamFilter $filter, $key); - - /** - * Remove an existing filter using $key. - * - * @param string $key - */ - public function removeFilter($key); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Image.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Image.php deleted file mode 100644 index 4213ee2..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Image.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An image, embedded in a multipart message. - * - * @author Chris Corbyn - */ -class Swift_Image extends Swift_EmbeddedFile -{ - /** - * Create a new EmbeddedFile. - * - * Details may be optionally provided to the constructor. - * - * @param string|Swift_OutputByteStream $data - * @param string $filename - * @param string $contentType - */ - public function __construct($data = null, $filename = null, $contentType = null) - { - parent::__construct($data, $filename, $contentType); - } - - /** - * Create a new Image. - * - * @param string|Swift_OutputByteStream $data - * @param string $filename - * @param string $contentType - * - * @return self - */ - public static function newInstance($data = null, $filename = null, $contentType = null) - { - return new self($data, $filename, $contentType); - } - - /** - * Create a new Image from a filesystem path. - * - * @param string $path - * - * @return self - */ - public static function fromPath($path) - { - return self::newInstance()->setFile(new Swift_ByteStream_FileByteStream($path)); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php deleted file mode 100644 index 56efc75..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An abstract means of writing data. - * - * Classes implementing this interface may use a subsystem which requires less - * memory than working with large strings of data. - * - * @author Chris Corbyn - */ -interface Swift_InputByteStream -{ - /** - * Writes $bytes to the end of the stream. - * - * Writing may not happen immediately if the stream chooses to buffer. If - * you want to write these bytes with immediate effect, call {@link commit()} - * after calling write(). - * - * This method returns the sequence ID of the write (i.e. 1 for first, 2 for - * second, etc etc). - * - * @param string $bytes - * - * @throws Swift_IoException - * - * @return int - */ - public function write($bytes); - - /** - * For any bytes that are currently buffered inside the stream, force them - * off the buffer. - * - * @throws Swift_IoException - */ - public function commit(); - - /** - * Attach $is to this stream. - * - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - * - * @param Swift_InputByteStream $is - */ - public function bind(Swift_InputByteStream $is); - - /** - * Remove an already bound stream. - * - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - * - * @param Swift_InputByteStream $is - */ - public function unbind(Swift_InputByteStream $is); - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - * - * @throws Swift_IoException - */ - public function flushBuffers(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/IoException.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/IoException.php deleted file mode 100644 index c405f35..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/IoException.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * I/O Exception class. - * - * @author Chris Corbyn - */ -class Swift_IoException extends Swift_SwiftException -{ - /** - * Create a new IoException with $message. - * - * @param string $message - * @param int $code - * @param Exception $previous - */ - public function __construct($message, $code = 0, Exception $previous = null) - { - parent::__construct($message, $code, $previous); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php deleted file mode 100644 index cd6f786..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Provides a mechanism for storing data using two keys. - * - * @author Chris Corbyn - */ -interface Swift_KeyCache -{ - /** Mode for replacing existing cached data */ - const MODE_WRITE = 1; - - /** Mode for appending data to the end of existing cached data */ - const MODE_APPEND = 2; - - /** - * Set a string into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode - */ - public function setString($nsKey, $itemKey, $string, $mode); - - /** - * Set a ByteStream into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_OutputByteStream $os - * @param int $mode - */ - public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode); - - /** - * Provides a ByteStream which when written to, writes data to $itemKey. - * - * NOTE: The stream will always write in append mode. - * If the optional third parameter is passed all writes will go through $is. - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $is optional input stream - * - * @return Swift_InputByteStream - */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $is = null); - - /** - * Get data back out of the cache as a string. - * - * @param string $nsKey - * @param string $itemKey - * - * @return string - */ - public function getString($nsKey, $itemKey); - - /** - * Get data back out of the cache as a ByteStream. - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $is stream to write the data to - */ - public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is); - - /** - * Check if the given $itemKey exists in the namespace $nsKey. - * - * @param string $nsKey - * @param string $itemKey - * - * @return bool - */ - public function hasKey($nsKey, $itemKey); - - /** - * Clear data for $itemKey in the namespace $nsKey if it exists. - * - * @param string $nsKey - * @param string $itemKey - */ - public function clearKey($nsKey, $itemKey); - - /** - * Clear all data in the namespace $nsKey if it exists. - * - * @param string $nsKey - */ - public function clearAll($nsKey); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php deleted file mode 100644 index b37f07f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php +++ /dev/null @@ -1,206 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A basic KeyCache backed by an array. - * - * @author Chris Corbyn - */ -class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache -{ - /** - * Cache contents. - * - * @var array - */ - private $_contents = array(); - - /** - * An InputStream for cloning. - * - * @var Swift_KeyCache_KeyCacheInputStream - */ - private $_stream; - - /** - * Create a new ArrayKeyCache with the given $stream for cloning to make - * InputByteStreams. - * - * @param Swift_KeyCache_KeyCacheInputStream $stream - */ - public function __construct(Swift_KeyCache_KeyCacheInputStream $stream) - { - $this->_stream = $stream; - } - - /** - * Set a string into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode - */ - public function setString($nsKey, $itemKey, $string, $mode) - { - $this->_prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $this->_contents[$nsKey][$itemKey] = $string; - break; - case self::MODE_APPEND: - if (!$this->hasKey($nsKey, $itemKey)) { - $this->_contents[$nsKey][$itemKey] = ''; - } - $this->_contents[$nsKey][$itemKey] .= $string; - break; - default: - throw new Swift_SwiftException( - 'Invalid mode ['.$mode.'] used to set nsKey='. - $nsKey.', itemKey='.$itemKey - ); - } - } - - /** - * Set a ByteStream into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_OutputByteStream $os - * @param int $mode - */ - public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode) - { - $this->_prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $this->clearKey($nsKey, $itemKey); - case self::MODE_APPEND: - if (!$this->hasKey($nsKey, $itemKey)) { - $this->_contents[$nsKey][$itemKey] = ''; - } - while (false !== $bytes = $os->read(8192)) { - $this->_contents[$nsKey][$itemKey] .= $bytes; - } - break; - default: - throw new Swift_SwiftException( - 'Invalid mode ['.$mode.'] used to set nsKey='. - $nsKey.', itemKey='.$itemKey - ); - } - } - - /** - * Provides a ByteStream which when written to, writes data to $itemKey. - * - * NOTE: The stream will always write in append mode. - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $writeThrough - * - * @return Swift_InputByteStream - */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) - { - $is = clone $this->_stream; - $is->setKeyCache($this); - $is->setNsKey($nsKey); - $is->setItemKey($itemKey); - if (isset($writeThrough)) { - $is->setWriteThroughStream($writeThrough); - } - - return $is; - } - - /** - * Get data back out of the cache as a string. - * - * @param string $nsKey - * @param string $itemKey - * - * @return string - */ - public function getString($nsKey, $itemKey) - { - $this->_prepareCache($nsKey); - if ($this->hasKey($nsKey, $itemKey)) { - return $this->_contents[$nsKey][$itemKey]; - } - } - - /** - * Get data back out of the cache as a ByteStream. - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $is to write the data to - */ - public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is) - { - $this->_prepareCache($nsKey); - $is->write($this->getString($nsKey, $itemKey)); - } - - /** - * Check if the given $itemKey exists in the namespace $nsKey. - * - * @param string $nsKey - * @param string $itemKey - * - * @return bool - */ - public function hasKey($nsKey, $itemKey) - { - $this->_prepareCache($nsKey); - - return array_key_exists($itemKey, $this->_contents[$nsKey]); - } - - /** - * Clear data for $itemKey in the namespace $nsKey if it exists. - * - * @param string $nsKey - * @param string $itemKey - */ - public function clearKey($nsKey, $itemKey) - { - unset($this->_contents[$nsKey][$itemKey]); - } - - /** - * Clear all data in the namespace $nsKey if it exists. - * - * @param string $nsKey - */ - public function clearAll($nsKey) - { - unset($this->_contents[$nsKey]); - } - - /** - * Initialize the namespace of $nsKey if needed. - * - * @param string $nsKey - */ - private function _prepareCache($nsKey) - { - if (!array_key_exists($nsKey, $this->_contents)) { - $this->_contents[$nsKey] = array(); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php deleted file mode 100644 index 453f50a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php +++ /dev/null @@ -1,321 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A KeyCache which streams to and from disk. - * - * @author Chris Corbyn - */ -class Swift_KeyCache_DiskKeyCache implements Swift_KeyCache -{ - /** Signal to place pointer at start of file */ - const POSITION_START = 0; - - /** Signal to place pointer at end of file */ - const POSITION_END = 1; - - /** Signal to leave pointer in whatever position it currently is */ - const POSITION_CURRENT = 2; - - /** - * An InputStream for cloning. - * - * @var Swift_KeyCache_KeyCacheInputStream - */ - private $_stream; - - /** - * A path to write to. - * - * @var string - */ - private $_path; - - /** - * Stored keys. - * - * @var array - */ - private $_keys = array(); - - /** - * Will be true if magic_quotes_runtime is turned on. - * - * @var bool - */ - private $_quotes = false; - - /** - * Create a new DiskKeyCache with the given $stream for cloning to make - * InputByteStreams, and the given $path to save to. - * - * @param Swift_KeyCache_KeyCacheInputStream $stream - * @param string $path to save to - */ - public function __construct(Swift_KeyCache_KeyCacheInputStream $stream, $path) - { - $this->_stream = $stream; - $this->_path = $path; - - if (function_exists('get_magic_quotes_runtime') && @get_magic_quotes_runtime() == 1) { - $this->_quotes = true; - } - } - - /** - * Set a string into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode - * - * @throws Swift_IoException - */ - public function setString($nsKey, $itemKey, $string, $mode) - { - $this->_prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START); - break; - case self::MODE_APPEND: - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_END); - break; - default: - throw new Swift_SwiftException( - 'Invalid mode ['.$mode.'] used to set nsKey='. - $nsKey.', itemKey='.$itemKey - ); - break; - } - fwrite($fp, $string); - $this->_freeHandle($nsKey, $itemKey); - } - - /** - * Set a ByteStream into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_OutputByteStream $os - * @param int $mode - * - * @throws Swift_IoException - */ - public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode) - { - $this->_prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START); - break; - case self::MODE_APPEND: - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_END); - break; - default: - throw new Swift_SwiftException( - 'Invalid mode ['.$mode.'] used to set nsKey='. - $nsKey.', itemKey='.$itemKey - ); - break; - } - while (false !== $bytes = $os->read(8192)) { - fwrite($fp, $bytes); - } - $this->_freeHandle($nsKey, $itemKey); - } - - /** - * Provides a ByteStream which when written to, writes data to $itemKey. - * - * NOTE: The stream will always write in append mode. - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $writeThrough - * - * @return Swift_InputByteStream - */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) - { - $is = clone $this->_stream; - $is->setKeyCache($this); - $is->setNsKey($nsKey); - $is->setItemKey($itemKey); - if (isset($writeThrough)) { - $is->setWriteThroughStream($writeThrough); - } - - return $is; - } - - /** - * Get data back out of the cache as a string. - * - * @param string $nsKey - * @param string $itemKey - * - * @throws Swift_IoException - * - * @return string - */ - public function getString($nsKey, $itemKey) - { - $this->_prepareCache($nsKey); - if ($this->hasKey($nsKey, $itemKey)) { - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START); - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 0); - } - $str = ''; - while (!feof($fp) && false !== $bytes = fread($fp, 8192)) { - $str .= $bytes; - } - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 1); - } - $this->_freeHandle($nsKey, $itemKey); - - return $str; - } - } - - /** - * Get data back out of the cache as a ByteStream. - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $is to write the data to - */ - public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is) - { - if ($this->hasKey($nsKey, $itemKey)) { - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START); - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 0); - } - while (!feof($fp) && false !== $bytes = fread($fp, 8192)) { - $is->write($bytes); - } - if ($this->_quotes) { - ini_set('magic_quotes_runtime', 1); - } - $this->_freeHandle($nsKey, $itemKey); - } - } - - /** - * Check if the given $itemKey exists in the namespace $nsKey. - * - * @param string $nsKey - * @param string $itemKey - * - * @return bool - */ - public function hasKey($nsKey, $itemKey) - { - return is_file($this->_path.'/'.$nsKey.'/'.$itemKey); - } - - /** - * Clear data for $itemKey in the namespace $nsKey if it exists. - * - * @param string $nsKey - * @param string $itemKey - */ - public function clearKey($nsKey, $itemKey) - { - if ($this->hasKey($nsKey, $itemKey)) { - $this->_freeHandle($nsKey, $itemKey); - unlink($this->_path.'/'.$nsKey.'/'.$itemKey); - } - } - - /** - * Clear all data in the namespace $nsKey if it exists. - * - * @param string $nsKey - */ - public function clearAll($nsKey) - { - if (array_key_exists($nsKey, $this->_keys)) { - foreach ($this->_keys[$nsKey] as $itemKey => $null) { - $this->clearKey($nsKey, $itemKey); - } - if (is_dir($this->_path.'/'.$nsKey)) { - rmdir($this->_path.'/'.$nsKey); - } - unset($this->_keys[$nsKey]); - } - } - - /** - * Initialize the namespace of $nsKey if needed. - * - * @param string $nsKey - */ - private function _prepareCache($nsKey) - { - $cacheDir = $this->_path.'/'.$nsKey; - if (!is_dir($cacheDir)) { - if (!mkdir($cacheDir)) { - throw new Swift_IoException('Failed to create cache directory '.$cacheDir); - } - $this->_keys[$nsKey] = array(); - } - } - - /** - * Get a file handle on the cache item. - * - * @param string $nsKey - * @param string $itemKey - * @param int $position - * - * @return resource - */ - private function _getHandle($nsKey, $itemKey, $position) - { - if (!isset($this->_keys[$nsKey][$itemKey])) { - $openMode = $this->hasKey($nsKey, $itemKey) ? 'r+b' : 'w+b'; - $fp = fopen($this->_path.'/'.$nsKey.'/'.$itemKey, $openMode); - $this->_keys[$nsKey][$itemKey] = $fp; - } - if (self::POSITION_START == $position) { - fseek($this->_keys[$nsKey][$itemKey], 0, SEEK_SET); - } elseif (self::POSITION_END == $position) { - fseek($this->_keys[$nsKey][$itemKey], 0, SEEK_END); - } - - return $this->_keys[$nsKey][$itemKey]; - } - - private function _freeHandle($nsKey, $itemKey) - { - $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_CURRENT); - fclose($fp); - $this->_keys[$nsKey][$itemKey] = null; - } - - /** - * Destructor. - */ - public function __destruct() - { - foreach ($this->_keys as $nsKey => $null) { - $this->clearAll($nsKey); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php deleted file mode 100644 index af80bdc..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Writes data to a KeyCache using a stream. - * - * @author Chris Corbyn - */ -interface Swift_KeyCache_KeyCacheInputStream extends Swift_InputByteStream -{ - /** - * Set the KeyCache to wrap. - * - * @param Swift_KeyCache $keyCache - */ - public function setKeyCache(Swift_KeyCache $keyCache); - - /** - * Set the nsKey which will be written to. - * - * @param string $nsKey - */ - public function setNsKey($nsKey); - - /** - * Set the itemKey which will be written to. - * - * @param string $itemKey - */ - public function setItemKey($itemKey); - - /** - * Specify a stream to write through for each write(). - * - * @param Swift_InputByteStream $is - */ - public function setWriteThroughStream(Swift_InputByteStream $is); - - /** - * Any implementation should be cloneable, allowing the clone to access a - * separate $nsKey and $itemKey. - */ - public function __clone(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/NullKeyCache.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/NullKeyCache.php deleted file mode 100644 index 4efe785..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/NullKeyCache.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A null KeyCache that does not cache at all. - * - * @author Chris Corbyn - */ -class Swift_KeyCache_NullKeyCache implements Swift_KeyCache -{ - /** - * Set a string into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode - */ - public function setString($nsKey, $itemKey, $string, $mode) - { - } - - /** - * Set a ByteStream into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_OutputByteStream $os - * @param int $mode - */ - public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode) - { - } - - /** - * Provides a ByteStream which when written to, writes data to $itemKey. - * - * NOTE: The stream will always write in append mode. - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $writeThrough - * - * @return Swift_InputByteStream - */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) - { - } - - /** - * Get data back out of the cache as a string. - * - * @param string $nsKey - * @param string $itemKey - * - * @return string - */ - public function getString($nsKey, $itemKey) - { - } - - /** - * Get data back out of the cache as a ByteStream. - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $is to write the data to - */ - public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is) - { - } - - /** - * Check if the given $itemKey exists in the namespace $nsKey. - * - * @param string $nsKey - * @param string $itemKey - * - * @return bool - */ - public function hasKey($nsKey, $itemKey) - { - return false; - } - - /** - * Clear data for $itemKey in the namespace $nsKey if it exists. - * - * @param string $nsKey - * @param string $itemKey - */ - public function clearKey($nsKey, $itemKey) - { - } - - /** - * Clear all data in the namespace $nsKey if it exists. - * - * @param string $nsKey - */ - public function clearAll($nsKey) - { - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php deleted file mode 100644 index b00d458..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php +++ /dev/null @@ -1,127 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Writes data to a KeyCache using a stream. - * - * @author Chris Corbyn - */ -class Swift_KeyCache_SimpleKeyCacheInputStream implements Swift_KeyCache_KeyCacheInputStream -{ - /** The KeyCache being written to */ - private $_keyCache; - - /** The nsKey of the KeyCache being written to */ - private $_nsKey; - - /** The itemKey of the KeyCache being written to */ - private $_itemKey; - - /** A stream to write through on each write() */ - private $_writeThrough = null; - - /** - * Set the KeyCache to wrap. - * - * @param Swift_KeyCache $keyCache - */ - public function setKeyCache(Swift_KeyCache $keyCache) - { - $this->_keyCache = $keyCache; - } - - /** - * Specify a stream to write through for each write(). - * - * @param Swift_InputByteStream $is - */ - public function setWriteThroughStream(Swift_InputByteStream $is) - { - $this->_writeThrough = $is; - } - - /** - * Writes $bytes to the end of the stream. - * - * @param string $bytes - * @param Swift_InputByteStream $is optional - */ - public function write($bytes, Swift_InputByteStream $is = null) - { - $this->_keyCache->setString( - $this->_nsKey, $this->_itemKey, $bytes, Swift_KeyCache::MODE_APPEND - ); - if (isset($is)) { - $is->write($bytes); - } - if (isset($this->_writeThrough)) { - $this->_writeThrough->write($bytes); - } - } - - /** - * Not used. - */ - public function commit() - { - } - - /** - * Not used. - */ - public function bind(Swift_InputByteStream $is) - { - } - - /** - * Not used. - */ - public function unbind(Swift_InputByteStream $is) - { - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - */ - public function flushBuffers() - { - $this->_keyCache->clearKey($this->_nsKey, $this->_itemKey); - } - - /** - * Set the nsKey which will be written to. - * - * @param string $nsKey - */ - public function setNsKey($nsKey) - { - $this->_nsKey = $nsKey; - } - - /** - * Set the itemKey which will be written to. - * - * @param string $itemKey - */ - public function setItemKey($itemKey) - { - $this->_itemKey = $itemKey; - } - - /** - * Any implementation should be cloneable, allowing the clone to access a - * separate $nsKey and $itemKey. - */ - public function __clone() - { - $this->_writeThrough = null; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php deleted file mode 100644 index e151b8a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Redundantly and rotationally uses several Transport implementations when sending. - * - * @author Chris Corbyn - */ -class Swift_LoadBalancedTransport extends Swift_Transport_LoadBalancedTransport -{ - /** - * Creates a new LoadBalancedTransport with $transports. - * - * @param array $transports - */ - public function __construct($transports = array()) - { - call_user_func_array( - array($this, 'Swift_Transport_LoadBalancedTransport::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.loadbalanced') - ); - - $this->setTransports($transports); - } - - /** - * Create a new LoadBalancedTransport instance. - * - * @param array $transports - * - * @return self - */ - public static function newInstance($transports = array()) - { - return new self($transports); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MailTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MailTransport.php deleted file mode 100644 index 1855698..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MailTransport.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Sends Messages using the mail() function. - * - * @author Chris Corbyn - * - * @deprecated since 5.4.5 (to be removed in 6.0) - */ -class Swift_MailTransport extends Swift_Transport_MailTransport -{ - /** - * Create a new MailTransport, optionally specifying $extraParams. - * - * @param string $extraParams - */ - public function __construct($extraParams = '-f%s') - { - call_user_func_array( - array($this, 'Swift_Transport_MailTransport::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.mail') - ); - - $this->setExtraParams($extraParams); - } - - /** - * Create a new MailTransport instance. - * - * @param string $extraParams To be passed to mail() - * - * @return self - */ - public static function newInstance($extraParams = '-f%s') - { - return new self($extraParams); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php deleted file mode 100644 index 8314fe8..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Swift Mailer class. - * - * @author Chris Corbyn - */ -class Swift_Mailer -{ - /** The Transport used to send messages */ - private $_transport; - - /** - * Create a new Mailer using $transport for delivery. - * - * @param Swift_Transport $transport - */ - public function __construct(Swift_Transport $transport) - { - $this->_transport = $transport; - } - - /** - * Create a new Mailer instance. - * - * @param Swift_Transport $transport - * - * @return self - */ - public static function newInstance(Swift_Transport $transport) - { - return new self($transport); - } - - /** - * Create a new class instance of one of the message services. - * - * For example 'mimepart' would create a 'message.mimepart' instance - * - * @param string $service - * - * @return object - */ - public function createMessage($service = 'message') - { - return Swift_DependencyContainer::getInstance() - ->lookup('message.'.$service); - } - - /** - * Send the given Message like it would be sent in a mail client. - * - * All recipients (with the exception of Bcc) will be able to see the other - * recipients this message was sent to. - * - * Recipient/sender data will be retrieved from the Message object. - * - * The return value is the number of recipients who were accepted for - * delivery. - * - * @param Swift_Mime_Message $message - * @param array $failedRecipients An array of failures by-reference - * - * @return int The number of successful recipients. Can be 0 which indicates failure - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $failedRecipients = (array) $failedRecipients; - - if (!$this->_transport->isStarted()) { - $this->_transport->start(); - } - - $sent = 0; - - try { - $sent = $this->_transport->send($message, $failedRecipients); - } catch (Swift_RfcComplianceException $e) { - foreach ($message->getTo() as $address => $name) { - $failedRecipients[] = $address; - } - } - - return $sent; - } - - /** - * Register a plugin using a known unique key (e.g. myPlugin). - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->_transport->registerPlugin($plugin); - } - - /** - * The Transport used to send messages. - * - * @return Swift_Transport - */ - public function getTransport() - { - return $this->_transport; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php deleted file mode 100644 index e3e6cad..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Wraps a standard PHP array in an iterator. - * - * @author Chris Corbyn - */ -class Swift_Mailer_ArrayRecipientIterator implements Swift_Mailer_RecipientIterator -{ - /** - * The list of recipients. - * - * @var array - */ - private $_recipients = array(); - - /** - * Create a new ArrayRecipientIterator from $recipients. - * - * @param array $recipients - */ - public function __construct(array $recipients) - { - $this->_recipients = $recipients; - } - - /** - * Returns true only if there are more recipients to send to. - * - * @return bool - */ - public function hasNext() - { - return !empty($this->_recipients); - } - - /** - * Returns an array where the keys are the addresses of recipients and the - * values are the names. e.g. ('foo@bar' => 'Foo') or ('foo@bar' => NULL). - * - * @return array - */ - public function nextRecipient() - { - return array_splice($this->_recipients, 0, 1); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php deleted file mode 100644 index 650f3ec..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Provides an abstract way of specifying recipients for batch sending. - * - * @author Chris Corbyn - */ -interface Swift_Mailer_RecipientIterator -{ - /** - * Returns true only if there are more recipients to send to. - * - * @return bool - */ - public function hasNext(); - - /** - * Returns an array where the keys are the addresses of recipients and the - * values are the names. e.g. ('foo@bar' => 'Foo') or ('foo@bar' => NULL). - * - * @return array - */ - public function nextRecipient(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php deleted file mode 100644 index 2cafb67..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2011 Fabien Potencier <fabien.potencier@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages in memory. - * - * @author Fabien Potencier - */ -class Swift_MemorySpool implements Swift_Spool -{ - protected $messages = array(); - private $flushRetries = 3; - - /** - * Tests if this Transport mechanism has started. - * - * @return bool - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Transport mechanism. - */ - public function start() - { - } - - /** - * Stops this Transport mechanism. - */ - public function stop() - { - } - - /** - * @param int $retries - */ - public function setFlushRetries($retries) - { - $this->flushRetries = $retries; - } - - /** - * Stores a message in the queue. - * - * @param Swift_Mime_Message $message The message to store - * - * @return bool Whether the operation has succeeded - */ - public function queueMessage(Swift_Mime_Message $message) - { - //clone the message to make sure it is not changed while in the queue - $this->messages[] = clone $message; - - return true; - } - - /** - * Sends messages using the given transport instance. - * - * @param Swift_Transport $transport A transport instance - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent emails - */ - public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) - { - if (!$this->messages) { - return 0; - } - - if (!$transport->isStarted()) { - $transport->start(); - } - - $count = 0; - $retries = $this->flushRetries; - while ($retries--) { - try { - while ($message = array_pop($this->messages)) { - $count += $transport->send($message, $failedRecipients); - } - } catch (Swift_TransportException $exception) { - if ($retries) { - // re-queue the message at the end of the queue to give a chance - // to the other messages to be sent, in case the failure was due to - // this message and not just the transport failing - array_unshift($this->messages, $message); - - // wait half a second before we try again - usleep(500000); - } else { - throw $exception; - } - } - } - - return $count; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php deleted file mode 100644 index 242cbf3..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php +++ /dev/null @@ -1,289 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * The Message class for building emails. - * - * @author Chris Corbyn - */ -class Swift_Message extends Swift_Mime_SimpleMessage -{ - /** - * @var Swift_Signers_HeaderSigner[] - */ - private $headerSigners = array(); - - /** - * @var Swift_Signers_BodySigner[] - */ - private $bodySigners = array(); - - /** - * @var array - */ - private $savedMessage = array(); - - /** - * Create a new Message. - * - * Details may be optionally passed into the constructor. - * - * @param string $subject - * @param string $body - * @param string $contentType - * @param string $charset - */ - public function __construct($subject = null, $body = null, $contentType = null, $charset = null) - { - call_user_func_array( - array($this, 'Swift_Mime_SimpleMessage::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('mime.message') - ); - - if (!isset($charset)) { - $charset = Swift_DependencyContainer::getInstance() - ->lookup('properties.charset'); - } - $this->setSubject($subject); - $this->setBody($body); - $this->setCharset($charset); - if ($contentType) { - $this->setContentType($contentType); - } - } - - /** - * Create a new Message. - * - * @param string $subject - * @param string $body - * @param string $contentType - * @param string $charset - * - * @return $this - */ - public static function newInstance($subject = null, $body = null, $contentType = null, $charset = null) - { - return new self($subject, $body, $contentType, $charset); - } - - /** - * Add a MimePart to this Message. - * - * @param string|Swift_OutputByteStream $body - * @param string $contentType - * @param string $charset - * - * @return $this - */ - public function addPart($body, $contentType = null, $charset = null) - { - return $this->attach(Swift_MimePart::newInstance($body, $contentType, $charset)->setEncoder($this->getEncoder())); - } - - /** - * Detach a signature handler from a message. - * - * @param Swift_Signer $signer - * - * @return $this - */ - public function attachSigner(Swift_Signer $signer) - { - if ($signer instanceof Swift_Signers_HeaderSigner) { - $this->headerSigners[] = $signer; - } elseif ($signer instanceof Swift_Signers_BodySigner) { - $this->bodySigners[] = $signer; - } - - return $this; - } - - /** - * Attach a new signature handler to the message. - * - * @param Swift_Signer $signer - * - * @return $this - */ - public function detachSigner(Swift_Signer $signer) - { - if ($signer instanceof Swift_Signers_HeaderSigner) { - foreach ($this->headerSigners as $k => $headerSigner) { - if ($headerSigner === $signer) { - unset($this->headerSigners[$k]); - - return $this; - } - } - } elseif ($signer instanceof Swift_Signers_BodySigner) { - foreach ($this->bodySigners as $k => $bodySigner) { - if ($bodySigner === $signer) { - unset($this->bodySigners[$k]); - - return $this; - } - } - } - - return $this; - } - - /** - * Get this message as a complete string. - * - * @return string - */ - public function toString() - { - if (empty($this->headerSigners) && empty($this->bodySigners)) { - return parent::toString(); - } - - $this->saveMessage(); - - $this->doSign(); - - $string = parent::toString(); - - $this->restoreMessage(); - - return $string; - } - - /** - * Write this message to a {@link Swift_InputByteStream}. - * - * @param Swift_InputByteStream $is - */ - public function toByteStream(Swift_InputByteStream $is) - { - if (empty($this->headerSigners) && empty($this->bodySigners)) { - parent::toByteStream($is); - - return; - } - - $this->saveMessage(); - - $this->doSign(); - - parent::toByteStream($is); - - $this->restoreMessage(); - } - - public function __wakeup() - { - Swift_DependencyContainer::getInstance()->createDependenciesFor('mime.message'); - } - - /** - * loops through signers and apply the signatures. - */ - protected function doSign() - { - foreach ($this->bodySigners as $signer) { - $altered = $signer->getAlteredHeaders(); - $this->saveHeaders($altered); - $signer->signMessage($this); - } - - foreach ($this->headerSigners as $signer) { - $altered = $signer->getAlteredHeaders(); - $this->saveHeaders($altered); - $signer->reset(); - - $signer->setHeaders($this->getHeaders()); - - $signer->startBody(); - $this->_bodyToByteStream($signer); - $signer->endBody(); - - $signer->addSignature($this->getHeaders()); - } - } - - /** - * save the message before any signature is applied. - */ - protected function saveMessage() - { - $this->savedMessage = array('headers' => array()); - $this->savedMessage['body'] = $this->getBody(); - $this->savedMessage['children'] = $this->getChildren(); - if (count($this->savedMessage['children']) > 0 && $this->getBody() != '') { - $this->setChildren(array_merge(array($this->_becomeMimePart()), $this->savedMessage['children'])); - $this->setBody(''); - } - } - - /** - * save the original headers. - * - * @param array $altered - */ - protected function saveHeaders(array $altered) - { - foreach ($altered as $head) { - $lc = strtolower($head); - - if (!isset($this->savedMessage['headers'][$lc])) { - $this->savedMessage['headers'][$lc] = $this->getHeaders()->getAll($head); - } - } - } - - /** - * Remove or restore altered headers. - */ - protected function restoreHeaders() - { - foreach ($this->savedMessage['headers'] as $name => $savedValue) { - $headers = $this->getHeaders()->getAll($name); - - foreach ($headers as $key => $value) { - if (!isset($savedValue[$key])) { - $this->getHeaders()->remove($name, $key); - } - } - } - } - - /** - * Restore message body. - */ - protected function restoreMessage() - { - $this->setBody($this->savedMessage['body']); - $this->setChildren($this->savedMessage['children']); - - $this->restoreHeaders(); - $this->savedMessage = array(); - } - - /** - * Clone Message Signers. - * - * @see Swift_Mime_SimpleMimeEntity::__clone() - */ - public function __clone() - { - parent::__clone(); - foreach ($this->bodySigners as $key => $bodySigner) { - $this->bodySigners[$key] = clone $bodySigner; - } - - foreach ($this->headerSigners as $key => $headerSigner) { - $this->headerSigners[$key] = clone $headerSigner; - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php deleted file mode 100644 index d5ba14b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php +++ /dev/null @@ -1,149 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An attachment, in a multipart message. - * - * @author Chris Corbyn - */ -class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity -{ - /** Recognized MIME types */ - private $_mimeTypes = array(); - - /** - * Create a new Attachment with $headers, $encoder and $cache. - * - * @param Swift_Mime_HeaderSet $headers - * @param Swift_Mime_ContentEncoder $encoder - * @param Swift_KeyCache $cache - * @param Swift_Mime_Grammar $grammar - * @param array $mimeTypes optional - */ - public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $mimeTypes = array()) - { - parent::__construct($headers, $encoder, $cache, $grammar); - $this->setDisposition('attachment'); - $this->setContentType('application/octet-stream'); - $this->_mimeTypes = $mimeTypes; - } - - /** - * Get the nesting level used for this attachment. - * - * Always returns {@link LEVEL_MIXED}. - * - * @return int - */ - public function getNestingLevel() - { - return self::LEVEL_MIXED; - } - - /** - * Get the Content-Disposition of this attachment. - * - * By default attachments have a disposition of "attachment". - * - * @return string - */ - public function getDisposition() - { - return $this->_getHeaderFieldModel('Content-Disposition'); - } - - /** - * Set the Content-Disposition of this attachment. - * - * @param string $disposition - * - * @return $this - */ - public function setDisposition($disposition) - { - if (!$this->_setHeaderFieldModel('Content-Disposition', $disposition)) { - $this->getHeaders()->addParameterizedHeader('Content-Disposition', $disposition); - } - - return $this; - } - - /** - * Get the filename of this attachment when downloaded. - * - * @return string - */ - public function getFilename() - { - return $this->_getHeaderParameter('Content-Disposition', 'filename'); - } - - /** - * Set the filename of this attachment. - * - * @param string $filename - * - * @return $this - */ - public function setFilename($filename) - { - $this->_setHeaderParameter('Content-Disposition', 'filename', $filename); - $this->_setHeaderParameter('Content-Type', 'name', $filename); - - return $this; - } - - /** - * Get the file size of this attachment. - * - * @return int - */ - public function getSize() - { - return $this->_getHeaderParameter('Content-Disposition', 'size'); - } - - /** - * Set the file size of this attachment. - * - * @param int $size - * - * @return $this - */ - public function setSize($size) - { - $this->_setHeaderParameter('Content-Disposition', 'size', $size); - - return $this; - } - - /** - * Set the file that this attachment is for. - * - * @param Swift_FileStream $file - * @param string $contentType optional - * - * @return $this - */ - public function setFile(Swift_FileStream $file, $contentType = null) - { - $this->setFilename(basename($file->getPath())); - $this->setBody($file, $contentType); - if (!isset($contentType)) { - $extension = strtolower(substr($file->getPath(), strrpos($file->getPath(), '.') + 1)); - - if (array_key_exists($extension, $this->_mimeTypes)) { - $this->setContentType($this->_mimeTypes[$extension]); - } - } - - return $this; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php deleted file mode 100644 index b49c3a8..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Observes changes in an Mime entity's character set. - * - * @author Chris Corbyn - */ -interface Swift_Mime_CharsetObserver -{ - /** - * Notify this observer that the entity's charset has changed. - * - * @param string $charset - */ - public function charsetChanged($charset); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder.php deleted file mode 100644 index d43ea9f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Interface for all Transfer Encoding schemes. - * - * @author Chris Corbyn - */ -interface Swift_Mime_ContentEncoder extends Swift_Encoder -{ - /** - * Encode $in to $out. - * - * @param Swift_OutputByteStream $os to read from - * @param Swift_InputByteStream $is to write to - * @param int $firstLineOffset - * @param int $maxLineLength - 0 indicates the default length for this encoding - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0); - - /** - * Get the MIME name of this content encoding scheme. - * - * @return string - */ - public function getName(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php deleted file mode 100644 index 8f76d70..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles Base 64 Transfer Encoding in Swift Mailer. - * - * @author Chris Corbyn - */ -class Swift_Mime_ContentEncoder_Base64ContentEncoder extends Swift_Encoder_Base64Encoder implements Swift_Mime_ContentEncoder -{ - /** - * Encode stream $in to stream $out. - * - * @param Swift_OutputByteStream $os - * @param Swift_InputByteStream $is - * @param int $firstLineOffset - * @param int $maxLineLength, optional, 0 indicates the default of 76 bytes - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - if (0 >= $maxLineLength || 76 < $maxLineLength) { - $maxLineLength = 76; - } - - $remainder = 0; - $base64ReadBufferRemainderBytes = null; - - // To reduce memory usage, the output buffer is streamed to the input buffer like so: - // Output Stream => base64encode => wrap line length => Input Stream - // HOWEVER it's important to note that base64_encode() should only be passed whole triplets of data (except for the final chunk of data) - // otherwise it will assume the input data has *ended* and it will incorrectly pad/terminate the base64 data mid-stream. - // We use $base64ReadBufferRemainderBytes to carry over 1-2 "remainder" bytes from the each chunk from OutputStream and pre-pend those onto the - // chunk of bytes read in the next iteration. - // When the OutputStream is empty, we must flush any remainder bytes. - while (true) { - $readBytes = $os->read(8192); - $atEOF = ($readBytes === false); - - if ($atEOF) { - $streamTheseBytes = $base64ReadBufferRemainderBytes; - } else { - $streamTheseBytes = $base64ReadBufferRemainderBytes.$readBytes; - } - $base64ReadBufferRemainderBytes = null; - $bytesLength = strlen($streamTheseBytes); - - if ($bytesLength === 0) { // no data left to encode - break; - } - - // if we're not on the last block of the ouput stream, make sure $streamTheseBytes ends with a complete triplet of data - // and carry over remainder 1-2 bytes to the next loop iteration - if (!$atEOF) { - $excessBytes = $bytesLength % 3; - if ($excessBytes !== 0) { - $base64ReadBufferRemainderBytes = substr($streamTheseBytes, -$excessBytes); - $streamTheseBytes = substr($streamTheseBytes, 0, $bytesLength - $excessBytes); - } - } - - $encoded = base64_encode($streamTheseBytes); - $encodedTransformed = ''; - $thisMaxLineLength = $maxLineLength - $remainder - $firstLineOffset; - - while ($thisMaxLineLength < strlen($encoded)) { - $encodedTransformed .= substr($encoded, 0, $thisMaxLineLength)."\r\n"; - $firstLineOffset = 0; - $encoded = substr($encoded, $thisMaxLineLength); - $thisMaxLineLength = $maxLineLength; - $remainder = 0; - } - - if (0 < $remainingLength = strlen($encoded)) { - $remainder += $remainingLength; - $encodedTransformed .= $encoded; - $encoded = null; - } - - $is->write($encodedTransformed); - - if ($atEOF) { - break; - } - } - } - - /** - * Get the name of this encoding scheme. - * Returns the string 'base64'. - * - * @return string - */ - public function getName() - { - return 'base64'; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php deleted file mode 100644 index 710b5ac..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles Quoted Printable (QP) Transfer Encoding in Swift Mailer using the PHP core function. - * - * @author Lars Strojny - */ -class Swift_Mime_ContentEncoder_NativeQpContentEncoder implements Swift_Mime_ContentEncoder -{ - /** - * @var null|string - */ - private $charset; - - /** - * @param null|string $charset - */ - public function __construct($charset = null) - { - $this->charset = $charset ? $charset : 'utf-8'; - } - - /** - * Notify this observer that the entity's charset has changed. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->charset = $charset; - } - - /** - * Encode $in to $out. - * - * @param Swift_OutputByteStream $os to read from - * @param Swift_InputByteStream $is to write to - * @param int $firstLineOffset - * @param int $maxLineLength 0 indicates the default length for this encoding - * - * @throws RuntimeException - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($this->charset !== 'utf-8') { - throw new RuntimeException( - sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset)); - } - - $string = ''; - - while (false !== $bytes = $os->read(8192)) { - $string .= $bytes; - } - - $is->write($this->encodeString($string)); - } - - /** - * Get the MIME name of this content encoding scheme. - * - * @return string - */ - public function getName() - { - return 'quoted-printable'; - } - - /** - * Encode a given string to produce an encoded string. - * - * @param string $string - * @param int $firstLineOffset if first line needs to be shorter - * @param int $maxLineLength 0 indicates the default length for this encoding - * - * @throws RuntimeException - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($this->charset !== 'utf-8') { - throw new RuntimeException( - sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset)); - } - - return $this->_standardize(quoted_printable_encode($string)); - } - - /** - * Make sure CRLF is correct and HT/SPACE are in valid places. - * - * @param string $string - * - * @return string - */ - protected function _standardize($string) - { - // transform CR or LF to CRLF - $string = preg_replace('~=0D(?!=0A)|(?<!=0D)=0A~', '=0D=0A', $string); - // transform =0D=0A to CRLF - $string = str_replace(array("\t=0D=0A", ' =0D=0A', '=0D=0A'), array("=09\r\n", "=20\r\n", "\r\n"), $string); - - switch ($end = ord(substr($string, -1))) { - case 0x09: - $string = substr_replace($string, '=09', -1); - break; - case 0x20: - $string = substr_replace($string, '=20', -1); - break; - } - - return $string; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php deleted file mode 100644 index 219f482..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php +++ /dev/null @@ -1,162 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles binary/7/8-bit Transfer Encoding in Swift Mailer. - * - * @author Chris Corbyn - */ -class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_ContentEncoder -{ - /** - * The name of this encoding scheme (probably 7bit or 8bit). - * - * @var string - */ - private $_name; - - /** - * True if canonical transformations should be done. - * - * @var bool - */ - private $_canonical; - - /** - * Creates a new PlainContentEncoder with $name (probably 7bit or 8bit). - * - * @param string $name - * @param bool $canonical If canonicalization transformation should be done. - */ - public function __construct($name, $canonical = false) - { - $this->_name = $name; - $this->_canonical = $canonical; - } - - /** - * Encode a given string to produce an encoded string. - * - * @param string $string - * @param int $firstLineOffset ignored - * @param int $maxLineLength - 0 means no wrapping will occur - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($this->_canonical) { - $string = $this->_canonicalize($string); - } - - return $this->_safeWordWrap($string, $maxLineLength, "\r\n"); - } - - /** - * Encode stream $in to stream $out. - * - * @param Swift_OutputByteStream $os - * @param Swift_InputByteStream $is - * @param int $firstLineOffset ignored - * @param int $maxLineLength optional, 0 means no wrapping will occur - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - $leftOver = ''; - while (false !== $bytes = $os->read(8192)) { - $toencode = $leftOver.$bytes; - if ($this->_canonical) { - $toencode = $this->_canonicalize($toencode); - } - $wrapped = $this->_safeWordWrap($toencode, $maxLineLength, "\r\n"); - $lastLinePos = strrpos($wrapped, "\r\n"); - $leftOver = substr($wrapped, $lastLinePos); - $wrapped = substr($wrapped, 0, $lastLinePos); - - $is->write($wrapped); - } - if (strlen($leftOver)) { - $is->write($leftOver); - } - } - - /** - * Get the name of this encoding scheme. - * - * @return string - */ - public function getName() - { - return $this->_name; - } - - /** - * Not used. - */ - public function charsetChanged($charset) - { - } - - /** - * A safer (but weaker) wordwrap for unicode. - * - * @param string $string - * @param int $length - * @param string $le - * - * @return string - */ - private function _safeWordwrap($string, $length = 75, $le = "\r\n") - { - if (0 >= $length) { - return $string; - } - - $originalLines = explode($le, $string); - - $lines = array(); - $lineCount = 0; - - foreach ($originalLines as $originalLine) { - $lines[] = ''; - $currentLine = &$lines[$lineCount++]; - - //$chunks = preg_split('/(?<=[\ \t,\.!\?\-&\+\/])/', $originalLine); - $chunks = preg_split('/(?<=\s)/', $originalLine); - - foreach ($chunks as $chunk) { - if (0 != strlen($currentLine) - && strlen($currentLine.$chunk) > $length) { - $lines[] = ''; - $currentLine = &$lines[$lineCount++]; - } - $currentLine .= $chunk; - } - } - - return implode("\r\n", $lines); - } - - /** - * Canonicalize string input (fix CRLF). - * - * @param string $string - * - * @return string - */ - private function _canonicalize($string) - { - return str_replace( - array("\r\n", "\r", "\n"), - array("\n", "\n", "\r\n"), - $string - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php deleted file mode 100644 index 5cc907b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles Quoted Printable (QP) Transfer Encoding in Swift Mailer. - * - * @author Chris Corbyn - */ -class Swift_Mime_ContentEncoder_QpContentEncoder extends Swift_Encoder_QpEncoder implements Swift_Mime_ContentEncoder -{ - protected $_dotEscape; - - /** - * Creates a new QpContentEncoder for the given CharacterStream. - * - * @param Swift_CharacterStream $charStream to use for reading characters - * @param Swift_StreamFilter $filter if canonicalization should occur - * @param bool $dotEscape if dot stuffing workaround must be enabled - */ - public function __construct(Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null, $dotEscape = false) - { - $this->_dotEscape = $dotEscape; - parent::__construct($charStream, $filter); - } - - public function __sleep() - { - return array('_charStream', '_filter', '_dotEscape'); - } - - protected function getSafeMapShareId() - { - return get_class($this).($this->_dotEscape ? '.dotEscape' : ''); - } - - protected function initSafeMap() - { - parent::initSafeMap(); - if ($this->_dotEscape) { - /* Encode . as =2e for buggy remote servers */ - unset($this->_safeMap[0x2e]); - } - } - - /** - * Encode stream $in to stream $out. - * - * QP encoded strings have a maximum line length of 76 characters. - * If the first line needs to be shorter, indicate the difference with - * $firstLineOffset. - * - * @param Swift_OutputByteStream $os output stream - * @param Swift_InputByteStream $is input stream - * @param int $firstLineOffset - * @param int $maxLineLength - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($maxLineLength > 76 || $maxLineLength <= 0) { - $maxLineLength = 76; - } - - $thisLineLength = $maxLineLength - $firstLineOffset; - - $this->_charStream->flushContents(); - $this->_charStream->importByteStream($os); - - $currentLine = ''; - $prepend = ''; - $size = $lineLen = 0; - - while (false !== $bytes = $this->_nextSequence()) { - // If we're filtering the input - if (isset($this->_filter)) { - // If we can't filter because we need more bytes - while ($this->_filter->shouldBuffer($bytes)) { - // Then collect bytes into the buffer - if (false === $moreBytes = $this->_nextSequence(1)) { - break; - } - - foreach ($moreBytes as $b) { - $bytes[] = $b; - } - } - // And filter them - $bytes = $this->_filter->filter($bytes); - } - - $enc = $this->_encodeByteSequence($bytes, $size); - - $i = strpos($enc, '=0D=0A'); - $newLineLength = $lineLen + ($i === false ? $size : $i); - - if ($currentLine && $newLineLength >= $thisLineLength) { - $is->write($prepend.$this->_standardize($currentLine)); - $currentLine = ''; - $prepend = "=\r\n"; - $thisLineLength = $maxLineLength; - $lineLen = 0; - } - - $currentLine .= $enc; - - if ($i === false) { - $lineLen += $size; - } else { - // 6 is the length of '=0D=0A'. - $lineLen = $size - strrpos($enc, '=0D=0A') - 6; - } - } - if (strlen($currentLine)) { - $is->write($prepend.$this->_standardize($currentLine)); - } - } - - /** - * Get the name of this encoding scheme. - * Returns the string 'quoted-printable'. - * - * @return string - */ - public function getName() - { - return 'quoted-printable'; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php deleted file mode 100644 index 3214e1c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Proxy for quoted-printable content encoders. - * - * Switches on the best QP encoder implementation for current charset. - * - * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> - */ -class Swift_Mime_ContentEncoder_QpContentEncoderProxy implements Swift_Mime_ContentEncoder -{ - /** - * @var Swift_Mime_ContentEncoder_QpContentEncoder - */ - private $safeEncoder; - - /** - * @var Swift_Mime_ContentEncoder_NativeQpContentEncoder - */ - private $nativeEncoder; - - /** - * @var null|string - */ - private $charset; - - /** - * Constructor. - * - * @param Swift_Mime_ContentEncoder_QpContentEncoder $safeEncoder - * @param Swift_Mime_ContentEncoder_NativeQpContentEncoder $nativeEncoder - * @param string|null $charset - */ - public function __construct(Swift_Mime_ContentEncoder_QpContentEncoder $safeEncoder, Swift_Mime_ContentEncoder_NativeQpContentEncoder $nativeEncoder, $charset) - { - $this->safeEncoder = $safeEncoder; - $this->nativeEncoder = $nativeEncoder; - $this->charset = $charset; - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->safeEncoder = clone $this->safeEncoder; - $this->nativeEncoder = clone $this->nativeEncoder; - } - - /** - * {@inheritdoc} - */ - public function charsetChanged($charset) - { - $this->charset = $charset; - $this->safeEncoder->charsetChanged($charset); - } - - /** - * {@inheritdoc} - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - $this->getEncoder()->encodeByteStream($os, $is, $firstLineOffset, $maxLineLength); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'quoted-printable'; - } - - /** - * {@inheritdoc} - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - return $this->getEncoder()->encodeString($string, $firstLineOffset, $maxLineLength); - } - - /** - * @return Swift_Mime_ContentEncoder - */ - private function getEncoder() - { - return 'utf-8' === $this->charset ? $this->nativeEncoder : $this->safeEncoder; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php deleted file mode 100644 index 0b8526e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles raw Transfer Encoding in Swift Mailer. - * - * - * @author Sebastiaan Stok <s.stok@rollerscapes.net> - */ -class Swift_Mime_ContentEncoder_RawContentEncoder implements Swift_Mime_ContentEncoder -{ - /** - * Encode a given string to produce an encoded string. - * - * @param string $string - * @param int $firstLineOffset ignored - * @param int $maxLineLength ignored - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - return $string; - } - - /** - * Encode stream $in to stream $out. - * - * @param Swift_OutputByteStream $in - * @param Swift_InputByteStream $out - * @param int $firstLineOffset ignored - * @param int $maxLineLength ignored - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - while (false !== ($bytes = $os->read(8192))) { - $is->write($bytes); - } - } - - /** - * Get the name of this encoding scheme. - * - * @return string - */ - public function getName() - { - return 'raw'; - } - - /** - * Not used. - */ - public function charsetChanged($charset) - { - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php deleted file mode 100644 index 6af7571..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An embedded file, in a multipart message. - * - * @author Chris Corbyn - */ -class Swift_Mime_EmbeddedFile extends Swift_Mime_Attachment -{ - /** - * Creates a new Attachment with $headers and $encoder. - * - * @param Swift_Mime_HeaderSet $headers - * @param Swift_Mime_ContentEncoder $encoder - * @param Swift_KeyCache $cache - * @param Swift_Mime_Grammar $grammar - * @param array $mimeTypes optional - */ - public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $mimeTypes = array()) - { - parent::__construct($headers, $encoder, $cache, $grammar, $mimeTypes); - $this->setDisposition('inline'); - $this->setId($this->getId()); - } - - /** - * Get the nesting level of this EmbeddedFile. - * - * Returns {@see LEVEL_RELATED}. - * - * @return int - */ - public function getNestingLevel() - { - return self::LEVEL_RELATED; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php deleted file mode 100644 index cc44a6e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Observes changes for a Mime entity's ContentEncoder. - * - * @author Chris Corbyn - */ -interface Swift_Mime_EncodingObserver -{ - /** - * Notify this observer that the observed entity's ContentEncoder has changed. - * - * @param Swift_Mime_ContentEncoder $encoder - */ - public function encoderChanged(Swift_Mime_ContentEncoder $encoder); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Grammar.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Grammar.php deleted file mode 100644 index a09f338..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Grammar.php +++ /dev/null @@ -1,176 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Defines the grammar to use for validation, implements the RFC 2822 (and friends) ABNF grammar definitions. - * - * @author Fabien Potencier - * @author Chris Corbyn - */ -class Swift_Mime_Grammar -{ - /** - * Special characters used in the syntax which need to be escaped. - * - * @var string[] - */ - private static $_specials = array(); - - /** - * Tokens defined in RFC 2822 (and some related RFCs). - * - * @var string[] - */ - private static $_grammar = array(); - - /** - * Initialize some RFC 2822 (and friends) ABNF grammar definitions. - */ - public function __construct() - { - $this->init(); - } - - public function __wakeup() - { - $this->init(); - } - - protected function init() - { - if (count(self::$_specials) > 0) { - return; - } - - self::$_specials = array( - '(', ')', '<', '>', '[', ']', - ':', ';', '@', ',', '.', '"', - ); - - /*** Refer to RFC 2822 for ABNF grammar ***/ - - // All basic building blocks - self::$_grammar['NO-WS-CTL'] = '[\x01-\x08\x0B\x0C\x0E-\x19\x7F]'; - self::$_grammar['WSP'] = '[ \t]'; - self::$_grammar['CRLF'] = '(?:\r\n)'; - self::$_grammar['FWS'] = '(?:(?:'.self::$_grammar['WSP'].'*'. - self::$_grammar['CRLF'].')?'.self::$_grammar['WSP'].')'; - self::$_grammar['text'] = '[\x00-\x08\x0B\x0C\x0E-\x7F]'; - self::$_grammar['quoted-pair'] = '(?:\\\\'.self::$_grammar['text'].')'; - self::$_grammar['ctext'] = '(?:'.self::$_grammar['NO-WS-CTL']. - '|[\x21-\x27\x2A-\x5B\x5D-\x7E])'; - // Uses recursive PCRE (?1) -- could be a weak point?? - self::$_grammar['ccontent'] = '(?:'.self::$_grammar['ctext'].'|'. - self::$_grammar['quoted-pair'].'|(?1))'; - self::$_grammar['comment'] = '(\((?:'.self::$_grammar['FWS'].'|'. - self::$_grammar['ccontent'].')*'.self::$_grammar['FWS'].'?\))'; - self::$_grammar['CFWS'] = '(?:(?:'.self::$_grammar['FWS'].'?'. - self::$_grammar['comment'].')*(?:(?:'.self::$_grammar['FWS'].'?'. - self::$_grammar['comment'].')|'.self::$_grammar['FWS'].'))'; - self::$_grammar['qtext'] = '(?:'.self::$_grammar['NO-WS-CTL']. - '|[\x21\x23-\x5B\x5D-\x7E])'; - self::$_grammar['qcontent'] = '(?:'.self::$_grammar['qtext'].'|'. - self::$_grammar['quoted-pair'].')'; - self::$_grammar['quoted-string'] = '(?:'.self::$_grammar['CFWS'].'?"'. - '('.self::$_grammar['FWS'].'?'.self::$_grammar['qcontent'].')*'. - self::$_grammar['FWS'].'?"'.self::$_grammar['CFWS'].'?)'; - self::$_grammar['atext'] = '[a-zA-Z0-9!#\$%&\'\*\+\-\/=\?\^_`\{\}\|~]'; - self::$_grammar['atom'] = '(?:'.self::$_grammar['CFWS'].'?'. - self::$_grammar['atext'].'+'.self::$_grammar['CFWS'].'?)'; - self::$_grammar['dot-atom-text'] = '(?:'.self::$_grammar['atext'].'+'. - '(\.'.self::$_grammar['atext'].'+)*)'; - self::$_grammar['dot-atom'] = '(?:'.self::$_grammar['CFWS'].'?'. - self::$_grammar['dot-atom-text'].'+'.self::$_grammar['CFWS'].'?)'; - self::$_grammar['word'] = '(?:'.self::$_grammar['atom'].'|'. - self::$_grammar['quoted-string'].')'; - self::$_grammar['phrase'] = '(?:'.self::$_grammar['word'].'+?)'; - self::$_grammar['no-fold-quote'] = '(?:"(?:'.self::$_grammar['qtext']. - '|'.self::$_grammar['quoted-pair'].')*")'; - self::$_grammar['dtext'] = '(?:'.self::$_grammar['NO-WS-CTL']. - '|[\x21-\x5A\x5E-\x7E])'; - self::$_grammar['no-fold-literal'] = '(?:\[(?:'.self::$_grammar['dtext']. - '|'.self::$_grammar['quoted-pair'].')*\])'; - - // Message IDs - self::$_grammar['id-left'] = '(?:'.self::$_grammar['dot-atom-text'].'|'. - self::$_grammar['no-fold-quote'].')'; - self::$_grammar['id-right'] = '(?:'.self::$_grammar['dot-atom-text'].'|'. - self::$_grammar['no-fold-literal'].')'; - - // Addresses, mailboxes and paths - self::$_grammar['local-part'] = '(?:'.self::$_grammar['dot-atom'].'|'. - self::$_grammar['quoted-string'].')'; - self::$_grammar['dcontent'] = '(?:'.self::$_grammar['dtext'].'|'. - self::$_grammar['quoted-pair'].')'; - self::$_grammar['domain-literal'] = '(?:'.self::$_grammar['CFWS'].'?\[('. - self::$_grammar['FWS'].'?'.self::$_grammar['dcontent'].')*?'. - self::$_grammar['FWS'].'?\]'.self::$_grammar['CFWS'].'?)'; - self::$_grammar['domain'] = '(?:'.self::$_grammar['dot-atom'].'|'. - self::$_grammar['domain-literal'].')'; - self::$_grammar['addr-spec'] = '(?:'.self::$_grammar['local-part'].'@'. - self::$_grammar['domain'].')'; - } - - /** - * Get the grammar defined for $name token. - * - * @param string $name exactly as written in the RFC - * - * @return string - */ - public function getDefinition($name) - { - if (array_key_exists($name, self::$_grammar)) { - return self::$_grammar[$name]; - } - - throw new Swift_RfcComplianceException( - "No such grammar '".$name."' defined." - ); - } - - /** - * Returns the tokens defined in RFC 2822 (and some related RFCs). - * - * @return array - */ - public function getGrammarDefinitions() - { - return self::$_grammar; - } - - /** - * Returns the current special characters used in the syntax which need to be escaped. - * - * @return array - */ - public function getSpecials() - { - return self::$_specials; - } - - /** - * Escape special characters in a string (convert to quoted-pairs). - * - * @param string $token - * @param string[] $include additional chars to escape - * @param string[] $exclude chars from escaping - * - * @return string - */ - public function escapeSpecials($token, $include = array(), $exclude = array()) - { - foreach (array_merge(array('\\'), array_diff(self::$_specials, $exclude), $include) as $char) { - $token = str_replace($char, '\\'.$char, $token); - } - - return $token; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Header.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Header.php deleted file mode 100644 index a8ddd27..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Header.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A MIME Header. - * - * @author Chris Corbyn - */ -interface Swift_Mime_Header -{ - /** Text headers */ - const TYPE_TEXT = 2; - - /** headers (text + params) */ - const TYPE_PARAMETERIZED = 6; - - /** Mailbox and address headers */ - const TYPE_MAILBOX = 8; - - /** Date and time headers */ - const TYPE_DATE = 16; - - /** Identification headers */ - const TYPE_ID = 32; - - /** Address path headers */ - const TYPE_PATH = 64; - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType(); - - /** - * Set the model for the field body. - * - * The actual types needed will vary depending upon the type of Header. - * - * @param mixed $model - */ - public function setFieldBodyModel($model); - - /** - * Set the charset used when rendering the Header. - * - * @param string $charset - */ - public function setCharset($charset); - - /** - * Get the model for the field body. - * - * The return type depends on the specifics of the Header. - * - * @return mixed - */ - public function getFieldBodyModel(); - - /** - * Get the name of this header (e.g. Subject). - * - * The name is an identifier and as such will be immutable. - * - * @return string - */ - public function getFieldName(); - - /** - * Get the field body, prepared for folding into a final header value. - * - * @return string - */ - public function getFieldBody(); - - /** - * Get this Header rendered as a compliant string. - * - * @return string - */ - public function toString(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder.php deleted file mode 100644 index 08fd453..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Interface for all Header Encoding schemes. - * - * @author Chris Corbyn - */ -interface Swift_Mime_HeaderEncoder extends Swift_Encoder -{ - /** - * Get the MIME name of this content encoding scheme. - * - * @return string - */ - public function getName(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php deleted file mode 100644 index 83a4f2f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles Base64 (B) Header Encoding in Swift Mailer. - * - * @author Chris Corbyn - */ -class Swift_Mime_HeaderEncoder_Base64HeaderEncoder extends Swift_Encoder_Base64Encoder implements Swift_Mime_HeaderEncoder -{ - /** - * Get the name of this encoding scheme. - * Returns the string 'B'. - * - * @return string - */ - public function getName() - { - return 'B'; - } - - /** - * Takes an unencoded string and produces a Base64 encoded string from it. - * - * If the charset is iso-2022-jp, it uses mb_encode_mimeheader instead of - * default encodeString, otherwise pass to the parent method. - * - * @param string $string string to encode - * @param int $firstLineOffset - * @param int $maxLineLength optional, 0 indicates the default of 76 bytes - * @param string $charset - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0, $charset = 'utf-8') - { - if (strtolower($charset) === 'iso-2022-jp') { - $old = mb_internal_encoding(); - mb_internal_encoding('utf-8'); - $newstring = mb_encode_mimeheader($string, $charset, $this->getName(), "\r\n"); - mb_internal_encoding($old); - - return $newstring; - } - - return parent::encodeString($string, $firstLineOffset, $maxLineLength); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php deleted file mode 100644 index 510dd66..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles Quoted Printable (Q) Header Encoding in Swift Mailer. - * - * @author Chris Corbyn - */ -class Swift_Mime_HeaderEncoder_QpHeaderEncoder extends Swift_Encoder_QpEncoder implements Swift_Mime_HeaderEncoder -{ - /** - * Creates a new QpHeaderEncoder for the given CharacterStream. - * - * @param Swift_CharacterStream $charStream to use for reading characters - */ - public function __construct(Swift_CharacterStream $charStream) - { - parent::__construct($charStream); - } - - protected function initSafeMap() - { - foreach (array_merge( - range(0x61, 0x7A), range(0x41, 0x5A), - range(0x30, 0x39), array(0x20, 0x21, 0x2A, 0x2B, 0x2D, 0x2F) - ) as $byte) { - $this->_safeMap[$byte] = chr($byte); - } - } - - /** - * Get the name of this encoding scheme. - * - * Returns the string 'Q'. - * - * @return string - */ - public function getName() - { - return 'Q'; - } - - /** - * Takes an unencoded string and produces a QP encoded string from it. - * - * @param string $string string to encode - * @param int $firstLineOffset optional - * @param int $maxLineLength optional, 0 indicates the default of 76 chars - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - return str_replace(array(' ', '=20', "=\r\n"), array('_', '_', "\r\n"), - parent::encodeString($string, $firstLineOffset, $maxLineLength) - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderFactory.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderFactory.php deleted file mode 100644 index c65f26d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderFactory.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Creates MIME headers. - * - * @author Chris Corbyn - */ -interface Swift_Mime_HeaderFactory extends Swift_Mime_CharsetObserver -{ - /** - * Create a new Mailbox Header with a list of $addresses. - * - * @param string $name - * @param array|string $addresses - * - * @return Swift_Mime_Header - */ - public function createMailboxHeader($name, $addresses = null); - - /** - * Create a new Date header using $timestamp (UNIX time). - * - * @param string $name - * @param int $timestamp - * - * @return Swift_Mime_Header - */ - public function createDateHeader($name, $timestamp = null); - - /** - * Create a new basic text header with $name and $value. - * - * @param string $name - * @param string $value - * - * @return Swift_Mime_Header - */ - public function createTextHeader($name, $value = null); - - /** - * Create a new ParameterizedHeader with $name, $value and $params. - * - * @param string $name - * @param string $value - * @param array $params - * - * @return Swift_Mime_ParameterizedHeader - */ - public function createParameterizedHeader($name, $value = null, $params = array()); - - /** - * Create a new ID header for Message-ID or Content-ID. - * - * @param string $name - * @param string|array $ids - * - * @return Swift_Mime_Header - */ - public function createIdHeader($name, $ids = null); - - /** - * Create a new Path header with an address (path) in it. - * - * @param string $name - * @param string $path - * - * @return Swift_Mime_Header - */ - public function createPathHeader($name, $path = null); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderSet.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderSet.php deleted file mode 100644 index 1768709..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderSet.php +++ /dev/null @@ -1,169 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A collection of MIME headers. - * - * @author Chris Corbyn - */ -interface Swift_Mime_HeaderSet extends Swift_Mime_CharsetObserver -{ - /** - * Add a new Mailbox Header with a list of $addresses. - * - * @param string $name - * @param array|string $addresses - */ - public function addMailboxHeader($name, $addresses = null); - - /** - * Add a new Date header using $timestamp (UNIX time). - * - * @param string $name - * @param int $timestamp - */ - public function addDateHeader($name, $timestamp = null); - - /** - * Add a new basic text header with $name and $value. - * - * @param string $name - * @param string $value - */ - public function addTextHeader($name, $value = null); - - /** - * Add a new ParameterizedHeader with $name, $value and $params. - * - * @param string $name - * @param string $value - * @param array $params - */ - public function addParameterizedHeader($name, $value = null, $params = array()); - - /** - * Add a new ID header for Message-ID or Content-ID. - * - * @param string $name - * @param string|array $ids - */ - public function addIdHeader($name, $ids = null); - - /** - * Add a new Path header with an address (path) in it. - * - * @param string $name - * @param string $path - */ - public function addPathHeader($name, $path = null); - - /** - * Returns true if at least one header with the given $name exists. - * - * If multiple headers match, the actual one may be specified by $index. - * - * @param string $name - * @param int $index - * - * @return bool - */ - public function has($name, $index = 0); - - /** - * Set a header in the HeaderSet. - * - * The header may be a previously fetched header via {@link get()} or it may - * be one that has been created separately. - * - * If $index is specified, the header will be inserted into the set at this - * offset. - * - * @param Swift_Mime_Header $header - * @param int $index - */ - public function set(Swift_Mime_Header $header, $index = 0); - - /** - * Get the header with the given $name. - * If multiple headers match, the actual one may be specified by $index. - * Returns NULL if none present. - * - * @param string $name - * @param int $index - * - * @return Swift_Mime_Header - */ - public function get($name, $index = 0); - - /** - * Get all headers with the given $name. - * - * @param string $name - * - * @return array - */ - public function getAll($name = null); - - /** - * Return the name of all Headers. - * - * @return array - */ - public function listAll(); - - /** - * Remove the header with the given $name if it's set. - * - * If multiple headers match, the actual one may be specified by $index. - * - * @param string $name - * @param int $index - */ - public function remove($name, $index = 0); - - /** - * Remove all headers with the given $name. - * - * @param string $name - */ - public function removeAll($name); - - /** - * Create a new instance of this HeaderSet. - * - * @return self - */ - public function newInstance(); - - /** - * Define a list of Header names as an array in the correct order. - * - * These Headers will be output in the given order where present. - * - * @param array $sequence - */ - public function defineOrdering(array $sequence); - - /** - * Set a list of header names which must always be displayed when set. - * - * Usually headers without a field value won't be output unless set here. - * - * @param array $names - */ - public function setAlwaysDisplayed(array $names); - - /** - * Returns a string with a representation of all headers. - * - * @return string - */ - public function toString(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php deleted file mode 100644 index 3a6d7b3..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php +++ /dev/null @@ -1,501 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An abstract base MIME Header. - * - * @author Chris Corbyn - */ -abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header -{ - /** - * The name of this Header. - * - * @var string - */ - private $_name; - - /** - * The Grammar used for this Header. - * - * @var Swift_Mime_Grammar - */ - private $_grammar; - - /** - * The Encoder used to encode this Header. - * - * @var Swift_Encoder - */ - private $_encoder; - - /** - * The maximum length of a line in the header. - * - * @var int - */ - private $_lineLength = 78; - - /** - * The language used in this Header. - * - * @var string - */ - private $_lang; - - /** - * The character set of the text in this Header. - * - * @var string - */ - private $_charset = 'utf-8'; - - /** - * The value of this Header, cached. - * - * @var string - */ - private $_cachedValue = null; - - /** - * Creates a new Header. - * - * @param Swift_Mime_Grammar $grammar - */ - public function __construct(Swift_Mime_Grammar $grammar) - { - $this->setGrammar($grammar); - } - - /** - * Set the character set used in this Header. - * - * @param string $charset - */ - public function setCharset($charset) - { - $this->clearCachedValueIf($charset != $this->_charset); - $this->_charset = $charset; - if (isset($this->_encoder)) { - $this->_encoder->charsetChanged($charset); - } - } - - /** - * Get the character set used in this Header. - * - * @return string - */ - public function getCharset() - { - return $this->_charset; - } - - /** - * Set the language used in this Header. - * - * For example, for US English, 'en-us'. - * This can be unspecified. - * - * @param string $lang - */ - public function setLanguage($lang) - { - $this->clearCachedValueIf($this->_lang != $lang); - $this->_lang = $lang; - } - - /** - * Get the language used in this Header. - * - * @return string - */ - public function getLanguage() - { - return $this->_lang; - } - - /** - * Set the encoder used for encoding the header. - * - * @param Swift_Mime_HeaderEncoder $encoder - */ - public function setEncoder(Swift_Mime_HeaderEncoder $encoder) - { - $this->_encoder = $encoder; - $this->setCachedValue(null); - } - - /** - * Get the encoder used for encoding this Header. - * - * @return Swift_Mime_HeaderEncoder - */ - public function getEncoder() - { - return $this->_encoder; - } - - /** - * Set the grammar used for the header. - * - * @param Swift_Mime_Grammar $grammar - */ - public function setGrammar(Swift_Mime_Grammar $grammar) - { - $this->_grammar = $grammar; - $this->setCachedValue(null); - } - - /** - * Get the grammar used for this Header. - * - * @return Swift_Mime_Grammar - */ - public function getGrammar() - { - return $this->_grammar; - } - - /** - * Get the name of this header (e.g. charset). - * - * @return string - */ - public function getFieldName() - { - return $this->_name; - } - - /** - * Set the maximum length of lines in the header (excluding EOL). - * - * @param int $lineLength - */ - public function setMaxLineLength($lineLength) - { - $this->clearCachedValueIf($this->_lineLength != $lineLength); - $this->_lineLength = $lineLength; - } - - /** - * Get the maximum permitted length of lines in this Header. - * - * @return int - */ - public function getMaxLineLength() - { - return $this->_lineLength; - } - - /** - * Get this Header rendered as a RFC 2822 compliant string. - * - * @throws Swift_RfcComplianceException - * - * @return string - */ - public function toString() - { - return $this->_tokensToString($this->toTokens()); - } - - /** - * Returns a string representation of this object. - * - * @return string - * - * @see toString() - */ - public function __toString() - { - return $this->toString(); - } - - /** - * Set the name of this Header field. - * - * @param string $name - */ - protected function setFieldName($name) - { - $this->_name = $name; - } - - /** - * Produces a compliant, formatted RFC 2822 'phrase' based on the string given. - * - * @param Swift_Mime_Header $header - * @param string $string as displayed - * @param string $charset of the text - * @param Swift_Mime_HeaderEncoder $encoder - * @param bool $shorten the first line to make remove for header name - * - * @return string - */ - protected function createPhrase(Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder = null, $shorten = false) - { - // Treat token as exactly what was given - $phraseStr = $string; - // If it's not valid - if (!preg_match('/^'.$this->getGrammar()->getDefinition('phrase').'$/D', $phraseStr)) { - // .. but it is just ascii text, try escaping some characters - // and make it a quoted-string - if (preg_match('/^'.$this->getGrammar()->getDefinition('text').'*$/D', $phraseStr)) { - $phraseStr = $this->getGrammar()->escapeSpecials( - $phraseStr, array('"'), $this->getGrammar()->getSpecials() - ); - $phraseStr = '"'.$phraseStr.'"'; - } else { - // ... otherwise it needs encoding - // Determine space remaining on line if first line - if ($shorten) { - $usedLength = strlen($header->getFieldName().': '); - } else { - $usedLength = 0; - } - $phraseStr = $this->encodeWords($header, $string, $usedLength); - } - } - - return $phraseStr; - } - - /** - * Encode needed word tokens within a string of input. - * - * @param Swift_Mime_Header $header - * @param string $input - * @param string $usedLength optional - * - * @return string - */ - protected function encodeWords(Swift_Mime_Header $header, $input, $usedLength = -1) - { - $value = ''; - - $tokens = $this->getEncodableWordTokens($input); - - foreach ($tokens as $token) { - // See RFC 2822, Sect 2.2 (really 2.2 ??) - if ($this->tokenNeedsEncoding($token)) { - // Don't encode starting WSP - $firstChar = substr($token, 0, 1); - switch ($firstChar) { - case ' ': - case "\t": - $value .= $firstChar; - $token = substr($token, 1); - } - - if (-1 == $usedLength) { - $usedLength = strlen($header->getFieldName().': ') + strlen($value); - } - $value .= $this->getTokenAsEncodedWord($token, $usedLength); - - $header->setMaxLineLength(76); // Forcefully override - } else { - $value .= $token; - } - } - - return $value; - } - - /** - * Test if a token needs to be encoded or not. - * - * @param string $token - * - * @return bool - */ - protected function tokenNeedsEncoding($token) - { - return preg_match('~[\x00-\x08\x10-\x19\x7F-\xFF\r\n]~', $token); - } - - /** - * Splits a string into tokens in blocks of words which can be encoded quickly. - * - * @param string $string - * - * @return string[] - */ - protected function getEncodableWordTokens($string) - { - $tokens = array(); - - $encodedToken = ''; - // Split at all whitespace boundaries - foreach (preg_split('~(?=[\t ])~', $string) as $token) { - if ($this->tokenNeedsEncoding($token)) { - $encodedToken .= $token; - } else { - if (strlen($encodedToken) > 0) { - $tokens[] = $encodedToken; - $encodedToken = ''; - } - $tokens[] = $token; - } - } - if (strlen($encodedToken)) { - $tokens[] = $encodedToken; - } - - return $tokens; - } - - /** - * Get a token as an encoded word for safe insertion into headers. - * - * @param string $token token to encode - * @param int $firstLineOffset optional - * - * @return string - */ - protected function getTokenAsEncodedWord($token, $firstLineOffset = 0) - { - // Adjust $firstLineOffset to account for space needed for syntax - $charsetDecl = $this->_charset; - if (isset($this->_lang)) { - $charsetDecl .= '*'.$this->_lang; - } - $encodingWrapperLength = strlen( - '=?'.$charsetDecl.'?'.$this->_encoder->getName().'??=' - ); - - if ($firstLineOffset >= 75) { - //Does this logic need to be here? - $firstLineOffset = 0; - } - - $encodedTextLines = explode("\r\n", - $this->_encoder->encodeString( - $token, $firstLineOffset, 75 - $encodingWrapperLength, $this->_charset - ) - ); - - if (strtolower($this->_charset) !== 'iso-2022-jp') { - // special encoding for iso-2022-jp using mb_encode_mimeheader - foreach ($encodedTextLines as $lineNum => $line) { - $encodedTextLines[$lineNum] = '=?'.$charsetDecl. - '?'.$this->_encoder->getName(). - '?'.$line.'?='; - } - } - - return implode("\r\n ", $encodedTextLines); - } - - /** - * Generates tokens from the given string which include CRLF as individual tokens. - * - * @param string $token - * - * @return string[] - */ - protected function generateTokenLines($token) - { - return preg_split('~(\r\n)~', $token, -1, PREG_SPLIT_DELIM_CAPTURE); - } - - /** - * Set a value into the cache. - * - * @param string $value - */ - protected function setCachedValue($value) - { - $this->_cachedValue = $value; - } - - /** - * Get the value in the cache. - * - * @return string - */ - protected function getCachedValue() - { - return $this->_cachedValue; - } - - /** - * Clear the cached value if $condition is met. - * - * @param bool $condition - */ - protected function clearCachedValueIf($condition) - { - if ($condition) { - $this->setCachedValue(null); - } - } - - /** - * Generate a list of all tokens in the final header. - * - * @param string $string The string to tokenize - * - * @return array An array of tokens as strings - */ - protected function toTokens($string = null) - { - if (null === $string) { - $string = $this->getFieldBody(); - } - - $tokens = array(); - - // Generate atoms; split at all invisible boundaries followed by WSP - foreach (preg_split('~(?=[ \t])~', $string) as $token) { - $newTokens = $this->generateTokenLines($token); - foreach ($newTokens as $newToken) { - $tokens[] = $newToken; - } - } - - return $tokens; - } - - /** - * Takes an array of tokens which appear in the header and turns them into - * an RFC 2822 compliant string, adding FWSP where needed. - * - * @param string[] $tokens - * - * @return string - */ - private function _tokensToString(array $tokens) - { - $lineCount = 0; - $headerLines = array(); - $headerLines[] = $this->_name.': '; - $currentLine = &$headerLines[$lineCount++]; - - // Build all tokens back into compliant header - foreach ($tokens as $i => $token) { - // Line longer than specified maximum or token was just a new line - if (("\r\n" == $token) || - ($i > 0 && strlen($currentLine.$token) > $this->_lineLength) - && 0 < strlen($currentLine)) { - $headerLines[] = ''; - $currentLine = &$headerLines[$lineCount++]; - } - - // Append token to the line - if ("\r\n" != $token) { - $currentLine .= $token; - } - } - - // Implode with FWS (RFC 2822, 2.2.3) - return implode("\r\n", $headerLines)."\r\n"; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php deleted file mode 100644 index 4075cbf..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A Date MIME Header for Swift Mailer. - * - * @author Chris Corbyn - */ -class Swift_Mime_Headers_DateHeader extends Swift_Mime_Headers_AbstractHeader -{ - /** - * The UNIX timestamp value of this Header. - * - * @var int - */ - private $_timestamp; - - /** - * Creates a new DateHeader with $name and $timestamp. - * - * Example: - * <code> - * <?php - * $header = new Swift_Mime_Headers_DateHeader('Date', time()); - * ?> - * </code> - * - * @param string $name of Header - * @param Swift_Mime_Grammar $grammar - */ - public function __construct($name, Swift_Mime_Grammar $grammar) - { - $this->setFieldName($name); - parent::__construct($grammar); - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_DATE; - } - - /** - * Set the model for the field body. - * - * This method takes a UNIX timestamp. - * - * @param int $model - */ - public function setFieldBodyModel($model) - { - $this->setTimestamp($model); - } - - /** - * Get the model for the field body. - * - * This method returns a UNIX timestamp. - * - * @return mixed - */ - public function getFieldBodyModel() - { - return $this->getTimestamp(); - } - - /** - * Get the UNIX timestamp of the Date in this Header. - * - * @return int - */ - public function getTimestamp() - { - return $this->_timestamp; - } - - /** - * Set the UNIX timestamp of the Date in this Header. - * - * @param int $timestamp - */ - public function setTimestamp($timestamp) - { - if (null !== $timestamp) { - $timestamp = (int) $timestamp; - } - $this->clearCachedValueIf($this->_timestamp != $timestamp); - $this->_timestamp = $timestamp; - } - - /** - * Get the string value of the body in this Header. - * - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@link toString()} for that). - * - * @see toString() - * - * @return string - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - if (isset($this->_timestamp)) { - $this->setCachedValue(date('r', $this->_timestamp)); - } - } - - return $this->getCachedValue(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php deleted file mode 100644 index b114506..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php +++ /dev/null @@ -1,180 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An ID MIME Header for something like Message-ID or Content-ID. - * - * @author Chris Corbyn - */ -class Swift_Mime_Headers_IdentificationHeader extends Swift_Mime_Headers_AbstractHeader -{ - /** - * The IDs used in the value of this Header. - * - * This may hold multiple IDs or just a single ID. - * - * @var string[] - */ - private $_ids = array(); - - /** - * Creates a new IdentificationHeader with the given $name and $id. - * - * @param string $name - * @param Swift_Mime_Grammar $grammar - */ - public function __construct($name, Swift_Mime_Grammar $grammar) - { - $this->setFieldName($name); - parent::__construct($grammar); - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_ID; - } - - /** - * Set the model for the field body. - * - * This method takes a string ID, or an array of IDs. - * - * @param mixed $model - * - * @throws Swift_RfcComplianceException - */ - public function setFieldBodyModel($model) - { - $this->setId($model); - } - - /** - * Get the model for the field body. - * - * This method returns an array of IDs - * - * @return array - */ - public function getFieldBodyModel() - { - return $this->getIds(); - } - - /** - * Set the ID used in the value of this header. - * - * @param string|array $id - * - * @throws Swift_RfcComplianceException - */ - public function setId($id) - { - $this->setIds(is_array($id) ? $id : array($id)); - } - - /** - * Get the ID used in the value of this Header. - * - * If multiple IDs are set only the first is returned. - * - * @return string - */ - public function getId() - { - if (count($this->_ids) > 0) { - return $this->_ids[0]; - } - } - - /** - * Set a collection of IDs to use in the value of this Header. - * - * @param string[] $ids - * - * @throws Swift_RfcComplianceException - */ - public function setIds(array $ids) - { - $actualIds = array(); - - foreach ($ids as $id) { - $this->_assertValidId($id); - $actualIds[] = $id; - } - - $this->clearCachedValueIf($this->_ids != $actualIds); - $this->_ids = $actualIds; - } - - /** - * Get the list of IDs used in this Header. - * - * @return string[] - */ - public function getIds() - { - return $this->_ids; - } - - /** - * Get the string value of the body in this Header. - * - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@see toString()} for that). - * - * @see toString() - * - * @throws Swift_RfcComplianceException - * - * @return string - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - $angleAddrs = array(); - - foreach ($this->_ids as $id) { - $angleAddrs[] = '<'.$id.'>'; - } - - $this->setCachedValue(implode(' ', $angleAddrs)); - } - - return $this->getCachedValue(); - } - - /** - * Throws an Exception if the id passed does not comply with RFC 2822. - * - * @param string $id - * - * @throws Swift_RfcComplianceException - */ - private function _assertValidId($id) - { - if (!preg_match( - '/^'.$this->getGrammar()->getDefinition('id-left').'@'. - $this->getGrammar()->getDefinition('id-right').'$/D', - $id - )) { - throw new Swift_RfcComplianceException( - 'Invalid ID given <'.$id.'>' - ); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php deleted file mode 100644 index e4567fc..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php +++ /dev/null @@ -1,351 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A Mailbox Address MIME Header for something like From or Sender. - * - * @author Chris Corbyn - */ -class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader -{ - /** - * The mailboxes used in this Header. - * - * @var string[] - */ - private $_mailboxes = array(); - - /** - * Creates a new MailboxHeader with $name. - * - * @param string $name of Header - * @param Swift_Mime_HeaderEncoder $encoder - * @param Swift_Mime_Grammar $grammar - */ - public function __construct($name, Swift_Mime_HeaderEncoder $encoder, Swift_Mime_Grammar $grammar) - { - $this->setFieldName($name); - $this->setEncoder($encoder); - parent::__construct($grammar); - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_MAILBOX; - } - - /** - * Set the model for the field body. - * - * This method takes a string, or an array of addresses. - * - * @param mixed $model - * - * @throws Swift_RfcComplianceException - */ - public function setFieldBodyModel($model) - { - $this->setNameAddresses($model); - } - - /** - * Get the model for the field body. - * - * This method returns an associative array like {@link getNameAddresses()} - * - * @throws Swift_RfcComplianceException - * - * @return array - */ - public function getFieldBodyModel() - { - return $this->getNameAddresses(); - } - - /** - * Set a list of mailboxes to be shown in this Header. - * - * The mailboxes can be a simple array of addresses, or an array of - * key=>value pairs where (email => personalName). - * Example: - * <code> - * <?php - * //Sets two mailboxes in the Header, one with a personal name - * $header->setNameAddresses(array( - * 'chris@swiftmailer.org' => 'Chris Corbyn', - * 'mark@swiftmailer.org' //No associated personal name - * )); - * ?> - * </code> - * - * @see __construct() - * @see setAddresses() - * @see setValue() - * - * @param string|string[] $mailboxes - * - * @throws Swift_RfcComplianceException - */ - public function setNameAddresses($mailboxes) - { - $this->_mailboxes = $this->normalizeMailboxes((array) $mailboxes); - $this->setCachedValue(null); //Clear any cached value - } - - /** - * Get the full mailbox list of this Header as an array of valid RFC 2822 strings. - * - * Example: - * <code> - * <?php - * $header = new Swift_Mime_Headers_MailboxHeader('From', - * array('chris@swiftmailer.org' => 'Chris Corbyn', - * 'mark@swiftmailer.org' => 'Mark Corbyn') - * ); - * print_r($header->getNameAddressStrings()); - * // array ( - * // 0 => Chris Corbyn <chris@swiftmailer.org>, - * // 1 => Mark Corbyn <mark@swiftmailer.org> - * // ) - * ?> - * </code> - * - * @see getNameAddresses() - * @see toString() - * - * @throws Swift_RfcComplianceException - * - * @return string[] - */ - public function getNameAddressStrings() - { - return $this->_createNameAddressStrings($this->getNameAddresses()); - } - - /** - * Get all mailboxes in this Header as key=>value pairs. - * - * The key is the address and the value is the name (or null if none set). - * Example: - * <code> - * <?php - * $header = new Swift_Mime_Headers_MailboxHeader('From', - * array('chris@swiftmailer.org' => 'Chris Corbyn', - * 'mark@swiftmailer.org' => 'Mark Corbyn') - * ); - * print_r($header->getNameAddresses()); - * // array ( - * // chris@swiftmailer.org => Chris Corbyn, - * // mark@swiftmailer.org => Mark Corbyn - * // ) - * ?> - * </code> - * - * @see getAddresses() - * @see getNameAddressStrings() - * - * @return string[] - */ - public function getNameAddresses() - { - return $this->_mailboxes; - } - - /** - * Makes this Header represent a list of plain email addresses with no names. - * - * Example: - * <code> - * <?php - * //Sets three email addresses as the Header data - * $header->setAddresses( - * array('one@domain.tld', 'two@domain.tld', 'three@domain.tld') - * ); - * ?> - * </code> - * - * @see setNameAddresses() - * @see setValue() - * - * @param string[] $addresses - * - * @throws Swift_RfcComplianceException - */ - public function setAddresses($addresses) - { - $this->setNameAddresses(array_values((array) $addresses)); - } - - /** - * Get all email addresses in this Header. - * - * @see getNameAddresses() - * - * @return string[] - */ - public function getAddresses() - { - return array_keys($this->_mailboxes); - } - - /** - * Remove one or more addresses from this Header. - * - * @param string|string[] $addresses - */ - public function removeAddresses($addresses) - { - $this->setCachedValue(null); - foreach ((array) $addresses as $address) { - unset($this->_mailboxes[$address]); - } - } - - /** - * Get the string value of the body in this Header. - * - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@link toString()} for that). - * - * @see toString() - * - * @throws Swift_RfcComplianceException - * - * @return string - */ - public function getFieldBody() - { - // Compute the string value of the header only if needed - if (null === $this->getCachedValue()) { - $this->setCachedValue($this->createMailboxListString($this->_mailboxes)); - } - - return $this->getCachedValue(); - } - - /** - * Normalizes a user-input list of mailboxes into consistent key=>value pairs. - * - * @param string[] $mailboxes - * - * @return string[] - */ - protected function normalizeMailboxes(array $mailboxes) - { - $actualMailboxes = array(); - - foreach ($mailboxes as $key => $value) { - if (is_string($key)) { - //key is email addr - $address = $key; - $name = $value; - } else { - $address = $value; - $name = null; - } - $this->_assertValidAddress($address); - $actualMailboxes[$address] = $name; - } - - return $actualMailboxes; - } - - /** - * Produces a compliant, formatted display-name based on the string given. - * - * @param string $displayName as displayed - * @param bool $shorten the first line to make remove for header name - * - * @return string - */ - protected function createDisplayNameString($displayName, $shorten = false) - { - return $this->createPhrase($this, $displayName, $this->getCharset(), $this->getEncoder(), $shorten); - } - - /** - * Creates a string form of all the mailboxes in the passed array. - * - * @param string[] $mailboxes - * - * @throws Swift_RfcComplianceException - * - * @return string - */ - protected function createMailboxListString(array $mailboxes) - { - return implode(', ', $this->_createNameAddressStrings($mailboxes)); - } - - /** - * Redefine the encoding requirements for mailboxes. - * - * All "specials" must be encoded as the full header value will not be quoted - * - * @see RFC 2822 3.2.1 - * - * @param string $token - * - * @return bool - */ - protected function tokenNeedsEncoding($token) - { - return preg_match('/[()<>\[\]:;@\,."]/', $token) || parent::tokenNeedsEncoding($token); - } - - /** - * Return an array of strings conforming the the name-addr spec of RFC 2822. - * - * @param string[] $mailboxes - * - * @return string[] - */ - private function _createNameAddressStrings(array $mailboxes) - { - $strings = array(); - - foreach ($mailboxes as $email => $name) { - $mailboxStr = $email; - if (null !== $name) { - $nameStr = $this->createDisplayNameString($name, empty($strings)); - $mailboxStr = $nameStr.' <'.$mailboxStr.'>'; - } - $strings[] = $mailboxStr; - } - - return $strings; - } - - /** - * Throws an Exception if the address passed does not comply with RFC 2822. - * - * @param string $address - * - * @throws Swift_RfcComplianceException If invalid. - */ - private function _assertValidAddress($address) - { - if (!preg_match('/^'.$this->getGrammar()->getDefinition('addr-spec').'$/D', - $address)) { - throw new Swift_RfcComplianceException( - 'Address in mailbox given ['.$address. - '] does not comply with RFC 2822, 3.6.2.' - ); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php deleted file mode 100644 index d749550..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php +++ /dev/null @@ -1,133 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An OpenDKIM Specific Header using only raw header datas without encoding. - * - * @author De Cock Xavier <xdecock@gmail.com> - */ -class Swift_Mime_Headers_OpenDKIMHeader implements Swift_Mime_Header -{ - /** - * The value of this Header. - * - * @var string - */ - private $_value; - - /** - * The name of this Header. - * - * @var string - */ - private $_fieldName; - - /** - * @param string $name - */ - public function __construct($name) - { - $this->_fieldName = $name; - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_TEXT; - } - - /** - * Set the model for the field body. - * - * This method takes a string for the field value. - * - * @param string $model - */ - public function setFieldBodyModel($model) - { - $this->setValue($model); - } - - /** - * Get the model for the field body. - * - * This method returns a string. - * - * @return string - */ - public function getFieldBodyModel() - { - return $this->getValue(); - } - - /** - * Get the (unencoded) value of this header. - * - * @return string - */ - public function getValue() - { - return $this->_value; - } - - /** - * Set the (unencoded) value of this header. - * - * @param string $value - */ - public function setValue($value) - { - $this->_value = $value; - } - - /** - * Get the value of this header prepared for rendering. - * - * @return string - */ - public function getFieldBody() - { - return $this->_value; - } - - /** - * Get this Header rendered as a RFC 2822 compliant string. - * - * @return string - */ - public function toString() - { - return $this->_fieldName.': '.$this->_value; - } - - /** - * Set the Header FieldName. - * - * @see Swift_Mime_Header::getFieldName() - */ - public function getFieldName() - { - return $this->_fieldName; - } - - /** - * Ignored. - */ - public function setCharset($charset) - { - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php deleted file mode 100644 index c1777d3..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php +++ /dev/null @@ -1,258 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An abstract base MIME Header. - * - * @author Chris Corbyn - */ -class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_UnstructuredHeader implements Swift_Mime_ParameterizedHeader -{ - /** - * RFC 2231's definition of a token. - * - * @var string - */ - const TOKEN_REGEX = '(?:[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7E]+)'; - - /** - * The Encoder used to encode the parameters. - * - * @var Swift_Encoder - */ - private $_paramEncoder; - - /** - * The parameters as an associative array. - * - * @var string[] - */ - private $_params = array(); - - /** - * Creates a new ParameterizedHeader with $name. - * - * @param string $name - * @param Swift_Mime_HeaderEncoder $encoder - * @param Swift_Encoder $paramEncoder, optional - * @param Swift_Mime_Grammar $grammar - */ - public function __construct($name, Swift_Mime_HeaderEncoder $encoder, Swift_Encoder $paramEncoder = null, Swift_Mime_Grammar $grammar) - { - parent::__construct($name, $encoder, $grammar); - $this->_paramEncoder = $paramEncoder; - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_PARAMETERIZED; - } - - /** - * Set the character set used in this Header. - * - * @param string $charset - */ - public function setCharset($charset) - { - parent::setCharset($charset); - if (isset($this->_paramEncoder)) { - $this->_paramEncoder->charsetChanged($charset); - } - } - - /** - * Set the value of $parameter. - * - * @param string $parameter - * @param string $value - */ - public function setParameter($parameter, $value) - { - $this->setParameters(array_merge($this->getParameters(), array($parameter => $value))); - } - - /** - * Get the value of $parameter. - * - * @param string $parameter - * - * @return string - */ - public function getParameter($parameter) - { - $params = $this->getParameters(); - - return array_key_exists($parameter, $params) ? $params[$parameter] : null; - } - - /** - * Set an associative array of parameter names mapped to values. - * - * @param string[] $parameters - */ - public function setParameters(array $parameters) - { - $this->clearCachedValueIf($this->_params != $parameters); - $this->_params = $parameters; - } - - /** - * Returns an associative array of parameter names mapped to values. - * - * @return string[] - */ - public function getParameters() - { - return $this->_params; - } - - /** - * Get the value of this header prepared for rendering. - * - * @return string - */ - public function getFieldBody() //TODO: Check caching here - { - $body = parent::getFieldBody(); - foreach ($this->_params as $name => $value) { - if (null !== $value) { - // Add the parameter - $body .= '; '.$this->_createParameter($name, $value); - } - } - - return $body; - } - - /** - * Generate a list of all tokens in the final header. - * - * This doesn't need to be overridden in theory, but it is for implementation - * reasons to prevent potential breakage of attributes. - * - * @param string $string The string to tokenize - * - * @return array An array of tokens as strings - */ - protected function toTokens($string = null) - { - $tokens = parent::toTokens(parent::getFieldBody()); - - // Try creating any parameters - foreach ($this->_params as $name => $value) { - if (null !== $value) { - // Add the semi-colon separator - $tokens[count($tokens) - 1] .= ';'; - $tokens = array_merge($tokens, $this->generateTokenLines( - ' '.$this->_createParameter($name, $value) - )); - } - } - - return $tokens; - } - - /** - * Render a RFC 2047 compliant header parameter from the $name and $value. - * - * @param string $name - * @param string $value - * - * @return string - */ - private function _createParameter($name, $value) - { - $origValue = $value; - - $encoded = false; - // Allow room for parameter name, indices, "=" and DQUOTEs - $maxValueLength = $this->getMaxLineLength() - strlen($name.'=*N"";') - 1; - $firstLineOffset = 0; - - // If it's not already a valid parameter value... - if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { - // TODO: text, or something else?? - // ... and it's not ascii - if (!preg_match('/^'.$this->getGrammar()->getDefinition('text').'*$/D', $value)) { - $encoded = true; - // Allow space for the indices, charset and language - $maxValueLength = $this->getMaxLineLength() - strlen($name.'*N*="";') - 1; - $firstLineOffset = strlen( - $this->getCharset()."'".$this->getLanguage()."'" - ); - } - } - - // Encode if we need to - if ($encoded || strlen($value) > $maxValueLength) { - if (isset($this->_paramEncoder)) { - $value = $this->_paramEncoder->encodeString( - $origValue, $firstLineOffset, $maxValueLength, $this->getCharset() - ); - } else { - // We have to go against RFC 2183/2231 in some areas for interoperability - $value = $this->getTokenAsEncodedWord($origValue); - $encoded = false; - } - } - - $valueLines = isset($this->_paramEncoder) ? explode("\r\n", $value) : array($value); - - // Need to add indices - if (count($valueLines) > 1) { - $paramLines = array(); - foreach ($valueLines as $i => $line) { - $paramLines[] = $name.'*'.$i. - $this->_getEndOfParameterValue($line, true, $i == 0); - } - - return implode(";\r\n ", $paramLines); - } else { - return $name.$this->_getEndOfParameterValue( - $valueLines[0], $encoded, true - ); - } - } - - /** - * Returns the parameter value from the "=" and beyond. - * - * @param string $value to append - * @param bool $encoded - * @param bool $firstLine - * - * @return string - */ - private function _getEndOfParameterValue($value, $encoded = false, $firstLine = false) - { - if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { - $value = '"'.$value.'"'; - } - $prepend = '='; - if ($encoded) { - $prepend = '*='; - if ($firstLine) { - $prepend = '*='.$this->getCharset()."'".$this->getLanguage(). - "'"; - } - } - - return $prepend.$value; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php deleted file mode 100644 index 4a814b1..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php +++ /dev/null @@ -1,143 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A Path Header in Swift Mailer, such a Return-Path. - * - * @author Chris Corbyn - */ -class Swift_Mime_Headers_PathHeader extends Swift_Mime_Headers_AbstractHeader -{ - /** - * The address in this Header (if specified). - * - * @var string - */ - private $_address; - - /** - * Creates a new PathHeader with the given $name. - * - * @param string $name - * @param Swift_Mime_Grammar $grammar - */ - public function __construct($name, Swift_Mime_Grammar $grammar) - { - $this->setFieldName($name); - parent::__construct($grammar); - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_PATH; - } - - /** - * Set the model for the field body. - * This method takes a string for an address. - * - * @param string $model - * - * @throws Swift_RfcComplianceException - */ - public function setFieldBodyModel($model) - { - $this->setAddress($model); - } - - /** - * Get the model for the field body. - * This method returns a string email address. - * - * @return mixed - */ - public function getFieldBodyModel() - { - return $this->getAddress(); - } - - /** - * Set the Address which should appear in this Header. - * - * @param string $address - * - * @throws Swift_RfcComplianceException - */ - public function setAddress($address) - { - if (null === $address) { - $this->_address = null; - } elseif ('' == $address) { - $this->_address = ''; - } else { - $this->_assertValidAddress($address); - $this->_address = $address; - } - $this->setCachedValue(null); - } - - /** - * Get the address which is used in this Header (if any). - * - * Null is returned if no address is set. - * - * @return string - */ - public function getAddress() - { - return $this->_address; - } - - /** - * Get the string value of the body in this Header. - * - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@link toString()} for that). - * - * @see toString() - * - * @return string - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - if (isset($this->_address)) { - $this->setCachedValue('<'.$this->_address.'>'); - } - } - - return $this->getCachedValue(); - } - - /** - * Throws an Exception if the address passed does not comply with RFC 2822. - * - * @param string $address - * - * @throws Swift_RfcComplianceException If address is invalid - */ - private function _assertValidAddress($address) - { - if (!preg_match('/^'.$this->getGrammar()->getDefinition('addr-spec').'$/D', - $address)) { - throw new Swift_RfcComplianceException( - 'Address set in PathHeader does not comply with addr-spec of RFC 2822.' - ); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php deleted file mode 100644 index 86177f1..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A Simple MIME Header. - * - * @author Chris Corbyn - */ -class Swift_Mime_Headers_UnstructuredHeader extends Swift_Mime_Headers_AbstractHeader -{ - /** - * The value of this Header. - * - * @var string - */ - private $_value; - - /** - * Creates a new SimpleHeader with $name. - * - * @param string $name - * @param Swift_Mime_HeaderEncoder $encoder - * @param Swift_Mime_Grammar $grammar - */ - public function __construct($name, Swift_Mime_HeaderEncoder $encoder, Swift_Mime_Grammar $grammar) - { - $this->setFieldName($name); - $this->setEncoder($encoder); - parent::__construct($grammar); - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_TEXT; - } - - /** - * Set the model for the field body. - * - * This method takes a string for the field value. - * - * @param string $model - */ - public function setFieldBodyModel($model) - { - $this->setValue($model); - } - - /** - * Get the model for the field body. - * - * This method returns a string. - * - * @return string - */ - public function getFieldBodyModel() - { - return $this->getValue(); - } - - /** - * Get the (unencoded) value of this header. - * - * @return string - */ - public function getValue() - { - return $this->_value; - } - - /** - * Set the (unencoded) value of this header. - * - * @param string $value - */ - public function setValue($value) - { - $this->clearCachedValueIf($this->_value != $value); - $this->_value = $value; - } - - /** - * Get the value of this header prepared for rendering. - * - * @return string - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - $this->setCachedValue( - $this->encodeWords($this, $this->_value) - ); - } - - return $this->getCachedValue(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Message.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Message.php deleted file mode 100644 index 9b36d21..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Message.php +++ /dev/null @@ -1,223 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A Message (RFC 2822) object. - * - * @author Chris Corbyn - */ -interface Swift_Mime_Message extends Swift_Mime_MimeEntity -{ - /** - * Generates a valid Message-ID and switches to it. - * - * @return string - */ - public function generateId(); - - /** - * Set the subject of the message. - * - * @param string $subject - */ - public function setSubject($subject); - - /** - * Get the subject of the message. - * - * @return string - */ - public function getSubject(); - - /** - * Set the origination date of the message as a UNIX timestamp. - * - * @param int $date - */ - public function setDate($date); - - /** - * Get the origination date of the message as a UNIX timestamp. - * - * @return int - */ - public function getDate(); - - /** - * Set the return-path (bounce-detect) address. - * - * @param string $address - */ - public function setReturnPath($address); - - /** - * Get the return-path (bounce-detect) address. - * - * @return string - */ - public function getReturnPath(); - - /** - * Set the sender of this message. - * - * If multiple addresses are present in the From field, this SHOULD be set. - * - * According to RFC 2822 it is a requirement when there are multiple From - * addresses, but Swift itself does not require it directly. - * - * An associative array (with one element!) can be used to provide a display- - * name: i.e. array('email@address' => 'Real Name'). - * - * If the second parameter is provided and the first is a string, then $name - * is associated with the address. - * - * @param mixed $address - * @param string $name optional - */ - public function setSender($address, $name = null); - - /** - * Get the sender address for this message. - * - * This has a higher significance than the From address. - * - * @return string - */ - public function getSender(); - - /** - * Set the From address of this message. - * - * It is permissible for multiple From addresses to be set using an array. - * - * If multiple From addresses are used, you SHOULD set the Sender address and - * according to RFC 2822, MUST set the sender address. - * - * An array can be used if display names are to be provided: i.e. - * array('email@address.com' => 'Real Name'). - * - * If the second parameter is provided and the first is a string, then $name - * is associated with the address. - * - * @param mixed $addresses - * @param string $name optional - */ - public function setFrom($addresses, $name = null); - - /** - * Get the From address(es) of this message. - * - * This method always returns an associative array where the keys are the - * addresses. - * - * @return string[] - */ - public function getFrom(); - - /** - * Set the Reply-To address(es). - * - * Any replies from the receiver will be sent to this address. - * - * It is permissible for multiple reply-to addresses to be set using an array. - * - * This method has the same synopsis as {@link setFrom()} and {@link setTo()}. - * - * If the second parameter is provided and the first is a string, then $name - * is associated with the address. - * - * @param mixed $addresses - * @param string $name optional - */ - public function setReplyTo($addresses, $name = null); - - /** - * Get the Reply-To addresses for this message. - * - * This method always returns an associative array where the keys provide the - * email addresses. - * - * @return string[] - */ - public function getReplyTo(); - - /** - * Set the To address(es). - * - * Recipients set in this field will receive a copy of this message. - * - * This method has the same synopsis as {@link setFrom()} and {@link setCc()}. - * - * If the second parameter is provided and the first is a string, then $name - * is associated with the address. - * - * @param mixed $addresses - * @param string $name optional - */ - public function setTo($addresses, $name = null); - - /** - * Get the To addresses for this message. - * - * This method always returns an associative array, whereby the keys provide - * the actual email addresses. - * - * @return string[] - */ - public function getTo(); - - /** - * Set the Cc address(es). - * - * Recipients set in this field will receive a 'carbon-copy' of this message. - * - * This method has the same synopsis as {@link setFrom()} and {@link setTo()}. - * - * @param mixed $addresses - * @param string $name optional - */ - public function setCc($addresses, $name = null); - - /** - * Get the Cc addresses for this message. - * - * This method always returns an associative array, whereby the keys provide - * the actual email addresses. - * - * @return string[] - */ - public function getCc(); - - /** - * Set the Bcc address(es). - * - * Recipients set in this field will receive a 'blind-carbon-copy' of this - * message. - * - * In other words, they will get the message, but any other recipients of the - * message will have no such knowledge of their receipt of it. - * - * This method has the same synopsis as {@link setFrom()} and {@link setTo()}. - * - * @param mixed $addresses - * @param string $name optional - */ - public function setBcc($addresses, $name = null); - - /** - * Get the Bcc addresses for this message. - * - * This method always returns an associative array, whereby the keys provide - * the actual email addresses. - * - * @return string[] - */ - public function getBcc(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimeEntity.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimeEntity.php deleted file mode 100644 index 30f460c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimeEntity.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A MIME entity, such as an attachment. - * - * @author Chris Corbyn - */ -interface Swift_Mime_MimeEntity extends Swift_Mime_CharsetObserver, Swift_Mime_EncodingObserver -{ - /** Main message document; there can only be one of these */ - const LEVEL_TOP = 16; - - /** An entity which nests with the same precedence as an attachment */ - const LEVEL_MIXED = 256; - - /** An entity which nests with the same precedence as a mime part */ - const LEVEL_ALTERNATIVE = 4096; - - /** An entity which nests with the same precedence as embedded content */ - const LEVEL_RELATED = 65536; - - /** - * Get the level at which this entity shall be nested in final document. - * - * The lower the value, the more outermost the entity will be nested. - * - * @see LEVEL_TOP, LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE - * - * @return int - */ - public function getNestingLevel(); - - /** - * Get the qualified content-type of this mime entity. - * - * @return string - */ - public function getContentType(); - - /** - * Returns a unique ID for this entity. - * - * For most entities this will likely be the Content-ID, though it has - * no explicit semantic meaning and can be considered an identifier for - * programming logic purposes. - * - * If a Content-ID header is present, this value SHOULD match the value of - * the header. - * - * @return string - */ - public function getId(); - - /** - * Get all children nested inside this entity. - * - * These are not just the immediate children, but all children. - * - * @return Swift_Mime_MimeEntity[] - */ - public function getChildren(); - - /** - * Set all children nested inside this entity. - * - * This includes grandchildren. - * - * @param Swift_Mime_MimeEntity[] $children - */ - public function setChildren(array $children); - - /** - * Get the collection of Headers in this Mime entity. - * - * @return Swift_Mime_HeaderSet - */ - public function getHeaders(); - - /** - * Get the body content of this entity as a string. - * - * Returns NULL if no body has been set. - * - * @return string|null - */ - public function getBody(); - - /** - * Set the body content of this entity as a string. - * - * @param string $body - * @param string $contentType optional - */ - public function setBody($body, $contentType = null); - - /** - * Get this entire entity in its string form. - * - * @return string - */ - public function toString(); - - /** - * Get this entire entity as a ByteStream. - * - * @param Swift_InputByteStream $is to write to - */ - public function toByteStream(Swift_InputByteStream $is); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php deleted file mode 100644 index 4564fef..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php +++ /dev/null @@ -1,212 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A MIME part, in a multipart message. - * - * @author Chris Corbyn - */ -class Swift_Mime_MimePart extends Swift_Mime_SimpleMimeEntity -{ - /** The format parameter last specified by the user */ - protected $_userFormat; - - /** The charset last specified by the user */ - protected $_userCharset; - - /** The delsp parameter last specified by the user */ - protected $_userDelSp; - - /** The nesting level of this MimePart */ - private $_nestingLevel = self::LEVEL_ALTERNATIVE; - - /** - * Create a new MimePart with $headers, $encoder and $cache. - * - * @param Swift_Mime_HeaderSet $headers - * @param Swift_Mime_ContentEncoder $encoder - * @param Swift_KeyCache $cache - * @param Swift_Mime_Grammar $grammar - * @param string $charset - */ - public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $charset = null) - { - parent::__construct($headers, $encoder, $cache, $grammar); - $this->setContentType('text/plain'); - if (null !== $charset) { - $this->setCharset($charset); - } - } - - /** - * Set the body of this entity, either as a string, or as an instance of - * {@link Swift_OutputByteStream}. - * - * @param mixed $body - * @param string $contentType optional - * @param string $charset optional - * - * @return $this - */ - public function setBody($body, $contentType = null, $charset = null) - { - if (isset($charset)) { - $this->setCharset($charset); - } - $body = $this->_convertString($body); - - parent::setBody($body, $contentType); - - return $this; - } - - /** - * Get the character set of this entity. - * - * @return string - */ - public function getCharset() - { - return $this->_getHeaderParameter('Content-Type', 'charset'); - } - - /** - * Set the character set of this entity. - * - * @param string $charset - * - * @return $this - */ - public function setCharset($charset) - { - $this->_setHeaderParameter('Content-Type', 'charset', $charset); - if ($charset !== $this->_userCharset) { - $this->_clearCache(); - } - $this->_userCharset = $charset; - parent::charsetChanged($charset); - - return $this; - } - - /** - * Get the format of this entity (i.e. flowed or fixed). - * - * @return string - */ - public function getFormat() - { - return $this->_getHeaderParameter('Content-Type', 'format'); - } - - /** - * Set the format of this entity (flowed or fixed). - * - * @param string $format - * - * @return $this - */ - public function setFormat($format) - { - $this->_setHeaderParameter('Content-Type', 'format', $format); - $this->_userFormat = $format; - - return $this; - } - - /** - * Test if delsp is being used for this entity. - * - * @return bool - */ - public function getDelSp() - { - return 'yes' == $this->_getHeaderParameter('Content-Type', 'delsp') ? true : false; - } - - /** - * Turn delsp on or off for this entity. - * - * @param bool $delsp - * - * @return $this - */ - public function setDelSp($delsp = true) - { - $this->_setHeaderParameter('Content-Type', 'delsp', $delsp ? 'yes' : null); - $this->_userDelSp = $delsp; - - return $this; - } - - /** - * Get the nesting level of this entity. - * - * @see LEVEL_TOP, LEVEL_ALTERNATIVE, LEVEL_MIXED, LEVEL_RELATED - * - * @return int - */ - public function getNestingLevel() - { - return $this->_nestingLevel; - } - - /** - * Receive notification that the charset has changed on this document, or a - * parent document. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->setCharset($charset); - } - - /** Fix the content-type and encoding of this entity */ - protected function _fixHeaders() - { - parent::_fixHeaders(); - if (count($this->getChildren())) { - $this->_setHeaderParameter('Content-Type', 'charset', null); - $this->_setHeaderParameter('Content-Type', 'format', null); - $this->_setHeaderParameter('Content-Type', 'delsp', null); - } else { - $this->setCharset($this->_userCharset); - $this->setFormat($this->_userFormat); - $this->setDelSp($this->_userDelSp); - } - } - - /** Set the nesting level of this entity */ - protected function _setNestingLevel($level) - { - $this->_nestingLevel = $level; - } - - /** Encode charset when charset is not utf-8 */ - protected function _convertString($string) - { - $charset = strtolower($this->getCharset()); - if (!in_array($charset, array('utf-8', 'iso-8859-1', 'iso-8859-15', ''))) { - // mb_convert_encoding must be the first one to check, since iconv cannot convert some words. - if (function_exists('mb_convert_encoding')) { - $string = mb_convert_encoding($string, $charset, 'utf-8'); - } elseif (function_exists('iconv')) { - $string = iconv('utf-8//TRANSLIT//IGNORE', $charset, $string); - } else { - throw new Swift_SwiftException('No suitable convert encoding function (use UTF-8 as your charset or install the mbstring or iconv extension).'); - } - - return $string; - } - - return $string; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ParameterizedHeader.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ParameterizedHeader.php deleted file mode 100644 index e15c6ef..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ParameterizedHeader.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A MIME Header with parameters. - * - * @author Chris Corbyn - */ -interface Swift_Mime_ParameterizedHeader extends Swift_Mime_Header -{ - /** - * Set the value of $parameter. - * - * @param string $parameter - * @param string $value - */ - public function setParameter($parameter, $value); - - /** - * Get the value of $parameter. - * - * @param string $parameter - * - * @return string - */ - public function getParameter($parameter); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php deleted file mode 100644 index 1ca504e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php +++ /dev/null @@ -1,193 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Creates MIME headers. - * - * @author Chris Corbyn - */ -class Swift_Mime_SimpleHeaderFactory implements Swift_Mime_HeaderFactory -{ - /** The HeaderEncoder used by these headers */ - private $_encoder; - - /** The Encoder used by parameters */ - private $_paramEncoder; - - /** The Grammar */ - private $_grammar; - - /** The charset of created Headers */ - private $_charset; - - /** - * Creates a new SimpleHeaderFactory using $encoder and $paramEncoder. - * - * @param Swift_Mime_HeaderEncoder $encoder - * @param Swift_Encoder $paramEncoder - * @param Swift_Mime_Grammar $grammar - * @param string|null $charset - */ - public function __construct(Swift_Mime_HeaderEncoder $encoder, Swift_Encoder $paramEncoder, Swift_Mime_Grammar $grammar, $charset = null) - { - $this->_encoder = $encoder; - $this->_paramEncoder = $paramEncoder; - $this->_grammar = $grammar; - $this->_charset = $charset; - } - - /** - * Create a new Mailbox Header with a list of $addresses. - * - * @param string $name - * @param array|string|null $addresses - * - * @return Swift_Mime_Header - */ - public function createMailboxHeader($name, $addresses = null) - { - $header = new Swift_Mime_Headers_MailboxHeader($name, $this->_encoder, $this->_grammar); - if (isset($addresses)) { - $header->setFieldBodyModel($addresses); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Create a new Date header using $timestamp (UNIX time). - * - * @param string $name - * @param int|null $timestamp - * - * @return Swift_Mime_Header - */ - public function createDateHeader($name, $timestamp = null) - { - $header = new Swift_Mime_Headers_DateHeader($name, $this->_grammar); - if (isset($timestamp)) { - $header->setFieldBodyModel($timestamp); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Create a new basic text header with $name and $value. - * - * @param string $name - * @param string $value - * - * @return Swift_Mime_Header - */ - public function createTextHeader($name, $value = null) - { - $header = new Swift_Mime_Headers_UnstructuredHeader($name, $this->_encoder, $this->_grammar); - if (isset($value)) { - $header->setFieldBodyModel($value); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Create a new ParameterizedHeader with $name, $value and $params. - * - * @param string $name - * @param string $value - * @param array $params - * - * @return Swift_Mime_ParameterizedHeader - */ - public function createParameterizedHeader($name, $value = null, - $params = array()) - { - $header = new Swift_Mime_Headers_ParameterizedHeader($name, $this->_encoder, strtolower($name) == 'content-disposition' ? $this->_paramEncoder : null, $this->_grammar); - if (isset($value)) { - $header->setFieldBodyModel($value); - } - foreach ($params as $k => $v) { - $header->setParameter($k, $v); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Create a new ID header for Message-ID or Content-ID. - * - * @param string $name - * @param string|array $ids - * - * @return Swift_Mime_Header - */ - public function createIdHeader($name, $ids = null) - { - $header = new Swift_Mime_Headers_IdentificationHeader($name, $this->_grammar); - if (isset($ids)) { - $header->setFieldBodyModel($ids); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Create a new Path header with an address (path) in it. - * - * @param string $name - * @param string $path - * - * @return Swift_Mime_Header - */ - public function createPathHeader($name, $path = null) - { - $header = new Swift_Mime_Headers_PathHeader($name, $this->_grammar); - if (isset($path)) { - $header->setFieldBodyModel($path); - } - $this->_setHeaderCharset($header); - - return $header; - } - - /** - * Notify this observer that the entity's charset has changed. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->_charset = $charset; - $this->_encoder->charsetChanged($charset); - $this->_paramEncoder->charsetChanged($charset); - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->_encoder = clone $this->_encoder; - $this->_paramEncoder = clone $this->_paramEncoder; - } - - /** Apply the charset to the Header */ - private function _setHeaderCharset(Swift_Mime_Header $header) - { - if (isset($this->_charset)) { - $header->setCharset($this->_charset); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php deleted file mode 100644 index a06ce72..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php +++ /dev/null @@ -1,414 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A collection of MIME headers. - * - * @author Chris Corbyn - */ -class Swift_Mime_SimpleHeaderSet implements Swift_Mime_HeaderSet -{ - /** HeaderFactory */ - private $_factory; - - /** Collection of set Headers */ - private $_headers = array(); - - /** Field ordering details */ - private $_order = array(); - - /** List of fields which are required to be displayed */ - private $_required = array(); - - /** The charset used by Headers */ - private $_charset; - - /** - * Create a new SimpleHeaderSet with the given $factory. - * - * @param Swift_Mime_HeaderFactory $factory - * @param string $charset - */ - public function __construct(Swift_Mime_HeaderFactory $factory, $charset = null) - { - $this->_factory = $factory; - if (isset($charset)) { - $this->setCharset($charset); - } - } - - /** - * Set the charset used by these headers. - * - * @param string $charset - */ - public function setCharset($charset) - { - $this->_charset = $charset; - $this->_factory->charsetChanged($charset); - $this->_notifyHeadersOfCharset($charset); - } - - /** - * Add a new Mailbox Header with a list of $addresses. - * - * @param string $name - * @param array|string $addresses - */ - public function addMailboxHeader($name, $addresses = null) - { - $this->_storeHeader($name, - $this->_factory->createMailboxHeader($name, $addresses)); - } - - /** - * Add a new Date header using $timestamp (UNIX time). - * - * @param string $name - * @param int $timestamp - */ - public function addDateHeader($name, $timestamp = null) - { - $this->_storeHeader($name, - $this->_factory->createDateHeader($name, $timestamp)); - } - - /** - * Add a new basic text header with $name and $value. - * - * @param string $name - * @param string $value - */ - public function addTextHeader($name, $value = null) - { - $this->_storeHeader($name, - $this->_factory->createTextHeader($name, $value)); - } - - /** - * Add a new ParameterizedHeader with $name, $value and $params. - * - * @param string $name - * @param string $value - * @param array $params - */ - public function addParameterizedHeader($name, $value = null, $params = array()) - { - $this->_storeHeader($name, $this->_factory->createParameterizedHeader($name, $value, $params)); - } - - /** - * Add a new ID header for Message-ID or Content-ID. - * - * @param string $name - * @param string|array $ids - */ - public function addIdHeader($name, $ids = null) - { - $this->_storeHeader($name, $this->_factory->createIdHeader($name, $ids)); - } - - /** - * Add a new Path header with an address (path) in it. - * - * @param string $name - * @param string $path - */ - public function addPathHeader($name, $path = null) - { - $this->_storeHeader($name, $this->_factory->createPathHeader($name, $path)); - } - - /** - * Returns true if at least one header with the given $name exists. - * - * If multiple headers match, the actual one may be specified by $index. - * - * @param string $name - * @param int $index - * - * @return bool - */ - public function has($name, $index = 0) - { - $lowerName = strtolower($name); - - if (!array_key_exists($lowerName, $this->_headers)) { - return false; - } - - if (func_num_args() < 2) { - // index was not specified, so we only need to check that there is at least one header value set - return (bool) count($this->_headers[$lowerName]); - } - - return array_key_exists($index, $this->_headers[$lowerName]); - } - - /** - * Set a header in the HeaderSet. - * - * The header may be a previously fetched header via {@link get()} or it may - * be one that has been created separately. - * - * If $index is specified, the header will be inserted into the set at this - * offset. - * - * @param Swift_Mime_Header $header - * @param int $index - */ - public function set(Swift_Mime_Header $header, $index = 0) - { - $this->_storeHeader($header->getFieldName(), $header, $index); - } - - /** - * Get the header with the given $name. - * - * If multiple headers match, the actual one may be specified by $index. - * Returns NULL if none present. - * - * @param string $name - * @param int $index - * - * @return Swift_Mime_Header - */ - public function get($name, $index = 0) - { - $name = strtolower($name); - - if (func_num_args() < 2) { - if ($this->has($name)) { - $values = array_values($this->_headers[$name]); - - return array_shift($values); - } - } else { - if ($this->has($name, $index)) { - return $this->_headers[$name][$index]; - } - } - } - - /** - * Get all headers with the given $name. - * - * @param string $name - * - * @return array - */ - public function getAll($name = null) - { - if (!isset($name)) { - $headers = array(); - foreach ($this->_headers as $collection) { - $headers = array_merge($headers, $collection); - } - - return $headers; - } - - $lowerName = strtolower($name); - if (!array_key_exists($lowerName, $this->_headers)) { - return array(); - } - - return $this->_headers[$lowerName]; - } - - /** - * Return the name of all Headers. - * - * @return array - */ - public function listAll() - { - $headers = $this->_headers; - if ($this->_canSort()) { - uksort($headers, array($this, '_sortHeaders')); - } - - return array_keys($headers); - } - - /** - * Remove the header with the given $name if it's set. - * - * If multiple headers match, the actual one may be specified by $index. - * - * @param string $name - * @param int $index - */ - public function remove($name, $index = 0) - { - $lowerName = strtolower($name); - unset($this->_headers[$lowerName][$index]); - } - - /** - * Remove all headers with the given $name. - * - * @param string $name - */ - public function removeAll($name) - { - $lowerName = strtolower($name); - unset($this->_headers[$lowerName]); - } - - /** - * Create a new instance of this HeaderSet. - * - * @return self - */ - public function newInstance() - { - return new self($this->_factory); - } - - /** - * Define a list of Header names as an array in the correct order. - * - * These Headers will be output in the given order where present. - * - * @param array $sequence - */ - public function defineOrdering(array $sequence) - { - $this->_order = array_flip(array_map('strtolower', $sequence)); - } - - /** - * Set a list of header names which must always be displayed when set. - * - * Usually headers without a field value won't be output unless set here. - * - * @param array $names - */ - public function setAlwaysDisplayed(array $names) - { - $this->_required = array_flip(array_map('strtolower', $names)); - } - - /** - * Notify this observer that the entity's charset has changed. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->setCharset($charset); - } - - /** - * Returns a string with a representation of all headers. - * - * @return string - */ - public function toString() - { - $string = ''; - $headers = $this->_headers; - if ($this->_canSort()) { - uksort($headers, array($this, '_sortHeaders')); - } - foreach ($headers as $collection) { - foreach ($collection as $header) { - if ($this->_isDisplayed($header) || $header->getFieldBody() != '') { - $string .= $header->toString(); - } - } - } - - return $string; - } - - /** - * Returns a string representation of this object. - * - * @return string - * - * @see toString() - */ - public function __toString() - { - return $this->toString(); - } - - /** Save a Header to the internal collection */ - private function _storeHeader($name, Swift_Mime_Header $header, $offset = null) - { - if (!isset($this->_headers[strtolower($name)])) { - $this->_headers[strtolower($name)] = array(); - } - if (!isset($offset)) { - $this->_headers[strtolower($name)][] = $header; - } else { - $this->_headers[strtolower($name)][$offset] = $header; - } - } - - /** Test if the headers can be sorted */ - private function _canSort() - { - return count($this->_order) > 0; - } - - /** uksort() algorithm for Header ordering */ - private function _sortHeaders($a, $b) - { - $lowerA = strtolower($a); - $lowerB = strtolower($b); - $aPos = array_key_exists($lowerA, $this->_order) ? $this->_order[$lowerA] : -1; - $bPos = array_key_exists($lowerB, $this->_order) ? $this->_order[$lowerB] : -1; - - if (-1 === $aPos && -1 === $bPos) { - // just be sure to be determinist here - return $a > $b ? -1 : 1; - } - - if ($aPos == -1) { - return 1; - } elseif ($bPos == -1) { - return -1; - } - - return $aPos < $bPos ? -1 : 1; - } - - /** Test if the given Header is always displayed */ - private function _isDisplayed(Swift_Mime_Header $header) - { - return array_key_exists(strtolower($header->getFieldName()), $this->_required); - } - - /** Notify all Headers of the new charset */ - private function _notifyHeadersOfCharset($charset) - { - foreach ($this->_headers as $headerGroup) { - foreach ($headerGroup as $header) { - $header->setCharset($charset); - } - } - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->_factory = clone $this->_factory; - foreach ($this->_headers as $groupKey => $headerGroup) { - foreach ($headerGroup as $key => $header) { - $this->_headers[$groupKey][$key] = clone $header; - } - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php deleted file mode 100644 index 72d40ce..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php +++ /dev/null @@ -1,655 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * The default email message class. - * - * @author Chris Corbyn - */ -class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime_Message -{ - const PRIORITY_HIGHEST = 1; - const PRIORITY_HIGH = 2; - const PRIORITY_NORMAL = 3; - const PRIORITY_LOW = 4; - const PRIORITY_LOWEST = 5; - - /** - * Create a new SimpleMessage with $headers, $encoder and $cache. - * - * @param Swift_Mime_HeaderSet $headers - * @param Swift_Mime_ContentEncoder $encoder - * @param Swift_KeyCache $cache - * @param Swift_Mime_Grammar $grammar - * @param string $charset - */ - public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $charset = null) - { - parent::__construct($headers, $encoder, $cache, $grammar, $charset); - $this->getHeaders()->defineOrdering(array( - 'Return-Path', - 'Received', - 'DKIM-Signature', - 'DomainKey-Signature', - 'Sender', - 'Message-ID', - 'Date', - 'Subject', - 'From', - 'Reply-To', - 'To', - 'Cc', - 'Bcc', - 'MIME-Version', - 'Content-Type', - 'Content-Transfer-Encoding', - )); - $this->getHeaders()->setAlwaysDisplayed(array('Date', 'Message-ID', 'From')); - $this->getHeaders()->addTextHeader('MIME-Version', '1.0'); - $this->setDate(time()); - $this->setId($this->getId()); - $this->getHeaders()->addMailboxHeader('From'); - } - - /** - * Always returns {@link LEVEL_TOP} for a message instance. - * - * @return int - */ - public function getNestingLevel() - { - return self::LEVEL_TOP; - } - - /** - * Set the subject of this message. - * - * @param string $subject - * - * @return $this - */ - public function setSubject($subject) - { - if (!$this->_setHeaderFieldModel('Subject', $subject)) { - $this->getHeaders()->addTextHeader('Subject', $subject); - } - - return $this; - } - - /** - * Get the subject of this message. - * - * @return string - */ - public function getSubject() - { - return $this->_getHeaderFieldModel('Subject'); - } - - /** - * Set the date at which this message was created. - * - * @param int $date - * - * @return $this - */ - public function setDate($date) - { - if (!$this->_setHeaderFieldModel('Date', $date)) { - $this->getHeaders()->addDateHeader('Date', $date); - } - - return $this; - } - - /** - * Get the date at which this message was created. - * - * @return int - */ - public function getDate() - { - return $this->_getHeaderFieldModel('Date'); - } - - /** - * Set the return-path (the bounce address) of this message. - * - * @param string $address - * - * @return $this - */ - public function setReturnPath($address) - { - if (!$this->_setHeaderFieldModel('Return-Path', $address)) { - $this->getHeaders()->addPathHeader('Return-Path', $address); - } - - return $this; - } - - /** - * Get the return-path (bounce address) of this message. - * - * @return string - */ - public function getReturnPath() - { - return $this->_getHeaderFieldModel('Return-Path'); - } - - /** - * Set the sender of this message. - * - * This does not override the From field, but it has a higher significance. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function setSender($address, $name = null) - { - if (!is_array($address) && isset($name)) { - $address = array($address => $name); - } - - if (!$this->_setHeaderFieldModel('Sender', (array) $address)) { - $this->getHeaders()->addMailboxHeader('Sender', (array) $address); - } - - return $this; - } - - /** - * Get the sender of this message. - * - * @return string - */ - public function getSender() - { - return $this->_getHeaderFieldModel('Sender'); - } - - /** - * Add a From: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function addFrom($address, $name = null) - { - $current = $this->getFrom(); - $current[$address] = $name; - - return $this->setFrom($current); - } - - /** - * Set the from address of this message. - * - * You may pass an array of addresses if this message is from multiple people. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param string|array $addresses - * @param string $name optional - * - * @return $this - */ - public function setFrom($addresses, $name = null) - { - if (!is_array($addresses) && isset($name)) { - $addresses = array($addresses => $name); - } - - if (!$this->_setHeaderFieldModel('From', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('From', (array) $addresses); - } - - return $this; - } - - /** - * Get the from address of this message. - * - * @return mixed - */ - public function getFrom() - { - return $this->_getHeaderFieldModel('From'); - } - - /** - * Add a Reply-To: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function addReplyTo($address, $name = null) - { - $current = $this->getReplyTo(); - $current[$address] = $name; - - return $this->setReplyTo($current); - } - - /** - * Set the reply-to address of this message. - * - * You may pass an array of addresses if replies will go to multiple people. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param mixed $addresses - * @param string $name optional - * - * @return $this - */ - public function setReplyTo($addresses, $name = null) - { - if (!is_array($addresses) && isset($name)) { - $addresses = array($addresses => $name); - } - - if (!$this->_setHeaderFieldModel('Reply-To', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('Reply-To', (array) $addresses); - } - - return $this; - } - - /** - * Get the reply-to address of this message. - * - * @return string - */ - public function getReplyTo() - { - return $this->_getHeaderFieldModel('Reply-To'); - } - - /** - * Add a To: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function addTo($address, $name = null) - { - $current = $this->getTo(); - $current[$address] = $name; - - return $this->setTo($current); - } - - /** - * Set the to addresses of this message. - * - * If multiple recipients will receive the message an array should be used. - * Example: array('receiver@domain.org', 'other@domain.org' => 'A name') - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param mixed $addresses - * @param string $name optional - * - * @return $this - */ - public function setTo($addresses, $name = null) - { - if (!is_array($addresses) && isset($name)) { - $addresses = array($addresses => $name); - } - - if (!$this->_setHeaderFieldModel('To', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('To', (array) $addresses); - } - - return $this; - } - - /** - * Get the To addresses of this message. - * - * @return array - */ - public function getTo() - { - return $this->_getHeaderFieldModel('To'); - } - - /** - * Add a Cc: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function addCc($address, $name = null) - { - $current = $this->getCc(); - $current[$address] = $name; - - return $this->setCc($current); - } - - /** - * Set the Cc addresses of this message. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param mixed $addresses - * @param string $name optional - * - * @return $this - */ - public function setCc($addresses, $name = null) - { - if (!is_array($addresses) && isset($name)) { - $addresses = array($addresses => $name); - } - - if (!$this->_setHeaderFieldModel('Cc', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('Cc', (array) $addresses); - } - - return $this; - } - - /** - * Get the Cc address of this message. - * - * @return array - */ - public function getCc() - { - return $this->_getHeaderFieldModel('Cc'); - } - - /** - * Add a Bcc: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function addBcc($address, $name = null) - { - $current = $this->getBcc(); - $current[$address] = $name; - - return $this->setBcc($current); - } - - /** - * Set the Bcc addresses of this message. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param mixed $addresses - * @param string $name optional - * - * @return $this - */ - public function setBcc($addresses, $name = null) - { - if (!is_array($addresses) && isset($name)) { - $addresses = array($addresses => $name); - } - - if (!$this->_setHeaderFieldModel('Bcc', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('Bcc', (array) $addresses); - } - - return $this; - } - - /** - * Get the Bcc addresses of this message. - * - * @return array - */ - public function getBcc() - { - return $this->_getHeaderFieldModel('Bcc'); - } - - /** - * Set the priority of this message. - * - * The value is an integer where 1 is the highest priority and 5 is the lowest. - * - * @param int $priority - * - * @return $this - */ - public function setPriority($priority) - { - $priorityMap = array( - self::PRIORITY_HIGHEST => 'Highest', - self::PRIORITY_HIGH => 'High', - self::PRIORITY_NORMAL => 'Normal', - self::PRIORITY_LOW => 'Low', - self::PRIORITY_LOWEST => 'Lowest', - ); - $pMapKeys = array_keys($priorityMap); - if ($priority > max($pMapKeys)) { - $priority = max($pMapKeys); - } elseif ($priority < min($pMapKeys)) { - $priority = min($pMapKeys); - } - if (!$this->_setHeaderFieldModel('X-Priority', - sprintf('%d (%s)', $priority, $priorityMap[$priority]))) { - $this->getHeaders()->addTextHeader('X-Priority', - sprintf('%d (%s)', $priority, $priorityMap[$priority])); - } - - return $this; - } - - /** - * Get the priority of this message. - * - * The returned value is an integer where 1 is the highest priority and 5 - * is the lowest. - * - * @return int - */ - public function getPriority() - { - list($priority) = sscanf($this->_getHeaderFieldModel('X-Priority'), - '%[1-5]' - ); - - return isset($priority) ? $priority : 3; - } - - /** - * Ask for a delivery receipt from the recipient to be sent to $addresses. - * - * @param array $addresses - * - * @return $this - */ - public function setReadReceiptTo($addresses) - { - if (!$this->_setHeaderFieldModel('Disposition-Notification-To', $addresses)) { - $this->getHeaders() - ->addMailboxHeader('Disposition-Notification-To', $addresses); - } - - return $this; - } - - /** - * Get the addresses to which a read-receipt will be sent. - * - * @return string - */ - public function getReadReceiptTo() - { - return $this->_getHeaderFieldModel('Disposition-Notification-To'); - } - - /** - * Attach a {@link Swift_Mime_MimeEntity} such as an Attachment or MimePart. - * - * @param Swift_Mime_MimeEntity $entity - * - * @return $this - */ - public function attach(Swift_Mime_MimeEntity $entity) - { - $this->setChildren(array_merge($this->getChildren(), array($entity))); - - return $this; - } - - /** - * Remove an already attached entity. - * - * @param Swift_Mime_MimeEntity $entity - * - * @return $this - */ - public function detach(Swift_Mime_MimeEntity $entity) - { - $newChildren = array(); - foreach ($this->getChildren() as $child) { - if ($entity !== $child) { - $newChildren[] = $child; - } - } - $this->setChildren($newChildren); - - return $this; - } - - /** - * Attach a {@link Swift_Mime_MimeEntity} and return it's CID source. - * This method should be used when embedding images or other data in a message. - * - * @param Swift_Mime_MimeEntity $entity - * - * @return string - */ - public function embed(Swift_Mime_MimeEntity $entity) - { - $this->attach($entity); - - return 'cid:'.$entity->getId(); - } - - /** - * Get this message as a complete string. - * - * @return string - */ - public function toString() - { - if (count($children = $this->getChildren()) > 0 && $this->getBody() != '') { - $this->setChildren(array_merge(array($this->_becomeMimePart()), $children)); - $string = parent::toString(); - $this->setChildren($children); - } else { - $string = parent::toString(); - } - - return $string; - } - - /** - * Returns a string representation of this object. - * - * @see toString() - * - * @return string - */ - public function __toString() - { - return $this->toString(); - } - - /** - * Write this message to a {@link Swift_InputByteStream}. - * - * @param Swift_InputByteStream $is - */ - public function toByteStream(Swift_InputByteStream $is) - { - if (count($children = $this->getChildren()) > 0 && $this->getBody() != '') { - $this->setChildren(array_merge(array($this->_becomeMimePart()), $children)); - parent::toByteStream($is); - $this->setChildren($children); - } else { - parent::toByteStream($is); - } - } - - /** @see Swift_Mime_SimpleMimeEntity::_getIdField() */ - protected function _getIdField() - { - return 'Message-ID'; - } - - /** Turn the body of this message into a child of itself if needed */ - protected function _becomeMimePart() - { - $part = new parent($this->getHeaders()->newInstance(), $this->getEncoder(), - $this->_getCache(), $this->_getGrammar(), $this->_userCharset - ); - $part->setContentType($this->_userContentType); - $part->setBody($this->getBody()); - $part->setFormat($this->_userFormat); - $part->setDelSp($this->_userDelSp); - $part->_setNestingLevel($this->_getTopNestingLevel()); - - return $part; - } - - /** Get the highest nesting level nested inside this message */ - private function _getTopNestingLevel() - { - $highestLevel = $this->getNestingLevel(); - foreach ($this->getChildren() as $child) { - $childLevel = $child->getNestingLevel(); - if ($highestLevel < $childLevel) { - $highestLevel = $childLevel; - } - } - - return $highestLevel; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php deleted file mode 100644 index a13f1b2..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php +++ /dev/null @@ -1,846 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A MIME entity, in a multipart message. - * - * @author Chris Corbyn - */ -class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity -{ - /** A collection of Headers for this mime entity */ - private $_headers; - - /** The body as a string, or a stream */ - private $_body; - - /** The encoder that encodes the body into a streamable format */ - private $_encoder; - - /** The grammar to use for id validation */ - private $_grammar; - - /** A mime boundary, if any is used */ - private $_boundary; - - /** Mime types to be used based on the nesting level */ - private $_compositeRanges = array( - 'multipart/mixed' => array(self::LEVEL_TOP, self::LEVEL_MIXED), - 'multipart/alternative' => array(self::LEVEL_MIXED, self::LEVEL_ALTERNATIVE), - 'multipart/related' => array(self::LEVEL_ALTERNATIVE, self::LEVEL_RELATED), - ); - - /** A set of filter rules to define what level an entity should be nested at */ - private $_compoundLevelFilters = array(); - - /** The nesting level of this entity */ - private $_nestingLevel = self::LEVEL_ALTERNATIVE; - - /** A KeyCache instance used during encoding and streaming */ - private $_cache; - - /** Direct descendants of this entity */ - private $_immediateChildren = array(); - - /** All descendants of this entity */ - private $_children = array(); - - /** The maximum line length of the body of this entity */ - private $_maxLineLength = 78; - - /** The order in which alternative mime types should appear */ - private $_alternativePartOrder = array( - 'text/plain' => 1, - 'text/html' => 2, - 'multipart/related' => 3, - ); - - /** The CID of this entity */ - private $_id; - - /** The key used for accessing the cache */ - private $_cacheKey; - - protected $_userContentType; - - /** - * Create a new SimpleMimeEntity with $headers, $encoder and $cache. - * - * @param Swift_Mime_HeaderSet $headers - * @param Swift_Mime_ContentEncoder $encoder - * @param Swift_KeyCache $cache - * @param Swift_Mime_Grammar $grammar - */ - public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar) - { - $this->_cacheKey = md5(uniqid(getmypid().mt_rand(), true)); - $this->_cache = $cache; - $this->_headers = $headers; - $this->_grammar = $grammar; - $this->setEncoder($encoder); - $this->_headers->defineOrdering(array('Content-Type', 'Content-Transfer-Encoding')); - - // This array specifies that, when the entire MIME document contains - // $compoundLevel, then for each child within $level, if its Content-Type - // is $contentType then it should be treated as if it's level is - // $neededLevel instead. I tried to write that unambiguously! :-\ - // Data Structure: - // array ( - // $compoundLevel => array( - // $level => array( - // $contentType => $neededLevel - // ) - // ) - // ) - - $this->_compoundLevelFilters = array( - (self::LEVEL_ALTERNATIVE + self::LEVEL_RELATED) => array( - self::LEVEL_ALTERNATIVE => array( - 'text/plain' => self::LEVEL_ALTERNATIVE, - 'text/html' => self::LEVEL_RELATED, - ), - ), - ); - - $this->_id = $this->getRandomId(); - } - - /** - * Generate a new Content-ID or Message-ID for this MIME entity. - * - * @return string - */ - public function generateId() - { - $this->setId($this->getRandomId()); - - return $this->_id; - } - - /** - * Get the {@link Swift_Mime_HeaderSet} for this entity. - * - * @return Swift_Mime_HeaderSet - */ - public function getHeaders() - { - return $this->_headers; - } - - /** - * Get the nesting level of this entity. - * - * @see LEVEL_TOP, LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE - * - * @return int - */ - public function getNestingLevel() - { - return $this->_nestingLevel; - } - - /** - * Get the Content-type of this entity. - * - * @return string - */ - public function getContentType() - { - return $this->_getHeaderFieldModel('Content-Type'); - } - - /** - * Set the Content-type of this entity. - * - * @param string $type - * - * @return $this - */ - public function setContentType($type) - { - $this->_setContentTypeInHeaders($type); - // Keep track of the value so that if the content-type changes automatically - // due to added child entities, it can be restored if they are later removed - $this->_userContentType = $type; - - return $this; - } - - /** - * Get the CID of this entity. - * - * The CID will only be present in headers if a Content-ID header is present. - * - * @return string - */ - public function getId() - { - $tmp = (array) $this->_getHeaderFieldModel($this->_getIdField()); - - return $this->_headers->has($this->_getIdField()) ? current($tmp) : $this->_id; - } - - /** - * Set the CID of this entity. - * - * @param string $id - * - * @return $this - */ - public function setId($id) - { - if (!$this->_setHeaderFieldModel($this->_getIdField(), $id)) { - $this->_headers->addIdHeader($this->_getIdField(), $id); - } - $this->_id = $id; - - return $this; - } - - /** - * Get the description of this entity. - * - * This value comes from the Content-Description header if set. - * - * @return string - */ - public function getDescription() - { - return $this->_getHeaderFieldModel('Content-Description'); - } - - /** - * Set the description of this entity. - * - * This method sets a value in the Content-ID header. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - if (!$this->_setHeaderFieldModel('Content-Description', $description)) { - $this->_headers->addTextHeader('Content-Description', $description); - } - - return $this; - } - - /** - * Get the maximum line length of the body of this entity. - * - * @return int - */ - public function getMaxLineLength() - { - return $this->_maxLineLength; - } - - /** - * Set the maximum line length of lines in this body. - * - * Though not enforced by the library, lines should not exceed 1000 chars. - * - * @param int $length - * - * @return $this - */ - public function setMaxLineLength($length) - { - $this->_maxLineLength = $length; - - return $this; - } - - /** - * Get all children added to this entity. - * - * @return Swift_Mime_MimeEntity[] - */ - public function getChildren() - { - return $this->_children; - } - - /** - * Set all children of this entity. - * - * @param Swift_Mime_MimeEntity[] $children - * @param int $compoundLevel For internal use only - * - * @return $this - */ - public function setChildren(array $children, $compoundLevel = null) - { - // TODO: Try to refactor this logic - - $compoundLevel = isset($compoundLevel) ? $compoundLevel : $this->_getCompoundLevel($children); - $immediateChildren = array(); - $grandchildren = array(); - $newContentType = $this->_userContentType; - - foreach ($children as $child) { - $level = $this->_getNeededChildLevel($child, $compoundLevel); - if (empty($immediateChildren)) { - //first iteration - $immediateChildren = array($child); - } else { - $nextLevel = $this->_getNeededChildLevel($immediateChildren[0], $compoundLevel); - if ($nextLevel == $level) { - $immediateChildren[] = $child; - } elseif ($level < $nextLevel) { - // Re-assign immediateChildren to grandchildren - $grandchildren = array_merge($grandchildren, $immediateChildren); - // Set new children - $immediateChildren = array($child); - } else { - $grandchildren[] = $child; - } - } - } - - if ($immediateChildren) { - $lowestLevel = $this->_getNeededChildLevel($immediateChildren[0], $compoundLevel); - - // Determine which composite media type is needed to accommodate the - // immediate children - foreach ($this->_compositeRanges as $mediaType => $range) { - if ($lowestLevel > $range[0] && $lowestLevel <= $range[1]) { - $newContentType = $mediaType; - - break; - } - } - - // Put any grandchildren in a subpart - if (!empty($grandchildren)) { - $subentity = $this->_createChild(); - $subentity->_setNestingLevel($lowestLevel); - $subentity->setChildren($grandchildren, $compoundLevel); - array_unshift($immediateChildren, $subentity); - } - } - - $this->_immediateChildren = $immediateChildren; - $this->_children = $children; - $this->_setContentTypeInHeaders($newContentType); - $this->_fixHeaders(); - $this->_sortChildren(); - - return $this; - } - - /** - * Get the body of this entity as a string. - * - * @return string - */ - public function getBody() - { - return $this->_body instanceof Swift_OutputByteStream ? $this->_readStream($this->_body) : $this->_body; - } - - /** - * Set the body of this entity, either as a string, or as an instance of - * {@link Swift_OutputByteStream}. - * - * @param mixed $body - * @param string $contentType optional - * - * @return $this - */ - public function setBody($body, $contentType = null) - { - if ($body !== $this->_body) { - $this->_clearCache(); - } - - $this->_body = $body; - if (isset($contentType)) { - $this->setContentType($contentType); - } - - return $this; - } - - /** - * Get the encoder used for the body of this entity. - * - * @return Swift_Mime_ContentEncoder - */ - public function getEncoder() - { - return $this->_encoder; - } - - /** - * Set the encoder used for the body of this entity. - * - * @param Swift_Mime_ContentEncoder $encoder - * - * @return $this - */ - public function setEncoder(Swift_Mime_ContentEncoder $encoder) - { - if ($encoder !== $this->_encoder) { - $this->_clearCache(); - } - - $this->_encoder = $encoder; - $this->_setEncoding($encoder->getName()); - $this->_notifyEncoderChanged($encoder); - - return $this; - } - - /** - * Get the boundary used to separate children in this entity. - * - * @return string - */ - public function getBoundary() - { - if (!isset($this->_boundary)) { - $this->_boundary = '_=_swift_v4_'.time().'_'.md5(getmypid().mt_rand().uniqid('', true)).'_=_'; - } - - return $this->_boundary; - } - - /** - * Set the boundary used to separate children in this entity. - * - * @param string $boundary - * - * @throws Swift_RfcComplianceException - * - * @return $this - */ - public function setBoundary($boundary) - { - $this->_assertValidBoundary($boundary); - $this->_boundary = $boundary; - - return $this; - } - - /** - * Receive notification that the charset of this entity, or a parent entity - * has changed. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->_notifyCharsetChanged($charset); - } - - /** - * Receive notification that the encoder of this entity or a parent entity - * has changed. - * - * @param Swift_Mime_ContentEncoder $encoder - */ - public function encoderChanged(Swift_Mime_ContentEncoder $encoder) - { - $this->_notifyEncoderChanged($encoder); - } - - /** - * Get this entire entity as a string. - * - * @return string - */ - public function toString() - { - $string = $this->_headers->toString(); - $string .= $this->_bodyToString(); - - return $string; - } - - /** - * Get this entire entity as a string. - * - * @return string - */ - protected function _bodyToString() - { - $string = ''; - - if (isset($this->_body) && empty($this->_immediateChildren)) { - if ($this->_cache->hasKey($this->_cacheKey, 'body')) { - $body = $this->_cache->getString($this->_cacheKey, 'body'); - } else { - $body = "\r\n".$this->_encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength()); - $this->_cache->setString($this->_cacheKey, 'body', $body, Swift_KeyCache::MODE_WRITE); - } - $string .= $body; - } - - if (!empty($this->_immediateChildren)) { - foreach ($this->_immediateChildren as $child) { - $string .= "\r\n\r\n--".$this->getBoundary()."\r\n"; - $string .= $child->toString(); - } - $string .= "\r\n\r\n--".$this->getBoundary()."--\r\n"; - } - - return $string; - } - - /** - * Returns a string representation of this object. - * - * @see toString() - * - * @return string - */ - public function __toString() - { - return $this->toString(); - } - - /** - * Write this entire entity to a {@see Swift_InputByteStream}. - * - * @param Swift_InputByteStream - */ - public function toByteStream(Swift_InputByteStream $is) - { - $is->write($this->_headers->toString()); - $is->commit(); - - $this->_bodyToByteStream($is); - } - - /** - * Write this entire entity to a {@link Swift_InputByteStream}. - * - * @param Swift_InputByteStream - */ - protected function _bodyToByteStream(Swift_InputByteStream $is) - { - if (empty($this->_immediateChildren)) { - if (isset($this->_body)) { - if ($this->_cache->hasKey($this->_cacheKey, 'body')) { - $this->_cache->exportToByteStream($this->_cacheKey, 'body', $is); - } else { - $cacheIs = $this->_cache->getInputByteStream($this->_cacheKey, 'body'); - if ($cacheIs) { - $is->bind($cacheIs); - } - - $is->write("\r\n"); - - if ($this->_body instanceof Swift_OutputByteStream) { - $this->_body->setReadPointer(0); - - $this->_encoder->encodeByteStream($this->_body, $is, 0, $this->getMaxLineLength()); - } else { - $is->write($this->_encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength())); - } - - if ($cacheIs) { - $is->unbind($cacheIs); - } - } - } - } - - if (!empty($this->_immediateChildren)) { - foreach ($this->_immediateChildren as $child) { - $is->write("\r\n\r\n--".$this->getBoundary()."\r\n"); - $child->toByteStream($is); - } - $is->write("\r\n\r\n--".$this->getBoundary()."--\r\n"); - } - } - - /** - * Get the name of the header that provides the ID of this entity. - */ - protected function _getIdField() - { - return 'Content-ID'; - } - - /** - * Get the model data (usually an array or a string) for $field. - */ - protected function _getHeaderFieldModel($field) - { - if ($this->_headers->has($field)) { - return $this->_headers->get($field)->getFieldBodyModel(); - } - } - - /** - * Set the model data for $field. - */ - protected function _setHeaderFieldModel($field, $model) - { - if ($this->_headers->has($field)) { - $this->_headers->get($field)->setFieldBodyModel($model); - - return true; - } - - return false; - } - - /** - * Get the parameter value of $parameter on $field header. - */ - protected function _getHeaderParameter($field, $parameter) - { - if ($this->_headers->has($field)) { - return $this->_headers->get($field)->getParameter($parameter); - } - } - - /** - * Set the parameter value of $parameter on $field header. - */ - protected function _setHeaderParameter($field, $parameter, $value) - { - if ($this->_headers->has($field)) { - $this->_headers->get($field)->setParameter($parameter, $value); - - return true; - } - - return false; - } - - /** - * Re-evaluate what content type and encoding should be used on this entity. - */ - protected function _fixHeaders() - { - if (count($this->_immediateChildren)) { - $this->_setHeaderParameter('Content-Type', 'boundary', - $this->getBoundary() - ); - $this->_headers->remove('Content-Transfer-Encoding'); - } else { - $this->_setHeaderParameter('Content-Type', 'boundary', null); - $this->_setEncoding($this->_encoder->getName()); - } - } - - /** - * Get the KeyCache used in this entity. - * - * @return Swift_KeyCache - */ - protected function _getCache() - { - return $this->_cache; - } - - /** - * Get the grammar used for validation. - * - * @return Swift_Mime_Grammar - */ - protected function _getGrammar() - { - return $this->_grammar; - } - - /** - * Empty the KeyCache for this entity. - */ - protected function _clearCache() - { - $this->_cache->clearKey($this->_cacheKey, 'body'); - } - - /** - * Returns a random Content-ID or Message-ID. - * - * @return string - */ - protected function getRandomId() - { - $idLeft = md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true)); - $idRight = !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'swift.generated'; - $id = $idLeft.'@'.$idRight; - - try { - $this->_assertValidId($id); - } catch (Swift_RfcComplianceException $e) { - $id = $idLeft.'@swift.generated'; - } - - return $id; - } - - private function _readStream(Swift_OutputByteStream $os) - { - $string = ''; - while (false !== $bytes = $os->read(8192)) { - $string .= $bytes; - } - - $os->setReadPointer(0); - - return $string; - } - - private function _setEncoding($encoding) - { - if (!$this->_setHeaderFieldModel('Content-Transfer-Encoding', $encoding)) { - $this->_headers->addTextHeader('Content-Transfer-Encoding', $encoding); - } - } - - private function _assertValidBoundary($boundary) - { - if (!preg_match('/^[a-z0-9\'\(\)\+_\-,\.\/:=\?\ ]{0,69}[a-z0-9\'\(\)\+_\-,\.\/:=\?]$/Di', $boundary)) { - throw new Swift_RfcComplianceException('Mime boundary set is not RFC 2046 compliant.'); - } - } - - private function _setContentTypeInHeaders($type) - { - if (!$this->_setHeaderFieldModel('Content-Type', $type)) { - $this->_headers->addParameterizedHeader('Content-Type', $type); - } - } - - private function _setNestingLevel($level) - { - $this->_nestingLevel = $level; - } - - private function _getCompoundLevel($children) - { - $level = 0; - foreach ($children as $child) { - $level |= $child->getNestingLevel(); - } - - return $level; - } - - private function _getNeededChildLevel($child, $compoundLevel) - { - $filter = array(); - foreach ($this->_compoundLevelFilters as $bitmask => $rules) { - if (($compoundLevel & $bitmask) === $bitmask) { - $filter = $rules + $filter; - } - } - - $realLevel = $child->getNestingLevel(); - $lowercaseType = strtolower($child->getContentType()); - - if (isset($filter[$realLevel]) && isset($filter[$realLevel][$lowercaseType])) { - return $filter[$realLevel][$lowercaseType]; - } - - return $realLevel; - } - - private function _createChild() - { - return new self($this->_headers->newInstance(), $this->_encoder, $this->_cache, $this->_grammar); - } - - private function _notifyEncoderChanged(Swift_Mime_ContentEncoder $encoder) - { - foreach ($this->_immediateChildren as $child) { - $child->encoderChanged($encoder); - } - } - - private function _notifyCharsetChanged($charset) - { - $this->_encoder->charsetChanged($charset); - $this->_headers->charsetChanged($charset); - foreach ($this->_immediateChildren as $child) { - $child->charsetChanged($charset); - } - } - - private function _sortChildren() - { - $shouldSort = false; - foreach ($this->_immediateChildren as $child) { - // NOTE: This include alternative parts moved into a related part - if ($child->getNestingLevel() == self::LEVEL_ALTERNATIVE) { - $shouldSort = true; - break; - } - } - - // Sort in order of preference, if there is one - if ($shouldSort) { - // Group the messages by order of preference - $sorted = array(); - foreach ($this->_immediateChildren as $child) { - $type = $child->getContentType(); - $level = array_key_exists($type, $this->_alternativePartOrder) ? $this->_alternativePartOrder[$type] : max($this->_alternativePartOrder) + 1; - - if (empty($sorted[$level])) { - $sorted[$level] = array(); - } - - $sorted[$level][] = $child; - } - - ksort($sorted); - - $this->_immediateChildren = array_reduce($sorted, 'array_merge', array()); - } - } - - /** - * Empties it's own contents from the cache. - */ - public function __destruct() - { - if ($this->_cache instanceof Swift_KeyCache) { - $this->_cache->clearAll($this->_cacheKey); - } - } - - /** - * Throws an Exception if the id passed does not comply with RFC 2822. - * - * @param string $id - * - * @throws Swift_RfcComplianceException - */ - private function _assertValidId($id) - { - if (!preg_match('/^'.$this->_grammar->getDefinition('id-left').'@'.$this->_grammar->getDefinition('id-right').'$/D', $id)) { - throw new Swift_RfcComplianceException('Invalid ID given <'.$id.'>'); - } - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->_headers = clone $this->_headers; - $this->_encoder = clone $this->_encoder; - $this->_cacheKey = md5(uniqid(getmypid().mt_rand(), true)); - $children = array(); - foreach ($this->_children as $pos => $child) { - $children[$pos] = clone $child; - } - $this->setChildren($children); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php deleted file mode 100644 index 525b7ec..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A MIME part, in a multipart message. - * - * @author Chris Corbyn - */ -class Swift_MimePart extends Swift_Mime_MimePart -{ - /** - * Create a new MimePart. - * - * Details may be optionally passed into the constructor. - * - * @param string $body - * @param string $contentType - * @param string $charset - */ - public function __construct($body = null, $contentType = null, $charset = null) - { - call_user_func_array( - array($this, 'Swift_Mime_MimePart::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('mime.part') - ); - - if (!isset($charset)) { - $charset = Swift_DependencyContainer::getInstance() - ->lookup('properties.charset'); - } - $this->setBody($body); - $this->setCharset($charset); - if ($contentType) { - $this->setContentType($contentType); - } - } - - /** - * Create a new MimePart. - * - * @param string $body - * @param string $contentType - * @param string $charset - * - * @return self - */ - public static function newInstance($body = null, $contentType = null, $charset = null) - { - return new self($body, $contentType, $charset); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php deleted file mode 100644 index ddde335..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2009 Fabien Potencier <fabien.potencier@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pretends messages have been sent, but just ignores them. - * - * @author Fabien Potencier - */ -class Swift_NullTransport extends Swift_Transport_NullTransport -{ - public function __construct() - { - call_user_func_array( - array($this, 'Swift_Transport_NullTransport::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.null') - ); - } - - /** - * Create a new NullTransport instance. - * - * @return self - */ - public static function newInstance() - { - return new self(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php deleted file mode 100644 index 1f26f9b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An abstract means of reading data. - * - * Classes implementing this interface may use a subsystem which requires less - * memory than working with large strings of data. - * - * @author Chris Corbyn - */ -interface Swift_OutputByteStream -{ - /** - * Reads $length bytes from the stream into a string and moves the pointer - * through the stream by $length. - * - * If less bytes exist than are requested the remaining bytes are given instead. - * If no bytes are remaining at all, boolean false is returned. - * - * @param int $length - * - * @throws Swift_IoException - * - * @return string|bool - */ - public function read($length); - - /** - * Move the internal read pointer to $byteOffset in the stream. - * - * @param int $byteOffset - * - * @throws Swift_IoException - * - * @return bool - */ - public function setReadPointer($byteOffset); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/AntiFloodPlugin.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/AntiFloodPlugin.php deleted file mode 100644 index a2ec2ab..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/AntiFloodPlugin.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Reduces network flooding when sending large amounts of mail. - * - * @author Chris Corbyn - */ -class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_Plugins_Sleeper -{ - /** - * The number of emails to send before restarting Transport. - * - * @var int - */ - private $_threshold; - - /** - * The number of seconds to sleep for during a restart. - * - * @var int - */ - private $_sleep; - - /** - * The internal counter. - * - * @var int - */ - private $_counter = 0; - - /** - * The Sleeper instance for sleeping. - * - * @var Swift_Plugins_Sleeper - */ - private $_sleeper; - - /** - * Create a new AntiFloodPlugin with $threshold and $sleep time. - * - * @param int $threshold - * @param int $sleep time - * @param Swift_Plugins_Sleeper $sleeper (not needed really) - */ - public function __construct($threshold = 99, $sleep = 0, Swift_Plugins_Sleeper $sleeper = null) - { - $this->setThreshold($threshold); - $this->setSleepTime($sleep); - $this->_sleeper = $sleeper; - } - - /** - * Set the number of emails to send before restarting. - * - * @param int $threshold - */ - public function setThreshold($threshold) - { - $this->_threshold = $threshold; - } - - /** - * Get the number of emails to send before restarting. - * - * @return int - */ - public function getThreshold() - { - return $this->_threshold; - } - - /** - * Set the number of seconds to sleep for during a restart. - * - * @param int $sleep time - */ - public function setSleepTime($sleep) - { - $this->_sleep = $sleep; - } - - /** - * Get the number of seconds to sleep for during a restart. - * - * @return int - */ - public function getSleepTime() - { - return $this->_sleep; - } - - /** - * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - ++$this->_counter; - if ($this->_counter >= $this->_threshold) { - $transport = $evt->getTransport(); - $transport->stop(); - if ($this->_sleep) { - $this->sleep($this->_sleep); - } - $transport->start(); - $this->_counter = 0; - } - } - - /** - * Sleep for $seconds. - * - * @param int $seconds - */ - public function sleep($seconds) - { - if (isset($this->_sleeper)) { - $this->_sleeper->sleep($seconds); - } else { - sleep($seconds); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php deleted file mode 100644 index f7e18d0..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php +++ /dev/null @@ -1,164 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Reduces network flooding when sending large amounts of mail. - * - * @author Chris Corbyn - */ -class Swift_Plugins_BandwidthMonitorPlugin implements Swift_Events_SendListener, Swift_Events_CommandListener, Swift_Events_ResponseListener, Swift_InputByteStream -{ - /** - * The outgoing traffic counter. - * - * @var int - */ - private $_out = 0; - - /** - * The incoming traffic counter. - * - * @var int - */ - private $_in = 0; - - /** Bound byte streams */ - private $_mirrors = array(); - - /** - * Not used. - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $message->toByteStream($this); - } - - /** - * Invoked immediately following a command being sent. - * - * @param Swift_Events_CommandEvent $evt - */ - public function commandSent(Swift_Events_CommandEvent $evt) - { - $command = $evt->getCommand(); - $this->_out += strlen($command); - } - - /** - * Invoked immediately following a response coming back. - * - * @param Swift_Events_ResponseEvent $evt - */ - public function responseReceived(Swift_Events_ResponseEvent $evt) - { - $response = $evt->getResponse(); - $this->_in += strlen($response); - } - - /** - * Called when a message is sent so that the outgoing counter can be increased. - * - * @param string $bytes - */ - public function write($bytes) - { - $this->_out += strlen($bytes); - foreach ($this->_mirrors as $stream) { - $stream->write($bytes); - } - } - - /** - * Not used. - */ - public function commit() - { - } - - /** - * Attach $is to this stream. - * - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - * - * @param Swift_InputByteStream $is - */ - public function bind(Swift_InputByteStream $is) - { - $this->_mirrors[] = $is; - } - - /** - * Remove an already bound stream. - * - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - * - * @param Swift_InputByteStream $is - */ - public function unbind(Swift_InputByteStream $is) - { - foreach ($this->_mirrors as $k => $stream) { - if ($is === $stream) { - unset($this->_mirrors[$k]); - } - } - } - - /** - * Not used. - */ - public function flushBuffers() - { - foreach ($this->_mirrors as $stream) { - $stream->flushBuffers(); - } - } - - /** - * Get the total number of bytes sent to the server. - * - * @return int - */ - public function getBytesOut() - { - return $this->_out; - } - - /** - * Get the total number of bytes received from the server. - * - * @return int - */ - public function getBytesIn() - { - return $this->_in; - } - - /** - * Reset the internal counters to zero. - */ - public function reset() - { - $this->_out = 0; - $this->_in = 0; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php deleted file mode 100644 index 9f9f08b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Allows customization of Messages on-the-fly. - * - * @author Chris Corbyn - */ -interface Swift_Plugins_Decorator_Replacements -{ - /** - * Return the array of replacements for $address. - * - * This method is invoked once for every single recipient of a message. - * - * If no replacements can be found, an empty value (NULL) should be returned - * and no replacements will then be made on the message. - * - * @param string $address - * - * @return array - */ - public function getReplacementsFor($address); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/DecoratorPlugin.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/DecoratorPlugin.php deleted file mode 100644 index 0762b36..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/DecoratorPlugin.php +++ /dev/null @@ -1,204 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Allows customization of Messages on-the-fly. - * - * @author Chris Corbyn - * @author Fabien Potencier - */ -class Swift_Plugins_DecoratorPlugin implements Swift_Events_SendListener, Swift_Plugins_Decorator_Replacements -{ - /** The replacement map */ - private $_replacements; - - /** The body as it was before replacements */ - private $_originalBody; - - /** The original headers of the message, before replacements */ - private $_originalHeaders = array(); - - /** Bodies of children before they are replaced */ - private $_originalChildBodies = array(); - - /** The Message that was last replaced */ - private $_lastMessage; - - /** - * Create a new DecoratorPlugin with $replacements. - * - * The $replacements can either be an associative array, or an implementation - * of {@link Swift_Plugins_Decorator_Replacements}. - * - * When using an array, it should be of the form: - * <code> - * $replacements = array( - * "address1@domain.tld" => array("{a}" => "b", "{c}" => "d"), - * "address2@domain.tld" => array("{a}" => "x", "{c}" => "y") - * ) - * </code> - * - * When using an instance of {@link Swift_Plugins_Decorator_Replacements}, - * the object should return just the array of replacements for the address - * given to {@link Swift_Plugins_Decorator_Replacements::getReplacementsFor()}. - * - * @param mixed $replacements Array or Swift_Plugins_Decorator_Replacements - */ - public function __construct($replacements) - { - $this->setReplacements($replacements); - } - - /** - * Sets replacements. - * - * @param mixed $replacements Array or Swift_Plugins_Decorator_Replacements - * - * @see __construct() - */ - public function setReplacements($replacements) - { - if (!($replacements instanceof Swift_Plugins_Decorator_Replacements)) { - $this->_replacements = (array) $replacements; - } else { - $this->_replacements = $replacements; - } - } - - /** - * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $this->_restoreMessage($message); - $to = array_keys($message->getTo()); - $address = array_shift($to); - if ($replacements = $this->getReplacementsFor($address)) { - $body = $message->getBody(); - $search = array_keys($replacements); - $replace = array_values($replacements); - $bodyReplaced = str_replace( - $search, $replace, $body - ); - if ($body != $bodyReplaced) { - $this->_originalBody = $body; - $message->setBody($bodyReplaced); - } - - foreach ($message->getHeaders()->getAll() as $header) { - $body = $header->getFieldBodyModel(); - $count = 0; - if (is_array($body)) { - $bodyReplaced = array(); - foreach ($body as $key => $value) { - $count1 = 0; - $count2 = 0; - $key = is_string($key) ? str_replace($search, $replace, $key, $count1) : $key; - $value = is_string($value) ? str_replace($search, $replace, $value, $count2) : $value; - $bodyReplaced[$key] = $value; - - if (!$count && ($count1 || $count2)) { - $count = 1; - } - } - } else { - $bodyReplaced = str_replace($search, $replace, $body, $count); - } - - if ($count) { - $this->_originalHeaders[$header->getFieldName()] = $body; - $header->setFieldBodyModel($bodyReplaced); - } - } - - $children = (array) $message->getChildren(); - foreach ($children as $child) { - list($type) = sscanf($child->getContentType(), '%[^/]/%s'); - if ('text' == $type) { - $body = $child->getBody(); - $bodyReplaced = str_replace( - $search, $replace, $body - ); - if ($body != $bodyReplaced) { - $child->setBody($bodyReplaced); - $this->_originalChildBodies[$child->getId()] = $body; - } - } - } - $this->_lastMessage = $message; - } - } - - /** - * Find a map of replacements for the address. - * - * If this plugin was provided with a delegate instance of - * {@link Swift_Plugins_Decorator_Replacements} then the call will be - * delegated to it. Otherwise, it will attempt to find the replacements - * from the array provided in the constructor. - * - * If no replacements can be found, an empty value (NULL) is returned. - * - * @param string $address - * - * @return array - */ - public function getReplacementsFor($address) - { - if ($this->_replacements instanceof Swift_Plugins_Decorator_Replacements) { - return $this->_replacements->getReplacementsFor($address); - } - - return isset($this->_replacements[$address]) ? $this->_replacements[$address] : null; - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $this->_restoreMessage($evt->getMessage()); - } - - /** Restore a changed message back to its original state */ - private function _restoreMessage(Swift_Mime_Message $message) - { - if ($this->_lastMessage === $message) { - if (isset($this->_originalBody)) { - $message->setBody($this->_originalBody); - $this->_originalBody = null; - } - if (!empty($this->_originalHeaders)) { - foreach ($message->getHeaders()->getAll() as $header) { - if (array_key_exists($header->getFieldName(), $this->_originalHeaders)) { - $header->setFieldBodyModel($this->_originalHeaders[$header->getFieldName()]); - } - } - $this->_originalHeaders = array(); - } - if (!empty($this->_originalChildBodies)) { - $children = (array) $message->getChildren(); - foreach ($children as $child) { - $id = $child->getId(); - if (array_key_exists($id, $this->_originalChildBodies)) { - $child->setBody($this->_originalChildBodies[$id]); - } - } - $this->_originalChildBodies = array(); - } - $this->_lastMessage = null; - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php deleted file mode 100644 index 5834440..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2009 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Replaces the sender of a message. - * - * @author Arjen Brouwer - */ -class Swift_Plugins_ImpersonatePlugin implements Swift_Events_SendListener -{ - /** - * The sender to impersonate. - * - * @var string - */ - private $_sender; - - /** - * Create a new ImpersonatePlugin to impersonate $sender. - * - * @param string $sender address - */ - public function __construct($sender) - { - $this->_sender = $sender; - } - - /** - * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $headers = $message->getHeaders(); - - // save current recipients - $headers->addPathHeader('X-Swift-Return-Path', $message->getReturnPath()); - - // replace them with the one to send to - $message->setReturnPath($this->_sender); - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - - // restore original headers - $headers = $message->getHeaders(); - - if ($headers->has('X-Swift-Return-Path')) { - $message->setReturnPath($headers->get('X-Swift-Return-Path')->getAddress()); - $headers->removeAll('X-Swift-Return-Path'); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php deleted file mode 100644 index d9bce89..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Logs events in the Transport system. - * - * @author Chris Corbyn - */ -interface Swift_Plugins_Logger -{ - /** - * Add a log entry. - * - * @param string $entry - */ - public function add($entry); - - /** - * Clear the log contents. - */ - public function clear(); - - /** - * Get this log as a string. - * - * @return string - */ - public function dump(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php deleted file mode 100644 index 64db438..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php +++ /dev/null @@ -1,142 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Does real time logging of Transport level information. - * - * @author Chris Corbyn - */ -class Swift_Plugins_LoggerPlugin implements Swift_Events_CommandListener, Swift_Events_ResponseListener, Swift_Events_TransportChangeListener, Swift_Events_TransportExceptionListener, Swift_Plugins_Logger -{ - /** The logger which is delegated to */ - private $_logger; - - /** - * Create a new LoggerPlugin using $logger. - * - * @param Swift_Plugins_Logger $logger - */ - public function __construct(Swift_Plugins_Logger $logger) - { - $this->_logger = $logger; - } - - /** - * Add a log entry. - * - * @param string $entry - */ - public function add($entry) - { - $this->_logger->add($entry); - } - - /** - * Clear the log contents. - */ - public function clear() - { - $this->_logger->clear(); - } - - /** - * Get this log as a string. - * - * @return string - */ - public function dump() - { - return $this->_logger->dump(); - } - - /** - * Invoked immediately following a command being sent. - * - * @param Swift_Events_CommandEvent $evt - */ - public function commandSent(Swift_Events_CommandEvent $evt) - { - $command = $evt->getCommand(); - $this->_logger->add(sprintf('>> %s', $command)); - } - - /** - * Invoked immediately following a response coming back. - * - * @param Swift_Events_ResponseEvent $evt - */ - public function responseReceived(Swift_Events_ResponseEvent $evt) - { - $response = $evt->getResponse(); - $this->_logger->add(sprintf('<< %s', $response)); - } - - /** - * Invoked just before a Transport is started. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt) - { - $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf('++ Starting %s', $transportName)); - } - - /** - * Invoked immediately after the Transport is started. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function transportStarted(Swift_Events_TransportChangeEvent $evt) - { - $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf('++ %s started', $transportName)); - } - - /** - * Invoked just before a Transport is stopped. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt) - { - $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf('++ Stopping %s', $transportName)); - } - - /** - * Invoked immediately after the Transport is stopped. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function transportStopped(Swift_Events_TransportChangeEvent $evt) - { - $transportName = get_class($evt->getSource()); - $this->_logger->add(sprintf('++ %s stopped', $transportName)); - } - - /** - * Invoked as a TransportException is thrown in the Transport system. - * - * @param Swift_Events_TransportExceptionEvent $evt - */ - public function exceptionThrown(Swift_Events_TransportExceptionEvent $evt) - { - $e = $evt->getException(); - $message = $e->getMessage(); - $code = $e->getCode(); - $this->_logger->add(sprintf('!! %s (code: %s)', $message, $code)); - $message .= PHP_EOL; - $message .= 'Log data:'.PHP_EOL; - $message .= $this->_logger->dump(); - $evt->cancelBubble(); - throw new Swift_TransportException($message, $code, $e->getPrevious()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php deleted file mode 100644 index 865bb0a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Logs to an Array backend. - * - * @author Chris Corbyn - */ -class Swift_Plugins_Loggers_ArrayLogger implements Swift_Plugins_Logger -{ - /** - * The log contents. - * - * @var array - */ - private $_log = array(); - - /** - * Max size of the log. - * - * @var int - */ - private $_size = 0; - - /** - * Create a new ArrayLogger with a maximum of $size entries. - * - * @var int - */ - public function __construct($size = 50) - { - $this->_size = $size; - } - - /** - * Add a log entry. - * - * @param string $entry - */ - public function add($entry) - { - $this->_log[] = $entry; - while (count($this->_log) > $this->_size) { - array_shift($this->_log); - } - } - - /** - * Clear the log contents. - */ - public function clear() - { - $this->_log = array(); - } - - /** - * Get this log as a string. - * - * @return string - */ - public function dump() - { - return implode(PHP_EOL, $this->_log); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php deleted file mode 100644 index 3583297..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Prints all log messages in real time. - * - * @author Chris Corbyn - */ -class Swift_Plugins_Loggers_EchoLogger implements Swift_Plugins_Logger -{ - /** Whether or not HTML should be output */ - private $_isHtml; - - /** - * Create a new EchoLogger. - * - * @param bool $isHtml - */ - public function __construct($isHtml = true) - { - $this->_isHtml = $isHtml; - } - - /** - * Add a log entry. - * - * @param string $entry - */ - public function add($entry) - { - if ($this->_isHtml) { - printf('%s%s%s', htmlspecialchars($entry, ENT_QUOTES), '<br />', PHP_EOL); - } else { - printf('%s%s', $entry, PHP_EOL); - } - } - - /** - * Not implemented. - */ - public function clear() - { - } - - /** - * Not implemented. - */ - public function dump() - { - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php deleted file mode 100644 index 5ff1d93..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2011 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores all sent emails for further usage. - * - * @author Fabien Potencier - */ -class Swift_Plugins_MessageLogger implements Swift_Events_SendListener -{ - /** - * @var Swift_Mime_Message[] - */ - private $messages; - - public function __construct() - { - $this->messages = array(); - } - - /** - * Get the message list. - * - * @return Swift_Mime_Message[] - */ - public function getMessages() - { - return $this->messages; - } - - /** - * Get the message count. - * - * @return int count - */ - public function countMessages() - { - return count($this->messages); - } - - /** - * Empty the message list. - */ - public function clear() - { - $this->messages = array(); - } - - /** - * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $this->messages[] = clone $evt->getMessage(); - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php deleted file mode 100644 index fb99e4c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pop3Connection interface for connecting and disconnecting to a POP3 host. - * - * @author Chris Corbyn - */ -interface Swift_Plugins_Pop_Pop3Connection -{ - /** - * Connect to the POP3 host and throw an Exception if it fails. - * - * @throws Swift_Plugins_Pop_Pop3Exception - */ - public function connect(); - - /** - * Disconnect from the POP3 host and throw an Exception if it fails. - * - * @throws Swift_Plugins_Pop_Pop3Exception - */ - public function disconnect(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Exception.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Exception.php deleted file mode 100644 index dc7be0c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Exception.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pop3Exception thrown when an error occurs connecting to a POP3 host. - * - * @author Chris Corbyn - */ -class Swift_Plugins_Pop_Pop3Exception extends Swift_IoException -{ - /** - * Create a new Pop3Exception with $message. - * - * @param string $message - */ - public function __construct($message) - { - parent::__construct($message); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php deleted file mode 100644 index 3146152..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php +++ /dev/null @@ -1,273 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Makes sure a connection to a POP3 host has been established prior to connecting to SMTP. - * - * @author Chris Corbyn - */ -class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeListener, Swift_Plugins_Pop_Pop3Connection -{ - /** A delegate connection to use (mostly a test hook) */ - private $_connection; - - /** Hostname of the POP3 server */ - private $_host; - - /** Port number to connect on */ - private $_port; - - /** Encryption type to use (if any) */ - private $_crypto; - - /** Username to use (if any) */ - private $_username; - - /** Password to use (if any) */ - private $_password; - - /** Established connection via TCP socket */ - private $_socket; - - /** Connect timeout in seconds */ - private $_timeout = 10; - - /** SMTP Transport to bind to */ - private $_transport; - - /** - * Create a new PopBeforeSmtpPlugin for $host and $port. - * - * @param string $host - * @param int $port - * @param string $crypto as "tls" or "ssl" - */ - public function __construct($host, $port = 110, $crypto = null) - { - $this->_host = $host; - $this->_port = $port; - $this->_crypto = $crypto; - } - - /** - * Create a new PopBeforeSmtpPlugin for $host and $port. - * - * @param string $host - * @param int $port - * @param string $crypto as "tls" or "ssl" - * - * @return self - */ - public static function newInstance($host, $port = 110, $crypto = null) - { - return new self($host, $port, $crypto); - } - - /** - * Set a Pop3Connection to delegate to instead of connecting directly. - * - * @param Swift_Plugins_Pop_Pop3Connection $connection - * - * @return $this - */ - public function setConnection(Swift_Plugins_Pop_Pop3Connection $connection) - { - $this->_connection = $connection; - - return $this; - } - - /** - * Bind this plugin to a specific SMTP transport instance. - * - * @param Swift_Transport - */ - public function bindSmtp(Swift_Transport $smtp) - { - $this->_transport = $smtp; - } - - /** - * Set the connection timeout in seconds (default 10). - * - * @param int $timeout - * - * @return $this - */ - public function setTimeout($timeout) - { - $this->_timeout = (int) $timeout; - - return $this; - } - - /** - * Set the username to use when connecting (if needed). - * - * @param string $username - * - * @return $this - */ - public function setUsername($username) - { - $this->_username = $username; - - return $this; - } - - /** - * Set the password to use when connecting (if needed). - * - * @param string $password - * - * @return $this - */ - public function setPassword($password) - { - $this->_password = $password; - - return $this; - } - - /** - * Connect to the POP3 host and authenticate. - * - * @throws Swift_Plugins_Pop_Pop3Exception if connection fails - */ - public function connect() - { - if (isset($this->_connection)) { - $this->_connection->connect(); - } else { - if (!isset($this->_socket)) { - if (!$socket = fsockopen( - $this->_getHostString(), $this->_port, $errno, $errstr, $this->_timeout)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to connect to POP3 host [%s]: %s', $this->_host, $errstr) - ); - } - $this->_socket = $socket; - - if (false === $greeting = fgets($this->_socket)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to connect to POP3 host [%s]', trim($greeting)) - ); - } - - $this->_assertOk($greeting); - - if ($this->_username) { - $this->_command(sprintf("USER %s\r\n", $this->_username)); - $this->_command(sprintf("PASS %s\r\n", $this->_password)); - } - } - } - } - - /** - * Disconnect from the POP3 host. - */ - public function disconnect() - { - if (isset($this->_connection)) { - $this->_connection->disconnect(); - } else { - $this->_command("QUIT\r\n"); - if (!fclose($this->_socket)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('POP3 host [%s] connection could not be stopped', $this->_host) - ); - } - $this->_socket = null; - } - } - - /** - * Invoked just before a Transport is started. - * - * @param Swift_Events_TransportChangeEvent $evt - */ - public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt) - { - if (isset($this->_transport)) { - if ($this->_transport !== $evt->getTransport()) { - return; - } - } - - $this->connect(); - $this->disconnect(); - } - - /** - * Not used. - */ - public function transportStarted(Swift_Events_TransportChangeEvent $evt) - { - } - - /** - * Not used. - */ - public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt) - { - } - - /** - * Not used. - */ - public function transportStopped(Swift_Events_TransportChangeEvent $evt) - { - } - - private function _command($command) - { - if (!fwrite($this->_socket, $command)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to write command [%s] to POP3 host', trim($command)) - ); - } - - if (false === $response = fgets($this->_socket)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to read from POP3 host after command [%s]', trim($command)) - ); - } - - $this->_assertOk($response); - - return $response; - } - - private function _assertOk($response) - { - if (substr($response, 0, 3) != '+OK') { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('POP3 command failed [%s]', trim($response)) - ); - } - } - - private function _getHostString() - { - $host = $this->_host; - switch (strtolower($this->_crypto)) { - case 'ssl': - $host = 'ssl://'.$host; - break; - - case 'tls': - $host = 'tls://'.$host; - break; - } - - return $host; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php deleted file mode 100644 index c3a1f86..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php +++ /dev/null @@ -1,213 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2009 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Redirects all email to a single recipient. - * - * @author Fabien Potencier - */ -class Swift_Plugins_RedirectingPlugin implements Swift_Events_SendListener -{ - /** - * The recipient who will receive all messages. - * - * @var mixed - */ - private $_recipient; - - /** - * List of regular expression for recipient whitelisting. - * - * @var array - */ - private $_whitelist = array(); - - /** - * Create a new RedirectingPlugin. - * - * @param mixed $recipient - * @param array $whitelist - */ - public function __construct($recipient, array $whitelist = array()) - { - $this->_recipient = $recipient; - $this->_whitelist = $whitelist; - } - - /** - * Set the recipient of all messages. - * - * @param mixed $recipient - */ - public function setRecipient($recipient) - { - $this->_recipient = $recipient; - } - - /** - * Get the recipient of all messages. - * - * @return mixed - */ - public function getRecipient() - { - return $this->_recipient; - } - - /** - * Set a list of regular expressions to whitelist certain recipients. - * - * @param array $whitelist - */ - public function setWhitelist(array $whitelist) - { - $this->_whitelist = $whitelist; - } - - /** - * Get the whitelist. - * - * @return array - */ - public function getWhitelist() - { - return $this->_whitelist; - } - - /** - * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $headers = $message->getHeaders(); - - // conditionally save current recipients - - if ($headers->has('to')) { - $headers->addMailboxHeader('X-Swift-To', $message->getTo()); - } - - if ($headers->has('cc')) { - $headers->addMailboxHeader('X-Swift-Cc', $message->getCc()); - } - - if ($headers->has('bcc')) { - $headers->addMailboxHeader('X-Swift-Bcc', $message->getBcc()); - } - - // Filter remaining headers against whitelist - $this->_filterHeaderSet($headers, 'To'); - $this->_filterHeaderSet($headers, 'Cc'); - $this->_filterHeaderSet($headers, 'Bcc'); - - // Add each hard coded recipient - $to = $message->getTo(); - if (null === $to) { - $to = array(); - } - - foreach ((array) $this->_recipient as $recipient) { - if (!array_key_exists($recipient, $to)) { - $message->addTo($recipient); - } - } - } - - /** - * Filter header set against a whitelist of regular expressions. - * - * @param Swift_Mime_HeaderSet $headerSet - * @param string $type - */ - private function _filterHeaderSet(Swift_Mime_HeaderSet $headerSet, $type) - { - foreach ($headerSet->getAll($type) as $headers) { - $headers->setNameAddresses($this->_filterNameAddresses($headers->getNameAddresses())); - } - } - - /** - * Filtered list of addresses => name pairs. - * - * @param array $recipients - * - * @return array - */ - private function _filterNameAddresses(array $recipients) - { - $filtered = array(); - - foreach ($recipients as $address => $name) { - if ($this->_isWhitelisted($address)) { - $filtered[$address] = $name; - } - } - - return $filtered; - } - - /** - * Matches address against whitelist of regular expressions. - * - * @param $recipient - * - * @return bool - */ - protected function _isWhitelisted($recipient) - { - if (in_array($recipient, (array) $this->_recipient)) { - return true; - } - - foreach ($this->_whitelist as $pattern) { - if (preg_match($pattern, $recipient)) { - return true; - } - } - - return false; - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $this->_restoreMessage($evt->getMessage()); - } - - private function _restoreMessage(Swift_Mime_Message $message) - { - // restore original headers - $headers = $message->getHeaders(); - - if ($headers->has('X-Swift-To')) { - $message->setTo($headers->get('X-Swift-To')->getNameAddresses()); - $headers->removeAll('X-Swift-To'); - } else { - $message->setTo(null); - } - - if ($headers->has('X-Swift-Cc')) { - $message->setCc($headers->get('X-Swift-Cc')->getNameAddresses()); - $headers->removeAll('X-Swift-Cc'); - } - - if ($headers->has('X-Swift-Bcc')) { - $message->setBcc($headers->get('X-Swift-Bcc')->getNameAddresses()); - $headers->removeAll('X-Swift-Bcc'); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php deleted file mode 100644 index 0f21b7d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * The Reporter plugin sends pass/fail notification to a Reporter. - * - * @author Chris Corbyn - */ -interface Swift_Plugins_Reporter -{ - /** The recipient was accepted for delivery */ - const RESULT_PASS = 0x01; - - /** The recipient could not be accepted */ - const RESULT_FAIL = 0x10; - - /** - * Notifies this ReportNotifier that $address failed or succeeded. - * - * @param Swift_Mime_Message $message - * @param string $address - * @param int $result from {@link RESULT_PASS, RESULT_FAIL} - */ - public function notify(Swift_Mime_Message $message, $address, $result); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php deleted file mode 100644 index a37901f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Does real time reporting of pass/fail for each recipient. - * - * @author Chris Corbyn - */ -class Swift_Plugins_ReporterPlugin implements Swift_Events_SendListener -{ - /** - * The reporter backend which takes notifications. - * - * @var Swift_Plugins_Reporter - */ - private $_reporter; - - /** - * Create a new ReporterPlugin using $reporter. - * - * @param Swift_Plugins_Reporter $reporter - */ - public function __construct(Swift_Plugins_Reporter $reporter) - { - $this->_reporter = $reporter; - } - - /** - * Not used. - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - } - - /** - * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $failures = array_flip($evt->getFailedRecipients()); - foreach ((array) $message->getTo() as $address => $null) { - $this->_reporter->notify($message, $address, array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS); - } - foreach ((array) $message->getCc() as $address => $null) { - $this->_reporter->notify($message, $address, array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS); - } - foreach ((array) $message->getBcc() as $address => $null) { - $this->_reporter->notify($message, $address, array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php deleted file mode 100644 index cad9d16..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A reporter which "collects" failures for the Reporter plugin. - * - * @author Chris Corbyn - */ -class Swift_Plugins_Reporters_HitReporter implements Swift_Plugins_Reporter -{ - /** - * The list of failures. - * - * @var array - */ - private $_failures = array(); - - private $_failures_cache = array(); - - /** - * Notifies this ReportNotifier that $address failed or succeeded. - * - * @param Swift_Mime_Message $message - * @param string $address - * @param int $result from {@link RESULT_PASS, RESULT_FAIL} - */ - public function notify(Swift_Mime_Message $message, $address, $result) - { - if (self::RESULT_FAIL == $result && !isset($this->_failures_cache[$address])) { - $this->_failures[] = $address; - $this->_failures_cache[$address] = true; - } - } - - /** - * Get an array of addresses for which delivery failed. - * - * @return array - */ - public function getFailedRecipients() - { - return $this->_failures; - } - - /** - * Clear the buffer (empty the list). - */ - public function clear() - { - $this->_failures = $this->_failures_cache = array(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php deleted file mode 100644 index c625935..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A HTML output reporter for the Reporter plugin. - * - * @author Chris Corbyn - */ -class Swift_Plugins_Reporters_HtmlReporter implements Swift_Plugins_Reporter -{ - /** - * Notifies this ReportNotifier that $address failed or succeeded. - * - * @param Swift_Mime_Message $message - * @param string $address - * @param int $result from {@see RESULT_PASS, RESULT_FAIL} - */ - public function notify(Swift_Mime_Message $message, $address, $result) - { - if (self::RESULT_PASS == $result) { - echo '<div style="color: #fff; background: #006600; padding: 2px; margin: 2px;">'.PHP_EOL; - echo 'PASS '.$address.PHP_EOL; - echo '</div>'.PHP_EOL; - flush(); - } else { - echo '<div style="color: #fff; background: #880000; padding: 2px; margin: 2px;">'.PHP_EOL; - echo 'FAIL '.$address.PHP_EOL; - echo '</div>'.PHP_EOL; - flush(); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php deleted file mode 100644 index 595c0f6..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Sleeps for a duration of time. - * - * @author Chris Corbyn - */ -interface Swift_Plugins_Sleeper -{ - /** - * Sleep for $seconds. - * - * @param int $seconds - */ - public function sleep($seconds); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php deleted file mode 100644 index 2f4b9a7..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php +++ /dev/null @@ -1,200 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Throttles the rate at which emails are sent. - * - * @author Chris Corbyn - */ -class Swift_Plugins_ThrottlerPlugin extends Swift_Plugins_BandwidthMonitorPlugin implements Swift_Plugins_Sleeper, Swift_Plugins_Timer -{ - /** Flag for throttling in bytes per minute */ - const BYTES_PER_MINUTE = 0x01; - - /** Flag for throttling in emails per second (Amazon SES) */ - const MESSAGES_PER_SECOND = 0x11; - - /** Flag for throttling in emails per minute */ - const MESSAGES_PER_MINUTE = 0x10; - - /** - * The Sleeper instance for sleeping. - * - * @var Swift_Plugins_Sleeper - */ - private $_sleeper; - - /** - * The Timer instance which provides the timestamp. - * - * @var Swift_Plugins_Timer - */ - private $_timer; - - /** - * The time at which the first email was sent. - * - * @var int - */ - private $_start; - - /** - * The rate at which messages should be sent. - * - * @var int - */ - private $_rate; - - /** - * The mode for throttling. - * - * This is {@link BYTES_PER_MINUTE} or {@link MESSAGES_PER_MINUTE} - * - * @var int - */ - private $_mode; - - /** - * An internal counter of the number of messages sent. - * - * @var int - */ - private $_messages = 0; - - /** - * Create a new ThrottlerPlugin. - * - * @param int $rate - * @param int $mode, defaults to {@link BYTES_PER_MINUTE} - * @param Swift_Plugins_Sleeper $sleeper (only needed in testing) - * @param Swift_Plugins_Timer $timer (only needed in testing) - */ - public function __construct($rate, $mode = self::BYTES_PER_MINUTE, Swift_Plugins_Sleeper $sleeper = null, Swift_Plugins_Timer $timer = null) - { - $this->_rate = $rate; - $this->_mode = $mode; - $this->_sleeper = $sleeper; - $this->_timer = $timer; - } - - /** - * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $time = $this->getTimestamp(); - if (!isset($this->_start)) { - $this->_start = $time; - } - $duration = $time - $this->_start; - - switch ($this->_mode) { - case self::BYTES_PER_MINUTE: - $sleep = $this->_throttleBytesPerMinute($duration); - break; - case self::MESSAGES_PER_SECOND: - $sleep = $this->_throttleMessagesPerSecond($duration); - break; - case self::MESSAGES_PER_MINUTE: - $sleep = $this->_throttleMessagesPerMinute($duration); - break; - default: - $sleep = 0; - break; - } - - if ($sleep > 0) { - $this->sleep($sleep); - } - } - - /** - * Invoked when a Message is sent. - * - * @param Swift_Events_SendEvent $evt - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - parent::sendPerformed($evt); - ++$this->_messages; - } - - /** - * Sleep for $seconds. - * - * @param int $seconds - */ - public function sleep($seconds) - { - if (isset($this->_sleeper)) { - $this->_sleeper->sleep($seconds); - } else { - sleep($seconds); - } - } - - /** - * Get the current UNIX timestamp. - * - * @return int - */ - public function getTimestamp() - { - if (isset($this->_timer)) { - return $this->_timer->getTimestamp(); - } - - return time(); - } - - /** - * Get a number of seconds to sleep for. - * - * @param int $timePassed - * - * @return int - */ - private function _throttleBytesPerMinute($timePassed) - { - $expectedDuration = $this->getBytesOut() / ($this->_rate / 60); - - return (int) ceil($expectedDuration - $timePassed); - } - - /** - * Get a number of seconds to sleep for. - * - * @param int $timePassed - * - * @return int - */ - private function _throttleMessagesPerSecond($timePassed) - { - $expectedDuration = $this->_messages / ($this->_rate); - - return (int) ceil($expectedDuration - $timePassed); - } - - /** - * Get a number of seconds to sleep for. - * - * @param int $timePassed - * - * @return int - */ - private function _throttleMessagesPerMinute($timePassed) - { - $expectedDuration = $this->_messages / ($this->_rate / 60); - - return (int) ceil($expectedDuration - $timePassed); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php deleted file mode 100644 index 9c8deb3..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Provides timestamp data. - * - * @author Chris Corbyn - */ -interface Swift_Plugins_Timer -{ - /** - * Get the current UNIX timestamp. - * - * @return int - */ - public function getTimestamp(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Preferences.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Preferences.php deleted file mode 100644 index 83cbddc..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Preferences.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Changes some global preference settings in Swift Mailer. - * - * @author Chris Corbyn - */ -class Swift_Preferences -{ - /** Singleton instance */ - private static $_instance = null; - - /** Constructor not to be used */ - private function __construct() - { - } - - /** - * Gets the instance of Preferences. - * - * @return self - */ - public static function getInstance() - { - if (!isset(self::$_instance)) { - self::$_instance = new self(); - } - - return self::$_instance; - } - - /** - * Set the default charset used. - * - * @param string $charset - * - * @return $this - */ - public function setCharset($charset) - { - Swift_DependencyContainer::getInstance()->register('properties.charset')->asValue($charset); - - return $this; - } - - /** - * Set the directory where temporary files can be saved. - * - * @param string $dir - * - * @return $this - */ - public function setTempDir($dir) - { - Swift_DependencyContainer::getInstance()->register('tempdir')->asValue($dir); - - return $this; - } - - /** - * Set the type of cache to use (i.e. "disk" or "array"). - * - * @param string $type - * - * @return $this - */ - public function setCacheType($type) - { - Swift_DependencyContainer::getInstance()->register('cache')->asAliasOf(sprintf('cache.%s', $type)); - - return $this; - } - - /** - * Set the QuotedPrintable dot escaper preference. - * - * @param bool $dotEscape - * - * @return $this - */ - public function setQPDotEscape($dotEscape) - { - $dotEscape = !empty($dotEscape); - Swift_DependencyContainer::getInstance() - ->register('mime.qpcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder') - ->withDependencies(array('mime.charstream', 'mime.bytecanonicalizer')) - ->addConstructorValue($dotEscape); - - return $this; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php deleted file mode 100644 index 2897474..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Creates StreamFilters. - * - * @author Chris Corbyn - */ -interface Swift_ReplacementFilterFactory -{ - /** - * Create a filter to replace $search with $replace. - * - * @param mixed $search - * @param mixed $replace - * - * @return Swift_StreamFilter - */ - public function createFilter($search, $replace); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/RfcComplianceException.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/RfcComplianceException.php deleted file mode 100644 index 81bc403..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/RfcComplianceException.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * RFC Compliance Exception class. - * - * @author Chris Corbyn - */ -class Swift_RfcComplianceException extends Swift_SwiftException -{ - /** - * Create a new RfcComplianceException with $message. - * - * @param string $message - */ - public function __construct($message) - { - parent::__construct($message); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SendmailTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SendmailTransport.php deleted file mode 100644 index 47ae7a5..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SendmailTransport.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * SendmailTransport for sending mail through a Sendmail/Postfix (etc..) binary. - * - * @author Chris Corbyn - */ -class Swift_SendmailTransport extends Swift_Transport_SendmailTransport -{ - /** - * Create a new SendmailTransport, optionally using $command for sending. - * - * @param string $command - */ - public function __construct($command = '/usr/sbin/sendmail -bs') - { - call_user_func_array( - array($this, 'Swift_Transport_SendmailTransport::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.sendmail') - ); - - $this->setCommand($command); - } - - /** - * Create a new SendmailTransport instance. - * - * @param string $command - * - * @return self - */ - public static function newInstance($command = '/usr/sbin/sendmail -bs') - { - return new self($command); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SignedMessage.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SignedMessage.php deleted file mode 100644 index 2e7a872..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SignedMessage.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Signed Message, message that can be signed using a signer. - * - * This class is only kept for compatibility - * - * - * @author Xavier De Cock <xdecock@gmail.com> - * - * @deprecated - */ -class Swift_SignedMessage extends Swift_Message -{ -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signer.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signer.php deleted file mode 100644 index 2d8176d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signer.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Base Class of Signer Infrastructure. - * - * - * @author Xavier De Cock <xdecock@gmail.com> - */ -interface Swift_Signer -{ - public function reset(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php deleted file mode 100644 index 8e66e18..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Body Signer Interface used to apply Body-Based Signature to a message. - * - * @author Xavier De Cock <xdecock@gmail.com> - */ -interface Swift_Signers_BodySigner extends Swift_Signer -{ - /** - * Change the Swift_Signed_Message to apply the singing. - * - * @param Swift_Message $message - * - * @return self - */ - public function signMessage(Swift_Message $message); - - /** - * Return the list of header a signer might tamper. - * - * @return array - */ - public function getAlteredHeaders(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php deleted file mode 100644 index 454e84b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php +++ /dev/null @@ -1,712 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * DKIM Signer used to apply DKIM Signature to a message. - * - * @author Xavier De Cock <xdecock@gmail.com> - */ -class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner -{ - /** - * PrivateKey. - * - * @var string - */ - protected $_privateKey; - - /** - * DomainName. - * - * @var string - */ - protected $_domainName; - - /** - * Selector. - * - * @var string - */ - protected $_selector; - - /** - * Hash algorithm used. - * - * @see RFC6376 3.3: Signers MUST implement and SHOULD sign using rsa-sha256. - * - * @var string - */ - protected $_hashAlgorithm = 'rsa-sha256'; - - /** - * Body canon method. - * - * @var string - */ - protected $_bodyCanon = 'simple'; - - /** - * Header canon method. - * - * @var string - */ - protected $_headerCanon = 'simple'; - - /** - * Headers not being signed. - * - * @var array - */ - protected $_ignoredHeaders = array('return-path' => true); - - /** - * Signer identity. - * - * @var string - */ - protected $_signerIdentity; - - /** - * BodyLength. - * - * @var int - */ - protected $_bodyLen = 0; - - /** - * Maximum signedLen. - * - * @var int - */ - protected $_maxLen = PHP_INT_MAX; - - /** - * Embbed bodyLen in signature. - * - * @var bool - */ - protected $_showLen = false; - - /** - * When the signature has been applied (true means time()), false means not embedded. - * - * @var mixed - */ - protected $_signatureTimestamp = true; - - /** - * When will the signature expires false means not embedded, if sigTimestamp is auto - * Expiration is relative, otherwise it's absolute. - * - * @var int - */ - protected $_signatureExpiration = false; - - /** - * Must we embed signed headers? - * - * @var bool - */ - protected $_debugHeaders = false; - - // work variables - /** - * Headers used to generate hash. - * - * @var array - */ - protected $_signedHeaders = array(); - - /** - * If debugHeaders is set store debugData here. - * - * @var string - */ - private $_debugHeadersData = ''; - - /** - * Stores the bodyHash. - * - * @var string - */ - private $_bodyHash = ''; - - /** - * Stores the signature header. - * - * @var Swift_Mime_Headers_ParameterizedHeader - */ - protected $_dkimHeader; - - private $_bodyHashHandler; - - private $_headerHash; - - private $_headerCanonData = ''; - - private $_bodyCanonEmptyCounter = 0; - - private $_bodyCanonIgnoreStart = 2; - - private $_bodyCanonSpace = false; - - private $_bodyCanonLastChar = null; - - private $_bodyCanonLine = ''; - - private $_bound = array(); - - /** - * Constructor. - * - * @param string $privateKey - * @param string $domainName - * @param string $selector - */ - public function __construct($privateKey, $domainName, $selector) - { - $this->_privateKey = $privateKey; - $this->_domainName = $domainName; - $this->_signerIdentity = '@'.$domainName; - $this->_selector = $selector; - - // keep fallback hash algorithm sha1 if php version is lower than 5.4.8 - if (PHP_VERSION_ID < 50408) { - $this->_hashAlgorithm = 'rsa-sha1'; - } - } - - /** - * Instanciate DKIMSigner. - * - * @param string $privateKey - * @param string $domainName - * @param string $selector - * - * @return self - */ - public static function newInstance($privateKey, $domainName, $selector) - { - return new static($privateKey, $domainName, $selector); - } - - /** - * Reset the Signer. - * - * @see Swift_Signer::reset() - */ - public function reset() - { - $this->_headerHash = null; - $this->_signedHeaders = array(); - $this->_bodyHash = null; - $this->_bodyHashHandler = null; - $this->_bodyCanonIgnoreStart = 2; - $this->_bodyCanonEmptyCounter = 0; - $this->_bodyCanonLastChar = null; - $this->_bodyCanonSpace = false; - } - - /** - * Writes $bytes to the end of the stream. - * - * Writing may not happen immediately if the stream chooses to buffer. If - * you want to write these bytes with immediate effect, call {@link commit()} - * after calling write(). - * - * This method returns the sequence ID of the write (i.e. 1 for first, 2 for - * second, etc etc). - * - * @param string $bytes - * - * @throws Swift_IoException - * - * @return int - */ - // TODO fix return - public function write($bytes) - { - $this->_canonicalizeBody($bytes); - foreach ($this->_bound as $is) { - $is->write($bytes); - } - } - - /** - * For any bytes that are currently buffered inside the stream, force them - * off the buffer. - */ - public function commit() - { - // Nothing to do - return; - } - - /** - * Attach $is to this stream. - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - * - * @param Swift_InputByteStream $is - */ - public function bind(Swift_InputByteStream $is) - { - // Don't have to mirror anything - $this->_bound[] = $is; - - return; - } - - /** - * Remove an already bound stream. - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - * - * @param Swift_InputByteStream $is - */ - public function unbind(Swift_InputByteStream $is) - { - // Don't have to mirror anything - foreach ($this->_bound as $k => $stream) { - if ($stream === $is) { - unset($this->_bound[$k]); - - return; - } - } - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - * - * @throws Swift_IoException - */ - public function flushBuffers() - { - $this->reset(); - } - - /** - * Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1. - * - * @param string $hash 'rsa-sha1' or 'rsa-sha256' - * - * @throws Swift_SwiftException - * - * @return $this - */ - public function setHashAlgorithm($hash) - { - switch ($hash) { - case 'rsa-sha1': - $this->_hashAlgorithm = 'rsa-sha1'; - break; - case 'rsa-sha256': - $this->_hashAlgorithm = 'rsa-sha256'; - if (!defined('OPENSSL_ALGO_SHA256')) { - throw new Swift_SwiftException('Unable to set sha256 as it is not supported by OpenSSL.'); - } - break; - default: - throw new Swift_SwiftException('Unable to set the hash algorithm, must be one of rsa-sha1 or rsa-sha256 (%s given).', $hash); - } - - return $this; - } - - /** - * Set the body canonicalization algorithm. - * - * @param string $canon - * - * @return $this - */ - public function setBodyCanon($canon) - { - if ($canon == 'relaxed') { - $this->_bodyCanon = 'relaxed'; - } else { - $this->_bodyCanon = 'simple'; - } - - return $this; - } - - /** - * Set the header canonicalization algorithm. - * - * @param string $canon - * - * @return $this - */ - public function setHeaderCanon($canon) - { - if ($canon == 'relaxed') { - $this->_headerCanon = 'relaxed'; - } else { - $this->_headerCanon = 'simple'; - } - - return $this; - } - - /** - * Set the signer identity. - * - * @param string $identity - * - * @return $this - */ - public function setSignerIdentity($identity) - { - $this->_signerIdentity = $identity; - - return $this; - } - - /** - * Set the length of the body to sign. - * - * @param mixed $len (bool or int) - * - * @return $this - */ - public function setBodySignedLen($len) - { - if ($len === true) { - $this->_showLen = true; - $this->_maxLen = PHP_INT_MAX; - } elseif ($len === false) { - $this->_showLen = false; - $this->_maxLen = PHP_INT_MAX; - } else { - $this->_showLen = true; - $this->_maxLen = (int) $len; - } - - return $this; - } - - /** - * Set the signature timestamp. - * - * @param int $time A timestamp - * - * @return $this - */ - public function setSignatureTimestamp($time) - { - $this->_signatureTimestamp = $time; - - return $this; - } - - /** - * Set the signature expiration timestamp. - * - * @param int $time A timestamp - * - * @return $this - */ - public function setSignatureExpiration($time) - { - $this->_signatureExpiration = $time; - - return $this; - } - - /** - * Enable / disable the DebugHeaders. - * - * @param bool $debug - * - * @return Swift_Signers_DKIMSigner - */ - public function setDebugHeaders($debug) - { - $this->_debugHeaders = (bool) $debug; - - return $this; - } - - /** - * Start Body. - */ - public function startBody() - { - // Init - switch ($this->_hashAlgorithm) { - case 'rsa-sha256': - $this->_bodyHashHandler = hash_init('sha256'); - break; - case 'rsa-sha1': - $this->_bodyHashHandler = hash_init('sha1'); - break; - } - $this->_bodyCanonLine = ''; - } - - /** - * End Body. - */ - public function endBody() - { - $this->_endOfBody(); - } - - /** - * Returns the list of Headers Tampered by this plugin. - * - * @return array - */ - public function getAlteredHeaders() - { - if ($this->_debugHeaders) { - return array('DKIM-Signature', 'X-DebugHash'); - } else { - return array('DKIM-Signature'); - } - } - - /** - * Adds an ignored Header. - * - * @param string $header_name - * - * @return Swift_Signers_DKIMSigner - */ - public function ignoreHeader($header_name) - { - $this->_ignoredHeaders[strtolower($header_name)] = true; - - return $this; - } - - /** - * Set the headers to sign. - * - * @param Swift_Mime_HeaderSet $headers - * - * @return Swift_Signers_DKIMSigner - */ - public function setHeaders(Swift_Mime_HeaderSet $headers) - { - $this->_headerCanonData = ''; - // Loop through Headers - $listHeaders = $headers->listAll(); - foreach ($listHeaders as $hName) { - // Check if we need to ignore Header - if (!isset($this->_ignoredHeaders[strtolower($hName)])) { - if ($headers->has($hName)) { - $tmp = $headers->getAll($hName); - foreach ($tmp as $header) { - if ($header->getFieldBody() != '') { - $this->_addHeader($header->toString()); - $this->_signedHeaders[] = $header->getFieldName(); - } - } - } - } - } - - return $this; - } - - /** - * Add the signature to the given Headers. - * - * @param Swift_Mime_HeaderSet $headers - * - * @return Swift_Signers_DKIMSigner - */ - public function addSignature(Swift_Mime_HeaderSet $headers) - { - // Prepare the DKIM-Signature - $params = array('v' => '1', 'a' => $this->_hashAlgorithm, 'bh' => base64_encode($this->_bodyHash), 'd' => $this->_domainName, 'h' => implode(': ', $this->_signedHeaders), 'i' => $this->_signerIdentity, 's' => $this->_selector); - if ($this->_bodyCanon != 'simple') { - $params['c'] = $this->_headerCanon.'/'.$this->_bodyCanon; - } elseif ($this->_headerCanon != 'simple') { - $params['c'] = $this->_headerCanon; - } - if ($this->_showLen) { - $params['l'] = $this->_bodyLen; - } - if ($this->_signatureTimestamp === true) { - $params['t'] = time(); - if ($this->_signatureExpiration !== false) { - $params['x'] = $params['t'] + $this->_signatureExpiration; - } - } else { - if ($this->_signatureTimestamp !== false) { - $params['t'] = $this->_signatureTimestamp; - } - if ($this->_signatureExpiration !== false) { - $params['x'] = $this->_signatureExpiration; - } - } - if ($this->_debugHeaders) { - $params['z'] = implode('|', $this->_debugHeadersData); - } - $string = ''; - foreach ($params as $k => $v) { - $string .= $k.'='.$v.'; '; - } - $string = trim($string); - $headers->addTextHeader('DKIM-Signature', $string); - // Add the last DKIM-Signature - $tmp = $headers->getAll('DKIM-Signature'); - $this->_dkimHeader = end($tmp); - $this->_addHeader(trim($this->_dkimHeader->toString())."\r\n b=", true); - $this->_endOfHeaders(); - if ($this->_debugHeaders) { - $headers->addTextHeader('X-DebugHash', base64_encode($this->_headerHash)); - } - $this->_dkimHeader->setValue($string.' b='.trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '))); - - return $this; - } - - /* Private helpers */ - - protected function _addHeader($header, $is_sig = false) - { - switch ($this->_headerCanon) { - case 'relaxed': - // Prepare Header and cascade - $exploded = explode(':', $header, 2); - $name = strtolower(trim($exploded[0])); - $value = str_replace("\r\n", '', $exploded[1]); - $value = preg_replace("/[ \t][ \t]+/", ' ', $value); - $header = $name.':'.trim($value).($is_sig ? '' : "\r\n"); - case 'simple': - // Nothing to do - } - $this->_addToHeaderHash($header); - } - - /** - * @deprecated This method is currently useless in this class but it must be - * kept for BC reasons due to its "protected" scope. This method - * might be overridden by custom client code. - */ - protected function _endOfHeaders() - { - } - - protected function _canonicalizeBody($string) - { - $len = strlen($string); - $canon = ''; - $method = ($this->_bodyCanon == 'relaxed'); - for ($i = 0; $i < $len; ++$i) { - if ($this->_bodyCanonIgnoreStart > 0) { - --$this->_bodyCanonIgnoreStart; - continue; - } - switch ($string[$i]) { - case "\r": - $this->_bodyCanonLastChar = "\r"; - break; - case "\n": - if ($this->_bodyCanonLastChar == "\r") { - if ($method) { - $this->_bodyCanonSpace = false; - } - if ($this->_bodyCanonLine == '') { - ++$this->_bodyCanonEmptyCounter; - } else { - $this->_bodyCanonLine = ''; - $canon .= "\r\n"; - } - } else { - // Wooops Error - // todo handle it but should never happen - } - break; - case ' ': - case "\t": - if ($method) { - $this->_bodyCanonSpace = true; - break; - } - default: - if ($this->_bodyCanonEmptyCounter > 0) { - $canon .= str_repeat("\r\n", $this->_bodyCanonEmptyCounter); - $this->_bodyCanonEmptyCounter = 0; - } - if ($this->_bodyCanonSpace) { - $this->_bodyCanonLine .= ' '; - $canon .= ' '; - $this->_bodyCanonSpace = false; - } - $this->_bodyCanonLine .= $string[$i]; - $canon .= $string[$i]; - } - } - $this->_addToBodyHash($canon); - } - - protected function _endOfBody() - { - // Add trailing Line return if last line is non empty - if (strlen($this->_bodyCanonLine) > 0) { - $this->_addToBodyHash("\r\n"); - } - $this->_bodyHash = hash_final($this->_bodyHashHandler, true); - } - - private function _addToBodyHash($string) - { - $len = strlen($string); - if ($len > ($new_len = ($this->_maxLen - $this->_bodyLen))) { - $string = substr($string, 0, $new_len); - $len = $new_len; - } - hash_update($this->_bodyHashHandler, $string); - $this->_bodyLen += $len; - } - - private function _addToHeaderHash($header) - { - if ($this->_debugHeaders) { - $this->_debugHeadersData[] = trim($header); - } - $this->_headerCanonData .= $header; - } - - /** - * @throws Swift_SwiftException - * - * @return string - */ - private function _getEncryptedHash() - { - $signature = ''; - - switch ($this->_hashAlgorithm) { - case 'rsa-sha1': - $algorithm = OPENSSL_ALGO_SHA1; - break; - case 'rsa-sha256': - $algorithm = OPENSSL_ALGO_SHA256; - break; - } - $pkeyId = openssl_get_privatekey($this->_privateKey); - if (!$pkeyId) { - throw new Swift_SwiftException('Unable to load DKIM Private Key ['.openssl_error_string().']'); - } - if (openssl_sign($this->_headerCanonData, $signature, $pkeyId, $algorithm)) { - return $signature; - } - throw new Swift_SwiftException('Unable to sign DKIM Hash ['.openssl_error_string().']'); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php deleted file mode 100644 index 0365363..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php +++ /dev/null @@ -1,524 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * DomainKey Signer used to apply DomainKeys Signature to a message. - * - * @author Xavier De Cock <xdecock@gmail.com> - */ -class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner -{ - /** - * PrivateKey. - * - * @var string - */ - protected $_privateKey; - - /** - * DomainName. - * - * @var string - */ - protected $_domainName; - - /** - * Selector. - * - * @var string - */ - protected $_selector; - - /** - * Hash algorithm used. - * - * @var string - */ - protected $_hashAlgorithm = 'rsa-sha1'; - - /** - * Canonisation method. - * - * @var string - */ - protected $_canon = 'simple'; - - /** - * Headers not being signed. - * - * @var array - */ - protected $_ignoredHeaders = array(); - - /** - * Signer identity. - * - * @var string - */ - protected $_signerIdentity; - - /** - * Must we embed signed headers? - * - * @var bool - */ - protected $_debugHeaders = false; - - // work variables - /** - * Headers used to generate hash. - * - * @var array - */ - private $_signedHeaders = array(); - - /** - * Stores the signature header. - * - * @var Swift_Mime_Headers_ParameterizedHeader - */ - protected $_domainKeyHeader; - - /** - * Hash Handler. - * - * @var resource|null - */ - private $_hashHandler; - - private $_hash; - - private $_canonData = ''; - - private $_bodyCanonEmptyCounter = 0; - - private $_bodyCanonIgnoreStart = 2; - - private $_bodyCanonSpace = false; - - private $_bodyCanonLastChar = null; - - private $_bodyCanonLine = ''; - - private $_bound = array(); - - /** - * Constructor. - * - * @param string $privateKey - * @param string $domainName - * @param string $selector - */ - public function __construct($privateKey, $domainName, $selector) - { - $this->_privateKey = $privateKey; - $this->_domainName = $domainName; - $this->_signerIdentity = '@'.$domainName; - $this->_selector = $selector; - } - - /** - * Instanciate DomainKeySigner. - * - * @param string $privateKey - * @param string $domainName - * @param string $selector - * - * @return self - */ - public static function newInstance($privateKey, $domainName, $selector) - { - return new static($privateKey, $domainName, $selector); - } - - /** - * Resets internal states. - * - * @return $this - */ - public function reset() - { - $this->_hash = null; - $this->_hashHandler = null; - $this->_bodyCanonIgnoreStart = 2; - $this->_bodyCanonEmptyCounter = 0; - $this->_bodyCanonLastChar = null; - $this->_bodyCanonSpace = false; - - return $this; - } - - /** - * Writes $bytes to the end of the stream. - * - * Writing may not happen immediately if the stream chooses to buffer. If - * you want to write these bytes with immediate effect, call {@link commit()} - * after calling write(). - * - * This method returns the sequence ID of the write (i.e. 1 for first, 2 for - * second, etc etc). - * - * @param string $bytes - * - * @throws Swift_IoException - * - * @return $this - */ - public function write($bytes) - { - $this->_canonicalizeBody($bytes); - foreach ($this->_bound as $is) { - $is->write($bytes); - } - - return $this; - } - - /** - * For any bytes that are currently buffered inside the stream, force them - * off the buffer. - * - * @throws Swift_IoException - * - * @return $this - */ - public function commit() - { - // Nothing to do - return $this; - } - - /** - * Attach $is to this stream. - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - * - * @param Swift_InputByteStream $is - * - * @return $this - */ - public function bind(Swift_InputByteStream $is) - { - // Don't have to mirror anything - $this->_bound[] = $is; - - return $this; - } - - /** - * Remove an already bound stream. - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - * - * @param Swift_InputByteStream $is - * - * @return $this - */ - public function unbind(Swift_InputByteStream $is) - { - // Don't have to mirror anything - foreach ($this->_bound as $k => $stream) { - if ($stream === $is) { - unset($this->_bound[$k]); - - break; - } - } - - return $this; - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - * - * @throws Swift_IoException - * - * @return $this - */ - public function flushBuffers() - { - $this->reset(); - - return $this; - } - - /** - * Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256. - * - * @param string $hash - * - * @return $this - */ - public function setHashAlgorithm($hash) - { - $this->_hashAlgorithm = 'rsa-sha1'; - - return $this; - } - - /** - * Set the canonicalization algorithm. - * - * @param string $canon simple | nofws defaults to simple - * - * @return $this - */ - public function setCanon($canon) - { - if ($canon == 'nofws') { - $this->_canon = 'nofws'; - } else { - $this->_canon = 'simple'; - } - - return $this; - } - - /** - * Set the signer identity. - * - * @param string $identity - * - * @return $this - */ - public function setSignerIdentity($identity) - { - $this->_signerIdentity = $identity; - - return $this; - } - - /** - * Enable / disable the DebugHeaders. - * - * @param bool $debug - * - * @return $this - */ - public function setDebugHeaders($debug) - { - $this->_debugHeaders = (bool) $debug; - - return $this; - } - - /** - * Start Body. - */ - public function startBody() - { - } - - /** - * End Body. - */ - public function endBody() - { - $this->_endOfBody(); - } - - /** - * Returns the list of Headers Tampered by this plugin. - * - * @return array - */ - public function getAlteredHeaders() - { - if ($this->_debugHeaders) { - return array('DomainKey-Signature', 'X-DebugHash'); - } - - return array('DomainKey-Signature'); - } - - /** - * Adds an ignored Header. - * - * @param string $header_name - * - * @return $this - */ - public function ignoreHeader($header_name) - { - $this->_ignoredHeaders[strtolower($header_name)] = true; - - return $this; - } - - /** - * Set the headers to sign. - * - * @param Swift_Mime_HeaderSet $headers - * - * @return $this - */ - public function setHeaders(Swift_Mime_HeaderSet $headers) - { - $this->_startHash(); - $this->_canonData = ''; - // Loop through Headers - $listHeaders = $headers->listAll(); - foreach ($listHeaders as $hName) { - // Check if we need to ignore Header - if (!isset($this->_ignoredHeaders[strtolower($hName)])) { - if ($headers->has($hName)) { - $tmp = $headers->getAll($hName); - foreach ($tmp as $header) { - if ($header->getFieldBody() != '') { - $this->_addHeader($header->toString()); - $this->_signedHeaders[] = $header->getFieldName(); - } - } - } - } - } - $this->_endOfHeaders(); - - return $this; - } - - /** - * Add the signature to the given Headers. - * - * @param Swift_Mime_HeaderSet $headers - * - * @return $this - */ - public function addSignature(Swift_Mime_HeaderSet $headers) - { - // Prepare the DomainKey-Signature Header - $params = array('a' => $this->_hashAlgorithm, 'b' => chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '), 'c' => $this->_canon, 'd' => $this->_domainName, 'h' => implode(': ', $this->_signedHeaders), 'q' => 'dns', 's' => $this->_selector); - $string = ''; - foreach ($params as $k => $v) { - $string .= $k.'='.$v.'; '; - } - $string = trim($string); - $headers->addTextHeader('DomainKey-Signature', $string); - - return $this; - } - - /* Private helpers */ - - protected function _addHeader($header) - { - switch ($this->_canon) { - case 'nofws': - // Prepare Header and cascade - $exploded = explode(':', $header, 2); - $name = strtolower(trim($exploded[0])); - $value = str_replace("\r\n", '', $exploded[1]); - $value = preg_replace("/[ \t][ \t]+/", ' ', $value); - $header = $name.':'.trim($value)."\r\n"; - case 'simple': - // Nothing to do - } - $this->_addToHash($header); - } - - protected function _endOfHeaders() - { - $this->_bodyCanonEmptyCounter = 1; - } - - protected function _canonicalizeBody($string) - { - $len = strlen($string); - $canon = ''; - $nofws = ($this->_canon == 'nofws'); - for ($i = 0; $i < $len; ++$i) { - if ($this->_bodyCanonIgnoreStart > 0) { - --$this->_bodyCanonIgnoreStart; - continue; - } - switch ($string[$i]) { - case "\r": - $this->_bodyCanonLastChar = "\r"; - break; - case "\n": - if ($this->_bodyCanonLastChar == "\r") { - if ($nofws) { - $this->_bodyCanonSpace = false; - } - if ($this->_bodyCanonLine == '') { - ++$this->_bodyCanonEmptyCounter; - } else { - $this->_bodyCanonLine = ''; - $canon .= "\r\n"; - } - } else { - // Wooops Error - throw new Swift_SwiftException('Invalid new line sequence in mail found \n without preceding \r'); - } - break; - case ' ': - case "\t": - case "\x09": //HTAB - if ($nofws) { - $this->_bodyCanonSpace = true; - break; - } - default: - if ($this->_bodyCanonEmptyCounter > 0) { - $canon .= str_repeat("\r\n", $this->_bodyCanonEmptyCounter); - $this->_bodyCanonEmptyCounter = 0; - } - $this->_bodyCanonLine .= $string[$i]; - $canon .= $string[$i]; - } - } - $this->_addToHash($canon); - } - - protected function _endOfBody() - { - if (strlen($this->_bodyCanonLine) > 0) { - $this->_addToHash("\r\n"); - } - $this->_hash = hash_final($this->_hashHandler, true); - } - - private function _addToHash($string) - { - $this->_canonData .= $string; - hash_update($this->_hashHandler, $string); - } - - private function _startHash() - { - // Init - switch ($this->_hashAlgorithm) { - case 'rsa-sha1': - $this->_hashHandler = hash_init('sha1'); - break; - } - $this->_bodyCanonLine = ''; - } - - /** - * @throws Swift_SwiftException - * - * @return string - */ - private function _getEncryptedHash() - { - $signature = ''; - $pkeyId = openssl_get_privatekey($this->_privateKey); - if (!$pkeyId) { - throw new Swift_SwiftException('Unable to load DomainKey Private Key ['.openssl_error_string().']'); - } - if (openssl_sign($this->_canonData, $signature, $pkeyId, OPENSSL_ALGO_SHA1)) { - return $signature; - } - throw new Swift_SwiftException('Unable to sign DomainKey Hash ['.openssl_error_string().']'); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php deleted file mode 100644 index ef8832f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Header Signer Interface used to apply Header-Based Signature to a message. - * - * @author Xavier De Cock <xdecock@gmail.com> - */ -interface Swift_Signers_HeaderSigner extends Swift_Signer, Swift_InputByteStream -{ - /** - * Exclude an header from the signed headers. - * - * @param string $header_name - * - * @return self - */ - public function ignoreHeader($header_name); - - /** - * Prepare the Signer to get a new Body. - * - * @return self - */ - public function startBody(); - - /** - * Give the signal that the body has finished streaming. - * - * @return self - */ - public function endBody(); - - /** - * Give the headers already given. - * - * @param Swift_Mime_SimpleHeaderSet $headers - * - * @return self - */ - public function setHeaders(Swift_Mime_HeaderSet $headers); - - /** - * Add the header(s) to the headerSet. - * - * @param Swift_Mime_HeaderSet $headers - * - * @return self - */ - public function addSignature(Swift_Mime_HeaderSet $headers); - - /** - * Return the list of header a signer might tamper. - * - * @return array - */ - public function getAlteredHeaders(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php deleted file mode 100644 index 8fdbaa4..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php +++ /dev/null @@ -1,190 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * DKIM Signer used to apply DKIM Signature to a message - * Takes advantage of pecl extension. - * - * @author Xavier De Cock <xdecock@gmail.com> - */ -class Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner -{ - private $_peclLoaded = false; - - private $_dkimHandler = null; - - private $dropFirstLF = true; - - const CANON_RELAXED = 1; - const CANON_SIMPLE = 2; - const SIG_RSA_SHA1 = 3; - const SIG_RSA_SHA256 = 4; - - public function __construct($privateKey, $domainName, $selector) - { - if (!extension_loaded('opendkim')) { - throw new Swift_SwiftException('php-opendkim extension not found'); - } - - $this->_peclLoaded = true; - - parent::__construct($privateKey, $domainName, $selector); - } - - public static function newInstance($privateKey, $domainName, $selector) - { - return new static($privateKey, $domainName, $selector); - } - - public function addSignature(Swift_Mime_HeaderSet $headers) - { - $header = new Swift_Mime_Headers_OpenDKIMHeader('DKIM-Signature'); - $headerVal = $this->_dkimHandler->getSignatureHeader(); - if (!$headerVal) { - throw new Swift_SwiftException('OpenDKIM Error: '.$this->_dkimHandler->getError()); - } - $header->setValue($headerVal); - $headers->set($header); - - return $this; - } - - public function setHeaders(Swift_Mime_HeaderSet $headers) - { - $bodyLen = $this->_bodyLen; - if (is_bool($bodyLen)) { - $bodyLen = -1; - } - $hash = $this->_hashAlgorithm == 'rsa-sha1' ? OpenDKIMSign::ALG_RSASHA1 : OpenDKIMSign::ALG_RSASHA256; - $bodyCanon = $this->_bodyCanon == 'simple' ? OpenDKIMSign::CANON_SIMPLE : OpenDKIMSign::CANON_RELAXED; - $headerCanon = $this->_headerCanon == 'simple' ? OpenDKIMSign::CANON_SIMPLE : OpenDKIMSign::CANON_RELAXED; - $this->_dkimHandler = new OpenDKIMSign($this->_privateKey, $this->_selector, $this->_domainName, $headerCanon, $bodyCanon, $hash, $bodyLen); - // Hardcode signature Margin for now - $this->_dkimHandler->setMargin(78); - - if (!is_numeric($this->_signatureTimestamp)) { - OpenDKIM::setOption(OpenDKIM::OPTS_FIXEDTIME, time()); - } else { - if (!OpenDKIM::setOption(OpenDKIM::OPTS_FIXEDTIME, $this->_signatureTimestamp)) { - throw new Swift_SwiftException('Unable to force signature timestamp ['.openssl_error_string().']'); - } - } - if (isset($this->_signerIdentity)) { - $this->_dkimHandler->setSigner($this->_signerIdentity); - } - $listHeaders = $headers->listAll(); - foreach ($listHeaders as $hName) { - // Check if we need to ignore Header - if (!isset($this->_ignoredHeaders[strtolower($hName)])) { - $tmp = $headers->getAll($hName); - if ($headers->has($hName)) { - foreach ($tmp as $header) { - if ($header->getFieldBody() != '') { - $htosign = $header->toString(); - $this->_dkimHandler->header($htosign); - $this->_signedHeaders[] = $header->getFieldName(); - } - } - } - } - } - - return $this; - } - - public function startBody() - { - if (!$this->_peclLoaded) { - return parent::startBody(); - } - $this->dropFirstLF = true; - $this->_dkimHandler->eoh(); - - return $this; - } - - public function endBody() - { - if (!$this->_peclLoaded) { - return parent::endBody(); - } - $this->_dkimHandler->eom(); - - return $this; - } - - public function reset() - { - $this->_dkimHandler = null; - parent::reset(); - - return $this; - } - - /** - * Set the signature timestamp. - * - * @param int $time - * - * @return $this - */ - public function setSignatureTimestamp($time) - { - $this->_signatureTimestamp = $time; - - return $this; - } - - /** - * Set the signature expiration timestamp. - * - * @param int $time - * - * @return $this - */ - public function setSignatureExpiration($time) - { - $this->_signatureExpiration = $time; - - return $this; - } - - /** - * Enable / disable the DebugHeaders. - * - * @param bool $debug - * - * @return $this - */ - public function setDebugHeaders($debug) - { - $this->_debugHeaders = (bool) $debug; - - return $this; - } - - // Protected - - protected function _canonicalizeBody($string) - { - if (!$this->_peclLoaded) { - return parent::_canonicalizeBody($string); - } - if (false && $this->dropFirstLF === true) { - if ($string[0] == "\r" && $string[1] == "\n") { - $string = substr($string, 2); - } - } - $this->dropFirstLF = false; - if (strlen($string)) { - $this->_dkimHandler->body($string); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php deleted file mode 100644 index d13c02e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php +++ /dev/null @@ -1,436 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * MIME Message Signer used to apply S/MIME Signature/Encryption to a message. - * - * - * @author Romain-Geissler - * @author Sebastiaan Stok <s.stok@rollerscapes.net> - */ -class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner -{ - protected $signCertificate; - protected $signPrivateKey; - protected $encryptCert; - protected $signThenEncrypt = true; - protected $signLevel; - protected $encryptLevel; - protected $signOptions; - protected $encryptOptions; - protected $encryptCipher; - protected $extraCerts = null; - - /** - * @var Swift_StreamFilters_StringReplacementFilterFactory - */ - protected $replacementFactory; - - /** - * @var Swift_Mime_HeaderFactory - */ - protected $headerFactory; - - /** - * Constructor. - * - * @param string|null $signCertificate - * @param string|null $signPrivateKey - * @param string|null $encryptCertificate - */ - public function __construct($signCertificate = null, $signPrivateKey = null, $encryptCertificate = null) - { - if (null !== $signPrivateKey) { - $this->setSignCertificate($signCertificate, $signPrivateKey); - } - - if (null !== $encryptCertificate) { - $this->setEncryptCertificate($encryptCertificate); - } - - $this->replacementFactory = Swift_DependencyContainer::getInstance() - ->lookup('transport.replacementfactory'); - - $this->signOptions = PKCS7_DETACHED; - - // Supported since php5.4 - if (defined('OPENSSL_CIPHER_AES_128_CBC')) { - $this->encryptCipher = OPENSSL_CIPHER_AES_128_CBC; - } else { - $this->encryptCipher = OPENSSL_CIPHER_RC2_128; - } - } - - /** - * Returns an new Swift_Signers_SMimeSigner instance. - * - * @param string $certificate - * @param string $privateKey - * - * @return self - */ - public static function newInstance($certificate = null, $privateKey = null) - { - return new self($certificate, $privateKey); - } - - /** - * Set the certificate location to use for signing. - * - * @see http://www.php.net/manual/en/openssl.pkcs7.flags.php - * - * @param string $certificate - * @param string|array $privateKey If the key needs an passphrase use array('file-location', 'passphrase') instead - * @param int $signOptions Bitwise operator options for openssl_pkcs7_sign() - * @param string $extraCerts A file containing intermediate certificates needed by the signing certificate - * - * @return $this - */ - public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null) - { - $this->signCertificate = 'file://'.str_replace('\\', '/', realpath($certificate)); - - if (null !== $privateKey) { - if (is_array($privateKey)) { - $this->signPrivateKey = $privateKey; - $this->signPrivateKey[0] = 'file://'.str_replace('\\', '/', realpath($privateKey[0])); - } else { - $this->signPrivateKey = 'file://'.str_replace('\\', '/', realpath($privateKey)); - } - } - - $this->signOptions = $signOptions; - if (null !== $extraCerts) { - $this->extraCerts = str_replace('\\', '/', realpath($extraCerts)); - } - - return $this; - } - - /** - * Set the certificate location to use for encryption. - * - * @see http://www.php.net/manual/en/openssl.pkcs7.flags.php - * @see http://nl3.php.net/manual/en/openssl.ciphers.php - * - * @param string|array $recipientCerts Either an single X.509 certificate, or an assoc array of X.509 certificates. - * @param int $cipher - * - * @return $this - */ - public function setEncryptCertificate($recipientCerts, $cipher = null) - { - if (is_array($recipientCerts)) { - $this->encryptCert = array(); - - foreach ($recipientCerts as $cert) { - $this->encryptCert[] = 'file://'.str_replace('\\', '/', realpath($cert)); - } - } else { - $this->encryptCert = 'file://'.str_replace('\\', '/', realpath($recipientCerts)); - } - - if (null !== $cipher) { - $this->encryptCipher = $cipher; - } - - return $this; - } - - /** - * @return string - */ - public function getSignCertificate() - { - return $this->signCertificate; - } - - /** - * @return string - */ - public function getSignPrivateKey() - { - return $this->signPrivateKey; - } - - /** - * Set perform signing before encryption. - * - * The default is to first sign the message and then encrypt. - * But some older mail clients, namely Microsoft Outlook 2000 will work when the message first encrypted. - * As this goes against the official specs, its recommended to only use 'encryption -> signing' when specifically targeting these 'broken' clients. - * - * @param bool $signThenEncrypt - * - * @return $this - */ - public function setSignThenEncrypt($signThenEncrypt = true) - { - $this->signThenEncrypt = $signThenEncrypt; - - return $this; - } - - /** - * @return bool - */ - public function isSignThenEncrypt() - { - return $this->signThenEncrypt; - } - - /** - * Resets internal states. - * - * @return $this - */ - public function reset() - { - return $this; - } - - /** - * Change the Swift_Message to apply the signing. - * - * @param Swift_Message $message - * - * @return $this - */ - public function signMessage(Swift_Message $message) - { - if (null === $this->signCertificate && null === $this->encryptCert) { - return $this; - } - - // Store the message using ByteStream to a file{1} - // Remove all Children - // Sign file{1}, parse the new MIME headers and set them on the primary MimeEntity - // Set the singed-body as the new body (without boundary) - - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $this->toSMimeByteStream($messageStream, $message); - $message->setEncoder(Swift_DependencyContainer::getInstance()->lookup('mime.rawcontentencoder')); - - $message->setChildren(array()); - $this->streamToMime($messageStream, $message); - } - - /** - * Return the list of header a signer might tamper. - * - * @return array - */ - public function getAlteredHeaders() - { - return array('Content-Type', 'Content-Transfer-Encoding', 'Content-Disposition'); - } - - /** - * @param Swift_InputByteStream $inputStream - * @param Swift_Message $mimeEntity - */ - protected function toSMimeByteStream(Swift_InputByteStream $inputStream, Swift_Message $message) - { - $mimeEntity = $this->createMessage($message); - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - $mimeEntity->toByteStream($messageStream); - $messageStream->commit(); - - if (null !== $this->signCertificate && null !== $this->encryptCert) { - $temporaryStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if ($this->signThenEncrypt) { - $this->messageStreamToSignedByteStream($messageStream, $temporaryStream); - $this->messageStreamToEncryptedByteStream($temporaryStream, $inputStream); - } else { - $this->messageStreamToEncryptedByteStream($messageStream, $temporaryStream); - $this->messageStreamToSignedByteStream($temporaryStream, $inputStream); - } - } elseif ($this->signCertificate !== null) { - $this->messageStreamToSignedByteStream($messageStream, $inputStream); - } else { - $this->messageStreamToEncryptedByteStream($messageStream, $inputStream); - } - } - - /** - * @param Swift_Message $message - * - * @return Swift_Message - */ - protected function createMessage(Swift_Message $message) - { - $mimeEntity = new Swift_Message('', $message->getBody(), $message->getContentType(), $message->getCharset()); - $mimeEntity->setChildren($message->getChildren()); - - $messageHeaders = $mimeEntity->getHeaders(); - $messageHeaders->remove('Message-ID'); - $messageHeaders->remove('Date'); - $messageHeaders->remove('Subject'); - $messageHeaders->remove('MIME-Version'); - $messageHeaders->remove('To'); - $messageHeaders->remove('From'); - - return $mimeEntity; - } - - /** - * @param Swift_FileStream $outputStream - * @param Swift_InputByteStream $inputStream - * - * @throws Swift_IoException - */ - protected function messageStreamToSignedByteStream(Swift_FileStream $outputStream, Swift_InputByteStream $inputStream) - { - $signedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - $args = array($outputStream->getPath(), $signedMessageStream->getPath(), $this->signCertificate, $this->signPrivateKey, array(), $this->signOptions); - if (null !== $this->extraCerts) { - $args[] = $this->extraCerts; - } - - if (!call_user_func_array('openssl_pkcs7_sign', $args)) { - throw new Swift_IoException(sprintf('Failed to sign S/Mime message. Error: "%s".', openssl_error_string())); - } - - $this->copyFromOpenSSLOutput($signedMessageStream, $inputStream); - } - - /** - * @param Swift_FileStream $outputStream - * @param Swift_InputByteStream $is - * - * @throws Swift_IoException - */ - protected function messageStreamToEncryptedByteStream(Swift_FileStream $outputStream, Swift_InputByteStream $is) - { - $encryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_encrypt($outputStream->getPath(), $encryptedMessageStream->getPath(), $this->encryptCert, array(), 0, $this->encryptCipher)) { - throw new Swift_IoException(sprintf('Failed to encrypt S/Mime message. Error: "%s".', openssl_error_string())); - } - - $this->copyFromOpenSSLOutput($encryptedMessageStream, $is); - } - - /** - * @param Swift_OutputByteStream $fromStream - * @param Swift_InputByteStream $toStream - */ - protected function copyFromOpenSSLOutput(Swift_OutputByteStream $fromStream, Swift_InputByteStream $toStream) - { - $bufferLength = 4096; - $filteredStream = new Swift_ByteStream_TemporaryFileByteStream(); - $filteredStream->addFilter($this->replacementFactory->createFilter("\r\n", "\n"), 'CRLF to LF'); - $filteredStream->addFilter($this->replacementFactory->createFilter("\n", "\r\n"), 'LF to CRLF'); - - while (false !== ($buffer = $fromStream->read($bufferLength))) { - $filteredStream->write($buffer); - } - - $filteredStream->flushBuffers(); - - while (false !== ($buffer = $filteredStream->read($bufferLength))) { - $toStream->write($buffer); - } - - $toStream->commit(); - } - - /** - * Merges an OutputByteStream to Swift_Message. - * - * @param Swift_OutputByteStream $fromStream - * @param Swift_Message $message - */ - protected function streamToMime(Swift_OutputByteStream $fromStream, Swift_Message $message) - { - $bufferLength = 78; - $headerData = ''; - - $fromStream->setReadPointer(0); - - while (($buffer = $fromStream->read($bufferLength)) !== false) { - $headerData .= $buffer; - - if (false !== strpos($buffer, "\r\n\r\n")) { - break; - } - } - - $headersPosEnd = strpos($headerData, "\r\n\r\n"); - $headerData = trim($headerData); - $headerData = substr($headerData, 0, $headersPosEnd); - $headerLines = explode("\r\n", $headerData); - unset($headerData); - - $headers = array(); - $currentHeaderName = ''; - - foreach ($headerLines as $headerLine) { - // Line separated - if (ctype_space($headerLines[0]) || false === strpos($headerLine, ':')) { - $headers[$currentHeaderName] .= ' '.trim($headerLine); - continue; - } - - $header = explode(':', $headerLine, 2); - $currentHeaderName = strtolower($header[0]); - $headers[$currentHeaderName] = trim($header[1]); - } - - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $messageStream->addFilter($this->replacementFactory->createFilter("\r\n", "\n"), 'CRLF to LF'); - $messageStream->addFilter($this->replacementFactory->createFilter("\n", "\r\n"), 'LF to CRLF'); - - $messageHeaders = $message->getHeaders(); - - // No need to check for 'application/pkcs7-mime', as this is always base64 - if ('multipart/signed;' === substr($headers['content-type'], 0, 17)) { - if (!preg_match('/boundary=("[^"]+"|(?:[^\s]+|$))/is', $headers['content-type'], $contentTypeData)) { - throw new Swift_SwiftException('Failed to find Boundary parameter'); - } - - $boundary = trim($contentTypeData['1'], '"'); - - // Skip the header and CRLF CRLF - $fromStream->setReadPointer($headersPosEnd + 4); - - while (false !== ($buffer = $fromStream->read($bufferLength))) { - $messageStream->write($buffer); - } - - $messageStream->commit(); - - $messageHeaders->remove('Content-Transfer-Encoding'); - $message->setContentType($headers['content-type']); - $message->setBoundary($boundary); - $message->setBody($messageStream); - } else { - $fromStream->setReadPointer($headersPosEnd + 4); - - if (null === $this->headerFactory) { - $this->headerFactory = Swift_DependencyContainer::getInstance()->lookup('mime.headerfactory'); - } - - $message->setContentType($headers['content-type']); - $messageHeaders->set($this->headerFactory->createTextHeader('Content-Transfer-Encoding', $headers['content-transfer-encoding'])); - $messageHeaders->set($this->headerFactory->createTextHeader('Content-Disposition', $headers['content-disposition'])); - - while (false !== ($buffer = $fromStream->read($bufferLength))) { - $messageStream->write($buffer); - } - - $messageStream->commit(); - $message->setBody($messageStream); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php deleted file mode 100644 index b97f01e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Sends Messages over SMTP with ESMTP support. - * - * @author Chris Corbyn - * - * @method Swift_SmtpTransport setUsername(string $username) Set the username to authenticate with. - * @method string getUsername() Get the username to authenticate with. - * @method Swift_SmtpTransport setPassword(string $password) Set the password to authenticate with. - * @method string getPassword() Get the password to authenticate with. - * @method Swift_SmtpTransport setAuthMode(string $mode) Set the auth mode to use to authenticate. - * @method string getAuthMode() Get the auth mode to use to authenticate. - */ -class Swift_SmtpTransport extends Swift_Transport_EsmtpTransport -{ - /** - * Create a new SmtpTransport, optionally with $host, $port and $security. - * - * @param string $host - * @param int $port - * @param string $security - */ - public function __construct($host = 'localhost', $port = 25, $security = null) - { - call_user_func_array( - array($this, 'Swift_Transport_EsmtpTransport::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.smtp') - ); - - $this->setHost($host); - $this->setPort($port); - $this->setEncryption($security); - } - - /** - * Create a new SmtpTransport instance. - * - * @param string $host - * @param int $port - * @param string $security - * - * @return self - */ - public static function newInstance($host = 'localhost', $port = 25, $security = null) - { - return new self($host, $port, $security); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php deleted file mode 100644 index c16ab4b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2009 Fabien Potencier <fabien.potencier@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Interface for spools. - * - * @author Fabien Potencier - */ -interface Swift_Spool -{ - /** - * Starts this Spool mechanism. - */ - public function start(); - - /** - * Stops this Spool mechanism. - */ - public function stop(); - - /** - * Tests if this Spool mechanism has started. - * - * @return bool - */ - public function isStarted(); - - /** - * Queues a message. - * - * @param Swift_Mime_Message $message The message to store - * - * @return bool Whether the operation has succeeded - */ - public function queueMessage(Swift_Mime_Message $message); - - /** - * Sends messages using the given transport instance. - * - * @param Swift_Transport $transport A transport instance - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent emails - */ - public function flushQueue(Swift_Transport $transport, &$failedRecipients = null); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php deleted file mode 100644 index 79c9b1f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2009 Fabien Potencier <fabien.potencier@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages in a queue. - * - * @author Fabien Potencier - */ -class Swift_SpoolTransport extends Swift_Transport_SpoolTransport -{ - /** - * Create a new SpoolTransport. - * - * @param Swift_Spool $spool - */ - public function __construct(Swift_Spool $spool) - { - $arguments = Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.spool'); - - $arguments[] = $spool; - - call_user_func_array( - array($this, 'Swift_Transport_SpoolTransport::__construct'), - $arguments - ); - } - - /** - * Create a new SpoolTransport instance. - * - * @param Swift_Spool $spool - * - * @return self - */ - public static function newInstance(Swift_Spool $spool) - { - return new self($spool); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php deleted file mode 100644 index 362be2e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Processes bytes as they pass through a stream and performs filtering. - * - * @author Chris Corbyn - */ -interface Swift_StreamFilter -{ - /** - * Based on the buffer given, this returns true if more buffering is needed. - * - * @param mixed $buffer - * - * @return bool - */ - public function shouldBuffer($buffer); - - /** - * Filters $buffer and returns the changes. - * - * @param mixed $buffer - * - * @return mixed - */ - public function filter($buffer); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php deleted file mode 100644 index 9412b1d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php +++ /dev/null @@ -1,170 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Processes bytes as they pass through a buffer and replaces sequences in it. - * - * This stream filter deals with Byte arrays rather than simple strings. - * - * @author Chris Corbyn - */ -class Swift_StreamFilters_ByteArrayReplacementFilter implements Swift_StreamFilter -{ - /** The needle(s) to search for */ - private $_search; - - /** The replacement(s) to make */ - private $_replace; - - /** The Index for searching */ - private $_index; - - /** The Search Tree */ - private $_tree = array(); - - /** Gives the size of the largest search */ - private $_treeMaxLen = 0; - - private $_repSize; - - /** - * Create a new ByteArrayReplacementFilter with $search and $replace. - * - * @param array $search - * @param array $replace - */ - public function __construct($search, $replace) - { - $this->_search = $search; - $this->_index = array(); - $this->_tree = array(); - $this->_replace = array(); - $this->_repSize = array(); - - $tree = null; - $i = null; - $last_size = $size = 0; - foreach ($search as $i => $search_element) { - if ($tree !== null) { - $tree[-1] = min(count($replace) - 1, $i - 1); - $tree[-2] = $last_size; - } - $tree = &$this->_tree; - if (is_array($search_element)) { - foreach ($search_element as $k => $char) { - $this->_index[$char] = true; - if (!isset($tree[$char])) { - $tree[$char] = array(); - } - $tree = &$tree[$char]; - } - $last_size = $k + 1; - $size = max($size, $last_size); - } else { - $last_size = 1; - if (!isset($tree[$search_element])) { - $tree[$search_element] = array(); - } - $tree = &$tree[$search_element]; - $size = max($last_size, $size); - $this->_index[$search_element] = true; - } - } - if ($i !== null) { - $tree[-1] = min(count($replace) - 1, $i); - $tree[-2] = $last_size; - $this->_treeMaxLen = $size; - } - foreach ($replace as $rep) { - if (!is_array($rep)) { - $rep = array($rep); - } - $this->_replace[] = $rep; - } - for ($i = count($this->_replace) - 1; $i >= 0; --$i) { - $this->_replace[$i] = $rep = $this->filter($this->_replace[$i], $i); - $this->_repSize[$i] = count($rep); - } - } - - /** - * Returns true if based on the buffer passed more bytes should be buffered. - * - * @param array $buffer - * - * @return bool - */ - public function shouldBuffer($buffer) - { - $endOfBuffer = end($buffer); - - return isset($this->_index[$endOfBuffer]); - } - - /** - * Perform the actual replacements on $buffer and return the result. - * - * @param array $buffer - * @param int $_minReplaces - * - * @return array - */ - public function filter($buffer, $_minReplaces = -1) - { - if ($this->_treeMaxLen == 0) { - return $buffer; - } - - $newBuffer = array(); - $buf_size = count($buffer); - $last_size = 0; - for ($i = 0; $i < $buf_size; ++$i) { - $search_pos = $this->_tree; - $last_found = PHP_INT_MAX; - // We try to find if the next byte is part of a search pattern - for ($j = 0; $j <= $this->_treeMaxLen; ++$j) { - // We have a new byte for a search pattern - if (isset($buffer[$p = $i + $j]) && isset($search_pos[$buffer[$p]])) { - $search_pos = $search_pos[$buffer[$p]]; - // We have a complete pattern, save, in case we don't find a better match later - if (isset($search_pos[-1]) && $search_pos[-1] < $last_found - && $search_pos[-1] > $_minReplaces) { - $last_found = $search_pos[-1]; - $last_size = $search_pos[-2]; - } - } - // We got a complete pattern - elseif ($last_found !== PHP_INT_MAX) { - // Adding replacement datas to output buffer - $rep_size = $this->_repSize[$last_found]; - for ($j = 0; $j < $rep_size; ++$j) { - $newBuffer[] = $this->_replace[$last_found][$j]; - } - // We Move cursor forward - $i += $last_size - 1; - // Edge Case, last position in buffer - if ($i >= $buf_size) { - $newBuffer[] = $buffer[$i]; - } - - // We start the next loop - continue 2; - } else { - // this byte is not in a pattern and we haven't found another pattern - break; - } - } - // Normal byte, move it to output buffer - $newBuffer[] = $buffer[$i]; - } - - return $newBuffer; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php deleted file mode 100644 index f64144a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Processes bytes as they pass through a buffer and replaces sequences in it. - * - * @author Chris Corbyn - */ -class Swift_StreamFilters_StringReplacementFilter implements Swift_StreamFilter -{ - /** The needle(s) to search for */ - private $_search; - - /** The replacement(s) to make */ - private $_replace; - - /** - * Create a new StringReplacementFilter with $search and $replace. - * - * @param string|array $search - * @param string|array $replace - */ - public function __construct($search, $replace) - { - $this->_search = $search; - $this->_replace = $replace; - } - - /** - * Returns true if based on the buffer passed more bytes should be buffered. - * - * @param string $buffer - * - * @return bool - */ - public function shouldBuffer($buffer) - { - if ('' === $buffer) { - return false; - } - - $endOfBuffer = substr($buffer, -1); - foreach ((array) $this->_search as $needle) { - if (false !== strpos($needle, $endOfBuffer)) { - return true; - } - } - - return false; - } - - /** - * Perform the actual replacements on $buffer and return the result. - * - * @param string $buffer - * - * @return string - */ - public function filter($buffer) - { - return str_replace($this->_search, $this->_replace, $buffer); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php deleted file mode 100644 index e98240b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Creates filters for replacing needles in a string buffer. - * - * @author Chris Corbyn - */ -class Swift_StreamFilters_StringReplacementFilterFactory implements Swift_ReplacementFilterFactory -{ - /** Lazy-loaded filters */ - private $_filters = array(); - - /** - * Create a new StreamFilter to replace $search with $replace in a string. - * - * @param string $search - * @param string $replace - * - * @return Swift_StreamFilter - */ - public function createFilter($search, $replace) - { - if (!isset($this->_filters[$search][$replace])) { - if (!isset($this->_filters[$search])) { - $this->_filters[$search] = array(); - } - - if (!isset($this->_filters[$search][$replace])) { - $this->_filters[$search][$replace] = array(); - } - - $this->_filters[$search][$replace] = new Swift_StreamFilters_StringReplacementFilter($search, $replace); - } - - return $this->_filters[$search][$replace]; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php deleted file mode 100644 index db3d310..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Base Exception class. - * - * @author Chris Corbyn - */ -class Swift_SwiftException extends Exception -{ - /** - * Create a new SwiftException with $message. - * - * @param string $message - * @param int $code - * @param Exception $previous - */ - public function __construct($message, $code = 0, Exception $previous = null) - { - parent::__construct($message, $code, $previous); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport.php deleted file mode 100644 index 6535ead..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Sends Messages via an abstract Transport subsystem. - * - * @author Chris Corbyn - */ -interface Swift_Transport -{ - /** - * Test if this Transport mechanism has started. - * - * @return bool - */ - public function isStarted(); - - /** - * Start this Transport mechanism. - */ - public function start(); - - /** - * Stop this Transport mechanism. - */ - public function stop(); - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param Swift_Mime_Message $message - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null); - - /** - * Register a plugin in the Transport. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php deleted file mode 100644 index 60233f9..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php +++ /dev/null @@ -1,499 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Sends Messages over SMTP. - * - * @author Chris Corbyn - */ -abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport -{ - /** Input-Output buffer for sending/receiving SMTP commands and responses */ - protected $_buffer; - - /** Connection status */ - protected $_started = false; - - /** The domain name to use in HELO command */ - protected $_domain = '[127.0.0.1]'; - - /** The event dispatching layer */ - protected $_eventDispatcher; - - /** Source Ip */ - protected $_sourceIp; - - /** Return an array of params for the Buffer */ - abstract protected function _getBufferParams(); - - /** - * Creates a new EsmtpTransport using the given I/O buffer. - * - * @param Swift_Transport_IoBuffer $buf - * @param Swift_Events_EventDispatcher $dispatcher - */ - public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher) - { - $this->_eventDispatcher = $dispatcher; - $this->_buffer = $buf; - $this->_lookupHostname(); - } - - /** - * Set the name of the local domain which Swift will identify itself as. - * - * This should be a fully-qualified domain name and should be truly the domain - * you're using. - * - * If your server doesn't have a domain name, use the IP in square - * brackets (i.e. [127.0.0.1]). - * - * @param string $domain - * - * @return $this - */ - public function setLocalDomain($domain) - { - $this->_domain = $domain; - - return $this; - } - - /** - * Get the name of the domain Swift will identify as. - * - * @return string - */ - public function getLocalDomain() - { - return $this->_domain; - } - - /** - * Sets the source IP. - * - * @param string $source - */ - public function setSourceIp($source) - { - $this->_sourceIp = $source; - } - - /** - * Returns the IP used to connect to the destination. - * - * @return string - */ - public function getSourceIp() - { - return $this->_sourceIp; - } - - /** - * Start the SMTP connection. - */ - public function start() - { - if (!$this->_started) { - if ($evt = $this->_eventDispatcher->createTransportChangeEvent($this)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeTransportStarted'); - if ($evt->bubbleCancelled()) { - return; - } - } - - try { - $this->_buffer->initialize($this->_getBufferParams()); - } catch (Swift_TransportException $e) { - $this->_throwException($e); - } - $this->_readGreeting(); - $this->_doHeloCommand(); - - if ($evt) { - $this->_eventDispatcher->dispatchEvent($evt, 'transportStarted'); - } - - $this->_started = true; - } - } - - /** - * Test if an SMTP connection has been established. - * - * @return bool - */ - public function isStarted() - { - return $this->_started; - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param Swift_Mime_Message $message - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $sent = 0; - $failedRecipients = (array) $failedRecipients; - - if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - if (!$reversePath = $this->_getReversePath($message)) { - $this->_throwException(new Swift_TransportException( - 'Cannot send message without a sender address' - ) - ); - } - - $to = (array) $message->getTo(); - $cc = (array) $message->getCc(); - $tos = array_merge($to, $cc); - $bcc = (array) $message->getBcc(); - - $message->setBcc(array()); - - try { - $sent += $this->_sendTo($message, $reversePath, $tos, $failedRecipients); - $sent += $this->_sendBcc($message, $reversePath, $bcc, $failedRecipients); - } catch (Exception $e) { - $message->setBcc($bcc); - throw $e; - } - - $message->setBcc($bcc); - - if ($evt) { - if ($sent == count($to) + count($cc) + count($bcc)) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - } elseif ($sent > 0) { - $evt->setResult(Swift_Events_SendEvent::RESULT_TENTATIVE); - } else { - $evt->setResult(Swift_Events_SendEvent::RESULT_FAILED); - } - $evt->setFailedRecipients($failedRecipients); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - $message->generateId(); //Make sure a new Message ID is used - - return $sent; - } - - /** - * Stop the SMTP connection. - */ - public function stop() - { - if ($this->_started) { - if ($evt = $this->_eventDispatcher->createTransportChangeEvent($this)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeTransportStopped'); - if ($evt->bubbleCancelled()) { - return; - } - } - - try { - $this->executeCommand("QUIT\r\n", array(221)); - } catch (Swift_TransportException $e) { - } - - try { - $this->_buffer->terminate(); - - if ($evt) { - $this->_eventDispatcher->dispatchEvent($evt, 'transportStopped'); - } - } catch (Swift_TransportException $e) { - $this->_throwException($e); - } - } - $this->_started = false; - } - - /** - * Register a plugin. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->_eventDispatcher->bindEventListener($plugin); - } - - /** - * Reset the current mail transaction. - */ - public function reset() - { - $this->executeCommand("RSET\r\n", array(250)); - } - - /** - * Get the IoBuffer where read/writes are occurring. - * - * @return Swift_Transport_IoBuffer - */ - public function getBuffer() - { - return $this->_buffer; - } - - /** - * Run a command against the buffer, expecting the given response codes. - * - * If no response codes are given, the response will not be validated. - * If codes are given, an exception will be thrown on an invalid response. - * - * @param string $command - * @param int[] $codes - * @param string[] $failures An array of failures by-reference - * - * @return string - */ - public function executeCommand($command, $codes = array(), &$failures = null) - { - $failures = (array) $failures; - $seq = $this->_buffer->write($command); - $response = $this->_getFullResponse($seq); - if ($evt = $this->_eventDispatcher->createCommandEvent($this, $command, $codes)) { - $this->_eventDispatcher->dispatchEvent($evt, 'commandSent'); - } - $this->_assertResponseCode($response, $codes); - - return $response; - } - - /** Read the opening SMTP greeting */ - protected function _readGreeting() - { - $this->_assertResponseCode($this->_getFullResponse(0), array(220)); - } - - /** Send the HELO welcome */ - protected function _doHeloCommand() - { - $this->executeCommand( - sprintf("HELO %s\r\n", $this->_domain), array(250) - ); - } - - /** Send the MAIL FROM command */ - protected function _doMailFromCommand($address) - { - $this->executeCommand( - sprintf("MAIL FROM:<%s>\r\n", $address), array(250) - ); - } - - /** Send the RCPT TO command */ - protected function _doRcptToCommand($address) - { - $this->executeCommand( - sprintf("RCPT TO:<%s>\r\n", $address), array(250, 251, 252) - ); - } - - /** Send the DATA command */ - protected function _doDataCommand() - { - $this->executeCommand("DATA\r\n", array(354)); - } - - /** Stream the contents of the message over the buffer */ - protected function _streamMessage(Swift_Mime_Message $message) - { - $this->_buffer->setWriteTranslations(array("\r\n." => "\r\n..")); - try { - $message->toByteStream($this->_buffer); - $this->_buffer->flushBuffers(); - } catch (Swift_TransportException $e) { - $this->_throwException($e); - } - $this->_buffer->setWriteTranslations(array()); - $this->executeCommand("\r\n.\r\n", array(250)); - } - - /** Determine the best-use reverse path for this message */ - protected function _getReversePath(Swift_Mime_Message $message) - { - $return = $message->getReturnPath(); - $sender = $message->getSender(); - $from = $message->getFrom(); - $path = null; - if (!empty($return)) { - $path = $return; - } elseif (!empty($sender)) { - // Don't use array_keys - reset($sender); // Reset Pointer to first pos - $path = key($sender); // Get key - } elseif (!empty($from)) { - reset($from); // Reset Pointer to first pos - $path = key($from); // Get key - } - - return $path; - } - - /** Throw a TransportException, first sending it to any listeners */ - protected function _throwException(Swift_TransportException $e) - { - if ($evt = $this->_eventDispatcher->createTransportExceptionEvent($this, $e)) { - $this->_eventDispatcher->dispatchEvent($evt, 'exceptionThrown'); - if (!$evt->bubbleCancelled()) { - throw $e; - } - } else { - throw $e; - } - } - - /** Throws an Exception if a response code is incorrect */ - protected function _assertResponseCode($response, $wanted) - { - list($code) = sscanf($response, '%3d'); - $valid = (empty($wanted) || in_array($code, $wanted)); - - if ($evt = $this->_eventDispatcher->createResponseEvent($this, $response, - $valid)) { - $this->_eventDispatcher->dispatchEvent($evt, 'responseReceived'); - } - - if (!$valid) { - $this->_throwException( - new Swift_TransportException( - 'Expected response code '.implode('/', $wanted).' but got code '. - '"'.$code.'", with message "'.$response.'"', - $code) - ); - } - } - - /** Get an entire multi-line response using its sequence number */ - protected function _getFullResponse($seq) - { - $response = ''; - try { - do { - $line = $this->_buffer->readLine($seq); - $response .= $line; - } while (null !== $line && false !== $line && ' ' != $line[3]); - } catch (Swift_TransportException $e) { - $this->_throwException($e); - } catch (Swift_IoException $e) { - $this->_throwException( - new Swift_TransportException( - $e->getMessage()) - ); - } - - return $response; - } - - /** Send an email to the given recipients from the given reverse path */ - private function _doMailTransaction($message, $reversePath, array $recipients, array &$failedRecipients) - { - $sent = 0; - $this->_doMailFromCommand($reversePath); - foreach ($recipients as $forwardPath) { - try { - $this->_doRcptToCommand($forwardPath); - ++$sent; - } catch (Swift_TransportException $e) { - $failedRecipients[] = $forwardPath; - } - } - - if ($sent != 0) { - $this->_doDataCommand(); - $this->_streamMessage($message); - } else { - $this->reset(); - } - - return $sent; - } - - /** Send a message to the given To: recipients */ - private function _sendTo(Swift_Mime_Message $message, $reversePath, array $to, array &$failedRecipients) - { - if (empty($to)) { - return 0; - } - - return $this->_doMailTransaction($message, $reversePath, array_keys($to), - $failedRecipients); - } - - /** Send a message to all Bcc: recipients */ - private function _sendBcc(Swift_Mime_Message $message, $reversePath, array $bcc, array &$failedRecipients) - { - $sent = 0; - foreach ($bcc as $forwardPath => $name) { - $message->setBcc(array($forwardPath => $name)); - $sent += $this->_doMailTransaction( - $message, $reversePath, array($forwardPath), $failedRecipients - ); - } - - return $sent; - } - - /** Try to determine the hostname of the server this is run on */ - private function _lookupHostname() - { - if (!empty($_SERVER['SERVER_NAME']) && $this->_isFqdn($_SERVER['SERVER_NAME'])) { - $this->_domain = $_SERVER['SERVER_NAME']; - } elseif (!empty($_SERVER['SERVER_ADDR'])) { - // Set the address literal tag (See RFC 5321, section: 4.1.3) - if (false === strpos($_SERVER['SERVER_ADDR'], ':')) { - $prefix = ''; // IPv4 addresses are not tagged. - } else { - $prefix = 'IPv6:'; // Adding prefix in case of IPv6. - } - - $this->_domain = sprintf('[%s%s]', $prefix, $_SERVER['SERVER_ADDR']); - } - } - - /** Determine is the $hostname is a fully-qualified name */ - private function _isFqdn($hostname) - { - // We could do a really thorough check, but there's really no point - if (false !== $dotPos = strpos($hostname, '.')) { - return ($dotPos > 0) && ($dotPos != strlen($hostname) - 1); - } - - return false; - } - - /** - * Destructor. - */ - public function __destruct() - { - try { - $this->stop(); - } catch (Exception $e) { - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php deleted file mode 100644 index 53f721d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles CRAM-MD5 authentication. - * - * @author Chris Corbyn - */ -class Swift_Transport_Esmtp_Auth_CramMd5Authenticator implements Swift_Transport_Esmtp_Authenticator -{ - /** - * Get the name of the AUTH mechanism this Authenticator handles. - * - * @return string - */ - public function getAuthKeyword() - { - return 'CRAM-MD5'; - } - - /** - * Try to authenticate the user with $username and $password. - * - * @param Swift_Transport_SmtpAgent $agent - * @param string $username - * @param string $password - * - * @return bool - */ - public function authenticate(Swift_Transport_SmtpAgent $agent, $username, $password) - { - try { - $challenge = $agent->executeCommand("AUTH CRAM-MD5\r\n", array(334)); - $challenge = base64_decode(substr($challenge, 4)); - $message = base64_encode( - $username.' '.$this->_getResponse($password, $challenge) - ); - $agent->executeCommand(sprintf("%s\r\n", $message), array(235)); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", array(250)); - - return false; - } - } - - /** - * Generate a CRAM-MD5 response from a server challenge. - * - * @param string $secret - * @param string $challenge - * - * @return string - */ - private function _getResponse($secret, $challenge) - { - if (strlen($secret) > 64) { - $secret = pack('H32', md5($secret)); - } - - if (strlen($secret) < 64) { - $secret = str_pad($secret, 64, chr(0)); - } - - $k_ipad = substr($secret, 0, 64) ^ str_repeat(chr(0x36), 64); - $k_opad = substr($secret, 0, 64) ^ str_repeat(chr(0x5C), 64); - - $inner = pack('H32', md5($k_ipad.$challenge)); - $digest = md5($k_opad.$inner); - - return $digest; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php deleted file mode 100644 index 6ab6e33..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles LOGIN authentication. - * - * @author Chris Corbyn - */ -class Swift_Transport_Esmtp_Auth_LoginAuthenticator implements Swift_Transport_Esmtp_Authenticator -{ - /** - * Get the name of the AUTH mechanism this Authenticator handles. - * - * @return string - */ - public function getAuthKeyword() - { - return 'LOGIN'; - } - - /** - * Try to authenticate the user with $username and $password. - * - * @param Swift_Transport_SmtpAgent $agent - * @param string $username - * @param string $password - * - * @return bool - */ - public function authenticate(Swift_Transport_SmtpAgent $agent, $username, $password) - { - try { - $agent->executeCommand("AUTH LOGIN\r\n", array(334)); - $agent->executeCommand(sprintf("%s\r\n", base64_encode($username)), array(334)); - $agent->executeCommand(sprintf("%s\r\n", base64_encode($password)), array(235)); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", array(250)); - - return false; - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php deleted file mode 100644 index 8392658..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php +++ /dev/null @@ -1,725 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * This authentication is for Exchange servers. We support version 1 & 2. - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles NTLM authentication. - * - * @author Ward Peeters <ward@coding-tech.com> - */ -class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Esmtp_Authenticator -{ - const NTLMSIG = "NTLMSSP\x00"; - const DESCONST = 'KGS!@#$%'; - - /** - * Get the name of the AUTH mechanism this Authenticator handles. - * - * @return string - */ - public function getAuthKeyword() - { - return 'NTLM'; - } - - /** - * Try to authenticate the user with $username and $password. - * - * @param Swift_Transport_SmtpAgent $agent - * @param string $username - * @param string $password - * - * @return bool - */ - public function authenticate(Swift_Transport_SmtpAgent $agent, $username, $password) - { - if (!function_exists('openssl_random_pseudo_bytes') || !function_exists('openssl_encrypt')) { - throw new LogicException('The OpenSSL extension must be enabled to use the NTLM authenticator.'); - } - - if (!function_exists('bcmul')) { - throw new LogicException('The BCMath functions must be enabled to use the NTLM authenticator.'); - } - - try { - // execute AUTH command and filter out the code at the beginning - // AUTH NTLM xxxx - $response = base64_decode(substr(trim($this->sendMessage1($agent)), 4)); - - // extra parameters for our unit cases - $timestamp = func_num_args() > 3 ? func_get_arg(3) : $this->getCorrectTimestamp(bcmul(microtime(true), '1000')); - $client = func_num_args() > 4 ? func_get_arg(4) : $this->getRandomBytes(8); - - // Message 3 response - $this->sendMessage3($response, $username, $password, $timestamp, $client, $agent); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", array(250)); - - return false; - } - } - - protected function si2bin($si, $bits = 32) - { - $bin = null; - if ($si >= -pow(2, $bits - 1) && ($si <= pow(2, $bits - 1))) { - // positive or zero - if ($si >= 0) { - $bin = base_convert($si, 10, 2); - // pad to $bits bit - $bin_length = strlen($bin); - if ($bin_length < $bits) { - $bin = str_repeat('0', $bits - $bin_length).$bin; - } - } else { - // negative - $si = -$si - pow(2, $bits); - $bin = base_convert($si, 10, 2); - $bin_length = strlen($bin); - if ($bin_length > $bits) { - $bin = str_repeat('1', $bits - $bin_length).$bin; - } - } - } - - return $bin; - } - - /** - * Send our auth message and returns the response. - * - * @param Swift_Transport_SmtpAgent $agent - * - * @return string SMTP Response - */ - protected function sendMessage1(Swift_Transport_SmtpAgent $agent) - { - $message = $this->createMessage1(); - - return $agent->executeCommand(sprintf("AUTH %s %s\r\n", $this->getAuthKeyword(), base64_encode($message)), array(334)); - } - - /** - * Fetch all details of our response (message 2). - * - * @param string $response - * - * @return array our response parsed - */ - protected function parseMessage2($response) - { - $responseHex = bin2hex($response); - $length = floor(hexdec(substr($responseHex, 28, 4)) / 256) * 2; - $offset = floor(hexdec(substr($responseHex, 32, 4)) / 256) * 2; - $challenge = $this->hex2bin(substr($responseHex, 48, 16)); - $context = $this->hex2bin(substr($responseHex, 64, 16)); - $targetInfoH = $this->hex2bin(substr($responseHex, 80, 16)); - $targetName = $this->hex2bin(substr($responseHex, $offset, $length)); - $offset = floor(hexdec(substr($responseHex, 88, 4)) / 256) * 2; - $targetInfoBlock = substr($responseHex, $offset); - list($domainName, $serverName, $DNSDomainName, $DNSServerName, $terminatorByte) = $this->readSubBlock($targetInfoBlock); - - return array( - $challenge, - $context, - $targetInfoH, - $targetName, - $domainName, - $serverName, - $DNSDomainName, - $DNSServerName, - $this->hex2bin($targetInfoBlock), - $terminatorByte, - ); - } - - /** - * Read the blob information in from message2. - * - * @param $block - * - * @return array - */ - protected function readSubBlock($block) - { - // remove terminatorByte cause it's always the same - $block = substr($block, 0, -8); - - $length = strlen($block); - $offset = 0; - $data = array(); - while ($offset < $length) { - $blockLength = hexdec(substr(substr($block, $offset, 8), -4)) / 256; - $offset += 8; - $data[] = $this->hex2bin(substr($block, $offset, $blockLength * 2)); - $offset += $blockLength * 2; - } - - if (count($data) == 3) { - $data[] = $data[2]; - $data[2] = ''; - } - - $data[] = $this->createByte('00'); - - return $data; - } - - /** - * Send our final message with all our data. - * - * @param string $response Message 1 response (message 2) - * @param string $username - * @param string $password - * @param string $timestamp - * @param string $client - * @param Swift_Transport_SmtpAgent $agent - * @param bool $v2 Use version2 of the protocol - * - * @return string - */ - protected function sendMessage3($response, $username, $password, $timestamp, $client, Swift_Transport_SmtpAgent $agent, $v2 = true) - { - list($domain, $username) = $this->getDomainAndUsername($username); - //$challenge, $context, $targetInfoH, $targetName, $domainName, $workstation, $DNSDomainName, $DNSServerName, $blob, $ter - list($challenge, , , , , $workstation, , , $blob) = $this->parseMessage2($response); - - if (!$v2) { - // LMv1 - $lmResponse = $this->createLMPassword($password, $challenge); - // NTLMv1 - $ntlmResponse = $this->createNTLMPassword($password, $challenge); - } else { - // LMv2 - $lmResponse = $this->createLMv2Password($password, $username, $domain, $challenge, $client); - // NTLMv2 - $ntlmResponse = $this->createNTLMv2Hash($password, $username, $domain, $challenge, $blob, $timestamp, $client); - } - - $message = $this->createMessage3($domain, $username, $workstation, $lmResponse, $ntlmResponse); - - return $agent->executeCommand(sprintf("%s\r\n", base64_encode($message)), array(235)); - } - - /** - * Create our message 1. - * - * @return string - */ - protected function createMessage1() - { - return self::NTLMSIG - .$this->createByte('01') // Message 1 -.$this->createByte('0702'); // Flags - } - - /** - * Create our message 3. - * - * @param string $domain - * @param string $username - * @param string $workstation - * @param string $lmResponse - * @param string $ntlmResponse - * - * @return string - */ - protected function createMessage3($domain, $username, $workstation, $lmResponse, $ntlmResponse) - { - // Create security buffers - $domainSec = $this->createSecurityBuffer($domain, 64); - $domainInfo = $this->readSecurityBuffer(bin2hex($domainSec)); - $userSec = $this->createSecurityBuffer($username, ($domainInfo[0] + $domainInfo[1]) / 2); - $userInfo = $this->readSecurityBuffer(bin2hex($userSec)); - $workSec = $this->createSecurityBuffer($workstation, ($userInfo[0] + $userInfo[1]) / 2); - $workInfo = $this->readSecurityBuffer(bin2hex($workSec)); - $lmSec = $this->createSecurityBuffer($lmResponse, ($workInfo[0] + $workInfo[1]) / 2, true); - $lmInfo = $this->readSecurityBuffer(bin2hex($lmSec)); - $ntlmSec = $this->createSecurityBuffer($ntlmResponse, ($lmInfo[0] + $lmInfo[1]) / 2, true); - - return self::NTLMSIG - .$this->createByte('03') // TYPE 3 message -.$lmSec // LM response header -.$ntlmSec // NTLM response header -.$domainSec // Domain header -.$userSec // User header -.$workSec // Workstation header -.$this->createByte('000000009a', 8) // session key header (empty) -.$this->createByte('01020000') // FLAGS -.$this->convertTo16bit($domain) // domain name -.$this->convertTo16bit($username) // username -.$this->convertTo16bit($workstation) // workstation -.$lmResponse - .$ntlmResponse; - } - - /** - * @param string $timestamp Epoch timestamp in microseconds - * @param string $client Random bytes - * @param string $targetInfo - * - * @return string - */ - protected function createBlob($timestamp, $client, $targetInfo) - { - return $this->createByte('0101') - .$this->createByte('00') - .$timestamp - .$client - .$this->createByte('00') - .$targetInfo - .$this->createByte('00'); - } - - /** - * Get domain and username from our username. - * - * @example DOMAIN\username - * - * @param string $name - * - * @return array - */ - protected function getDomainAndUsername($name) - { - if (strpos($name, '\\') !== false) { - return explode('\\', $name); - } - - if (false !== strpos($name, '@')) { - list($user, $domain) = explode('@', $name); - - return array($domain, $user); - } - - // no domain passed - return array('', $name); - } - - /** - * Create LMv1 response. - * - * @param string $password - * @param string $challenge - * - * @return string - */ - protected function createLMPassword($password, $challenge) - { - // FIRST PART - $password = $this->createByte(strtoupper($password), 14, false); - list($key1, $key2) = str_split($password, 7); - - $desKey1 = $this->createDesKey($key1); - $desKey2 = $this->createDesKey($key2); - - $constantDecrypt = $this->createByte($this->desEncrypt(self::DESCONST, $desKey1).$this->desEncrypt(self::DESCONST, $desKey2), 21, false); - - // SECOND PART - list($key1, $key2, $key3) = str_split($constantDecrypt, 7); - - $desKey1 = $this->createDesKey($key1); - $desKey2 = $this->createDesKey($key2); - $desKey3 = $this->createDesKey($key3); - - return $this->desEncrypt($challenge, $desKey1).$this->desEncrypt($challenge, $desKey2).$this->desEncrypt($challenge, $desKey3); - } - - /** - * Create NTLMv1 response. - * - * @param string $password - * @param string $challenge - * - * @return string - */ - protected function createNTLMPassword($password, $challenge) - { - // FIRST PART - $ntlmHash = $this->createByte($this->md4Encrypt($password), 21, false); - list($key1, $key2, $key3) = str_split($ntlmHash, 7); - - $desKey1 = $this->createDesKey($key1); - $desKey2 = $this->createDesKey($key2); - $desKey3 = $this->createDesKey($key3); - - return $this->desEncrypt($challenge, $desKey1).$this->desEncrypt($challenge, $desKey2).$this->desEncrypt($challenge, $desKey3); - } - - /** - * Convert a normal timestamp to a tenth of a microtime epoch time. - * - * @param string $time - * - * @return string - */ - protected function getCorrectTimestamp($time) - { - // Get our timestamp (tricky!) - $time = number_format($time, 0, '.', ''); // save microtime to string - $time = bcadd($time, '11644473600000', 0); // add epoch time - $time = bcmul($time, 10000, 0); // tenths of a microsecond. - - $binary = $this->si2bin($time, 64); // create 64 bit binary string - $timestamp = ''; - for ($i = 0; $i < 8; ++$i) { - $timestamp .= chr(bindec(substr($binary, -(($i + 1) * 8), 8))); - } - - return $timestamp; - } - - /** - * Create LMv2 response. - * - * @param string $password - * @param string $username - * @param string $domain - * @param string $challenge NTLM Challenge - * @param string $client Random string - * - * @return string - */ - protected function createLMv2Password($password, $username, $domain, $challenge, $client) - { - $lmPass = '00'; // by default 00 - // if $password > 15 than we can't use this method - if (strlen($password) <= 15) { - $ntlmHash = $this->md4Encrypt($password); - $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username).$domain)); - - $lmPass = bin2hex($this->md5Encrypt($ntml2Hash, $challenge.$client).$client); - } - - return $this->createByte($lmPass, 24); - } - - /** - * Create NTLMv2 response. - * - * @param string $password - * @param string $username - * @param string $domain - * @param string $challenge Hex values - * @param string $targetInfo Hex values - * @param string $timestamp - * @param string $client Random bytes - * - * @return string - * - * @see http://davenport.sourceforge.net/ntlm.html#theNtlmResponse - */ - protected function createNTLMv2Hash($password, $username, $domain, $challenge, $targetInfo, $timestamp, $client) - { - $ntlmHash = $this->md4Encrypt($password); - $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username).$domain)); - - // create blob - $blob = $this->createBlob($timestamp, $client, $targetInfo); - - $ntlmv2Response = $this->md5Encrypt($ntml2Hash, $challenge.$blob); - - return $ntlmv2Response.$blob; - } - - protected function createDesKey($key) - { - $material = array(bin2hex($key[0])); - $len = strlen($key); - for ($i = 1; $i < $len; ++$i) { - list($high, $low) = str_split(bin2hex($key[$i])); - $v = $this->castToByte(ord($key[$i - 1]) << (7 + 1 - $i) | $this->uRShift(hexdec(dechex(hexdec($high) & 0xf).dechex(hexdec($low) & 0xf)), $i)); - $material[] = str_pad(substr(dechex($v), -2), 2, '0', STR_PAD_LEFT); // cast to byte - } - $material[] = str_pad(substr(dechex($this->castToByte(ord($key[6]) << 1)), -2), 2, '0'); - - // odd parity - foreach ($material as $k => $v) { - $b = $this->castToByte(hexdec($v)); - $needsParity = (($this->uRShift($b, 7) ^ $this->uRShift($b, 6) ^ $this->uRShift($b, 5) - ^ $this->uRShift($b, 4) ^ $this->uRShift($b, 3) ^ $this->uRShift($b, 2) - ^ $this->uRShift($b, 1)) & 0x01) == 0; - - list($high, $low) = str_split($v); - if ($needsParity) { - $material[$k] = dechex(hexdec($high) | 0x0).dechex(hexdec($low) | 0x1); - } else { - $material[$k] = dechex(hexdec($high) & 0xf).dechex(hexdec($low) & 0xe); - } - } - - return $this->hex2bin(implode('', $material)); - } - - /** HELPER FUNCTIONS */ - - /** - * Create our security buffer depending on length and offset. - * - * @param string $value Value we want to put in - * @param int $offset start of value - * @param bool $is16 Do we 16bit string or not? - * - * @return string - */ - protected function createSecurityBuffer($value, $offset, $is16 = false) - { - $length = strlen(bin2hex($value)); - $length = $is16 ? $length / 2 : $length; - $length = $this->createByte(str_pad(dechex($length), 2, '0', STR_PAD_LEFT), 2); - - return $length.$length.$this->createByte(dechex($offset), 4); - } - - /** - * Read our security buffer to fetch length and offset of our value. - * - * @param string $value Securitybuffer in hex - * - * @return array array with length and offset - */ - protected function readSecurityBuffer($value) - { - $length = floor(hexdec(substr($value, 0, 4)) / 256) * 2; - $offset = floor(hexdec(substr($value, 8, 4)) / 256) * 2; - - return array($length, $offset); - } - - /** - * Cast to byte java equivalent to (byte). - * - * @param int $v - * - * @return int - */ - protected function castToByte($v) - { - return (($v + 128) % 256) - 128; - } - - /** - * Java unsigned right bitwise - * $a >>> $b. - * - * @param int $a - * @param int $b - * - * @return int - */ - protected function uRShift($a, $b) - { - if ($b == 0) { - return $a; - } - - return ($a >> $b) & ~(1 << (8 * PHP_INT_SIZE - 1) >> ($b - 1)); - } - - /** - * Right padding with 0 to certain length. - * - * @param string $input - * @param int $bytes Length of bytes - * @param bool $isHex Did we provided hex value - * - * @return string - */ - protected function createByte($input, $bytes = 4, $isHex = true) - { - if ($isHex) { - $byte = $this->hex2bin(str_pad($input, $bytes * 2, '00')); - } else { - $byte = str_pad($input, $bytes, "\x00"); - } - - return $byte; - } - - /** - * Create random bytes. - * - * @param $length - * - * @return string - */ - protected function getRandomBytes($length) - { - $bytes = openssl_random_pseudo_bytes($length, $strong); - - if (false !== $bytes && true === $strong) { - return $bytes; - } - - throw new RuntimeException('OpenSSL did not produce a secure random number.'); - } - - /** ENCRYPTION ALGORITHMS */ - - /** - * DES Encryption. - * - * @param string $value An 8-byte string - * @param string $key - * - * @return string - */ - protected function desEncrypt($value, $key) - { - // 1 == OPENSSL_RAW_DATA - but constant is only available as of PHP 5.4. - return substr(openssl_encrypt($value, 'DES-ECB', $key, 1), 0, 8); - } - - /** - * MD5 Encryption. - * - * @param string $key Encryption key - * @param string $msg Message to encrypt - * - * @return string - */ - protected function md5Encrypt($key, $msg) - { - $blocksize = 64; - if (strlen($key) > $blocksize) { - $key = pack('H*', md5($key)); - } - - $key = str_pad($key, $blocksize, "\0"); - $ipadk = $key ^ str_repeat("\x36", $blocksize); - $opadk = $key ^ str_repeat("\x5c", $blocksize); - - return pack('H*', md5($opadk.pack('H*', md5($ipadk.$msg)))); - } - - /** - * MD4 Encryption. - * - * @param string $input - * - * @return string - * - * @see http://php.net/manual/en/ref.hash.php - */ - protected function md4Encrypt($input) - { - $input = $this->convertTo16bit($input); - - return function_exists('hash') ? $this->hex2bin(hash('md4', $input)) : mhash(MHASH_MD4, $input); - } - - /** - * Convert UTF-8 to UTF-16. - * - * @param string $input - * - * @return string - */ - protected function convertTo16bit($input) - { - return iconv('UTF-8', 'UTF-16LE', $input); - } - - /** - * Hex2bin replacement for < PHP 5.4. - * - * @param string $hex - * - * @return string Binary - */ - protected function hex2bin($hex) - { - if (function_exists('hex2bin')) { - return hex2bin($hex); - } else { - return pack('H*', $hex); - } - } - - /** - * @param string $message - */ - protected function debug($message) - { - $message = bin2hex($message); - $messageId = substr($message, 16, 8); - echo substr($message, 0, 16)." NTLMSSP Signature<br />\n"; - echo $messageId." Type Indicator<br />\n"; - - if ($messageId == '02000000') { - $map = array( - 'Challenge', - 'Context', - 'Target Information Security Buffer', - 'Target Name Data', - 'NetBIOS Domain Name', - 'NetBIOS Server Name', - 'DNS Domain Name', - 'DNS Server Name', - 'BLOB', - 'Target Information Terminator', - ); - - $data = $this->parseMessage2($this->hex2bin($message)); - - foreach ($map as $key => $value) { - echo bin2hex($data[$key]).' - '.$data[$key].' ||| '.$value."<br />\n"; - } - } elseif ($messageId == '03000000') { - $i = 0; - $data[$i++] = substr($message, 24, 16); - list($lmLength, $lmOffset) = $this->readSecurityBuffer($data[$i - 1]); - - $data[$i++] = substr($message, 40, 16); - list($ntmlLength, $ntmlOffset) = $this->readSecurityBuffer($data[$i - 1]); - - $data[$i++] = substr($message, 56, 16); - list($targetLength, $targetOffset) = $this->readSecurityBuffer($data[$i - 1]); - - $data[$i++] = substr($message, 72, 16); - list($userLength, $userOffset) = $this->readSecurityBuffer($data[$i - 1]); - - $data[$i++] = substr($message, 88, 16); - list($workLength, $workOffset) = $this->readSecurityBuffer($data[$i - 1]); - - $data[$i++] = substr($message, 104, 16); - $data[$i++] = substr($message, 120, 8); - $data[$i++] = substr($message, $targetOffset, $targetLength); - $data[$i++] = substr($message, $userOffset, $userLength); - $data[$i++] = substr($message, $workOffset, $workLength); - $data[$i++] = substr($message, $lmOffset, $lmLength); - $data[$i] = substr($message, $ntmlOffset, $ntmlLength); - - $map = array( - 'LM Response Security Buffer', - 'NTLM Response Security Buffer', - 'Target Name Security Buffer', - 'User Name Security Buffer', - 'Workstation Name Security Buffer', - 'Session Key Security Buffer', - 'Flags', - 'Target Name Data', - 'User Name Data', - 'Workstation Name Data', - 'LM Response Data', - 'NTLM Response Data', - ); - - foreach ($map as $key => $value) { - echo $data[$key].' - '.$this->hex2bin($data[$key]).' ||| '.$value."<br />\n"; - } - } - - echo '<br /><br />'; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php deleted file mode 100644 index 43219f9..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles PLAIN authentication. - * - * @author Chris Corbyn - */ -class Swift_Transport_Esmtp_Auth_PlainAuthenticator implements Swift_Transport_Esmtp_Authenticator -{ - /** - * Get the name of the AUTH mechanism this Authenticator handles. - * - * @return string - */ - public function getAuthKeyword() - { - return 'PLAIN'; - } - - /** - * Try to authenticate the user with $username and $password. - * - * @param Swift_Transport_SmtpAgent $agent - * @param string $username - * @param string $password - * - * @return bool - */ - public function authenticate(Swift_Transport_SmtpAgent $agent, $username, $password) - { - try { - $message = base64_encode($username.chr(0).$username.chr(0).$password); - $agent->executeCommand(sprintf("AUTH PLAIN %s\r\n", $message), array(235)); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", array(250)); - - return false; - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php deleted file mode 100644 index ca35e7b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Handles XOAUTH2 authentication. - * - * Example: - * <code> - * $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 587, 'tls') - * ->setAuthMode('XOAUTH2') - * ->setUsername('YOUR_EMAIL_ADDRESS') - * ->setPassword('YOUR_ACCESS_TOKEN'); - * </code> - * - * @author xu.li<AthenaLightenedMyPath@gmail.com> - * - * @see https://developers.google.com/google-apps/gmail/xoauth2_protocol - */ -class Swift_Transport_Esmtp_Auth_XOAuth2Authenticator implements Swift_Transport_Esmtp_Authenticator -{ - /** - * Get the name of the AUTH mechanism this Authenticator handles. - * - * @return string - */ - public function getAuthKeyword() - { - return 'XOAUTH2'; - } - - /** - * Try to authenticate the user with $email and $token. - * - * @param Swift_Transport_SmtpAgent $agent - * @param string $email - * @param string $token - * - * @return bool - */ - public function authenticate(Swift_Transport_SmtpAgent $agent, $email, $token) - { - try { - $param = $this->constructXOAuth2Params($email, $token); - $agent->executeCommand('AUTH XOAUTH2 '.$param."\r\n", array(235)); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", array(250)); - - return false; - } - } - - /** - * Construct the auth parameter. - * - * @see https://developers.google.com/google-apps/gmail/xoauth2_protocol#the_sasl_xoauth2_mechanism - */ - protected function constructXOAuth2Params($email, $token) - { - return base64_encode("user=$email\1auth=Bearer $token\1\1"); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php deleted file mode 100644 index cb36133..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php +++ /dev/null @@ -1,263 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An ESMTP handler for AUTH support. - * - * @author Chris Corbyn - */ -class Swift_Transport_Esmtp_AuthHandler implements Swift_Transport_EsmtpHandler -{ - /** - * Authenticators available to process the request. - * - * @var Swift_Transport_Esmtp_Authenticator[] - */ - private $_authenticators = array(); - - /** - * The username for authentication. - * - * @var string - */ - private $_username; - - /** - * The password for authentication. - * - * @var string - */ - private $_password; - - /** - * The auth mode for authentication. - * - * @var string - */ - private $_auth_mode; - - /** - * The ESMTP AUTH parameters available. - * - * @var string[] - */ - private $_esmtpParams = array(); - - /** - * Create a new AuthHandler with $authenticators for support. - * - * @param Swift_Transport_Esmtp_Authenticator[] $authenticators - */ - public function __construct(array $authenticators) - { - $this->setAuthenticators($authenticators); - } - - /** - * Set the Authenticators which can process a login request. - * - * @param Swift_Transport_Esmtp_Authenticator[] $authenticators - */ - public function setAuthenticators(array $authenticators) - { - $this->_authenticators = $authenticators; - } - - /** - * Get the Authenticators which can process a login request. - * - * @return Swift_Transport_Esmtp_Authenticator[] - */ - public function getAuthenticators() - { - return $this->_authenticators; - } - - /** - * Set the username to authenticate with. - * - * @param string $username - */ - public function setUsername($username) - { - $this->_username = $username; - } - - /** - * Get the username to authenticate with. - * - * @return string - */ - public function getUsername() - { - return $this->_username; - } - - /** - * Set the password to authenticate with. - * - * @param string $password - */ - public function setPassword($password) - { - $this->_password = $password; - } - - /** - * Get the password to authenticate with. - * - * @return string - */ - public function getPassword() - { - return $this->_password; - } - - /** - * Set the auth mode to use to authenticate. - * - * @param string $mode - */ - public function setAuthMode($mode) - { - $this->_auth_mode = $mode; - } - - /** - * Get the auth mode to use to authenticate. - * - * @return string - */ - public function getAuthMode() - { - return $this->_auth_mode; - } - - /** - * Get the name of the ESMTP extension this handles. - * - * @return bool - */ - public function getHandledKeyword() - { - return 'AUTH'; - } - - /** - * Set the parameters which the EHLO greeting indicated. - * - * @param string[] $parameters - */ - public function setKeywordParams(array $parameters) - { - $this->_esmtpParams = $parameters; - } - - /** - * Runs immediately after a EHLO has been issued. - * - * @param Swift_Transport_SmtpAgent $agent to read/write - */ - public function afterEhlo(Swift_Transport_SmtpAgent $agent) - { - if ($this->_username) { - $count = 0; - foreach ($this->_getAuthenticatorsForAgent() as $authenticator) { - if (in_array(strtolower($authenticator->getAuthKeyword()), - array_map('strtolower', $this->_esmtpParams))) { - ++$count; - if ($authenticator->authenticate($agent, $this->_username, $this->_password)) { - return; - } - } - } - throw new Swift_TransportException( - 'Failed to authenticate on SMTP server with username "'. - $this->_username.'" using '.$count.' possible authenticators' - ); - } - } - - /** - * Not used. - */ - public function getMailParams() - { - return array(); - } - - /** - * Not used. - */ - public function getRcptParams() - { - return array(); - } - - /** - * Not used. - */ - public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = array(), &$failedRecipients = null, &$stop = false) - { - } - - /** - * Returns +1, -1 or 0 according to the rules for usort(). - * - * This method is called to ensure extensions can be execute in an appropriate order. - * - * @param string $esmtpKeyword to compare with - * - * @return int - */ - public function getPriorityOver($esmtpKeyword) - { - return 0; - } - - /** - * Returns an array of method names which are exposed to the Esmtp class. - * - * @return string[] - */ - public function exposeMixinMethods() - { - return array('setUsername', 'getUsername', 'setPassword', 'getPassword', 'setAuthMode', 'getAuthMode'); - } - - /** - * Not used. - */ - public function resetState() - { - } - - /** - * Returns the authenticator list for the given agent. - * - * @param Swift_Transport_SmtpAgent $agent - * - * @return array - */ - protected function _getAuthenticatorsForAgent() - { - if (!$mode = strtolower($this->_auth_mode)) { - return $this->_authenticators; - } - - foreach ($this->_authenticators as $authenticator) { - if (strtolower($authenticator->getAuthKeyword()) == $mode) { - return array($authenticator); - } - } - - throw new Swift_TransportException('Auth mode '.$mode.' is invalid'); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php deleted file mode 100644 index 12a9abf..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An Authentication mechanism. - * - * @author Chris Corbyn - */ -interface Swift_Transport_Esmtp_Authenticator -{ - /** - * Get the name of the AUTH mechanism this Authenticator handles. - * - * @return string - */ - public function getAuthKeyword(); - - /** - * Try to authenticate the user with $username and $password. - * - * @param Swift_Transport_SmtpAgent $agent - * @param string $username - * @param string $password - * - * @return bool - */ - public function authenticate(Swift_Transport_SmtpAgent $agent, $username, $password); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpHandler.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpHandler.php deleted file mode 100644 index c17ef8f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpHandler.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An ESMTP handler. - * - * @author Chris Corbyn - */ -interface Swift_Transport_EsmtpHandler -{ - /** - * Get the name of the ESMTP extension this handles. - * - * @return bool - */ - public function getHandledKeyword(); - - /** - * Set the parameters which the EHLO greeting indicated. - * - * @param string[] $parameters - */ - public function setKeywordParams(array $parameters); - - /** - * Runs immediately after a EHLO has been issued. - * - * @param Swift_Transport_SmtpAgent $agent to read/write - */ - public function afterEhlo(Swift_Transport_SmtpAgent $agent); - - /** - * Get params which are appended to MAIL FROM:<>. - * - * @return string[] - */ - public function getMailParams(); - - /** - * Get params which are appended to RCPT TO:<>. - * - * @return string[] - */ - public function getRcptParams(); - - /** - * Runs when a command is due to be sent. - * - * @param Swift_Transport_SmtpAgent $agent to read/write - * @param string $command to send - * @param int[] $codes expected in response - * @param string[] $failedRecipients to collect failures - * @param bool $stop to be set true by-reference if the command is now sent - */ - public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = array(), &$failedRecipients = null, &$stop = false); - - /** - * Returns +1, -1 or 0 according to the rules for usort(). - * - * This method is called to ensure extensions can be execute in an appropriate order. - * - * @param string $esmtpKeyword to compare with - * - * @return int - */ - public function getPriorityOver($esmtpKeyword); - - /** - * Returns an array of method names which are exposed to the Esmtp class. - * - * @return string[] - */ - public function exposeMixinMethods(); - - /** - * Tells this handler to clear any buffers and reset its state. - */ - public function resetState(); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php deleted file mode 100644 index 156e2cf..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php +++ /dev/null @@ -1,411 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Sends Messages over SMTP with ESMTP support. - * - * @author Chris Corbyn - */ -class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTransport implements Swift_Transport_SmtpAgent -{ - /** - * ESMTP extension handlers. - * - * @var Swift_Transport_EsmtpHandler[] - */ - private $_handlers = array(); - - /** - * ESMTP capabilities. - * - * @var string[] - */ - private $_capabilities = array(); - - /** - * Connection buffer parameters. - * - * @var array - */ - private $_params = array( - 'protocol' => 'tcp', - 'host' => 'localhost', - 'port' => 25, - 'timeout' => 30, - 'blocking' => 1, - 'tls' => false, - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'stream_context_options' => array(), - ); - - /** - * Creates a new EsmtpTransport using the given I/O buffer. - * - * @param Swift_Transport_IoBuffer $buf - * @param Swift_Transport_EsmtpHandler[] $extensionHandlers - * @param Swift_Events_EventDispatcher $dispatcher - */ - public function __construct(Swift_Transport_IoBuffer $buf, array $extensionHandlers, Swift_Events_EventDispatcher $dispatcher) - { - parent::__construct($buf, $dispatcher); - $this->setExtensionHandlers($extensionHandlers); - } - - /** - * Set the host to connect to. - * - * @param string $host - * - * @return $this - */ - public function setHost($host) - { - $this->_params['host'] = $host; - - return $this; - } - - /** - * Get the host to connect to. - * - * @return string - */ - public function getHost() - { - return $this->_params['host']; - } - - /** - * Set the port to connect to. - * - * @param int $port - * - * @return $this - */ - public function setPort($port) - { - $this->_params['port'] = (int) $port; - - return $this; - } - - /** - * Get the port to connect to. - * - * @return int - */ - public function getPort() - { - return $this->_params['port']; - } - - /** - * Set the connection timeout. - * - * @param int $timeout seconds - * - * @return $this - */ - public function setTimeout($timeout) - { - $this->_params['timeout'] = (int) $timeout; - $this->_buffer->setParam('timeout', (int) $timeout); - - return $this; - } - - /** - * Get the connection timeout. - * - * @return int - */ - public function getTimeout() - { - return $this->_params['timeout']; - } - - /** - * Set the encryption type (tls or ssl). - * - * @param string $encryption - * - * @return $this - */ - public function setEncryption($encryption) - { - $encryption = strtolower($encryption); - if ('tls' == $encryption) { - $this->_params['protocol'] = 'tcp'; - $this->_params['tls'] = true; - } else { - $this->_params['protocol'] = $encryption; - $this->_params['tls'] = false; - } - - return $this; - } - - /** - * Get the encryption type. - * - * @return string - */ - public function getEncryption() - { - return $this->_params['tls'] ? 'tls' : $this->_params['protocol']; - } - - /** - * Sets the stream context options. - * - * @param array $options - * - * @return $this - */ - public function setStreamOptions($options) - { - $this->_params['stream_context_options'] = $options; - - return $this; - } - - /** - * Returns the stream context options. - * - * @return array - */ - public function getStreamOptions() - { - return $this->_params['stream_context_options']; - } - - /** - * Sets the source IP. - * - * @param string $source - * - * @return $this - */ - public function setSourceIp($source) - { - $this->_params['sourceIp'] = $source; - - return $this; - } - - /** - * Returns the IP used to connect to the destination. - * - * @return string - */ - public function getSourceIp() - { - return isset($this->_params['sourceIp']) ? $this->_params['sourceIp'] : null; - } - - /** - * Set ESMTP extension handlers. - * - * @param Swift_Transport_EsmtpHandler[] $handlers - * - * @return $this - */ - public function setExtensionHandlers(array $handlers) - { - $assoc = array(); - foreach ($handlers as $handler) { - $assoc[$handler->getHandledKeyword()] = $handler; - } - - @uasort($assoc, array($this, '_sortHandlers')); - $this->_handlers = $assoc; - $this->_setHandlerParams(); - - return $this; - } - - /** - * Get ESMTP extension handlers. - * - * @return Swift_Transport_EsmtpHandler[] - */ - public function getExtensionHandlers() - { - return array_values($this->_handlers); - } - - /** - * Run a command against the buffer, expecting the given response codes. - * - * If no response codes are given, the response will not be validated. - * If codes are given, an exception will be thrown on an invalid response. - * - * @param string $command - * @param int[] $codes - * @param string[] $failures An array of failures by-reference - * - * @return string - */ - public function executeCommand($command, $codes = array(), &$failures = null) - { - $failures = (array) $failures; - $stopSignal = false; - $response = null; - foreach ($this->_getActiveHandlers() as $handler) { - $response = $handler->onCommand( - $this, $command, $codes, $failures, $stopSignal - ); - if ($stopSignal) { - return $response; - } - } - - return parent::executeCommand($command, $codes, $failures); - } - - /** Mixin handling method for ESMTP handlers */ - public function __call($method, $args) - { - foreach ($this->_handlers as $handler) { - if (in_array(strtolower($method), - array_map('strtolower', (array) $handler->exposeMixinMethods()) - )) { - $return = call_user_func_array(array($handler, $method), $args); - // Allow fluid method calls - if (null === $return && substr($method, 0, 3) == 'set') { - return $this; - } else { - return $return; - } - } - } - trigger_error('Call to undefined method '.$method, E_USER_ERROR); - } - - /** Get the params to initialize the buffer */ - protected function _getBufferParams() - { - return $this->_params; - } - - /** Overridden to perform EHLO instead */ - protected function _doHeloCommand() - { - try { - $response = $this->executeCommand( - sprintf("EHLO %s\r\n", $this->_domain), array(250) - ); - } catch (Swift_TransportException $e) { - return parent::_doHeloCommand(); - } - - if ($this->_params['tls']) { - try { - $this->executeCommand("STARTTLS\r\n", array(220)); - - if (!$this->_buffer->startTLS()) { - throw new Swift_TransportException('Unable to connect with TLS encryption'); - } - - try { - $response = $this->executeCommand( - sprintf("EHLO %s\r\n", $this->_domain), array(250) - ); - } catch (Swift_TransportException $e) { - return parent::_doHeloCommand(); - } - } catch (Swift_TransportException $e) { - $this->_throwException($e); - } - } - - $this->_capabilities = $this->_getCapabilities($response); - $this->_setHandlerParams(); - foreach ($this->_getActiveHandlers() as $handler) { - $handler->afterEhlo($this); - } - } - - /** Overridden to add Extension support */ - protected function _doMailFromCommand($address) - { - $handlers = $this->_getActiveHandlers(); - $params = array(); - foreach ($handlers as $handler) { - $params = array_merge($params, (array) $handler->getMailParams()); - } - $paramStr = !empty($params) ? ' '.implode(' ', $params) : ''; - $this->executeCommand( - sprintf("MAIL FROM:<%s>%s\r\n", $address, $paramStr), array(250) - ); - } - - /** Overridden to add Extension support */ - protected function _doRcptToCommand($address) - { - $handlers = $this->_getActiveHandlers(); - $params = array(); - foreach ($handlers as $handler) { - $params = array_merge($params, (array) $handler->getRcptParams()); - } - $paramStr = !empty($params) ? ' '.implode(' ', $params) : ''; - $this->executeCommand( - sprintf("RCPT TO:<%s>%s\r\n", $address, $paramStr), array(250, 251, 252) - ); - } - - /** Determine ESMTP capabilities by function group */ - private function _getCapabilities($ehloResponse) - { - $capabilities = array(); - $ehloResponse = trim($ehloResponse); - $lines = explode("\r\n", $ehloResponse); - array_shift($lines); - foreach ($lines as $line) { - if (preg_match('/^[0-9]{3}[ -]([A-Z0-9-]+)((?:[ =].*)?)$/Di', $line, $matches)) { - $keyword = strtoupper($matches[1]); - $paramStr = strtoupper(ltrim($matches[2], ' =')); - $params = !empty($paramStr) ? explode(' ', $paramStr) : array(); - $capabilities[$keyword] = $params; - } - } - - return $capabilities; - } - - /** Set parameters which are used by each extension handler */ - private function _setHandlerParams() - { - foreach ($this->_handlers as $keyword => $handler) { - if (array_key_exists($keyword, $this->_capabilities)) { - $handler->setKeywordParams($this->_capabilities[$keyword]); - } - } - } - - /** Get ESMTP handlers which are currently ok to use */ - private function _getActiveHandlers() - { - $handlers = array(); - foreach ($this->_handlers as $keyword => $handler) { - if (array_key_exists($keyword, $this->_capabilities)) { - $handlers[] = $handler; - } - } - - return $handlers; - } - - /** Custom sort for extension handler ordering */ - private function _sortHandlers($a, $b) - { - return $a->getPriorityOver($b->getHandledKeyword()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php deleted file mode 100644 index 311a0f2..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Contains a list of redundant Transports so when one fails, the next is used. - * - * @author Chris Corbyn - */ -class Swift_Transport_FailoverTransport extends Swift_Transport_LoadBalancedTransport -{ - /** - * Registered transport currently used. - * - * @var Swift_Transport - */ - private $_currentTransport; - - // needed as __construct is called from elsewhere explicitly - public function __construct() - { - parent::__construct(); - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param Swift_Mime_Message $message - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $maxTransports = count($this->_transports); - $sent = 0; - $this->_lastUsedTransport = null; - - for ($i = 0; $i < $maxTransports - && $transport = $this->_getNextTransport(); ++$i) { - try { - if (!$transport->isStarted()) { - $transport->start(); - } - - if ($sent = $transport->send($message, $failedRecipients)) { - $this->_lastUsedTransport = $transport; - - return $sent; - } - } catch (Swift_TransportException $e) { - $this->_killCurrentTransport(); - } - } - - if (count($this->_transports) == 0) { - throw new Swift_TransportException( - 'All Transports in FailoverTransport failed, or no Transports available' - ); - } - - return $sent; - } - - protected function _getNextTransport() - { - if (!isset($this->_currentTransport)) { - $this->_currentTransport = parent::_getNextTransport(); - } - - return $this->_currentTransport; - } - - protected function _killCurrentTransport() - { - $this->_currentTransport = null; - parent::_killCurrentTransport(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php deleted file mode 100644 index af97adf..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Buffers input and output to a resource. - * - * @author Chris Corbyn - */ -interface Swift_Transport_IoBuffer extends Swift_InputByteStream, Swift_OutputByteStream -{ - /** A socket buffer over TCP */ - const TYPE_SOCKET = 0x0001; - - /** A process buffer with I/O support */ - const TYPE_PROCESS = 0x0010; - - /** - * Perform any initialization needed, using the given $params. - * - * Parameters will vary depending upon the type of IoBuffer used. - * - * @param array $params - */ - public function initialize(array $params); - - /** - * Set an individual param on the buffer (e.g. switching to SSL). - * - * @param string $param - * @param mixed $value - */ - public function setParam($param, $value); - - /** - * Perform any shutdown logic needed. - */ - public function terminate(); - - /** - * Set an array of string replacements which should be made on data written - * to the buffer. - * - * This could replace LF with CRLF for example. - * - * @param string[] $replacements - */ - public function setWriteTranslations(array $replacements); - - /** - * Get a line of output (including any CRLF). - * - * The $sequence number comes from any writes and may or may not be used - * depending upon the implementation. - * - * @param int $sequence of last write to scan from - * - * @return string - */ - public function readLine($sequence); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/LoadBalancedTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/LoadBalancedTransport.php deleted file mode 100644 index e2adc56..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/LoadBalancedTransport.php +++ /dev/null @@ -1,183 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Redundantly and rotationally uses several Transports when sending. - * - * @author Chris Corbyn - */ -class Swift_Transport_LoadBalancedTransport implements Swift_Transport -{ - /** - * Transports which are deemed useless. - * - * @var Swift_Transport[] - */ - private $_deadTransports = array(); - - /** - * The Transports which are used in rotation. - * - * @var Swift_Transport[] - */ - protected $_transports = array(); - - /** - * The Transport used in the last successful send operation. - * - * @var Swift_Transport - */ - protected $_lastUsedTransport = null; - - // needed as __construct is called from elsewhere explicitly - public function __construct() - { - } - - /** - * Set $transports to delegate to. - * - * @param Swift_Transport[] $transports - */ - public function setTransports(array $transports) - { - $this->_transports = $transports; - $this->_deadTransports = array(); - } - - /** - * Get $transports to delegate to. - * - * @return Swift_Transport[] - */ - public function getTransports() - { - return array_merge($this->_transports, $this->_deadTransports); - } - - /** - * Get the Transport used in the last successful send operation. - * - * @return Swift_Transport - */ - public function getLastUsedTransport() - { - return $this->_lastUsedTransport; - } - - /** - * Test if this Transport mechanism has started. - * - * @return bool - */ - public function isStarted() - { - return count($this->_transports) > 0; - } - - /** - * Start this Transport mechanism. - */ - public function start() - { - $this->_transports = array_merge($this->_transports, $this->_deadTransports); - } - - /** - * Stop this Transport mechanism. - */ - public function stop() - { - foreach ($this->_transports as $transport) { - $transport->stop(); - } - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param Swift_Mime_Message $message - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $maxTransports = count($this->_transports); - $sent = 0; - $this->_lastUsedTransport = null; - - for ($i = 0; $i < $maxTransports - && $transport = $this->_getNextTransport(); ++$i) { - try { - if (!$transport->isStarted()) { - $transport->start(); - } - if ($sent = $transport->send($message, $failedRecipients)) { - $this->_lastUsedTransport = $transport; - break; - } - } catch (Swift_TransportException $e) { - $this->_killCurrentTransport(); - } - } - - if (count($this->_transports) == 0) { - throw new Swift_TransportException( - 'All Transports in LoadBalancedTransport failed, or no Transports available' - ); - } - - return $sent; - } - - /** - * Register a plugin. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - foreach ($this->_transports as $transport) { - $transport->registerPlugin($plugin); - } - } - - /** - * Rotates the transport list around and returns the first instance. - * - * @return Swift_Transport - */ - protected function _getNextTransport() - { - if ($next = array_shift($this->_transports)) { - $this->_transports[] = $next; - } - - return $next; - } - - /** - * Tag the currently used (top of stack) transport as dead/useless. - */ - protected function _killCurrentTransport() - { - if ($transport = array_pop($this->_transports)) { - try { - $transport->stop(); - } catch (Exception $e) { - } - $this->_deadTransports[] = $transport; - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailInvoker.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailInvoker.php deleted file mode 100644 index 77489ce..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailInvoker.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * This interface intercepts calls to the mail() function. - * - * @author Chris Corbyn - */ -interface Swift_Transport_MailInvoker -{ - /** - * Send mail via the mail() function. - * - * This method takes the same arguments as PHP mail(). - * - * @param string $to - * @param string $subject - * @param string $body - * @param string $headers - * @param string $extraParams - * - * @return bool - */ - public function mail($to, $subject, $body, $headers = null, $extraParams = null); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailTransport.php deleted file mode 100644 index 48ef4a7..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailTransport.php +++ /dev/null @@ -1,297 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Sends Messages using the mail() function. - * - * It is advised that users do not use this transport if at all possible - * since a number of plugin features cannot be used in conjunction with this - * transport due to the internal interface in PHP itself. - * - * The level of error reporting with this transport is incredibly weak, again - * due to limitations of PHP's internal mail() function. You'll get an - * all-or-nothing result from sending. - * - * @author Chris Corbyn - * - * @deprecated since 5.4.5 (to be removed in 6.0) - */ -class Swift_Transport_MailTransport implements Swift_Transport -{ - /** Additional parameters to pass to mail() */ - private $_extraParams = '-f%s'; - - /** The event dispatcher from the plugin API */ - private $_eventDispatcher; - - /** An invoker that calls the mail() function */ - private $_invoker; - - /** - * Create a new MailTransport with the $log. - * - * @param Swift_Transport_MailInvoker $invoker - * @param Swift_Events_EventDispatcher $eventDispatcher - */ - public function __construct(Swift_Transport_MailInvoker $invoker, Swift_Events_EventDispatcher $eventDispatcher) - { - @trigger_error(sprintf('The %s class is deprecated since version 5.4.5 and will be removed in 6.0. Use the Sendmail or SMTP transport instead.', __CLASS__), E_USER_DEPRECATED); - - $this->_invoker = $invoker; - $this->_eventDispatcher = $eventDispatcher; - } - - /** - * Not used. - */ - public function isStarted() - { - return false; - } - - /** - * Not used. - */ - public function start() - { - } - - /** - * Not used. - */ - public function stop() - { - } - - /** - * Set the additional parameters used on the mail() function. - * - * This string is formatted for sprintf() where %s is the sender address. - * - * @param string $params - * - * @return $this - */ - public function setExtraParams($params) - { - $this->_extraParams = $params; - - return $this; - } - - /** - * Get the additional parameters used on the mail() function. - * - * This string is formatted for sprintf() where %s is the sender address. - * - * @return string - */ - public function getExtraParams() - { - return $this->_extraParams; - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param Swift_Mime_Message $message - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $failedRecipients = (array) $failedRecipients; - - if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - $count = ( - count((array) $message->getTo()) - + count((array) $message->getCc()) - + count((array) $message->getBcc()) - ); - - $toHeader = $message->getHeaders()->get('To'); - $subjectHeader = $message->getHeaders()->get('Subject'); - - if (0 === $count) { - $this->_throwException(new Swift_TransportException('Cannot send message without a recipient')); - } - $to = $toHeader ? $toHeader->getFieldBody() : ''; - $subject = $subjectHeader ? $subjectHeader->getFieldBody() : ''; - - $reversePath = $this->_getReversePath($message); - - // Remove headers that would otherwise be duplicated - $message->getHeaders()->remove('To'); - $message->getHeaders()->remove('Subject'); - - $messageStr = $message->toString(); - - if ($toHeader) { - $message->getHeaders()->set($toHeader); - } - $message->getHeaders()->set($subjectHeader); - - // Separate headers from body - if (false !== $endHeaders = strpos($messageStr, "\r\n\r\n")) { - $headers = substr($messageStr, 0, $endHeaders)."\r\n"; //Keep last EOL - $body = substr($messageStr, $endHeaders + 4); - } else { - $headers = $messageStr."\r\n"; - $body = ''; - } - - unset($messageStr); - - if ("\r\n" != PHP_EOL) { - // Non-windows (not using SMTP) - $headers = str_replace("\r\n", PHP_EOL, $headers); - $subject = str_replace("\r\n", PHP_EOL, $subject); - $body = str_replace("\r\n", PHP_EOL, $body); - $to = str_replace("\r\n", PHP_EOL, $to); - } else { - // Windows, using SMTP - $headers = str_replace("\r\n.", "\r\n..", $headers); - $subject = str_replace("\r\n.", "\r\n..", $subject); - $body = str_replace("\r\n.", "\r\n..", $body); - $to = str_replace("\r\n.", "\r\n..", $to); - } - - if ($this->_invoker->mail($to, $subject, $body, $headers, $this->_formatExtraParams($this->_extraParams, $reversePath))) { - if ($evt) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - $evt->setFailedRecipients($failedRecipients); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - } else { - $failedRecipients = array_merge( - $failedRecipients, - array_keys((array) $message->getTo()), - array_keys((array) $message->getCc()), - array_keys((array) $message->getBcc()) - ); - - if ($evt) { - $evt->setResult(Swift_Events_SendEvent::RESULT_FAILED); - $evt->setFailedRecipients($failedRecipients); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - $message->generateId(); - - $count = 0; - } - - return $count; - } - - /** - * Register a plugin. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->_eventDispatcher->bindEventListener($plugin); - } - - /** Throw a TransportException, first sending it to any listeners */ - protected function _throwException(Swift_TransportException $e) - { - if ($evt = $this->_eventDispatcher->createTransportExceptionEvent($this, $e)) { - $this->_eventDispatcher->dispatchEvent($evt, 'exceptionThrown'); - if (!$evt->bubbleCancelled()) { - throw $e; - } - } else { - throw $e; - } - } - - /** Determine the best-use reverse path for this message */ - private function _getReversePath(Swift_Mime_Message $message) - { - $return = $message->getReturnPath(); - $sender = $message->getSender(); - $from = $message->getFrom(); - $path = null; - if (!empty($return)) { - $path = $return; - } elseif (!empty($sender)) { - $keys = array_keys($sender); - $path = array_shift($keys); - } elseif (!empty($from)) { - $keys = array_keys($from); - $path = array_shift($keys); - } - - return $path; - } - - /** - * Fix CVE-2016-10074 by disallowing potentially unsafe shell characters. - * - * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows. - * - * @param string $string The string to be validated - * - * @return bool - */ - private function _isShellSafe($string) - { - // Future-proof - if (escapeshellcmd($string) !== $string || !in_array(escapeshellarg($string), array("'$string'", "\"$string\""))) { - return false; - } - - $length = strlen($string); - for ($i = 0; $i < $length; ++$i) { - $c = $string[$i]; - // All other characters have a special meaning in at least one common shell, including = and +. - // Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. - // Note that this does permit non-Latin alphanumeric characters based on the current locale. - if (!ctype_alnum($c) && strpos('@_-.', $c) === false) { - return false; - } - } - - return true; - } - - /** - * Return php mail extra params to use for invoker->mail. - * - * @param $extraParams - * @param $reversePath - * - * @return string|null - */ - private function _formatExtraParams($extraParams, $reversePath) - { - if (false !== strpos($extraParams, '-f%s')) { - if (empty($reversePath) || false === $this->_isShellSafe($reversePath)) { - $extraParams = str_replace('-f%s', '', $extraParams); - } else { - $extraParams = sprintf($extraParams, $reversePath); - } - } - - return !empty($extraParams) ? $extraParams : null; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php deleted file mode 100644 index ad20e0e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2009 Fabien Potencier <fabien.potencier@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pretends messages have been sent, but just ignores them. - * - * @author Fabien Potencier - */ -class Swift_Transport_NullTransport implements Swift_Transport -{ - /** The event dispatcher from the plugin API */ - private $_eventDispatcher; - - /** - * Constructor. - */ - public function __construct(Swift_Events_EventDispatcher $eventDispatcher) - { - $this->_eventDispatcher = $eventDispatcher; - } - - /** - * Tests if this Transport mechanism has started. - * - * @return bool - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Transport mechanism. - */ - public function start() - { - } - - /** - * Stops this Transport mechanism. - */ - public function stop() - { - } - - /** - * Sends the given message. - * - * @param Swift_Mime_Message $message - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent emails - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - if ($evt) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - $count = ( - count((array) $message->getTo()) - + count((array) $message->getCc()) - + count((array) $message->getBcc()) - ); - - return $count; - } - - /** - * Register a plugin. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->_eventDispatcher->bindEventListener($plugin); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php deleted file mode 100644 index 6430d5f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php +++ /dev/null @@ -1,160 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * SendmailTransport for sending mail through a Sendmail/Postfix (etc..) binary. - * - * Supported modes are -bs and -t, with any additional flags desired. - * It is advised to use -bs mode since error reporting with -t mode is not - * possible. - * - * @author Chris Corbyn - */ -class Swift_Transport_SendmailTransport extends Swift_Transport_AbstractSmtpTransport -{ - /** - * Connection buffer parameters. - * - * @var array - */ - private $_params = array( - 'timeout' => 30, - 'blocking' => 1, - 'command' => '/usr/sbin/sendmail -bs', - 'type' => Swift_Transport_IoBuffer::TYPE_PROCESS, - ); - - /** - * Create a new SendmailTransport with $buf for I/O. - * - * @param Swift_Transport_IoBuffer $buf - * @param Swift_Events_EventDispatcher $dispatcher - */ - public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher) - { - parent::__construct($buf, $dispatcher); - } - - /** - * Start the standalone SMTP session if running in -bs mode. - */ - public function start() - { - if (false !== strpos($this->getCommand(), ' -bs')) { - parent::start(); - } - } - - /** - * Set the command to invoke. - * - * If using -t mode you are strongly advised to include -oi or -i in the flags. - * For example: /usr/sbin/sendmail -oi -t - * Swift will append a -f<sender> flag if one is not present. - * - * The recommended mode is "-bs" since it is interactive and failure notifications - * are hence possible. - * - * @param string $command - * - * @return $this - */ - public function setCommand($command) - { - $this->_params['command'] = $command; - - return $this; - } - - /** - * Get the sendmail command which will be invoked. - * - * @return string - */ - public function getCommand() - { - return $this->_params['command']; - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * - * The return value is the number of recipients who were accepted for delivery. - * NOTE: If using 'sendmail -t' you will not be aware of any failures until - * they bounce (i.e. send() will always return 100% success). - * - * @param Swift_Mime_Message $message - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - $failedRecipients = (array) $failedRecipients; - $command = $this->getCommand(); - $buffer = $this->getBuffer(); - $count = 0; - - if (false !== strpos($command, ' -t')) { - if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - if (false === strpos($command, ' -f')) { - $command .= ' -f'.escapeshellarg($this->_getReversePath($message)); - } - - $buffer->initialize(array_merge($this->_params, array('command' => $command))); - - if (false === strpos($command, ' -i') && false === strpos($command, ' -oi')) { - $buffer->setWriteTranslations(array("\r\n" => "\n", "\n." => "\n..")); - } else { - $buffer->setWriteTranslations(array("\r\n" => "\n")); - } - - $count = count((array) $message->getTo()) - + count((array) $message->getCc()) - + count((array) $message->getBcc()) - ; - $message->toByteStream($buffer); - $buffer->flushBuffers(); - $buffer->setWriteTranslations(array()); - $buffer->terminate(); - - if ($evt) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - $evt->setFailedRecipients($failedRecipients); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - $message->generateId(); - } elseif (false !== strpos($command, ' -bs')) { - $count = parent::send($message, $failedRecipients); - } else { - $this->_throwException(new Swift_TransportException( - 'Unsupported sendmail command flags ['.$command.']. '. - 'Must be one of "-bs" or "-t" but can include additional flags.' - )); - } - - return $count; - } - - /** Get the params to initialize the buffer */ - protected function _getBufferParams() - { - return $this->_params; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SimpleMailInvoker.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SimpleMailInvoker.php deleted file mode 100644 index 4cab66b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SimpleMailInvoker.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * This is the implementation class for {@link Swift_Transport_MailInvoker}. - * - * @author Chris Corbyn - */ -class Swift_Transport_SimpleMailInvoker implements Swift_Transport_MailInvoker -{ - /** - * Send mail via the mail() function. - * - * This method takes the same arguments as PHP mail(). - * - * @param string $to - * @param string $subject - * @param string $body - * @param string $headers - * @param string $extraParams - * - * @return bool - */ - public function mail($to, $subject, $body, $headers = null, $extraParams = null) - { - if (!ini_get('safe_mode')) { - return @mail($to, $subject, $body, $headers, $extraParams); - } - - return @mail($to, $subject, $body, $headers); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php deleted file mode 100644 index 90e913f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Wraps an IoBuffer to send/receive SMTP commands/responses. - * - * @author Chris Corbyn - */ -interface Swift_Transport_SmtpAgent -{ - /** - * Get the IoBuffer where read/writes are occurring. - * - * @return Swift_Transport_IoBuffer - */ - public function getBuffer(); - - /** - * Run a command against the buffer, expecting the given response codes. - * - * If no response codes are given, the response will not be validated. - * If codes are given, an exception will be thrown on an invalid response. - * - * @param string $command - * @param int[] $codes - * @param string[] $failures An array of failures by-reference - */ - public function executeCommand($command, $codes = array(), &$failures = null); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SpoolTransport.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SpoolTransport.php deleted file mode 100644 index e4b87f3..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SpoolTransport.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2009 Fabien Potencier <fabien.potencier@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages in a queue. - * - * @author Fabien Potencier - */ -class Swift_Transport_SpoolTransport implements Swift_Transport -{ - /** The spool instance */ - private $_spool; - - /** The event dispatcher from the plugin API */ - private $_eventDispatcher; - - /** - * Constructor. - */ - public function __construct(Swift_Events_EventDispatcher $eventDispatcher, Swift_Spool $spool = null) - { - $this->_eventDispatcher = $eventDispatcher; - $this->_spool = $spool; - } - - /** - * Sets the spool object. - * - * @param Swift_Spool $spool - * - * @return $this - */ - public function setSpool(Swift_Spool $spool) - { - $this->_spool = $spool; - - return $this; - } - - /** - * Get the spool object. - * - * @return Swift_Spool - */ - public function getSpool() - { - return $this->_spool; - } - - /** - * Tests if this Transport mechanism has started. - * - * @return bool - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Transport mechanism. - */ - public function start() - { - } - - /** - * Stops this Transport mechanism. - */ - public function stop() - { - } - - /** - * Sends the given message. - * - * @param Swift_Mime_Message $message - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent e-mail's - */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) - { - if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) { - $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - $success = $this->_spool->queueMessage($message); - - if ($evt) { - $evt->setResult($success ? Swift_Events_SendEvent::RESULT_SPOOLED : Swift_Events_SendEvent::RESULT_FAILED); - $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - return 1; - } - - /** - * Register a plugin. - * - * @param Swift_Events_EventListener $plugin - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->_eventDispatcher->bindEventListener($plugin); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php deleted file mode 100644 index 9f2fff4..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php +++ /dev/null @@ -1,325 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A generic IoBuffer implementation supporting remote sockets and local processes. - * - * @author Chris Corbyn - */ -class Swift_Transport_StreamBuffer extends Swift_ByteStream_AbstractFilterableInputStream implements Swift_Transport_IoBuffer -{ - /** A primary socket */ - private $_stream; - - /** The input stream */ - private $_in; - - /** The output stream */ - private $_out; - - /** Buffer initialization parameters */ - private $_params = array(); - - /** The ReplacementFilterFactory */ - private $_replacementFactory; - - /** Translations performed on data being streamed into the buffer */ - private $_translations = array(); - - /** - * Create a new StreamBuffer using $replacementFactory for transformations. - * - * @param Swift_ReplacementFilterFactory $replacementFactory - */ - public function __construct(Swift_ReplacementFilterFactory $replacementFactory) - { - $this->_replacementFactory = $replacementFactory; - } - - /** - * Perform any initialization needed, using the given $params. - * - * Parameters will vary depending upon the type of IoBuffer used. - * - * @param array $params - */ - public function initialize(array $params) - { - $this->_params = $params; - switch ($params['type']) { - case self::TYPE_PROCESS: - $this->_establishProcessConnection(); - break; - case self::TYPE_SOCKET: - default: - $this->_establishSocketConnection(); - break; - } - } - - /** - * Set an individual param on the buffer (e.g. switching to SSL). - * - * @param string $param - * @param mixed $value - */ - public function setParam($param, $value) - { - if (isset($this->_stream)) { - switch ($param) { - case 'timeout': - if ($this->_stream) { - stream_set_timeout($this->_stream, $value); - } - break; - - case 'blocking': - if ($this->_stream) { - stream_set_blocking($this->_stream, 1); - } - } - } - $this->_params[$param] = $value; - } - - public function startTLS() - { - return stream_socket_enable_crypto($this->_stream, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); - } - - /** - * Perform any shutdown logic needed. - */ - public function terminate() - { - if (isset($this->_stream)) { - switch ($this->_params['type']) { - case self::TYPE_PROCESS: - fclose($this->_in); - fclose($this->_out); - proc_close($this->_stream); - break; - case self::TYPE_SOCKET: - default: - fclose($this->_stream); - break; - } - } - $this->_stream = null; - $this->_out = null; - $this->_in = null; - } - - /** - * Set an array of string replacements which should be made on data written - * to the buffer. - * - * This could replace LF with CRLF for example. - * - * @param string[] $replacements - */ - public function setWriteTranslations(array $replacements) - { - foreach ($this->_translations as $search => $replace) { - if (!isset($replacements[$search])) { - $this->removeFilter($search); - unset($this->_translations[$search]); - } - } - - foreach ($replacements as $search => $replace) { - if (!isset($this->_translations[$search])) { - $this->addFilter( - $this->_replacementFactory->createFilter($search, $replace), $search - ); - $this->_translations[$search] = true; - } - } - } - - /** - * Get a line of output (including any CRLF). - * - * The $sequence number comes from any writes and may or may not be used - * depending upon the implementation. - * - * @param int $sequence of last write to scan from - * - * @throws Swift_IoException - * - * @return string - */ - public function readLine($sequence) - { - if (isset($this->_out) && !feof($this->_out)) { - $line = fgets($this->_out); - if (strlen($line) == 0) { - $metas = stream_get_meta_data($this->_out); - if ($metas['timed_out']) { - throw new Swift_IoException( - 'Connection to '. - $this->_getReadConnectionDescription(). - ' Timed Out' - ); - } - } - - return $line; - } - } - - /** - * Reads $length bytes from the stream into a string and moves the pointer - * through the stream by $length. - * - * If less bytes exist than are requested the remaining bytes are given instead. - * If no bytes are remaining at all, boolean false is returned. - * - * @param int $length - * - * @throws Swift_IoException - * - * @return string|bool - */ - public function read($length) - { - if (isset($this->_out) && !feof($this->_out)) { - $ret = fread($this->_out, $length); - if (strlen($ret) == 0) { - $metas = stream_get_meta_data($this->_out); - if ($metas['timed_out']) { - throw new Swift_IoException( - 'Connection to '. - $this->_getReadConnectionDescription(). - ' Timed Out' - ); - } - } - - return $ret; - } - } - - /** Not implemented */ - public function setReadPointer($byteOffset) - { - } - - /** Flush the stream contents */ - protected function _flush() - { - if (isset($this->_in)) { - fflush($this->_in); - } - } - - /** Write this bytes to the stream */ - protected function _commit($bytes) - { - if (isset($this->_in)) { - $bytesToWrite = strlen($bytes); - $totalBytesWritten = 0; - - while ($totalBytesWritten < $bytesToWrite) { - $bytesWritten = fwrite($this->_in, substr($bytes, $totalBytesWritten)); - if (false === $bytesWritten || 0 === $bytesWritten) { - break; - } - - $totalBytesWritten += $bytesWritten; - } - - if ($totalBytesWritten > 0) { - return ++$this->_sequence; - } - } - } - - /** - * Establishes a connection to a remote server. - */ - private function _establishSocketConnection() - { - $host = $this->_params['host']; - if (!empty($this->_params['protocol'])) { - $host = $this->_params['protocol'].'://'.$host; - } - $timeout = 15; - if (!empty($this->_params['timeout'])) { - $timeout = $this->_params['timeout']; - } - $options = array(); - if (!empty($this->_params['sourceIp'])) { - $options['socket']['bindto'] = $this->_params['sourceIp'].':0'; - } - if (isset($this->_params['stream_context_options'])) { - $options = array_merge($options, $this->_params['stream_context_options']); - } - $streamContext = stream_context_create($options); - $this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext); - if (false === $this->_stream) { - throw new Swift_TransportException( - 'Connection could not be established with host '.$this->_params['host']. - ' ['.$errstr.' #'.$errno.']' - ); - } - if (!empty($this->_params['blocking'])) { - stream_set_blocking($this->_stream, 1); - } else { - stream_set_blocking($this->_stream, 0); - } - stream_set_timeout($this->_stream, $timeout); - $this->_in = &$this->_stream; - $this->_out = &$this->_stream; - } - - /** - * Opens a process for input/output. - */ - private function _establishProcessConnection() - { - $command = $this->_params['command']; - $descriptorSpec = array( - 0 => array('pipe', 'r'), - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w'), - ); - $pipes = array(); - $this->_stream = proc_open($command, $descriptorSpec, $pipes); - stream_set_blocking($pipes[2], 0); - if ($err = stream_get_contents($pipes[2])) { - throw new Swift_TransportException( - 'Process could not be started ['.$err.']' - ); - } - $this->_in = &$pipes[0]; - $this->_out = &$pipes[1]; - } - - private function _getReadConnectionDescription() - { - switch ($this->_params['type']) { - case self::TYPE_PROCESS: - return 'Process '.$this->_params['command']; - break; - - case self::TYPE_SOCKET: - default: - $host = $this->_params['host']; - if (!empty($this->_params['protocol'])) { - $host = $this->_params['protocol'].'://'.$host; - } - $host .= ':'.$this->_params['port']; - - return $host; - break; - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php deleted file mode 100644 index 4ae2412..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * TransportException thrown when an error occurs in the Transport subsystem. - * - * @author Chris Corbyn - */ -class Swift_TransportException extends Swift_IoException -{ - /** - * Create a new TransportException with $message. - * - * @param string $message - * @param int $code - * @param Exception $previous - */ - public function __construct($message, $code = 0, Exception $previous = null) - { - parent::__construct($message, $code, $previous); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Validate.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Validate.php deleted file mode 100644 index e16c212..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Validate.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Utility Class allowing users to simply check expressions again Swift Grammar. - * - * @author Xavier De Cock <xdecock@gmail.com> - */ -class Swift_Validate -{ - /** - * Grammar Object. - * - * @var Swift_Mime_Grammar - */ - private static $grammar = null; - - /** - * Checks if an e-mail address matches the current grammars. - * - * @param string $email - * - * @return bool - */ - public static function email($email) - { - if (self::$grammar === null) { - self::$grammar = Swift_DependencyContainer::getInstance() - ->lookup('mime.grammar'); - } - - return (bool) preg_match( - '/^'.self::$grammar->getDefinition('addr-spec').'$/D', - $email - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/cache_deps.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/cache_deps.php deleted file mode 100644 index 6023448..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/cache_deps.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -Swift_DependencyContainer::getInstance() - ->register('cache') - ->asAliasOf('cache.array') - - ->register('tempdir') - ->asValue('/tmp') - - ->register('cache.null') - ->asSharedInstanceOf('Swift_KeyCache_NullKeyCache') - - ->register('cache.array') - ->asSharedInstanceOf('Swift_KeyCache_ArrayKeyCache') - ->withDependencies(array('cache.inputstream')) - - ->register('cache.disk') - ->asSharedInstanceOf('Swift_KeyCache_DiskKeyCache') - ->withDependencies(array('cache.inputstream', 'tempdir')) - - ->register('cache.inputstream') - ->asNewInstanceOf('Swift_KeyCache_SimpleKeyCacheInputStream') -; diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php deleted file mode 100644 index 64d69d2..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -Swift_DependencyContainer::getInstance() - ->register('message.message') - ->asNewInstanceOf('Swift_Message') - - ->register('message.mimepart') - ->asNewInstanceOf('Swift_MimePart') -; diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php deleted file mode 100644 index 90085d5..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php - -require __DIR__ . '/../mime_types.php'; - -Swift_DependencyContainer::getInstance() - ->register('properties.charset') - ->asValue('utf-8') - - ->register('mime.grammar') - ->asSharedInstanceOf('Swift_Mime_Grammar') - - ->register('mime.message') - ->asNewInstanceOf('Swift_Mime_SimpleMessage') - ->withDependencies(array( - 'mime.headerset', - 'mime.qpcontentencoder', - 'cache', - 'mime.grammar', - 'properties.charset', - )) - - ->register('mime.part') - ->asNewInstanceOf('Swift_Mime_MimePart') - ->withDependencies(array( - 'mime.headerset', - 'mime.qpcontentencoder', - 'cache', - 'mime.grammar', - 'properties.charset', - )) - - ->register('mime.attachment') - ->asNewInstanceOf('Swift_Mime_Attachment') - ->withDependencies(array( - 'mime.headerset', - 'mime.base64contentencoder', - 'cache', - 'mime.grammar', - )) - ->addConstructorValue($swift_mime_types) - - ->register('mime.embeddedfile') - ->asNewInstanceOf('Swift_Mime_EmbeddedFile') - ->withDependencies(array( - 'mime.headerset', - 'mime.base64contentencoder', - 'cache', - 'mime.grammar', - )) - ->addConstructorValue($swift_mime_types) - - ->register('mime.headerfactory') - ->asNewInstanceOf('Swift_Mime_SimpleHeaderFactory') - ->withDependencies(array( - 'mime.qpheaderencoder', - 'mime.rfc2231encoder', - 'mime.grammar', - 'properties.charset', - )) - - ->register('mime.headerset') - ->asNewInstanceOf('Swift_Mime_SimpleHeaderSet') - ->withDependencies(array('mime.headerfactory', 'properties.charset')) - - ->register('mime.qpheaderencoder') - ->asNewInstanceOf('Swift_Mime_HeaderEncoder_QpHeaderEncoder') - ->withDependencies(array('mime.charstream')) - - ->register('mime.base64headerencoder') - ->asNewInstanceOf('Swift_Mime_HeaderEncoder_Base64HeaderEncoder') - ->withDependencies(array('mime.charstream')) - - ->register('mime.charstream') - ->asNewInstanceOf('Swift_CharacterStream_NgCharacterStream') - ->withDependencies(array('mime.characterreaderfactory', 'properties.charset')) - - ->register('mime.bytecanonicalizer') - ->asSharedInstanceOf('Swift_StreamFilters_ByteArrayReplacementFilter') - ->addConstructorValue(array(array(0x0D, 0x0A), array(0x0D), array(0x0A))) - ->addConstructorValue(array(array(0x0A), array(0x0A), array(0x0D, 0x0A))) - - ->register('mime.characterreaderfactory') - ->asSharedInstanceOf('Swift_CharacterReaderFactory_SimpleCharacterReaderFactory') - - ->register('mime.safeqpcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder') - ->withDependencies(array('mime.charstream', 'mime.bytecanonicalizer')) - - ->register('mime.rawcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_RawContentEncoder') - - ->register('mime.nativeqpcontentencoder') - ->withDependencies(array('properties.charset')) - ->asNewInstanceOf('Swift_Mime_ContentEncoder_NativeQpContentEncoder') - - ->register('mime.qpcontentencoderproxy') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoderProxy') - ->withDependencies(array('mime.safeqpcontentencoder', 'mime.nativeqpcontentencoder', 'properties.charset')) - - ->register('mime.7bitcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_PlainContentEncoder') - ->addConstructorValue('7bit') - ->addConstructorValue(true) - - ->register('mime.8bitcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_PlainContentEncoder') - ->addConstructorValue('8bit') - ->addConstructorValue(true) - - ->register('mime.base64contentencoder') - ->asSharedInstanceOf('Swift_Mime_ContentEncoder_Base64ContentEncoder') - - ->register('mime.rfc2231encoder') - ->asNewInstanceOf('Swift_Encoder_Rfc2231Encoder') - ->withDependencies(array('mime.charstream')) - - // As of PHP 5.4.7, the quoted_printable_encode() function behaves correctly. - // see https://github.com/php/php-src/commit/18bb426587d62f93c54c40bf8535eb8416603629 - ->register('mime.qpcontentencoder') - ->asAliasOf(PHP_VERSION_ID >= 50407 ? 'mime.qpcontentencoderproxy' : 'mime.safeqpcontentencoder') -; - -unset($swift_mime_types); diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php deleted file mode 100644 index 77e432c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -Swift_DependencyContainer::getInstance() - ->register('transport.smtp') - ->asNewInstanceOf('Swift_Transport_EsmtpTransport') - ->withDependencies(array( - 'transport.buffer', - array('transport.authhandler'), - 'transport.eventdispatcher', - )) - - ->register('transport.sendmail') - ->asNewInstanceOf('Swift_Transport_SendmailTransport') - ->withDependencies(array( - 'transport.buffer', - 'transport.eventdispatcher', - )) - - ->register('transport.mail') - ->asNewInstanceOf('Swift_Transport_MailTransport') - ->withDependencies(array('transport.mailinvoker', 'transport.eventdispatcher')) - - ->register('transport.loadbalanced') - ->asNewInstanceOf('Swift_Transport_LoadBalancedTransport') - - ->register('transport.failover') - ->asNewInstanceOf('Swift_Transport_FailoverTransport') - - ->register('transport.spool') - ->asNewInstanceOf('Swift_Transport_SpoolTransport') - ->withDependencies(array('transport.eventdispatcher')) - - ->register('transport.null') - ->asNewInstanceOf('Swift_Transport_NullTransport') - ->withDependencies(array('transport.eventdispatcher')) - - ->register('transport.mailinvoker') - ->asSharedInstanceOf('Swift_Transport_SimpleMailInvoker') - - ->register('transport.buffer') - ->asNewInstanceOf('Swift_Transport_StreamBuffer') - ->withDependencies(array('transport.replacementfactory')) - - ->register('transport.authhandler') - ->asNewInstanceOf('Swift_Transport_Esmtp_AuthHandler') - ->withDependencies(array( - array( - 'transport.crammd5auth', - 'transport.loginauth', - 'transport.plainauth', - 'transport.ntlmauth', - 'transport.xoauth2auth', - ), - )) - - ->register('transport.crammd5auth') - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_CramMd5Authenticator') - - ->register('transport.loginauth') - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_LoginAuthenticator') - - ->register('transport.plainauth') - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_PlainAuthenticator') - - ->register('transport.xoauth2auth') - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_XOAuth2Authenticator') - - ->register('transport.ntlmauth') - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_NTLMAuthenticator') - - ->register('transport.eventdispatcher') - ->asNewInstanceOf('Swift_Events_SimpleEventDispatcher') - - ->register('transport.replacementfactory') - ->asSharedInstanceOf('Swift_StreamFilters_StringReplacementFilterFactory') -; diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/mime_types.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/mime_types.php deleted file mode 100644 index b42c1cc..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/mime_types.php +++ /dev/null @@ -1,1007 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - * - * autogenerated using https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types - * and https://raw.github.com/minad/mimemagic/master/script/freedesktop.org.xml - */ - -/* - * List of MIME type automatically detected in Swift Mailer. - */ - -// You may add or take away what you like (lowercase required) - -$swift_mime_types = array( - '3dml' => 'text/vnd.in3d.3dml', - '3ds' => 'image/x-3ds', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gpp', - '7z' => 'application/x-7z-compressed', - 'aab' => 'application/x-authorware-bin', - 'aac' => 'audio/x-aac', - 'aam' => 'application/x-authorware-map', - 'aas' => 'application/x-authorware-seg', - 'abw' => 'application/x-abiword', - 'ac' => 'application/pkix-attr-cert', - 'acc' => 'application/vnd.americandynamics.acc', - 'ace' => 'application/x-ace-compressed', - 'acu' => 'application/vnd.acucobol', - 'acutc' => 'application/vnd.acucorp', - 'adp' => 'audio/adpcm', - 'aep' => 'application/vnd.audiograph', - 'afm' => 'application/x-font-type1', - 'afp' => 'application/vnd.ibm.modcap', - 'ahead' => 'application/vnd.ahead.space', - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'air' => 'application/vnd.adobe.air-application-installer-package+zip', - 'ait' => 'application/vnd.dvb.ait', - 'ami' => 'application/vnd.amiga.ami', - 'apk' => 'application/vnd.android.package-archive', - 'appcache' => 'text/cache-manifest', - 'apr' => 'application/vnd.lotus-approach', - 'aps' => 'application/postscript', - 'arc' => 'application/x-freearc', - 'asc' => 'application/pgp-signature', - 'asf' => 'video/x-ms-asf', - 'asm' => 'text/x-asm', - 'aso' => 'application/vnd.accpac.simply.aso', - 'asx' => 'video/x-ms-asf', - 'atc' => 'application/vnd.acucorp', - 'atom' => 'application/atom+xml', - 'atomcat' => 'application/atomcat+xml', - 'atomsvc' => 'application/atomsvc+xml', - 'atx' => 'application/vnd.antix.game-component', - 'au' => 'audio/basic', - 'avi' => 'video/x-msvideo', - 'aw' => 'application/applixware', - 'azf' => 'application/vnd.airzip.filesecure.azf', - 'azs' => 'application/vnd.airzip.filesecure.azs', - 'azw' => 'application/vnd.amazon.ebook', - 'bat' => 'application/x-msdownload', - 'bcpio' => 'application/x-bcpio', - 'bdf' => 'application/x-font-bdf', - 'bdm' => 'application/vnd.syncml.dm+wbxml', - 'bed' => 'application/vnd.realvnc.bed', - 'bh2' => 'application/vnd.fujitsu.oasysprs', - 'bin' => 'application/octet-stream', - 'blb' => 'application/x-blorb', - 'blorb' => 'application/x-blorb', - 'bmi' => 'application/vnd.bmi', - 'bmp' => 'image/bmp', - 'book' => 'application/vnd.framemaker', - 'box' => 'application/vnd.previewsystems.box', - 'boz' => 'application/x-bzip2', - 'bpk' => 'application/octet-stream', - 'btif' => 'image/prs.btif', - 'bz' => 'application/x-bzip', - 'bz2' => 'application/x-bzip2', - 'c' => 'text/x-c', - 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', - 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', - 'c4d' => 'application/vnd.clonk.c4group', - 'c4f' => 'application/vnd.clonk.c4group', - 'c4g' => 'application/vnd.clonk.c4group', - 'c4p' => 'application/vnd.clonk.c4group', - 'c4u' => 'application/vnd.clonk.c4group', - 'cab' => 'application/vnd.ms-cab-compressed', - 'caf' => 'audio/x-caf', - 'cap' => 'application/vnd.tcpdump.pcap', - 'car' => 'application/vnd.curl.car', - 'cat' => 'application/vnd.ms-pki.seccat', - 'cb7' => 'application/x-cbr', - 'cba' => 'application/x-cbr', - 'cbr' => 'application/x-cbr', - 'cbt' => 'application/x-cbr', - 'cbz' => 'application/x-cbr', - 'cc' => 'text/x-c', - 'cct' => 'application/x-director', - 'ccxml' => 'application/ccxml+xml', - 'cdbcmsg' => 'application/vnd.contact.cmsg', - 'cdf' => 'application/x-netcdf', - 'cdkey' => 'application/vnd.mediastation.cdkey', - 'cdmia' => 'application/cdmi-capability', - 'cdmic' => 'application/cdmi-container', - 'cdmid' => 'application/cdmi-domain', - 'cdmio' => 'application/cdmi-object', - 'cdmiq' => 'application/cdmi-queue', - 'cdx' => 'chemical/x-cdx', - 'cdxml' => 'application/vnd.chemdraw+xml', - 'cdy' => 'application/vnd.cinderella', - 'cer' => 'application/pkix-cert', - 'cfs' => 'application/x-cfs-compressed', - 'cgm' => 'image/cgm', - 'chat' => 'application/x-chat', - 'chm' => 'application/vnd.ms-htmlhelp', - 'chrt' => 'application/vnd.kde.kchart', - 'cif' => 'chemical/x-cif', - 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', - 'cil' => 'application/vnd.ms-artgalry', - 'cla' => 'application/vnd.claymore', - 'class' => 'application/java-vm', - 'clkk' => 'application/vnd.crick.clicker.keyboard', - 'clkp' => 'application/vnd.crick.clicker.palette', - 'clkt' => 'application/vnd.crick.clicker.template', - 'clkw' => 'application/vnd.crick.clicker.wordbank', - 'clkx' => 'application/vnd.crick.clicker', - 'clp' => 'application/x-msclip', - 'cmc' => 'application/vnd.cosmocaller', - 'cmdf' => 'chemical/x-cmdf', - 'cml' => 'chemical/x-cml', - 'cmp' => 'application/vnd.yellowriver-custom-menu', - 'cmx' => 'image/x-cmx', - 'cod' => 'application/vnd.rim.cod', - 'com' => 'application/x-msdownload', - 'conf' => 'text/plain', - 'cpio' => 'application/x-cpio', - 'cpp' => 'text/x-c', - 'cpt' => 'application/mac-compactpro', - 'crd' => 'application/x-mscardfile', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'csh' => 'application/x-csh', - 'csml' => 'chemical/x-csml', - 'csp' => 'application/vnd.commonspace', - 'css' => 'text/css', - 'cst' => 'application/x-director', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'curl' => 'text/vnd.curl', - 'cww' => 'application/prs.cww', - 'cxt' => 'application/x-director', - 'cxx' => 'text/x-c', - 'dae' => 'model/vnd.collada+xml', - 'daf' => 'application/vnd.mobius.daf', - 'dart' => 'application/vnd.dart', - 'dataless' => 'application/vnd.fdsn.seed', - 'davmount' => 'application/davmount+xml', - 'dbk' => 'application/docbook+xml', - 'dcr' => 'application/x-director', - 'dcurl' => 'text/vnd.curl.dcurl', - 'dd2' => 'application/vnd.oma.dd2+xml', - 'ddd' => 'application/vnd.fujixerox.ddd', - 'deb' => 'application/x-debian-package', - 'def' => 'text/plain', - 'deploy' => 'application/octet-stream', - 'der' => 'application/x-x509-ca-cert', - 'dfac' => 'application/vnd.dreamfactory', - 'dgc' => 'application/x-dgc-compressed', - 'dic' => 'text/x-c', - 'dir' => 'application/x-director', - 'dis' => 'application/vnd.mobius.dis', - 'dist' => 'application/octet-stream', - 'distz' => 'application/octet-stream', - 'djv' => 'image/vnd.djvu', - 'djvu' => 'image/vnd.djvu', - 'dll' => 'application/x-msdownload', - 'dmg' => 'application/x-apple-diskimage', - 'dmp' => 'application/vnd.tcpdump.pcap', - 'dms' => 'application/octet-stream', - 'dna' => 'application/vnd.dna', - 'doc' => 'application/msword', - 'docm' => 'application/vnd.ms-word.document.macroenabled.12', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dot' => 'application/msword', - 'dotm' => 'application/vnd.ms-word.template.macroenabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dp' => 'application/vnd.osgi.dp', - 'dpg' => 'application/vnd.dpgraph', - 'dra' => 'audio/vnd.dra', - 'dsc' => 'text/prs.lines.tag', - 'dssc' => 'application/dssc+der', - 'dtb' => 'application/x-dtbook+xml', - 'dtd' => 'application/xml-dtd', - 'dts' => 'audio/vnd.dts', - 'dtshd' => 'audio/vnd.dts.hd', - 'dump' => 'application/octet-stream', - 'dvb' => 'video/vnd.dvb.file', - 'dvi' => 'application/x-dvi', - 'dwf' => 'model/vnd.dwf', - 'dwg' => 'image/vnd.dwg', - 'dxf' => 'image/vnd.dxf', - 'dxp' => 'application/vnd.spotfire.dxp', - 'dxr' => 'application/x-director', - 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', - 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', - 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', - 'ecma' => 'application/ecmascript', - 'edm' => 'application/vnd.novadigm.edm', - 'edx' => 'application/vnd.novadigm.edx', - 'efif' => 'application/vnd.picsel', - 'ei6' => 'application/vnd.pg.osasli', - 'elc' => 'application/octet-stream', - 'emf' => 'application/x-msmetafile', - 'eml' => 'message/rfc822', - 'emma' => 'application/emma+xml', - 'emz' => 'application/x-msmetafile', - 'eol' => 'audio/vnd.digital-winds', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'es3' => 'application/vnd.eszigno3+xml', - 'esa' => 'application/vnd.osgi.subsystem', - 'esf' => 'application/vnd.epson.esf', - 'et3' => 'application/vnd.eszigno3+xml', - 'etx' => 'text/x-setext', - 'eva' => 'application/x-eva', - 'evy' => 'application/x-envoy', - 'exe' => 'application/x-msdownload', - 'exi' => 'application/exi', - 'ext' => 'application/vnd.novadigm.ext', - 'ez' => 'application/andrew-inset', - 'ez2' => 'application/vnd.ezpix-album', - 'ez3' => 'application/vnd.ezpix-package', - 'f' => 'text/x-fortran', - 'f4v' => 'video/x-f4v', - 'f77' => 'text/x-fortran', - 'f90' => 'text/x-fortran', - 'fbs' => 'image/vnd.fastbidsheet', - 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', - 'fcs' => 'application/vnd.isac.fcs', - 'fdf' => 'application/vnd.fdf', - 'fe_launch' => 'application/vnd.denovo.fcselayout-link', - 'fg5' => 'application/vnd.fujitsu.oasysgp', - 'fgd' => 'application/x-director', - 'fh' => 'image/x-freehand', - 'fh4' => 'image/x-freehand', - 'fh5' => 'image/x-freehand', - 'fh7' => 'image/x-freehand', - 'fhc' => 'image/x-freehand', - 'fig' => 'application/x-xfig', - 'flac' => 'audio/x-flac', - 'fli' => 'video/x-fli', - 'flo' => 'application/vnd.micrografx.flo', - 'flv' => 'video/x-flv', - 'flw' => 'application/vnd.kde.kivio', - 'flx' => 'text/vnd.fmi.flexstor', - 'fly' => 'text/vnd.fly', - 'fm' => 'application/vnd.framemaker', - 'fnc' => 'application/vnd.frogans.fnc', - 'for' => 'text/x-fortran', - 'fpx' => 'image/vnd.fpx', - 'frame' => 'application/vnd.framemaker', - 'fsc' => 'application/vnd.fsc.weblaunch', - 'fst' => 'image/vnd.fst', - 'ftc' => 'application/vnd.fluxtime.clip', - 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', - 'fvt' => 'video/vnd.fvt', - 'fxp' => 'application/vnd.adobe.fxp', - 'fxpl' => 'application/vnd.adobe.fxp', - 'fzs' => 'application/vnd.fuzzysheet', - 'g2w' => 'application/vnd.geoplan', - 'g3' => 'image/g3fax', - 'g3w' => 'application/vnd.geospace', - 'gac' => 'application/vnd.groove-account', - 'gam' => 'application/x-tads', - 'gbr' => 'application/rpki-ghostbusters', - 'gca' => 'application/x-gca-compressed', - 'gdl' => 'model/vnd.gdl', - 'geo' => 'application/vnd.dynageo', - 'gex' => 'application/vnd.geometry-explorer', - 'ggb' => 'application/vnd.geogebra.file', - 'ggt' => 'application/vnd.geogebra.tool', - 'ghf' => 'application/vnd.groove-help', - 'gif' => 'image/gif', - 'gim' => 'application/vnd.groove-identity-message', - 'gml' => 'application/gml+xml', - 'gmx' => 'application/vnd.gmx', - 'gnumeric' => 'application/x-gnumeric', - 'gph' => 'application/vnd.flographit', - 'gpx' => 'application/gpx+xml', - 'gqf' => 'application/vnd.grafeq', - 'gqs' => 'application/vnd.grafeq', - 'gram' => 'application/srgs', - 'gramps' => 'application/x-gramps-xml', - 'gre' => 'application/vnd.geometry-explorer', - 'grv' => 'application/vnd.groove-injector', - 'grxml' => 'application/srgs+xml', - 'gsf' => 'application/x-font-ghostscript', - 'gtar' => 'application/x-gtar', - 'gtm' => 'application/vnd.groove-tool-message', - 'gtw' => 'model/vnd.gtw', - 'gv' => 'text/vnd.graphviz', - 'gxf' => 'application/gxf', - 'gxt' => 'application/vnd.geonext', - 'gz' => 'application/x-gzip', - 'h' => 'text/x-c', - 'h261' => 'video/h261', - 'h263' => 'video/h263', - 'h264' => 'video/h264', - 'hal' => 'application/vnd.hal+xml', - 'hbci' => 'application/vnd.hbci', - 'hdf' => 'application/x-hdf', - 'hh' => 'text/x-c', - 'hlp' => 'application/winhlp', - 'hpgl' => 'application/vnd.hp-hpgl', - 'hpid' => 'application/vnd.hp-hpid', - 'hps' => 'application/vnd.hp-hps', - 'hqx' => 'application/mac-binhex40', - 'htke' => 'application/vnd.kenameaapp', - 'htm' => 'text/html', - 'html' => 'text/html', - 'hvd' => 'application/vnd.yamaha.hv-dic', - 'hvp' => 'application/vnd.yamaha.hv-voice', - 'hvs' => 'application/vnd.yamaha.hv-script', - 'i2g' => 'application/vnd.intergeo', - 'icc' => 'application/vnd.iccprofile', - 'ice' => 'x-conference/x-cooltalk', - 'icm' => 'application/vnd.iccprofile', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ief' => 'image/ief', - 'ifb' => 'text/calendar', - 'ifm' => 'application/vnd.shana.informed.formdata', - 'iges' => 'model/iges', - 'igl' => 'application/vnd.igloader', - 'igm' => 'application/vnd.insors.igm', - 'igs' => 'model/iges', - 'igx' => 'application/vnd.micrografx.igx', - 'iif' => 'application/vnd.shana.informed.interchange', - 'imp' => 'application/vnd.accpac.simply.imp', - 'ims' => 'application/vnd.ms-ims', - 'in' => 'text/plain', - 'ink' => 'application/inkml+xml', - 'inkml' => 'application/inkml+xml', - 'install' => 'application/x-install-instructions', - 'iota' => 'application/vnd.astraea-software.iota', - 'ipfix' => 'application/ipfix', - 'ipk' => 'application/vnd.shana.informed.package', - 'irm' => 'application/vnd.ibm.rights-management', - 'irp' => 'application/vnd.irepository.package+xml', - 'iso' => 'application/x-iso9660-image', - 'itp' => 'application/vnd.shana.informed.formtemplate', - 'ivp' => 'application/vnd.immervision-ivp', - 'ivu' => 'application/vnd.immervision-ivu', - 'jad' => 'text/vnd.sun.j2me.app-descriptor', - 'jam' => 'application/vnd.jam', - 'jar' => 'application/java-archive', - 'java' => 'text/x-java-source', - 'jisp' => 'application/vnd.jisp', - 'jlt' => 'application/vnd.hp-jlyt', - 'jnlp' => 'application/x-java-jnlp-file', - 'joda' => 'application/vnd.joost.joda-archive', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'jpgm' => 'video/jpm', - 'jpgv' => 'video/jpeg', - 'jpm' => 'video/jpm', - 'js' => 'application/javascript', - 'json' => 'application/json', - 'jsonml' => 'application/jsonml+json', - 'kar' => 'audio/midi', - 'karbon' => 'application/vnd.kde.karbon', - 'kfo' => 'application/vnd.kde.kformula', - 'kia' => 'application/vnd.kidspiration', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kne' => 'application/vnd.kinar', - 'knp' => 'application/vnd.kinar', - 'kon' => 'application/vnd.kde.kontour', - 'kpr' => 'application/vnd.kde.kpresenter', - 'kpt' => 'application/vnd.kde.kpresenter', - 'kpxx' => 'application/vnd.ds-keypoint', - 'ksp' => 'application/vnd.kde.kspread', - 'ktr' => 'application/vnd.kahootz', - 'ktx' => 'image/ktx', - 'ktz' => 'application/vnd.kahootz', - 'kwd' => 'application/vnd.kde.kword', - 'kwt' => 'application/vnd.kde.kword', - 'lasxml' => 'application/vnd.las.las+xml', - 'latex' => 'application/x-latex', - 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', - 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', - 'les' => 'application/vnd.hhe.lesson-player', - 'lha' => 'application/x-lzh-compressed', - 'link66' => 'application/vnd.route66.link66+xml', - 'list' => 'text/plain', - 'list3820' => 'application/vnd.ibm.modcap', - 'listafp' => 'application/vnd.ibm.modcap', - 'lnk' => 'application/x-ms-shortcut', - 'log' => 'text/plain', - 'lostxml' => 'application/lost+xml', - 'lrf' => 'application/octet-stream', - 'lrm' => 'application/vnd.ms-lrm', - 'ltf' => 'application/vnd.frogans.ltf', - 'lvp' => 'audio/vnd.lucent.voice', - 'lwp' => 'application/vnd.lotus-wordpro', - 'lzh' => 'application/x-lzh-compressed', - 'm13' => 'application/x-msmediaview', - 'm14' => 'application/x-msmediaview', - 'm1v' => 'video/mpeg', - 'm21' => 'application/mp21', - 'm2a' => 'audio/mpeg', - 'm2v' => 'video/mpeg', - 'm3a' => 'audio/mpeg', - 'm3u' => 'audio/x-mpegurl', - 'm3u8' => 'application/vnd.apple.mpegurl', - 'm4a' => 'audio/mp4', - 'm4u' => 'video/vnd.mpegurl', - 'm4v' => 'video/x-m4v', - 'ma' => 'application/mathematica', - 'mads' => 'application/mads+xml', - 'mag' => 'application/vnd.ecowin.chart', - 'maker' => 'application/vnd.framemaker', - 'man' => 'text/troff', - 'mar' => 'application/octet-stream', - 'mathml' => 'application/mathml+xml', - 'mb' => 'application/mathematica', - 'mbk' => 'application/vnd.mobius.mbk', - 'mbox' => 'application/mbox', - 'mc1' => 'application/vnd.medcalcdata', - 'mcd' => 'application/vnd.mcd', - 'mcurl' => 'text/vnd.curl.mcurl', - 'mdb' => 'application/x-msaccess', - 'mdi' => 'image/vnd.ms-modi', - 'me' => 'text/troff', - 'mesh' => 'model/mesh', - 'meta4' => 'application/metalink4+xml', - 'metalink' => 'application/metalink+xml', - 'mets' => 'application/mets+xml', - 'mfm' => 'application/vnd.mfmp', - 'mft' => 'application/rpki-manifest', - 'mgp' => 'application/vnd.osgeo.mapguide.package', - 'mgz' => 'application/vnd.proteus.magazine', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mie' => 'application/x-mie', - 'mif' => 'application/vnd.mif', - 'mime' => 'message/rfc822', - 'mj2' => 'video/mj2', - 'mjp2' => 'video/mj2', - 'mk3d' => 'video/x-matroska', - 'mka' => 'audio/x-matroska', - 'mks' => 'video/x-matroska', - 'mkv' => 'video/x-matroska', - 'mlp' => 'application/vnd.dolby.mlp', - 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', - 'mmf' => 'application/vnd.smaf', - 'mmr' => 'image/vnd.fujixerox.edmics-mmr', - 'mng' => 'video/x-mng', - 'mny' => 'application/x-msmoney', - 'mobi' => 'application/x-mobipocket-ebook', - 'mods' => 'application/mods+xml', - 'mov' => 'video/quicktime', - 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/mpeg', - 'mp21' => 'application/mp21', - 'mp2a' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4s' => 'application/mp4', - 'mp4v' => 'video/mp4', - 'mpc' => 'application/vnd.mophun.certificate', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'mpga' => 'audio/mpeg', - 'mpkg' => 'application/vnd.apple.installer+xml', - 'mpm' => 'application/vnd.blueice.multipass', - 'mpn' => 'application/vnd.mophun.application', - 'mpp' => 'application/vnd.ms-project', - 'mpt' => 'application/vnd.ms-project', - 'mpy' => 'application/vnd.ibm.minipay', - 'mqy' => 'application/vnd.mobius.mqy', - 'mrc' => 'application/marc', - 'mrcx' => 'application/marcxml+xml', - 'ms' => 'text/troff', - 'mscml' => 'application/mediaservercontrol+xml', - 'mseed' => 'application/vnd.fdsn.mseed', - 'mseq' => 'application/vnd.mseq', - 'msf' => 'application/vnd.epson.msf', - 'msh' => 'model/mesh', - 'msi' => 'application/x-msdownload', - 'msl' => 'application/vnd.mobius.msl', - 'msty' => 'application/vnd.muvee.style', - 'mts' => 'model/vnd.mts', - 'mus' => 'application/vnd.musician', - 'musicxml' => 'application/vnd.recordare.musicxml+xml', - 'mvb' => 'application/x-msmediaview', - 'mwf' => 'application/vnd.mfer', - 'mxf' => 'application/mxf', - 'mxl' => 'application/vnd.recordare.musicxml', - 'mxml' => 'application/xv+xml', - 'mxs' => 'application/vnd.triscape.mxs', - 'mxu' => 'video/vnd.mpegurl', - 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', - 'n3' => 'text/n3', - 'nb' => 'application/mathematica', - 'nbp' => 'application/vnd.wolfram.player', - 'nc' => 'application/x-netcdf', - 'ncx' => 'application/x-dtbncx+xml', - 'nfo' => 'text/x-nfo', - 'ngdat' => 'application/vnd.nokia.n-gage.data', - 'nitf' => 'application/vnd.nitf', - 'nlu' => 'application/vnd.neurolanguage.nlu', - 'nml' => 'application/vnd.enliven', - 'nnd' => 'application/vnd.noblenet-directory', - 'nns' => 'application/vnd.noblenet-sealer', - 'nnw' => 'application/vnd.noblenet-web', - 'npx' => 'image/vnd.net-fpx', - 'nsc' => 'application/x-conference', - 'nsf' => 'application/vnd.lotus-notes', - 'ntf' => 'application/vnd.nitf', - 'nzb' => 'application/x-nzb', - 'oa2' => 'application/vnd.fujitsu.oasys2', - 'oa3' => 'application/vnd.fujitsu.oasys3', - 'oas' => 'application/vnd.fujitsu.oasys', - 'obd' => 'application/x-msbinder', - 'obj' => 'application/x-tgif', - 'oda' => 'application/oda', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odft' => 'application/vnd.oasis.opendocument.formula-template', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'oga' => 'audio/ogg', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'omdoc' => 'application/omdoc+xml', - 'onepkg' => 'application/onenote', - 'onetmp' => 'application/onenote', - 'onetoc' => 'application/onenote', - 'onetoc2' => 'application/onenote', - 'opf' => 'application/oebps-package+xml', - 'opml' => 'text/x-opml', - 'oprc' => 'application/vnd.palm', - 'org' => 'application/vnd.lotus-organizer', - 'osf' => 'application/vnd.yamaha.openscoreformat', - 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', - 'otc' => 'application/vnd.oasis.opendocument.chart-template', - 'otf' => 'application/x-font-otf', - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'oti' => 'application/vnd.oasis.opendocument.image-template', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', - 'oxps' => 'application/oxps', - 'oxt' => 'application/vnd.openofficeorg.extension', - 'p' => 'text/x-pascal', - 'p10' => 'application/pkcs10', - 'p12' => 'application/x-pkcs12', - 'p7b' => 'application/x-pkcs7-certificates', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'p8' => 'application/pkcs8', - 'pas' => 'text/x-pascal', - 'paw' => 'application/vnd.pawaafile', - 'pbd' => 'application/vnd.powerbuilder6', - 'pbm' => 'image/x-portable-bitmap', - 'pcap' => 'application/vnd.tcpdump.pcap', - 'pcf' => 'application/x-font-pcf', - 'pcl' => 'application/vnd.hp-pcl', - 'pclxl' => 'application/vnd.hp-pclxl', - 'pct' => 'image/x-pict', - 'pcurl' => 'application/vnd.curl.pcurl', - 'pcx' => 'image/x-pcx', - 'pdb' => 'application/vnd.palm', - 'pdf' => 'application/pdf', - 'pfa' => 'application/x-font-type1', - 'pfb' => 'application/x-font-type1', - 'pfm' => 'application/x-font-type1', - 'pfr' => 'application/font-tdpfr', - 'pfx' => 'application/x-pkcs12', - 'pgm' => 'image/x-portable-graymap', - 'pgn' => 'application/x-chess-pgn', - 'pgp' => 'application/pgp-encrypted', - 'php' => 'application/x-php', - 'php3' => 'application/x-php', - 'php4' => 'application/x-php', - 'php5' => 'application/x-php', - 'pic' => 'image/x-pict', - 'pkg' => 'application/octet-stream', - 'pki' => 'application/pkixcmp', - 'pkipath' => 'application/pkix-pkipath', - 'plb' => 'application/vnd.3gpp.pic-bw-large', - 'plc' => 'application/vnd.mobius.plc', - 'plf' => 'application/vnd.pocketlearn', - 'pls' => 'application/pls+xml', - 'pml' => 'application/vnd.ctc-posml', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'portpkg' => 'application/vnd.macports.portpkg', - 'pot' => 'application/vnd.ms-powerpoint', - 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12', - 'ppd' => 'application/vnd.cups-ppd', - 'ppm' => 'image/x-portable-pixmap', - 'pps' => 'application/vnd.ms-powerpoint', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'pqa' => 'application/vnd.palm', - 'prc' => 'application/x-mobipocket-ebook', - 'pre' => 'application/vnd.lotus-freelance', - 'prf' => 'application/pics-rules', - 'ps' => 'application/postscript', - 'psb' => 'application/vnd.3gpp.pic-bw-small', - 'psd' => 'image/vnd.adobe.photoshop', - 'psf' => 'application/x-font-linux-psf', - 'pskcxml' => 'application/pskc+xml', - 'ptid' => 'application/vnd.pvi.ptid1', - 'pub' => 'application/x-mspublisher', - 'pvb' => 'application/vnd.3gpp.pic-bw-var', - 'pwn' => 'application/vnd.3m.post-it-notes', - 'pya' => 'audio/vnd.ms-playready.media.pya', - 'pyv' => 'video/vnd.ms-playready.media.pyv', - 'qam' => 'application/vnd.epson.quickanime', - 'qbo' => 'application/vnd.intu.qbo', - 'qfx' => 'application/vnd.intu.qfx', - 'qps' => 'application/vnd.publishare-delta-tree', - 'qt' => 'video/quicktime', - 'qwd' => 'application/vnd.quark.quarkxpress', - 'qwt' => 'application/vnd.quark.quarkxpress', - 'qxb' => 'application/vnd.quark.quarkxpress', - 'qxd' => 'application/vnd.quark.quarkxpress', - 'qxl' => 'application/vnd.quark.quarkxpress', - 'qxt' => 'application/vnd.quark.quarkxpress', - 'ra' => 'audio/x-pn-realaudio', - 'ram' => 'audio/x-pn-realaudio', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', - 'rdf' => 'application/rdf+xml', - 'rdz' => 'application/vnd.data-vision.rdz', - 'rep' => 'application/vnd.businessobjects', - 'res' => 'application/x-dtbresource+xml', - 'rgb' => 'image/x-rgb', - 'rif' => 'application/reginfo+xml', - 'rip' => 'audio/vnd.rip', - 'ris' => 'application/x-research-info-systems', - 'rl' => 'application/resource-lists+xml', - 'rlc' => 'image/vnd.fujixerox.edmics-rlc', - 'rld' => 'application/resource-lists-diff+xml', - 'rm' => 'application/vnd.rn-realmedia', - 'rmi' => 'audio/midi', - 'rmp' => 'audio/x-pn-realaudio-plugin', - 'rms' => 'application/vnd.jcp.javame.midlet-rms', - 'rmvb' => 'application/vnd.rn-realmedia-vbr', - 'rnc' => 'application/relax-ng-compact-syntax', - 'roa' => 'application/rpki-roa', - 'roff' => 'text/troff', - 'rp9' => 'application/vnd.cloanto.rp9', - 'rpss' => 'application/vnd.nokia.radio-presets', - 'rpst' => 'application/vnd.nokia.radio-preset', - 'rq' => 'application/sparql-query', - 'rs' => 'application/rls-services+xml', - 'rsd' => 'application/rsd+xml', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'rtx' => 'text/richtext', - 's' => 'text/x-asm', - 's3m' => 'audio/s3m', - 'saf' => 'application/vnd.yamaha.smaf-audio', - 'sbml' => 'application/sbml+xml', - 'sc' => 'application/vnd.ibm.secure-container', - 'scd' => 'application/x-msschedule', - 'scm' => 'application/vnd.lotus-screencam', - 'scq' => 'application/scvp-cv-request', - 'scs' => 'application/scvp-cv-response', - 'scurl' => 'text/vnd.curl.scurl', - 'sda' => 'application/vnd.stardivision.draw', - 'sdc' => 'application/vnd.stardivision.calc', - 'sdd' => 'application/vnd.stardivision.impress', - 'sdkd' => 'application/vnd.solent.sdkm+xml', - 'sdkm' => 'application/vnd.solent.sdkm+xml', - 'sdp' => 'application/sdp', - 'sdw' => 'application/vnd.stardivision.writer', - 'see' => 'application/vnd.seemail', - 'seed' => 'application/vnd.fdsn.seed', - 'sema' => 'application/vnd.sema', - 'semd' => 'application/vnd.semd', - 'semf' => 'application/vnd.semf', - 'ser' => 'application/java-serialized-object', - 'setpay' => 'application/set-payment-initiation', - 'setreg' => 'application/set-registration-initiation', - 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', - 'sfs' => 'application/vnd.spotfire.sfs', - 'sfv' => 'text/x-sfv', - 'sgi' => 'image/sgi', - 'sgl' => 'application/vnd.stardivision.writer-global', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'sh' => 'application/x-sh', - 'shar' => 'application/x-shar', - 'shf' => 'application/shf+xml', - 'sid' => 'image/x-mrsid-image', - 'sig' => 'application/pgp-signature', - 'sil' => 'audio/silk', - 'silo' => 'model/mesh', - 'sis' => 'application/vnd.symbian.install', - 'sisx' => 'application/vnd.symbian.install', - 'sit' => 'application/x-stuffit', - 'sitx' => 'application/x-stuffitx', - 'skd' => 'application/vnd.koan', - 'skm' => 'application/vnd.koan', - 'skp' => 'application/vnd.koan', - 'skt' => 'application/vnd.koan', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'slt' => 'application/vnd.epson.salt', - 'sm' => 'application/vnd.stepmania.stepchart', - 'smf' => 'application/vnd.stardivision.math', - 'smi' => 'application/smil+xml', - 'smil' => 'application/smil+xml', - 'smv' => 'video/x-smv', - 'smzip' => 'application/vnd.stepmania.package', - 'snd' => 'audio/basic', - 'snf' => 'application/x-font-snf', - 'so' => 'application/octet-stream', - 'spc' => 'application/x-pkcs7-certificates', - 'spf' => 'application/vnd.yamaha.smaf-phrase', - 'spl' => 'application/x-futuresplash', - 'spot' => 'text/vnd.in3d.spot', - 'spp' => 'application/scvp-vp-response', - 'spq' => 'application/scvp-vp-request', - 'spx' => 'audio/ogg', - 'sql' => 'application/x-sql', - 'src' => 'application/x-wais-source', - 'srt' => 'application/x-subrip', - 'sru' => 'application/sru+xml', - 'srx' => 'application/sparql-results+xml', - 'ssdl' => 'application/ssdl+xml', - 'sse' => 'application/vnd.kodak-descriptor', - 'ssf' => 'application/vnd.epson.ssf', - 'ssml' => 'application/ssml+xml', - 'st' => 'application/vnd.sailingtracker.track', - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'stf' => 'application/vnd.wt.stf', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stk' => 'application/hyperstudio', - 'stl' => 'application/vnd.ms-pki.stl', - 'str' => 'application/vnd.pg.format', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'sub' => 'text/vnd.dvb.subtitle', - 'sus' => 'application/vnd.sus-calendar', - 'susp' => 'application/vnd.sus-calendar', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svc' => 'application/vnd.dvb.service', - 'svd' => 'application/vnd.svd', - 'svg' => 'image/svg+xml', - 'svgz' => 'image/svg+xml', - 'swa' => 'application/x-director', - 'swf' => 'application/x-shockwave-flash', - 'swi' => 'application/vnd.aristanetworks.swi', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', - 't' => 'text/troff', - 't3' => 'application/x-t3vm-image', - 'taglet' => 'application/vnd.mynfc', - 'tao' => 'application/vnd.tao.intent-module-archive', - 'tar' => 'application/x-tar', - 'tcap' => 'application/vnd.3gpp2.tcap', - 'tcl' => 'application/x-tcl', - 'teacher' => 'application/vnd.smart.teacher', - 'tei' => 'application/tei+xml', - 'teicorpus' => 'application/tei+xml', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', - 'texinfo' => 'application/x-texinfo', - 'text' => 'text/plain', - 'tfi' => 'application/thraud+xml', - 'tfm' => 'application/x-tex-tfm', - 'tga' => 'image/x-tga', - 'thmx' => 'application/vnd.ms-officetheme', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'tmo' => 'application/vnd.tmobile-livetv', - 'torrent' => 'application/x-bittorrent', - 'tpl' => 'application/vnd.groove-tool-template', - 'tpt' => 'application/vnd.trid.tpt', - 'tr' => 'text/troff', - 'tra' => 'application/vnd.trueapp', - 'trm' => 'application/x-msterminal', - 'tsd' => 'application/timestamped-data', - 'tsv' => 'text/tab-separated-values', - 'ttc' => 'application/x-font-ttf', - 'ttf' => 'application/x-font-ttf', - 'ttl' => 'text/turtle', - 'twd' => 'application/vnd.simtech-mindmapper', - 'twds' => 'application/vnd.simtech-mindmapper', - 'txd' => 'application/vnd.genomatix.tuxedo', - 'txf' => 'application/vnd.mobius.txf', - 'txt' => 'text/plain', - 'u32' => 'application/x-authorware-bin', - 'udeb' => 'application/x-debian-package', - 'ufd' => 'application/vnd.ufdl', - 'ufdl' => 'application/vnd.ufdl', - 'ulx' => 'application/x-glulx', - 'umj' => 'application/vnd.umajin', - 'unityweb' => 'application/vnd.unity', - 'uoml' => 'application/vnd.uoml+xml', - 'uri' => 'text/uri-list', - 'uris' => 'text/uri-list', - 'urls' => 'text/uri-list', - 'ustar' => 'application/x-ustar', - 'utz' => 'application/vnd.uiq.theme', - 'uu' => 'text/x-uuencode', - 'uva' => 'audio/vnd.dece.audio', - 'uvd' => 'application/vnd.dece.data', - 'uvf' => 'application/vnd.dece.data', - 'uvg' => 'image/vnd.dece.graphic', - 'uvh' => 'video/vnd.dece.hd', - 'uvi' => 'image/vnd.dece.graphic', - 'uvm' => 'video/vnd.dece.mobile', - 'uvp' => 'video/vnd.dece.pd', - 'uvs' => 'video/vnd.dece.sd', - 'uvt' => 'application/vnd.dece.ttml+xml', - 'uvu' => 'video/vnd.uvvu.mp4', - 'uvv' => 'video/vnd.dece.video', - 'uvva' => 'audio/vnd.dece.audio', - 'uvvd' => 'application/vnd.dece.data', - 'uvvf' => 'application/vnd.dece.data', - 'uvvg' => 'image/vnd.dece.graphic', - 'uvvh' => 'video/vnd.dece.hd', - 'uvvi' => 'image/vnd.dece.graphic', - 'uvvm' => 'video/vnd.dece.mobile', - 'uvvp' => 'video/vnd.dece.pd', - 'uvvs' => 'video/vnd.dece.sd', - 'uvvt' => 'application/vnd.dece.ttml+xml', - 'uvvu' => 'video/vnd.uvvu.mp4', - 'uvvv' => 'video/vnd.dece.video', - 'uvvx' => 'application/vnd.dece.unspecified', - 'uvvz' => 'application/vnd.dece.zip', - 'uvx' => 'application/vnd.dece.unspecified', - 'uvz' => 'application/vnd.dece.zip', - 'vcard' => 'text/vcard', - 'vcd' => 'application/x-cdlink', - 'vcf' => 'text/x-vcard', - 'vcg' => 'application/vnd.groove-vcard', - 'vcs' => 'text/x-vcalendar', - 'vcx' => 'application/vnd.vcx', - 'vis' => 'application/vnd.visionary', - 'viv' => 'video/vnd.vivo', - 'vob' => 'video/x-ms-vob', - 'vor' => 'application/vnd.stardivision.writer', - 'vox' => 'application/x-authorware-bin', - 'vrml' => 'model/vrml', - 'vsd' => 'application/vnd.visio', - 'vsf' => 'application/vnd.vsf', - 'vss' => 'application/vnd.visio', - 'vst' => 'application/vnd.visio', - 'vsw' => 'application/vnd.visio', - 'vtu' => 'model/vnd.vtu', - 'vxml' => 'application/voicexml+xml', - 'w3d' => 'application/x-director', - 'wad' => 'application/x-doom', - 'wav' => 'audio/x-wav', - 'wax' => 'audio/x-ms-wax', - 'wbmp' => 'image/vnd.wap.wbmp', - 'wbs' => 'application/vnd.criticaltools.wbs+xml', - 'wbxml' => 'application/vnd.wap.wbxml', - 'wcm' => 'application/vnd.ms-works', - 'wdb' => 'application/vnd.ms-works', - 'wdp' => 'image/vnd.ms-photo', - 'weba' => 'audio/webm', - 'webm' => 'video/webm', - 'webp' => 'image/webp', - 'wg' => 'application/vnd.pmi.widget', - 'wgt' => 'application/widget', - 'wks' => 'application/vnd.ms-works', - 'wm' => 'video/x-ms-wm', - 'wma' => 'audio/x-ms-wma', - 'wmd' => 'application/x-ms-wmd', - 'wmf' => 'application/x-msmetafile', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/vnd.wap.wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'wmv' => 'video/x-ms-wmv', - 'wmx' => 'video/x-ms-wmx', - 'wmz' => 'application/x-msmetafile', - 'woff' => 'application/font-woff', - 'wpd' => 'application/vnd.wordperfect', - 'wpl' => 'application/vnd.ms-wpl', - 'wps' => 'application/vnd.ms-works', - 'wqd' => 'application/vnd.wqd', - 'wri' => 'application/x-mswrite', - 'wrl' => 'model/vrml', - 'wsdl' => 'application/wsdl+xml', - 'wspolicy' => 'application/wspolicy+xml', - 'wtb' => 'application/vnd.webturbo', - 'wvx' => 'video/x-ms-wvx', - 'x32' => 'application/x-authorware-bin', - 'x3d' => 'model/x3d+xml', - 'x3db' => 'model/x3d+binary', - 'x3dbz' => 'model/x3d+binary', - 'x3dv' => 'model/x3d+vrml', - 'x3dvz' => 'model/x3d+vrml', - 'x3dz' => 'model/x3d+xml', - 'xaml' => 'application/xaml+xml', - 'xap' => 'application/x-silverlight-app', - 'xar' => 'application/vnd.xara', - 'xbap' => 'application/x-ms-xbap', - 'xbd' => 'application/vnd.fujixerox.docuworks.binder', - 'xbm' => 'image/x-xbitmap', - 'xdf' => 'application/xcap-diff+xml', - 'xdm' => 'application/vnd.syncml.dm+xml', - 'xdp' => 'application/vnd.adobe.xdp+xml', - 'xdssc' => 'application/dssc+xml', - 'xdw' => 'application/vnd.fujixerox.docuworks', - 'xenc' => 'application/xenc+xml', - 'xer' => 'application/patch-ops-error+xml', - 'xfdf' => 'application/vnd.adobe.xfdf', - 'xfdl' => 'application/vnd.xfdl', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'xhvml' => 'application/xv+xml', - 'xif' => 'image/vnd.xiff', - 'xla' => 'application/vnd.ms-excel', - 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12', - 'xlc' => 'application/vnd.ms-excel', - 'xlf' => 'application/x-xliff+xml', - 'xlm' => 'application/vnd.ms-excel', - 'xls' => 'application/vnd.ms-excel', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xlt' => 'application/vnd.ms-excel', - 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xlw' => 'application/vnd.ms-excel', - 'xm' => 'audio/xm', - 'xml' => 'application/xml', - 'xo' => 'application/vnd.olpc-sugar', - 'xop' => 'application/xop+xml', - 'xpi' => 'application/x-xpinstall', - 'xpl' => 'application/xproc+xml', - 'xpm' => 'image/x-xpixmap', - 'xpr' => 'application/vnd.is-xpr', - 'xps' => 'application/vnd.ms-xpsdocument', - 'xpw' => 'application/vnd.intercon.formnet', - 'xpx' => 'application/vnd.intercon.formnet', - 'xsl' => 'application/xml', - 'xslt' => 'application/xslt+xml', - 'xsm' => 'application/vnd.syncml+xml', - 'xspf' => 'application/xspf+xml', - 'xul' => 'application/vnd.mozilla.xul+xml', - 'xvm' => 'application/xv+xml', - 'xvml' => 'application/xv+xml', - 'xwd' => 'image/x-xwindowdump', - 'xyz' => 'chemical/x-xyz', - 'xz' => 'application/x-xz', - 'yang' => 'application/yang', - 'yin' => 'application/yin+xml', - 'z1' => 'application/x-zmachine', - 'z2' => 'application/x-zmachine', - 'z3' => 'application/x-zmachine', - 'z4' => 'application/x-zmachine', - 'z5' => 'application/x-zmachine', - 'z6' => 'application/x-zmachine', - 'z7' => 'application/x-zmachine', - 'z8' => 'application/x-zmachine', - 'zaz' => 'application/vnd.zzazz.deck+xml', - 'zip' => 'application/zip', - 'zir' => 'application/vnd.zul', - 'zirz' => 'application/vnd.zul', - 'zmm' => 'application/vnd.handheld-entertainment+xml', - '123' => 'application/vnd.lotus-1-2-3', -); diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/preferences.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/preferences.php deleted file mode 100644 index 0b430e6..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/preferences.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -/****************************************************************************/ -/* */ -/* YOU MAY WISH TO MODIFY OR REMOVE THE FOLLOWING LINES WHICH SET DEFAULTS */ -/* */ -/****************************************************************************/ - -$preferences = Swift_Preferences::getInstance(); - -// Sets the default charset so that setCharset() is not needed elsewhere -$preferences->setCharset('utf-8'); - -// Without these lines the default caching mechanism is "array" but this uses a lot of memory. -// If possible, use a disk cache to enable attaching large attachments etc. -// You can override the default temporary directory by setting the TMPDIR environment variable. -if (@is_writable($tmpDir = sys_get_temp_dir())) { - $preferences->setTempDir($tmpDir)->setCacheType('disk'); -} - -// this should only be done when Swiftmailer won't use the native QP content encoder -// see mime_deps.php -if (PHP_VERSION_ID < 50407) { - $preferences->setQPDotEscape(false); -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_init.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_init.php deleted file mode 100644 index 2f85e74..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_init.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Dependency injection initialization for Swift Mailer. - */ - -if (defined('SWIFT_INIT_LOADED')) { - return; -} - -define('SWIFT_INIT_LOADED', true); - -// Load in dependency maps -require __DIR__ . '/dependency_maps/cache_deps.php'; -require __DIR__ . '/dependency_maps/mime_deps.php'; -require __DIR__ . '/dependency_maps/message_deps.php'; -require __DIR__ . '/dependency_maps/transport_deps.php'; - -// Load in global library preferences -require __DIR__ . '/preferences.php'; diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_required.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_required.php deleted file mode 100644 index 4e30ae8..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_required.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Autoloader and dependency injection initialization for Swift Mailer. - */ - -if (class_exists('Swift', false)) { - return; -} - -// Load Swift utility class -require __DIR__ . '/classes/Swift.php'; - -if (!function_exists('_swiftmailer_init')) { - function _swiftmailer_init() - { - require __DIR__ . '/swift_init.php'; - } -} - -// Start the autoloader and lazy-load the init script to set up dependency injection -Swift::registerAutoload('_swiftmailer_init'); diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_required_pear.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_required_pear.php deleted file mode 100644 index 2b5181a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swift_required_pear.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -/* - * This file is part of SwiftMailer. - * (c) 2004-2009 Chris Corbyn - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Autoloader and dependency injection initialization for Swift Mailer. - */ - -if (class_exists('Swift', false)) { - return; -} - -// Load Swift utility class -require __DIR__.'/Swift.php'; - -if (!function_exists('_swiftmailer_init')) { - function _swiftmailer_init() - { - require __DIR__.'/swift_init.php'; - } -} - -// Start the autoloader and lazy-load the init script to set up dependency injection -Swift::registerAutoload('_swiftmailer_init'); diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php deleted file mode 100644 index 85f2d69..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php +++ /dev/null @@ -1,193 +0,0 @@ -#!/usr/bin/php - -<?php -define('APACHE_MIME_TYPES_URL', 'https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types'); -define('FREEDESKTOP_XML_URL', 'https://raw.github.com/minad/mimemagic/master/script/freedesktop.org.xml'); - -function generateUpToDateMimeArray() -{ - $preamble = "<?php\n\n"; - $preamble .= "/*\n"; - $preamble .= " * This file is part of SwiftMailer.\n"; - $preamble .= " * (c) 2004-2009 Chris Corbyn\n *\n"; - $preamble .= " * For the full copyright and license information, please view the LICENSE\n"; - $preamble .= " * file that was distributed with this source code.\n *\n"; - $preamble .= " * autogenerated using https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\n"; - $preamble .= " * and https://raw.github.com/minad/mimemagic/master/script/freedesktop.org.xml\n"; - $preamble .= " */\n\n"; - $preamble .= "/*\n"; - $preamble .= " * List of MIME type automatically detected in Swift Mailer.\n"; - $preamble .= " */\n\n"; - $preamble .= "// You may add or take away what you like (lowercase required)\n\n"; - - // get current mime types files - $mime_types = @file_get_contents(APACHE_MIME_TYPES_URL); - $mime_xml = @file_get_contents(FREEDESKTOP_XML_URL); - - // prepare valid mime types - $valid_mime_types = array(); - - // split mime type and extensions eg. "video/x-matroska mkv mk3d mks" - if (preg_match_all('/^#?([a-z0-9\-\+\/\.]+)[\t]+(.*)$/miu', $mime_types, $matches) !== false) { - // collection of predefined mimetypes (bugfix for wrong resolved or missing mime types) - $valid_mime_types_preset = array( - 'php' => 'application/x-php', - 'php3' => 'application/x-php', - 'php4' => 'application/x-php', - 'php5' => 'application/x-php', - 'zip' => 'application/zip', - 'gif' => 'image/gif', - 'png' => 'image/png', - 'css' => 'text/css', - 'js' => 'text/javascript', - 'txt' => 'text/plain', - 'aif' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'avi' => 'video/avi', - 'bmp' => 'image/bmp', - 'bz2' => 'application/x-bz2', - 'csv' => 'text/csv', - 'dmg' => 'application/x-apple-diskimage', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'eml' => 'message/rfc822', - 'aps' => 'application/postscript', - 'exe' => 'application/x-ms-dos-executable', - 'flv' => 'video/x-flv', - 'gz' => 'application/x-gzip', - 'hqx' => 'application/stuffit', - 'htm' => 'text/html', - 'html' => 'text/html', - 'jar' => 'application/x-java-archive', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'm3u' => 'audio/x-mpegurl', - 'm4a' => 'audio/mp4', - 'mdb' => 'application/x-msaccess', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'odg' => 'vnd.oasis.opendocument.graphics', - 'odp' => 'vnd.oasis.opendocument.presentation', - 'odt' => 'vnd.oasis.opendocument.text', - 'ods' => 'vnd.oasis.opendocument.spreadsheet', - 'ogg' => 'audio/ogg', - 'pdf' => 'application/pdf', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ps' => 'application/postscript', - 'rar' => 'application/x-rar-compressed', - 'rtf' => 'application/rtf', - 'tar' => 'application/x-tar', - 'sit' => 'application/x-stuffit', - 'svg' => 'image/svg+xml', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'ttf' => 'application/x-font-truetype', - 'vcf' => 'text/x-vcard', - 'wav' => 'audio/wav', - 'wma' => 'audio/x-ms-wma', - 'wmv' => 'audio/x-ms-wmv', - 'xls' => 'application/vnd.ms-excel', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xml' => 'application/xml', - ); - - // wrap array for generating file - foreach ($valid_mime_types_preset as $extension => $mime_type) { - // generate array for mimetype to extension resolver (only first match) - $valid_mime_types[$extension] = "'{$extension}' => '{$mime_type}'"; - } - - // collect extensions - $valid_extensions = array(); - - // all extensions from second match - foreach ($matches[2] as $i => $extensions) { - // explode multiple extensions from string - $extensions = explode(' ', strtolower($extensions)); - - // force array for foreach - if (!is_array($extensions)) { - $extensions = array($extensions); - } - - foreach ($extensions as $extension) { - // get mime type - $mime_type = $matches[1][$i]; - - // check if string length lower than 10 - if (strlen($extension) < 10) { - // add extension - $valid_extensions[] = $extension; - - if (!isset($valid_mime_types[$mime_type])) { - // generate array for mimetype to extension resolver (only first match) - $valid_mime_types[$extension] = "'{$extension}' => '{$mime_type}'"; - } - } - } - } - } - - $xml = simplexml_load_string($mime_xml); - - foreach ($xml as $node) { - // check if there is no pattern - if (!isset($node->glob['pattern'])) { - continue; - } - - // get all matching extensions from match - foreach ((array) $node->glob['pattern'] as $extension) { - // skip none glob extensions - if (strpos($extension, '.') === false) { - continue; - } - - // remove get only last part - $extension = explode('.', strtolower($extension)); - $extension = end($extension); - - // maximum length in database column - if (strlen($extension) <= 9) { - $valid_extensions[] = $extension; - } - } - - if (isset($node->glob['pattern'][0])) { - // mime type - $mime_type = strtolower((string) $node['type']); - - // get first extension - $extension = strtolower(trim($node->glob['ddpattern'][0], '*.')); - - // skip none glob extensions and check if string length between 1 and 10 - if (strpos($extension, '.') !== false || strlen($extension) < 1 || strlen($extension) > 9) { - continue; - } - - // check if string length lower than 10 - if (!isset($valid_mime_types[$mime_type])) { - // generate array for mimetype to extension resolver (only first match) - $valid_mime_types[$extension] = "'{$extension}' => '{$mime_type}'"; - } - } - } - - // full list of valid extensions only - $valid_mime_types = array_unique($valid_mime_types); - ksort($valid_mime_types); - - // combine mime types and extensions array - $output = "$preamble\$swift_mime_types = array(\n ".implode($valid_mime_types, ",\n ")."\n);"; - - // write mime_types.php config file - @file_put_contents('./mime_types.php', $output); -} - -generateUpToDateMimeArray(); diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/phpunit.xml.dist b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/phpunit.xml.dist deleted file mode 100644 index 606c5b4..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/phpunit.xml.dist +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<phpunit backupGlobals="false" - backupStaticAttributes="false" - colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - processIsolation="false" - stopOnFailure="false" - syntaxCheck="false" - bootstrap="tests/bootstrap.php" -> - <php> - <ini name="intl.default_locale" value="en"/> - <ini name="intl.error_level" value="0"/> - <ini name="memory_limit" value="-1"/> - <ini name="error_reporting" value="-1" /> - </php> - - <testsuites> - <testsuite name="SwiftMailer unit tests"> - <directory>tests/unit</directory> - </testsuite> - <testsuite name="SwiftMailer acceptance tests"> - <directory>tests/acceptance</directory> - </testsuite> - <testsuite name="SwiftMailer bug"> - <directory>tests/bug</directory> - </testsuite> - <testsuite name="SwiftMailer smoke tests"> - <directory>tests/smoke</directory> - </testsuite> - </testsuites> - - <listeners> - <listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" /> - <listener class="Mockery\Adapter\Phpunit\TestListener" /> - </listeners> -</phpunit> diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/IdenticalBinaryConstraint.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/IdenticalBinaryConstraint.php deleted file mode 100644 index 069d11a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/IdenticalBinaryConstraint.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/** - * A binary safe string comparison. - * - * @author Chris Corbyn - */ -class IdenticalBinaryConstraint extends \PHPUnit_Framework_Constraint -{ - protected $value; - - public function __construct($value) - { - $this->value = $value; - } - - /** - * Evaluates the constraint for parameter $other. Returns TRUE if the - * constraint is met, FALSE otherwise. - * - * @param mixed $other Value or object to evaluate. - * - * @return bool - */ - public function matches($other) - { - $aHex = $this->asHexString($this->value); - $bHex = $this->asHexString($other); - - return $aHex === $bHex; - } - - /** - * Returns a string representation of the constraint. - * - * @return string - */ - public function toString() - { - return 'indentical binary'; - } - - /** - * Get the given string of bytes as a stirng of Hexadecimal sequences. - * - * @param string $binary - * - * @return string - */ - private function asHexString($binary) - { - $hex = ''; - - $bytes = unpack('H*', $binary); - - foreach ($bytes as &$byte) { - $byte = strtoupper($byte); - } - - return implode('', $bytes); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/StreamCollector.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/StreamCollector.php deleted file mode 100644 index 7f079d9..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/StreamCollector.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -class Swift_StreamCollector -{ - public $content = ''; - - public function __invoke($arg) - { - $this->content .= $arg; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/SwiftMailerSmokeTestCase.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/SwiftMailerSmokeTestCase.php deleted file mode 100644 index 71c5713..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/SwiftMailerSmokeTestCase.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -/** - * Base test for smoke tests. - * - * @author Rouven Weßling - */ -class SwiftMailerSmokeTestCase extends SwiftMailerTestCase -{ - protected function setUp() - { - if (!defined('SWIFT_SMOKE_TRANSPORT_TYPE')) { - $this->markTestSkipped( - 'Smoke tests are skipped if tests/smoke.conf.php is not edited' - ); - } - } - - protected function _getMailer() - { - switch (SWIFT_SMOKE_TRANSPORT_TYPE) { - case 'smtp': - $transport = Swift_DependencyContainer::getInstance()->lookup('transport.smtp') - ->setHost(SWIFT_SMOKE_SMTP_HOST) - ->setPort(SWIFT_SMOKE_SMTP_PORT) - ->setUsername(SWIFT_SMOKE_SMTP_USER) - ->setPassword(SWIFT_SMOKE_SMTP_PASS) - ->setEncryption(SWIFT_SMOKE_SMTP_ENCRYPTION) - ; - break; - case 'sendmail': - $transport = Swift_DependencyContainer::getInstance()->lookup('transport.sendmail') - ->setCommand(SWIFT_SMOKE_SENDMAIL_COMMAND) - ; - break; - case 'mail': - case 'nativemail': - $transport = Swift_DependencyContainer::getInstance()->lookup('transport.mail'); - break; - default: - throw new Exception('Undefined transport ['.SWIFT_SMOKE_TRANSPORT_TYPE.']'); - } - - return new Swift_Mailer($transport); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/SwiftMailerTestCase.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/SwiftMailerTestCase.php deleted file mode 100644 index f0e2736..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/SwiftMailerTestCase.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -/** - * A base test case with some custom expectations. - * - * @author Rouven Weßling - */ -class SwiftMailerTestCase extends \PHPUnit_Framework_TestCase -{ - public static function regExp($pattern) - { - if (!is_string($pattern)) { - throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); - } - - return new PHPUnit_Framework_Constraint_PCREMatch($pattern); - } - - public function assertIdenticalBinary($expected, $actual, $message = '') - { - $constraint = new IdenticalBinaryConstraint($expected); - self::assertThat($actual, $constraint, $message); - } - - protected function tearDown() - { - \Mockery::close(); - } - - protected function getMockery($class) - { - return \Mockery::mock($class); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-2022-jp/one.txt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-2022-jp/one.txt deleted file mode 100644 index c2923de..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-2022-jp/one.txt +++ /dev/null @@ -1,11 +0,0 @@ -ISO-2022-JPは、インターネット上(特に電子メール)などで使われる日本の文字用の文字符号化方式。ISO/IEC 2022のエスケープシーケンスを利用して文字集合を切り替える7ビットのコードであることを特徴とする (アナウンス機能のエスケープシーケンスは省略される)。俗に「JISコード」と呼ばれることもある。 - -概要 -日本語表記への利用が想定されている文字コードであり、日本語の利用されるネットワークにおいて、日本の規格を応用したものである。また文字集合としては、日本語で用いられる漢字、ひらがな、カタカナはもちろん、ラテン文字、ギリシア文字、キリル文字なども含んでおり、学術や産業の分野での利用も考慮たものとなっている。規格名に、ISOの日本語の言語コードであるjaではなく、国・地域名コードのJPが示されているゆえんである。 -文字集合としてJIS X 0201のC0集合(制御文字)、JIS X 0201のラテン文字集合、ISO 646の国際基準版図形文字、JIS X 0208の1978年版(JIS C 6226-1978)と1983年および1990年版が利用できる。JIS X 0201の片仮名文字集合は利用できない。1986年以降、日本の電子メールで用いられてきたJUNETコードを、村井純・Mark Crispin・Erik van der Poelが1993年にRFC化したもの(RFC 1468)。後にJIS X 0208:1997の附属書2としてJISに規定された。MIMEにおける文字符号化方式の識別用の名前として IANA に登録されている。 -なお、符号化の仕様についてはISO/IEC 2022#ISO-2022-JPも参照。 - -ISO-2022-JPと非標準的拡張使用 -「JISコード」(または「ISO-2022-JP」)というコード名の規定下では、その仕様通りの使用が求められる。しかし、Windows OS上では、実際にはCP932コード (MicrosoftによるShift JISを拡張した亜種。ISO-2022-JP規定外文字が追加されている。)による独自拡張(の文字)を断りなく使うアプリケーションが多い。この例としてInternet ExplorerやOutlook Expressがある。また、EmEditor、秀丸エディタやThunderbirdのようなMicrosoft社以外のWindowsアプリケーションでも同様の場合がある。この場合、ISO-2022-JPの範囲外の文字を使ってしまうと、異なる製品間では未定義不明文字として認識されるか、もしくは文字化けを起こす原因となる。そのため、Windows用の電子メールクライアントであっても独自拡張の文字を使用すると警告を出したり、あえて使えないように制限しているものも存在する。さらにはISO-2022-JPの範囲内であってもCP932は非標準文字(FULLWIDTH TILDE等)を持つので文字化けの原因になり得る。 -また、符号化方式名をISO-2022-JPとしているのに、文字集合としてはJIS X 0212 (いわゆる補助漢字) やJIS X 0201の片仮名文字集合 (いわゆる半角カナ) をも符号化している例があるが、ISO-2022-JPではこれらの文字を許容していない。これらの符号化は独自拡張の実装であり、中にはISO/IEC 2022の仕様に準拠すらしていないものもある[2]。従って受信側の電子メールクライアントがこれらの独自拡張に対応していない場合、その文字あるいはその文字を含む行、時にはテキスト全体が文字化けすることがある。 - diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-8859-1/one.txt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-8859-1/one.txt deleted file mode 100644 index 3101178..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-8859-1/one.txt +++ /dev/null @@ -1,19 +0,0 @@ -Op mat eraus hinnen beschte, rou zënne schaddreg ké. Ké sin Eisen Kaffi prächteg, den haut esou Fielse wa, Well zielen d'Welt am dir. Aus grousse rëschten d'Stroos do, as dat Kléder gewëss d'Kàchen. Schied gehéiert d'Vioule net hu, rou ke zënter Säiten d'Hierz. Ze eise Fletschen mat, gei as gréng d'Lëtzebuerger. Wäit räich no mat. - -Säiten d'Liewen aus en. Un gëtt bléit lossen wee, da wéi alle weisen Kolrettchen. Et deser d'Pan d'Kirmes vun, en wuel Benn rëschten méi. En get drem ménger beschte, da wär Stad welle. Nun Dach d'Pied do, mä gét ruffen gehéiert. Ze onser ugedon fir, d'Liewen Plett'len ech no, si Räis wielen bereet wat. Iwer spilt fir jo. - -An hin däischter Margréitchen, eng ke Frot brommt, vu den Räis néierens. Da hir Hunn Frot nozegon, rout Fläiß Himmel zum si, net gutt Kaffi Gesträich fu. Vill lait Gaart sou wa, Land Mamm Schuebersonndeg rei do. Gei geet Minutt en, gei d'Leit beschte Kolrettchen et, Mamm fergiess un hun. - -Et gutt Heck kommen oft, Lann rëscht rei um, Hunn rëscht schéinste ke der. En lait zielen schnéiwäiss hir, fu rou botze éiweg Minutt, rem fest gudden schaddreg en. Noper bereet Margréitchen mat op, dem denkt d'Leit d'Vioule no, oft ké Himmel Hämmel. En denkt blénken Fréijor net, Gart Schiet d'Natur no wou. No hin Ierd Frot d'Kirmes. Hire aremt un rou, ké den éiweg wielen Milliounen. - -Mir si Hunn Blénkeg. Ké get ston derfir d'Kàchen. Haut d'Pan fu ons, dé frou löschteg d'Meereische rei. Sou op wuel Léift. Stret schlon grousse gin hu. Mä denkt d'Leit hinnen net, ké gét haut fort rëscht. - -Koum d'Pan hannendrun ass ké, ké den brét Kaffi geplot. Schéi Hären d'Pied fu gét, do d'Mier néierens bei. Rëm päift Hämmel am, wee Engel beschéngt mä. Brommt klinzecht der ke, wa rout jeitzt dén. Get Zalot d'Vioule däischter da, jo fir Bänk päift duerch, bei d'Beem schéinen Plett'len jo. Den haut Faarwen ze, eng en Biereg Kirmesdag, um sin alles Faarwen d'Vioule. - -Eng Hunn Schied et, wat wa Frot fest gebotzt. Bei jo bleiwe ruffen Klarinett. Un Feld klinzecht gét, rifft Margréitchen rem ke. Mir dé Noper duurch gewëss, ston sech kille sin en. Gei Stret d'Wise um, Haus Gart wee as. Monn ménger an blo, wat da Gart gefällt Hämmelsbrot. - -Brommt geplot och ze, dat wa Räis Well Kaffi. Do get spilt prächteg, as wär kille bleiwe gewalteg. Onser frësch Margréitchen rem ke, blo en huet ugedon. Onser Hemecht wär de, hu eraus d'Sonn dat, eise deser hannendrun da och. - -As durch Himmel hun, no fest iw'rem schéinste mir, Hunn séngt Hierz ke zum. Séngt iw'rem d'Natur zum an. Ke wär gutt Grénge. Kënnt gudden prächteg mä rei. Dé dir Blénkeg Klarinett Kolrettchen, da fort muerges d'Kanner wou, main Feld ruffen vu wéi. Da gin esou Zalot gewalteg, gét vill Hemecht blénken dé. - -Haut gréng nun et, nei vu Bass gréng d'Gaassen. Fest d'Beem uechter si gin. Oft vu sinn wellen kréien. Et ass lait Zalot schéinen. \ No newline at end of file diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/one.txt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/one.txt deleted file mode 100644 index 26c94d5..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/one.txt +++ /dev/null @@ -1,22 +0,0 @@ -Код одно гринспана руководишь на. Его вы знания движение. Ты две начать -одиночку, сказать основатель удовольствием но миф. Бы какие система тем. -Полностью использует три мы, человек клоунов те нас, бы давать творческую -эзотерическая шеф. - -Мог не помнить никакого сэкономленного, две либо какие пишите бы. Должен -компанию кто те, этот заключалась проектировщик не ты. Глупые периоды ты -для. Вам который хороший он. Те любых кремния концентрируются мог, -собирать принадлежите без вы. - -Джоэла меньше хорошего вы миф, за тем году разработки. Даже управляющим -руководители был не. Три коде выпускать заботиться ну. То его система -удовольствием безостановочно, или ты главной процессорах. Мы без джоэл -знания получат, статьи остальные мы ещё. - -Них русском касается поскольку по, образование должником -систематизированный ну мои. Прийти кандидата университет но нас, для бы -должны никакого, биг многие причин интервьюирования за. - -Тем до плиту почему. Вот учёт такие одного бы, об биг разным внешних -промежуток. Вас до какому возможностей безответственный, были погодите бы -его, по них глупые долгий количества. diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/three.txt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/three.txt deleted file mode 100644 index c81ccd5..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/three.txt +++ /dev/null @@ -1,45 +0,0 @@ -Αν ήδη διάβασε γλιτώσει μεταγλωτίσει, αυτήν θυμάμαι μου μα. Την κατάσταση χρησιμοποίησέ να! Τα διαφορά φαινόμενο διολισθήσεις πες, υψηλότερη προκαλείς περισσότερες όχι κι. Με ελέγχου γίνεται σας, μικρής δημιουργούν τη του. Τις τα γράψει εικόνες απαράδεκτη? - -Να ότι πρώτοι απαραίτητο. Άμεση πετάνε κακόκεφος τον ώς, να χώρου πιθανότητες του. Το μέχρι ορίστε λιγότερους σας. Πω ναί φυσικά εικόνες. - -Μου οι κώδικα αποκλειστικούς, λες το μάλλον συνεχώς. Νέου σημεία απίστευτα σας μα. Χρόνου μεταγλωτιστής σε νέα, τη τις πιάνει μπορούσες προγραμματιστές. Των κάνε βγαίνει εντυπωσιακό τα? Κρατάει τεσσαρών δυστυχώς της κι, ήδη υψηλότερη εξακολουθεί τα? - -Ώρα πετάνε μπορούσε λιγότερους αν, τα απαράδεκτη συγχωνευτεί ροή. Τη έγραψες συνηθίζουν σαν. Όλα με υλικό στήλες χειρότερα. Ανώδυνη δουλέψει επί ως, αν διαδίκτυο εσωτερικών παράγοντες από. Κεντρικό επιτυχία πες το. - -Πω ναι λέει τελειώσει, έξι ως έργων τελειώσει. Με αρχεία βουτήξουν ανταγωνιστής ώρα, πολύ γραφικά σελίδων τα στη. Όρο οέλεγχος δημιουργούν δε, ας θέλεις ελέγχου συντακτικό όρο! Της θυμάμαι επιδιόρθωση τα. Για μπορούσε περισσότερο αν, μέγιστη σημαίνει αποφάσισε τα του, άτομο αποτελέσει τι στα. - -Τι στην αφήσεις διοίκηση στη. Τα εσφαλμένη δημιουργια επιχείριση έξι! Βήμα μαγικά εκτελέσει ανά τη. Όλη αφήσεις συνεχώς εμπορικά αν, το λες κόλπα επιτυχία. Ότι οι ζώνη κειμένων. Όρο κι ρωτάει γραμμής πελάτες, τελειώσει διολισθήσεις καθυστερούσε αν εγώ? Τι πετούν διοίκηση προβλήματα ήδη. - -Τη γλιτώσει αποθηκευτικού μια. Πω έξι δημιουργια πιθανότητες, ως πέντε ελέγχους εκτελείται λες. Πως ερωτήσεις διοικητικό συγκεντρωμένοι οι, ας συνεχώς διοικητικό αποστηθίσει σαν. Δε πρώτες συνεχώς διολισθήσεις έχω, από τι κανένας βουτήξουν, γειτονιάς προσεκτικά ανταγωνιστής κι σαν. - -Δημιουργια συνηθίζουν κλπ τι? Όχι ποσοστό διακοπής κι. Κλπ φακέλους δεδομένη εξοργιστικά θα? Υποψήφιο καθορίζουν με όλη, στα πήρε προσοχή εταιρείες πω, ώς τον συνάδελφος διοικητικό δημιουργήσεις! Δούλευε επιτίθενται σας θα, με ένας παραγωγικής ένα, να ναι σημεία μέγιστη απαράδεκτη? - -Σας τεσσαρών συνεντεύξης τη, αρπάζεις σίγουρος μη για', επί τοπικές εντολές ακούσει θα? Ως δυστυχής μεταγλωτιστής όλη, να την είχαν σφάλμα απαραίτητο! Μην ώς άτομο διορθώσει χρησιμοποιούνταν. Δεν τα κόλπα πετάξαμε, μη που άγχος υόρκη άμεση, αφού δυστυχώς διακόψουμε όρο αν! Όλη μαγικά πετάνε επιδιορθώσεις δε, ροή φυσικά αποτελέσει πω. - -Άπειρα παραπάνω φαινόμενο πω ώρα, σαν πόρτες κρατήσουν συνηθίζουν ως. Κι ώρα τρέξει είχαμε εφαρμογή. Απλό σχεδιαστής μεταγλωτιστής ας επί, τις τα όταν έγραψες γραμμής? Όλα κάνεις συνάδελφος εργαζόμενοι θα, χαρτιού χαμηλός τα ροή. Ως ναι όροφο έρθει, μην πελάτες αποφάσισε μεταφραστής με, να βιαστικά εκδόσεις αναζήτησης λες. Των φταίει εκθέσεις προσπαθήσεις οι, σπίτι αποστηθίσει ας λες? - -Ώς που υπηρεσία απαραίτητο δημιουργείς. Μη άρα χαρά καθώς νύχτας, πω ματ μπουν είχαν. Άμεση δημιουργείς ώς ροή, γράψει γραμμής σίγουρος στα τι! Αν αφού πρώτοι εργαζόμενων ναί. - -Άμεση διορθώσεις με δύο? Έχουν παράδειγμα των θα, μου έρθει θυμάμαι περισσότερο το. Ότι θα αφού χρειάζονται περισσότερες. Σαν συνεχώς περίπου οι. - -Ώς πρώτης πετάξαμε λες, όρο κι πρώτες ζητήσεις δυστυχής. Ανά χρόνου διακοπή επιχειρηματίες ας, ώς μόλις άτομο χειρότερα όρο, κρατάει σχεδιαστής προσπαθήσεις νέο το. Πουλάς προσθέσει όλη πω, τύπου χαρακτηριστικό εγώ σε, πω πιο δούλευε αναζήτησης? Αναφορά δίνοντας σαν μη, μάθε δεδομένη εσωτερικών με ναι, αναφέρονται περιβάλλοντος ώρα αν. Και λέει απόλαυσε τα, που το όροφο προσπαθούν? - -Πάντα χρόνου χρήματα ναι το, σαν σωστά θυμάμαι σκεφτείς τα. Μα αποτελέσει ανεπιθύμητη την, πιο το τέτοιο ατόμου, τη των τρόπο εργαλείων επιδιόρθωσης. Περιβάλλον παραγωγικής σου κι, κλπ οι τύπου κακόκεφους αποστηθίσει, δε των πλέον τρόποι. Πιθανότητες χαρακτηριστικών σας κι, γραφικά δημιουργήσεις μια οι, πω πολλοί εξαρτάται προσεκτικά εδώ. Σταματάς παράγοντες για' ώς, στις ρωτάει το ναι! Καρέκλα ζητήσεις συνδυασμούς τη ήδη! - -Για μαγικά συνεχώς ακούσει το. Σταματάς προϊόντα βουτήξουν ώς ροή. Είχαν πρώτες οι ναι, μα λες αποστηθίσει ανακαλύπτεις. Όροφο άλγεβρα παραπάνω εδώ τη, πρόσληψη λαμβάνουν καταλάθος ήδη ας? Ως και εισαγωγή κρατήσουν, ένας κακόκεφους κι μας, όχι κώδικάς παίξουν πω. Πω νέα κρατάει εκφράσουν, τότε τελικών τη όχι, ας της τρέξει αλλάζοντας αποκλειστικούς. - -Ένας βιβλίο σε άρα, ναι ως γράψει ταξινομεί διορθώσεις! Εδώ να γεγονός συγγραφείς, ώς ήδη διακόψουμε επιχειρηματίες? Ότι πακέτων εσφαλμένη κι, θα όρο κόλπα παραγωγικής? Αν έχω κεντρικό υψηλότερη, κι δεν ίδιο πετάνε παρατηρούμενη! Που λοιπόν σημαντικό μα, προκαλείς χειροκροτήματα ως όλα, μα επί κόλπα άγχος γραμμές! Δε σου κάνεις βουτήξουν, μη έργων επενδυτής χρησιμοποίησέ στα, ως του πρώτες διάσημα σημαντικό. - -Βιβλίο τεράστιο προκύπτουν σαν το, σαν τρόπο επιδιόρθωση ας. Είχαν προσοχή προσπάθεια κι ματ, εδώ ως έτσι σελίδων συζήτηση. Και στην βγαίνει εσφαλμένη με, δυστυχής παράδειγμα δε μας, από σε υόρκη επιδιόρθωσης. Νέα πω νέου πιθανό, στήλες συγγραφείς μπαίνοντας μα για', το ρωτήσει κακόκεφους της? Μου σε αρέσει συγγραφής συγχωνευτεί, μη μου υόρκη ξέχασε διακοπής! Ώς επί αποφάσισε αποκλειστικούς χρησιμοποιώντας, χρήματα σελίδων ταξινομεί ναι με. - -Μη ανά γραμμή απόλαυσε, πω ναι μάτσο διασφαλίζεται. Τη έξι μόλις εργάστηκε δημιουργούν, έκδοση αναφορά δυσκολότερο οι νέο. Σας ως μπορούσε παράδειγμα, αν ότι δούλευε μπορούσε αποκλειστικούς, πιο λέει βουτήξουν διορθώσει ως. Έχω τελευταία κακόκεφους ας, όσο εργαζόμενων δημιουργήσεις τα. - -Του αν δουλέψει μπορούσε, πετούν χαμηλός εδώ ας? Κύκλο τύπους με που, δεν σε έχουν συνεχώς χειρότερα, τις τι απαράδεκτη συνηθίζουν? Θα μην τους αυτήν, τη ένα πήρε πακέτων, κι προκύπτουν περιβάλλον πως. Μα για δουλέψει απόλαυσε εφαμοργής, ώς εδώ σημαίνει μπορούσες, άμεση ακούσει προσοχή τη εδώ? - -Στα δώσε αθόρυβες λιγότερους οι, δε αναγκάζονται αποκλειστικούς όλα! Ας μπουν διοικητικό μια, πάντα ελέγχου διορθώσεις ώς τον. Ότι πήρε κανόνα μα. Που άτομα κάνεις δημιουργίες τα, οι μας αφού κόλπα προγραμματιστής, αφού ωραίο προκύπτουν στα ως. Θέμα χρησιμοποιήσει αν όλα, του τα άλγεβρα σελίδων. Τα ότι ανώδυνη δυστυχώς συνδυασμούς, μας οι πάντα γνωρίζουμε ανταγωνιστής, όχι τα δοκιμάσεις σχεδιαστής! Στην συνεντεύξης επιδιόρθωση πιο τα, μα από πουλάς περιβάλλον παραγωγικής. - -Έχουν μεταγλωτίσει σε σας, σε πάντα πρώτης μειώσει των, γράψει ρουτίνα δυσκολότερο ήδη μα? Ταξινομεί διορθώσεις να μας. Θα της προσπαθούν περιεχόμενα, δε έχω τοπικές στέλνοντάς. Ανά δε αλφα άμεση, κάποιο ρωτάει γνωρίζουμε πω στη, φράση μαγικά συνέχεια δε δύο! Αν είχαμε μειώσει ροή, μας μετράει καθυστερούσε επιδιορθώσεις μη. Χάος υόρκη κεντρικό έχω σε, ανά περίπου αναγκάζονται πω. - -Όσο επιστρέφουν χρονοδιαγράμματα μη. Πως ωραίο κακόκεφος διαχειριστής ως, τις να διακοπής αναζήτησης. Κάποιο ποσοστό ταξινομεί επί τη? Μάθε άμεση αλλάζοντας δύο με, μου νέου πάντα να. - -Πω του δυστυχώς πιθανότητες. Κι ρωτάει υψηλότερη δημιουργια ότι, πω εισαγωγή τελευταία απομόνωση ναι. Των ζητήσεις γνωρίζουμε ώς? Για' μη παραδοτέου αναφέρονται! Ύψος παραγωγικά ροή ως, φυσικά διάβασε εικόνες όσο σε? Δεν υόρκη διορθώσεις επεξεργασία θα, ως μέση σύστημα χρησιμοποιήσει τις. \ No newline at end of file diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/two.txt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/two.txt deleted file mode 100644 index 2443fc4..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/two.txt +++ /dev/null @@ -1,3 +0,0 @@ -रखति आवश्यकत प्रेरना मुख्यतह हिंदी किएलोग असक्षम कार्यलय करते विवरण किके मानसिक दिनांक पुर्व संसाध एवम् कुशलता अमितकुमार प्रोत्साहित जनित देखने उदेशीत विकसित बलवान ब्रौशर किएलोग विश्लेषण लोगो कैसे जागरुक प्रव्रुति प्रोत्साहित सदस्य आवश्यकत प्रसारन उपलब्धता अथवा हिंदी जनित दर्शाता यन्त्रालय बलवान अतित सहयोग शुरुआत सभीकुछ माहितीवानीज्य लिये खरिदे है।अभी एकत्रित सम्पर्क रिती मुश्किल प्राथमिक भेदनक्षमता विश्व उन्हे गटको द्वारा तकरीबन - -विश्व द्वारा व्याख्या सके। आजपर वातावरण व्याख्यान पहोच। हमारी कीसे प्राथमिक विचारशिलता पुर्व करती कम्प्युटर भेदनक्षमता लिये बलवान और्४५० यायेका वार्तालाप सुचना भारत शुरुआत लाभान्वित पढाए संस्था वर्णित मार्गदर्शन चुनने \ No newline at end of file diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/dkim/dkim.test.priv b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/dkim/dkim.test.priv deleted file mode 100644 index 3bd381a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/dkim/dkim.test.priv +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQDZeUdi1RKnm9cRYNn6E24xxrRTouh3Va8JOEHQ5SB018lvbjwH -2lW5mZ/I0kh/dHsTN0zcN0VE62WIbnLreMk/af/4Pg1i93+c9TmfXmoropsmdLos -w0tjq50jGbBqtHZNJYAokP/u3uUuRw8g0V/O4zlQ3GlO/PDH7xDQzekl9wIDAQAB -AoGAaoCBXD5a72hbb/BNb7HaUlgscZUjYWW93bcGTGYZef8/b+m9Tl83gjhgzvlk -db62k1eOtX3/11uskp78eqLhctv7yWc0mQQhgOogY2qCwHTCH8wja8kJkUAnKQhs -P9sa5iJvgckiuX3SdxgTMwib9d1VyGq6YywiORiZF9rxyhECQQD/xhiZSi7y0ciB -g4bassy0GVMS7EDRumMHc8wC23E1H2mj5yPE/QLqkW4ddmCv2BbJnYmyNvOaK9tk -T2W+mn3/AkEA2aqDGja9CaTlY4BCXfiT166n+xVl5+d+1DENQ4FK9O2jpSi1265J -tjEkXVxUOpV1ZEcUVOdK6RpvsKpc7vVICQJBALEFO5UsQJ4SD0GD9Ft8kCy9sj9Q -f/Qnmc5YmIQJuKpZmVW07Y6yxcfu61U8zuIlHnBftiM/4Q18+RTN1s86QaUCQHoL -9MTfCnH85q46/XuJZQRbp07O+bvlfqTl+CTwuyHImaiCwi2ydRxWQ6ihm4zZvuAC -RvEwWz2HGDc73y4RlFkCQDDdnN9e46l1nMDLDI4cyyGBVg4Z2IZ3IAu5GaoUCGjM -a8w6kxE8f1d8DD5vvqVbmfK89TA/DjT+7/arBNBCiCM= ------END RSA PRIVATE KEY----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/dkim/dkim.test.pub b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/dkim/dkim.test.pub deleted file mode 100644 index b503a91..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/dkim/dkim.test.pub +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZeUdi1RKnm9cRYNn6E24xxrRT -ouh3Va8JOEHQ5SB018lvbjwH2lW5mZ/I0kh/dHsTN0zcN0VE62WIbnLreMk/af/4 -Pg1i93+c9TmfXmoropsmdLosw0tjq50jGbBqtHZNJYAokP/u3uUuRw8g0V/O4zlQ -3GlO/PDH7xDQzekl9wIDAQAB ------END PUBLIC KEY----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/files/data.txt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/files/data.txt deleted file mode 100644 index 3f35021..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/files/data.txt +++ /dev/null @@ -1 +0,0 @@ -<data> \ No newline at end of file diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/files/swiftmailer.png b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/files/swiftmailer.png deleted file mode 100644 index 1b95f619af1fcbed1fca382d22022bdf329849cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3194 zcmeAS@N?(olHy`uVBq!ia0y~yVA#sQz~I8c#=yXEd~S&-0|SF(iEBhjaDG}zd16s2 zgJVj5QmTSyZen_BP-<dIW#P$G8wLg*8BZ6-kcwMx=Gx{c9~V9DzUkaK&a%E^s*Q~n zmU1yW3Yr#su@~$x;#uPPZpEoq!HzYTT$Lsq^KjI1n4re6ltHseM5+5q)K0TCp*$9@ z0tKwQ3kC1Qy*Z?*ceA)K{r8iYd(rzQx*eW*H*(VMJ4>H2a(kVAT6gB(x3mBE{=A`@ zw$|X=?(cEy54iJ+u}_QM5b`2_ZtI30Un-fp+yC$X`>Xn4s@`$c?jS{nyhBCmj1NrO z7Vsw&GJZJVl&h;hL-2twla;sgf$tn2E;!}ta?e=(VWYkC`kXAqgL`+sD2QJ1d8(vr z#J1-(THO5GTdm|582+$sSQ@q9veVkTOdD*uw{G3yVD6bGa`i&;cHJx2d>ZeaR}`4j zx^Vlw2ocMqh1(p859^%#rPQ!D>0@-p0_IPL)LC@fx4YFpRzKhW_`dswHIe?gzHGaW zKb!r~VM68M?)-{#p=I;ZboL(G7NGAJ&>>fuJ}ZZ9PW|-WOMS0X&viwtNM|=$zfapz zewV)iyYZULtPT51xxYST+vVhN{nV40$?MW1o-Me@*0p(~U!Q|=MlQp;`40_mmDnzw zqHrzvyjvMhvDKW@ZfhG7`L2g*u3o+^z`y=;f5f-BlbxDwZdJ`&cuwkt+G)GnjhQ=p zPv6kLmGw&G+e7#NYd9mh{<qs#WM0bJHu>YqZ;a2T9sMFy`Reia_L>*MOs}rSM}JOo zIF@S=do|&4=Jpkx7QA;XD_({jJGkK8E*UPN#S4>)n9u!tFjq@DwQ5z;&#h+p;>%Qv zb{=sk*K~M2@wiP>sk@=W<88jn&M9A4yKpqJ^5ujl$7~wpgf`e#CA4o?r<fa-`ZzWt z+cjzNmVoA~qOVI5zC{$pKa1*`eLvymmtMC8*Pjat1c|wavPFjlKTmhlEq}6fb{nH) zo__Trft1eqhkKtn{C3qlZxk`pwlrgh-}AlE4BE#;&MW)8*|V@Q{9uhF(~G_*7w51t zOX+&-yyrBxaqG>>a<6xpx7#)`8Ou#fJNiIC%%4MOvdy(?OiX7rQg>)uve^mUJ=Gt> z@-;g<;z4$BgGuMRHJfgJpL}nI`30sMxxL8|GX8r%-?q2hpwn}0R-^Bfk3XKB`hMe8 z@b#%e9`7c!7&d5>t8IP!y`68V4R`up`#(#$PM=YcG2%LXbE}?b{37u~69ssE6<X(> z|2;SUztX3Y-_7OUo-W{;|K-}V+@*ZMIr0a#-8#m4<DbJM=JeZ_d0%_nf8WSnu6g6J z<&#xP!Gd0wR6U#BgR5;V_J&*6esX=fS--aI`@`LWYu4L*e|FQYf8W0If6lwN@BR1X z^qXf_&2Mm@k9nf?>+Rz5n}65a*}d-ZKd8f}b0cI*y2)I}7(UrkP1hB^O6=|DKhJP# z`TE=E4?ZlMe9qD4-??LRcj?~|Zcpm%_J98D?NW;l&ux}cmK`_e9sZ_&|5f&ayJ~tn zc^eMeHQt%LZs*=Zp6QDf{}lT3`~OThn0vu0G_=O&mJi#OWw+$6@h@<&Ir^*Z*~3Tt zjqj?b_dQl|`ITwoTB5ve?VXN)k+J{6SiW+fU$gObc%0q+S6tl->Ym;-zj^km`4nrX z6P#ZrZ@=lir!?5SmTA8B6TTetYZfd9;V&NMO2jb7=~v~qWXnDXvsIbhRb<&&$e<Qi z8U3&(rTd*~PWSQq3_G3{OV6IfJLBujUH^Z{>e=%J-FedX<%{uA&KXq)cD#KpmGC?- z{A!TWrttayr;26#+{qeHowKLZ?|Xo(#<hHDrrb^IbyD2=ZC0*q>CIyN5qs%dsF<-r zvSdg8k&vC%IVPK&zAuqm*06n^P?>u$cZwLttXt2Q&(GMu`@zo1xz=ZS)z{|*En~El ziM32wx82h?Kl`2U{H)^m&lhr~9b!9A*R9}66F2dWF8Ut2%FXFy@wbpmj4G|!9QnMz zg*&Wd{;fZfp)dTJTYT-MnT$u--3~rj9$#}nt|`v0{a3u3dgK0T2L1!47w+lTJ$Cn; z&Aw#5Hdn6hwMqNFOt5xZ+qwU{OD5w7Gn08c4SUxZtn4)TzEt-Vcf<bG8lQC|_OG6x zX!ZEAWO5{nwp7J28zl!hj;d+w?2HT&8hH+}EEB$zs4l$qGF#=`&Cb_M0XIFW%QQJ& zuUgQSyKB|`L*J4E>X{0h64GnT<?Sm^{QGwQe*A|Q|Er6n>i)m#FHODB{yCHLc|)pU z$dt%fM$TlzxjPLC*f#v`s#rE};q-NxO`o^%X#Kgbsv8@6#KzN4=T$mi&aNUae^xJd zpNT3nW-r)1v+><(X^|b_)Ar2gF%he)sPdoww9s|I%Y{5XS*i?X4NIl3TTgrwcg}Ug z%3bFq&Rbt#ea>mdW-?t~eU>aAV@^Nci%%x=j;%f|wL;6YOJ)6q30aKCKOEvt|1Mv@ z=F*+D+vDEulCS$xeAWNkCWeWZYVQ2Ldt#?VmZ4R2>f|}`@vJ88yW}Sq6=u9-d{Dh) ztFvd*4u*miKlW;9%Cue=y&f8{=)k_3SL?0AN*|W5nX_$n>3VCX9gZ`XsH~jczOwIr z%FC$aeBY?wI>Jj{b4oJL)8D&#qUt=oQ1_EnH*Xo<<V){j*qHGw-S)QNSMB|$&q*tG zU0|~5K6C1b<eF42ri<M7rZkz#-f^G8Dfrfab%|VMY-m&LAD>(G7kjO{bsFDoeA7PV z>}j=q&$XS(l)F?IZ<vJ&N9*jHx>~g|$g(wf;TreY$&rOiUum2Ru2$WnIn$5LxiT%( z&Rk*cJMYG5<Kx-iMekLy8_QP8)U25<cd)nfW9*v?N8BvWdBuEXnrF_^5GuYX>qa5# z4t)`mH;Y$WOzZxwFL`0DOw~P86NmLDeIMM|naQ_xO3w99Ruwt=whVVB+Z4@73rbbD zGGv^8>UUn|CheUwl5FBqR-eA!`~Bmc;QL>n8}6HMpV@bQ-<@R6!|evrD-KGRC*BNy z@nnm7u9Be5!QJd#e?y*$s$8n6_`OQ)gZTP++u7nGqpp@J_r7`gH2pc}Ro-5olhtz; zdhsWhU%qki`xVtv>1iwF81DJ>T@4mKQ1-Hg>7a7C&w^zoF$W%5KbO%~=<lA=8!ecg z5b;1Xhj$9^@8UmCZdV8Xll*_|{QiH>&0RTMQnQ(kd~a!(f81?nnu~*VHN!HmJ~Pd5 z+l1%7w@s@gWD~3NrP8-8TA}1KPbjvz@$@6>#T8xZR%gFOR=!l*pZDhdnpaa=<Yuiu zUU!AnAa%cVk(29*js-cPXAL9H{`xa5@>fklcTj`cyolw?cb0z_>a#z=_+k~u@#Xz? z9ag`OM_&3~DPcBobBXi%qN%PA*48pvms_?4Y@fdV@9ifCB064MJaX{<y&`>HUi{xF zum84$9Vxg~x@56_N_jxtpT7s?lXp+A`}Xuh&h055S~R!uPuj-1p`7=C<MEBlR-8M` zDbMyed%;AVY@MBdo!2$q3Z8O1!$REcum8TNwf6sxpYId3;;4UfwBmVTq1C-EiQ8w^ zzB;;Gigz(*lhz^Muzzl|tof~ZDogHe)R#G=7`aKraRKXtX#2nC=GR``XZl>Rd?oLS z&qBtQ`O9X0?{_<3(N+EY5<}{~-XDAQ)4llk`k&@H6>3Z`*uN^LCL(Tv0L!a$6OErO z77PD7%`Gj~V!egj^p-4%{0|>xE(h+s#q;b?cI>oGTC;UM&81#n-RrtP(uDKTMUmYH zt_PLq+8s67`H}Uv)|Us%^7RcaT<*L0I(mWkla;Nr`{K^TZrM38{R5k>b$p5B!e@=j zmBv#P-?~<8)lao*%lUNEYwZ&a<10Z5p})$*g7tni_})8zovpQ-VJnN-e2zQ2TP7W5 z+UpVEoiKeJ*F2#Ym+Vf6Wf@zzY_R<l=XkJD?7ZdLpE~pHE?#@ax>dmD-Q?@sC$ry+ znJ66DCv%pw{NcoQK3zF(zOBow+!=1Ue#~&<yOn04b7iINLYsvt^BXvxu^7vnTV^f} zJRnl+8ogU3fLo#TX2t#+cOI&}os*X4d$Xwe{`Rd+&b|(oOE$0O+QA-KY4_<2$LDJz zL5Hi-xxc!E);r8AFyOxHdr+(X^1&tZe&&?by`HOkMJ;ak;V;48+C(DeT}T&D4}OvO zaDDmiqiM#!FT`x!zjczMZsr|7uSf;22AyY3n+>8@q_ce&n|;4}_0BUdqG#w{+1w_b zdidECD~nvSWP|?i)gZTJGugJEeb@Sx@uc{iyn~w$&fmJUQg+6!=As?1pB&BRENb#^ mIMnQW-zmp;+kb8YhJ>SHGylKhZ((3yVDNPHb6Mw<&;$TjyB3}R diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/files/textfile.zip b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/files/textfile.zip deleted file mode 100644 index 5a580ecbf81ff98445bc5c6d0fce7a9a301f0e39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 202 zcmWIWW@h1HU}9ikII%0tqR&rhgB}9|0|@glh%%I<R+OY==A`PCRFs5<a56BL@7w1N z!l4x`3||?)GKOSi7As^HD-<Lal_=z=DI_WcmuIGxDEKC3=A;%Wl$j_L=jLapDwL!a zm*{Z?cr!AIGvl(3mjMJA85kIrG=f;Dma{@E53OKe2=HcQ11Vr+U}SJ-U|`4vaToxz Ck1>z{ diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/CA.srl b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/CA.srl deleted file mode 100644 index dd9818a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/CA.srl +++ /dev/null @@ -1 +0,0 @@ -D42DA34CF90FA0DE diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.crt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.crt deleted file mode 100644 index 695f814..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDazCCAlOgAwIBAgIJAKJCGQYLxWT1MA0GCSqGSIb3DQEBBQUAMEwxFzAVBgNV -BAMMDlN3aWZ0bWFpbGVyIENBMRQwEgYDVQQKDAtTd2lmdG1haWxlcjEOMAwGA1UE -BwwFUGFyaXMxCzAJBgNVBAYTAkZSMB4XDTEzMTEyNzA4MzkxMFoXDTE3MTEyNjA4 -MzkxMFowTDEXMBUGA1UEAwwOU3dpZnRtYWlsZXIgQ0ExFDASBgNVBAoMC1N3aWZ0 -bWFpbGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQC7RLdHE3OWo9aZwv1xA/cYyPui/gegxpTqClRp -gGcVQ+jxIfnJQDQndyoAvFDiqOiZ+gAjZGJeUHDp9C/2IZp05MLh+omt9N8pBykm -3nj/3ZwPXOAO0uyDPAOHhISITAxEuZCqDnq7iYujywtwfQ7bpW1hCK9PfNZYMStM -kw7LsGr5BqcKkPuOWTvxE3+NqK8HxydYolsoApEGhgonyImVh1Pg1Kjkt5ojvwAX -zOdjfw5poY5NArwuLORUH+XocetRo8DC6S42HkU/MoqcYxa9EuRuwuQh7GtE6baR -PgrDsEYaY4Asy43sK81V51F/8Q1bHZKN/goQdxQwzv+/nOLTAgMBAAGjUDBOMB0G -A1UdDgQWBBRHgqkl543tKhsVAvcx1I0JFU7JuDAfBgNVHSMEGDAWgBRHgqkl543t -KhsVAvcx1I0JFU7JuDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAz -OJiEQcygKGkkXXDiXGBvP/cSznj3nG9FolON0yHUBgdvLfNnctRMStGzPke0siLt -RJvjqiL0Uw+blmLJU8lgMyLJ9ctXkiLJ/WflabN7VzmwYRWe5HzafGQJAg5uFjae -VtAAHQgvbmdXB6brWvcMQmB8di7wjVedeigZvkt1z2V0FtBy8ybJaT5H6bX9Bf5C -dS9r4mLhk/0ThthpRhRxsmupSL6e49nJaIk9q0UTEQVnorJXPcs4SPTIY51bCp6u -cOebhNgndSxCiy0zSD7vRjNiyB/YNGZ9Uv/3DNTLleMZ9kZgfoKVpwYKrRL0IFT/ -cfS2OV1wxRxq668qaOfK ------END CERTIFICATE----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.key b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.key deleted file mode 100644 index df67470..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEAu0S3RxNzlqPWmcL9cQP3GMj7ov4HoMaU6gpUaYBnFUPo8SH5 -yUA0J3cqALxQ4qjomfoAI2RiXlBw6fQv9iGadOTC4fqJrfTfKQcpJt54/92cD1zg -DtLsgzwDh4SEiEwMRLmQqg56u4mLo8sLcH0O26VtYQivT3zWWDErTJMOy7Bq+Qan -CpD7jlk78RN/jaivB8cnWKJbKAKRBoYKJ8iJlYdT4NSo5LeaI78AF8znY38OaaGO -TQK8LizkVB/l6HHrUaPAwukuNh5FPzKKnGMWvRLkbsLkIexrROm2kT4Kw7BGGmOA -LMuN7CvNVedRf/ENWx2Sjf4KEHcUMM7/v5zi0wIDAQABAoIBAGyaWkvu/O7Uz2TW -z1JWgVuvWzfYaKYV5FCicvfITn/npVUKZikPge+NTR+mFqaMXHDHqoLb+axGrGUR -hysPq9q0vEx/lo763tyVWYlAJh4E8Dd8njganK0zBbz23kGJEOheUYY95XGTQBda -bqTq8c3x7zAB8GGBvXDh+wFqm38GLyMF6T+YEzWJZqXfg31f1ldRvf6+VFwlLfz6 -cvTR7oUpYIsUeGE47kBs13SN7Oju6a355o/7wy9tOCRiu+r/ikXFh8rFGLfeTiwv -R1dhYjcEYGxZUD8u64U+Cj4qR1P0gHJL0kbh22VMMqgALOc8FpndkjNdg1Nun2X8 -BWpsPwECgYEA7C9PfTOIZfxGBlCl05rmWex++/h5E5PbH1Cw/NGjIH1HjmAkO3+5 -WyMXhySOJ8yWyCBQ/nxqc0w7+TO4C7wQcEdZdUak25KJ74v0sfmWWrVw6kcnLU6k -oawW/L2F2w7ET3zDoxKh4fOF34pfHpSbZk7XJ68YOfHpYVnP4efkQVMCgYEAyvrM -KA7xjnsKumWh206ag3QEI0M/9uPHWmrh2164p7w1MtawccZTxYYJ5o5SsjTwbxkf -0cAamp4qLInmRUxU1gk76tPYC3Ndp6Yf1C+dt0q/vtzyJetCDrdz8HHT1SpKbW0l -g6z1I5FMwa6oWvWsfS++W51vsxUheNsOJ4uxKIECgYBwM7GRiw+7U3N4wItm0Wmp -Qp642Tu7vzwTzmOmV3klkB6UVrwfv/ewgiVFQGqAIcNn42JW44g2qfq70oQWnws4 -K80l15+t6Bm7QUPH4Qg6o4O26IKGFZxEadqpyudyP7um/2B5cfqRuvzYS4YQowyI -N+AirB3YOUJjyyTk7yMSnQKBgGNLpSvDg6+ryWe96Bwcq8G6s3t8noHsk81LlAl4 -oOSNUYj5NX+zAbATDizXWuUKuMPgioxVaa5RyVfYbelgme/KvKD32Sxg12P4BIIM -eR79VifMdjjOiZYhcHojdPlGovo89qkfpxwrLF1jT8CPhj4HaRvwPIBiyekRYC9A -Sv4BAoGAXCIC1xxAJP15osUuQjcM8KdsL1qw+LiPB2+cJJ2VMAZGV7CR2K0aCsis -OwRaYM0jZKUpxzp1uwtfrfqbhdYsv+jIBkfwoShYZuo6MhbUrj0sffkhJC3WrT2z -xafCFLFv1idzGvvNxatlp1DNKrndG2NS3syVAox9MnL5OMsvGM8= ------END RSA PRIVATE KEY----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/create-cert.sh b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/create-cert.sh deleted file mode 100644 index 0454f20..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/create-cert.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -openssl genrsa -out CA.key 2048 -openssl req -x509 -new -nodes -key CA.key -days 1460 -subj '/CN=Swiftmailer CA/O=Swiftmailer/L=Paris/C=FR' -out CA.crt -openssl x509 -in CA.crt -clrtrust -out CA.crt - -openssl genrsa -out sign.key 2048 -openssl req -new -key sign.key -subj '/CN=Swiftmailer-User/O=Swiftmailer/L=Paris/C=FR' -out sign.csr -openssl x509 -req -in sign.csr -CA CA.crt -CAkey CA.key -out sign.crt -days 1460 -addtrust emailProtection -openssl x509 -in sign.crt -clrtrust -out sign.crt - -rm sign.csr - -openssl genrsa -out intermediate.key 2048 -openssl req -new -key intermediate.key -subj '/CN=Swiftmailer Intermediate/O=Swiftmailer/L=Paris/C=FR' -out intermediate.csr -openssl x509 -req -in intermediate.csr -CA CA.crt -CAkey CA.key -set_serial 01 -out intermediate.crt -days 1460 -openssl x509 -in intermediate.crt -clrtrust -out intermediate.crt - -rm intermediate.csr - -openssl genrsa -out sign2.key 2048 -openssl req -new -key sign2.key -subj '/CN=Swiftmailer-User2/O=Swiftmailer/L=Paris/C=FR' -out sign2.csr -openssl x509 -req -in sign2.csr -CA intermediate.crt -CAkey intermediate.key -set_serial 01 -out sign2.crt -days 1460 -addtrust emailProtection -openssl x509 -in sign2.crt -clrtrust -out sign2.crt - -rm sign2.csr - -openssl genrsa -out encrypt.key 2048 -openssl req -new -key encrypt.key -subj '/CN=Swiftmailer-User/O=Swiftmailer/L=Paris/C=FR' -out encrypt.csr -openssl x509 -req -in encrypt.csr -CA CA.crt -CAkey CA.key -CAcreateserial -out encrypt.crt -days 1460 -addtrust emailProtection -openssl x509 -in encrypt.crt -clrtrust -out encrypt.crt - -rm encrypt.csr - -openssl genrsa -out encrypt2.key 2048 -openssl req -new -key encrypt2.key -subj '/CN=Swiftmailer-User2/O=Swiftmailer/L=Paris/C=FR' -out encrypt2.csr -openssl x509 -req -in encrypt2.csr -CA CA.crt -CAkey CA.key -CAcreateserial -out encrypt2.crt -days 1460 -addtrust emailProtection -openssl x509 -in encrypt2.crt -clrtrust -out encrypt2.crt - -rm encrypt2.csr diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.crt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.crt deleted file mode 100644 index 7435855..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDFjCCAf4CCQDULaNM+Q+g3TANBgkqhkiG9w0BAQUFADBMMRcwFQYDVQQDDA5T -d2lmdG1haWxlciBDQTEUMBIGA1UECgwLU3dpZnRtYWlsZXIxDjAMBgNVBAcMBVBh -cmlzMQswCQYDVQQGEwJGUjAeFw0xMzExMjcwODM5MTFaFw0xNzExMjYwODM5MTFa -ME4xGTAXBgNVBAMMEFN3aWZ0bWFpbGVyLVVzZXIxFDASBgNVBAoMC1N3aWZ0bWFp -bGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQCcNO+fVZBT2znmVwXXZ08n3G5WA1kyvqh9z4RBBZOD -V46Gc1X9MMXr9+wzZBFkAckKaa6KsTkeUr4pC8XUBpQnakxH/kW9CaDPdOE+7wNo -FkPfc6pjWWgpAVxdkrtk7pb4/aGQ++HUkqVu0cMpIcj/7ht7H+3QLZHybn+oMr2+ -FDnn8vPmHxVioinSrxKTlUITuLWS9ZZUTrDa0dG8UAv55A/Tba4T4McCPDpJSA4m -9jrW321NGQUntQoItOJxagaueSvh6PveGV826gTXoU5X+YJ3I2OZUEQ2l6yByAzf -nT+QlxPj5ikotFwL72HsenYtetynOO/k43FblAF/V/l7AgMBAAEwDQYJKoZIhvcN -AQEFBQADggEBAJ048Sdb9Sw5OJM5L00OtGHgcT1B/phqdzSjkM/s64cg3Q20VN+F -fZIIkOnxgyYWcpOWXcdNw2tm5OWhWPGsBcYgMac7uK/ukgoOJSjICg+TTS5kRo96 -iHtmImqkWc6WjNODh7uMnQ6DsZsscdl7Bkx5pKhgGnEdHr5GW8sztgXgyPQO5LUs -YzCmR1RK1WoNMxwbPrGLgYdcpJw69ns5hJbZbMWwrdufiMjYWvTfBPABkk1JRCcY -K6rRTAx4fApsw1kEIY8grGxyAzfRXLArpro7thJr0SIquZ8GpXkQT/mgRR8JD9Hp -z9yhr98EnKzITE/yclGN4pUsuk9S3jiyzUU= ------END CERTIFICATE----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.key b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.key deleted file mode 100644 index aa620ca..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAnDTvn1WQU9s55lcF12dPJ9xuVgNZMr6ofc+EQQWTg1eOhnNV -/TDF6/fsM2QRZAHJCmmuirE5HlK+KQvF1AaUJ2pMR/5FvQmgz3ThPu8DaBZD33Oq -Y1loKQFcXZK7ZO6W+P2hkPvh1JKlbtHDKSHI/+4bex/t0C2R8m5/qDK9vhQ55/Lz -5h8VYqIp0q8Sk5VCE7i1kvWWVE6w2tHRvFAL+eQP022uE+DHAjw6SUgOJvY61t9t -TRkFJ7UKCLTicWoGrnkr4ej73hlfNuoE16FOV/mCdyNjmVBENpesgcgM350/kJcT -4+YpKLRcC+9h7Hp2LXrcpzjv5ONxW5QBf1f5ewIDAQABAoIBADmuMm2botfUM+Ui -bT3FIC2P8A5C3kUmsgEDB8sazAXL5w0uuanswKkJu2aepO1Q23PE4nbESlswIpf1 -iO9qHnsPfWt4MThEveTdO++JQrDEx/tTMq/M6/F4VysWa6wxjf4Taf2nhRSBsiTh -wDcICri2q98jQyWELkhfFTR+yCHPsn6iNtzE2OpNv9ojKiSqck/sVjC39Z+uU/HD -N4v0CPf9pDGkO+modaVGKf2TpvZT7Hpq/jsPzkk1h7BY7aWdZiIY4YkBkWYqZk8f -0dsxKkOR2glfuEYNtcywG+4UGx3i1AY0mMu96hH5M1ACFmFrTCoodmWDnWy9wUpm -leLmG8ECgYEAywWdryqcvLyhcmqHbnmUhCL9Vl4/5w5fr/5/FNvqArxSGwd2CxcN -Jtkvu22cxWAUoe155eMc6GlPIdNRG8KdWg4sg0TN3Jb2jiHQ3QkHXUJlWU6onjP1 -g2n5h052JxVNGBEb7hr3U7ZMW6wnuYnGdYwCB9P3r5oGxxtfVRB8ygUCgYEAxPfy -tAd3SNT8Sv/cciw76GYKbztUjJRXkLo6GOBGq/AQxP1NDWMuL2AES11YIahidMsF -TMmM+zhkNHsd5P69p87FTMWx0cLoH0M9iQNK7Q6C1luTjLf5DTFuk+nHGErM4Drs -+6Ly1Z4KLXfXgBDD8Ce6U9+W3RrCc36poGZvjX8CgYEAna0P6WJr9r19mhIYevmc -Gf/ex7xNXxMvx80dP8MIfPVrwyhJSpWtljVpt+SKtFRJ0fVRDfUUl4Bqf/fR74B3 -muCVO6ItTBxHAt5Ki9CeUpTlh7XqiWwLSvP8Y1TRuMr3ZDCtg4CYBAD6Ttxmwde6 -NcL2NMQwgsZaazrcEIHMmU0CgYEAl/Mn2tZ/oUIdt8YWzEVvmeNOXW0J1sGBo/bm -ZtZt7qpuZWl7jb5bnNSXu4QxPxXljnAokIpUJmHke9AWydfze4c6EfXZLhcMd0Gq -MQ7HOIWfTbqr4zzx9smRoq4Ql57s2nba521XpJAdDeKL7xH/9j7PsXCls8C3Dd5D -AajEmgUCgYAGEdn6tYxIdX7jF39E3x7zHQf8jHIoQ7+cLTLtd944mSGgeqMfbiww -CoUa+AAUqjdAD5ViAyJrA+gmDtWpkFnJZtToXYwfUF2o3zRo4k1DeBrVbFqwSQkE -omrfiBGtviYIPdqQLE34LYpWEooNPraqO9qTyc+9w5038u2OFS+WmQ== ------END RSA PRIVATE KEY----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.crt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.crt deleted file mode 100644 index 6908165..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDFzCCAf8CCQDULaNM+Q+g3jANBgkqhkiG9w0BAQUFADBMMRcwFQYDVQQDDA5T -d2lmdG1haWxlciBDQTEUMBIGA1UECgwLU3dpZnRtYWlsZXIxDjAMBgNVBAcMBVBh -cmlzMQswCQYDVQQGEwJGUjAeFw0xMzExMjcwODM5MTJaFw0xNzExMjYwODM5MTJa -ME8xGjAYBgNVBAMMEVN3aWZ0bWFpbGVyLVVzZXIyMRQwEgYDVQQKDAtTd2lmdG1h -aWxlcjEOMAwGA1UEBwwFUGFyaXMxCzAJBgNVBAYTAkZSMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEAw4AoYVYss2sa1BWJAJpK6gVemjXrp1mVXVpb1/z6 -SH15AGsp3kiNXsMpgvsdofbqC/5HXrw2G8gWqo+uh6GuK67+Tvp7tO2aD4+8CZzU -K1cffj7Pbx95DUPwXckv79PT5ZcuyeFaVo92aug11+gS/P8n0WXSlzZxNuZ1f3G2 -r/IgwfNKZlarEf1Ih781L2SwmyveW/dtsV2pdrd4IZwsV5SOF2zBFIXSuhPN0c+m -mtwSJe+Ow1udLX4KJkAX8sGVFJ5P5q4s2nS9vLkkj7X6YRQscbyJO9L7e1TksRqL -DLxZwiko6gUhp4/bIs1wDj5tzkQBi4qXviRq3i7A9b2d0QIDAQABMA0GCSqGSIb3 -DQEBBQUAA4IBAQAj8iARhPB2DA3YfT5mJJrgU156Sm0Z3mekAECsr+VqFZtU/9Dz -pPFYEf0hg61cjvwhLtOmaTB+50hu1KNNlu8QlxAfPJqNxtH85W0CYiZHJwW9eSTr -z1swaHpRHLDUgo3oAXdh5syMbdl0MWos0Z14WP5yYu4IwJXs+j2JRW70BICyrNjm -d+AjCzoYjKMdJkSj4uxQEOuW2/5veAoDyU+kHDdfT7SmbyoKu+Pw4Xg/XDuKoWYg -w5/sRiw5vxsmOr9+anspDHdP9rUe1JEfwAJqZB3fwdqEyxu54Xw/GedG4wZBEJf0 -ZcS1eh31emcjYUHQa1IA93jcFSmXzJ+ftJrY ------END CERTIFICATE----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.key b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.key deleted file mode 100644 index e322a8f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAw4AoYVYss2sa1BWJAJpK6gVemjXrp1mVXVpb1/z6SH15AGsp -3kiNXsMpgvsdofbqC/5HXrw2G8gWqo+uh6GuK67+Tvp7tO2aD4+8CZzUK1cffj7P -bx95DUPwXckv79PT5ZcuyeFaVo92aug11+gS/P8n0WXSlzZxNuZ1f3G2r/IgwfNK -ZlarEf1Ih781L2SwmyveW/dtsV2pdrd4IZwsV5SOF2zBFIXSuhPN0c+mmtwSJe+O -w1udLX4KJkAX8sGVFJ5P5q4s2nS9vLkkj7X6YRQscbyJO9L7e1TksRqLDLxZwiko -6gUhp4/bIs1wDj5tzkQBi4qXviRq3i7A9b2d0QIDAQABAoIBAH8RvK1PmqxfkEeL -W8oVf13OcafgJjRW6NuNkKa5mmAlldFs1gDRvXl7dm7ZE3CjkYqMEw2DXdP+4KSp -0TH9J7zi+A6ThnaZ/QniTcEdu1YUQbcH0kIS/dZec0wyKUNDtrXC5zl2jQY4Jyrj -laOpBzaEDfhvq0p3q2yYrIRSgACpSEVEsfPoHrxtlLhfMkVNe8P0nkQkzdwou5MQ -MZKV4JUopLHLgPH6IXQCqA1wzlU32yZ86w88GFcBVLkwlLJCKbuAo7yxMCD+nzvA -xm5NuF1kzpP0gk+kZRXF+rFEV4av/2kSS+n8IeUBQZrxovLBuQHVDvJXoqcEjmlh -ZUltznUCgYEA4inwieePfb7kh7L/ma5OLLn+uCNwzVw9LayzXT1dyPravOnkHl6h -MgaoTspqDyU8k8pStedRrr5dVYbseni/A4WSMGvi4innqSXBQGp64TyeJy/e+LrS -ypSWQ6RSJkCxI5t8s4mOpR7FMcdE34I5qeA4G5RS1HIacn7Hxc7uXtcCgYEA3Uqn -E7EDfNfYdZm6AikvE6x64oihWI0x47rlkLu6lf6ihiF1dbfaEN+IAaIxQ/unGYwU -130F0TUwarXnVkeBIRlij4fXhExyd7USSQH1VpqmIqDwsS2ojrzQVMo5UcH+A22G -bbHPtwJNmw8a7yzTPWo2/vnjgV2OaXEQ9vCVG5cCgYEAu1kEoihJDGBijSqxY4wp -xBE7OSxamDNtlnV2i6l3FDMBmfaieqnnHDq5l7NDklJFUSQLyhXZ60hUprHDGV0G -1pMCW8wzQSh3d/4HjSXnrsd5N3sHWMHiNeBKbbQkPP3f/2AhN9SebpgDwE2S9xe4 -TsmnkOkYiFYRJIFzWaAmhDcCgYEAwxRCgZt0xaPKULG6RpljxOYyVm24PsYKCwYB -xjuYWw5k2/W3BJWVCXblAPuojpPUVTMmVGkErc9D5W6Ch471iOZF+t334cs6xci8 -W9v8GeKvPqu+Q5NKmrpctcKoESkA8qik7yLnSCAhpeYFCn/roKJ35QMJyktddhqU -p/yilfUCgYBxZ6YmFjYH6l5SxQdcfa5JQ2To8lZCfRJwB65EyWj4pKH4TaWFS7vb -50WOGTBwJgyhTKLCO3lOmXIUyIwC+OO9xzaeRCBjqEhpup/Ih3MsfMEd6BZRVK5E -IxtmIWba5HQ52k8FKHeRrRB7PSVSADUN2pUFkLudH+j/01kSZyJoLA== ------END RSA PRIVATE KEY----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.crt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.crt deleted file mode 100644 index 012f734..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDFjCCAf4CAQEwDQYJKoZIhvcNAQEFBQAwTDEXMBUGA1UEAwwOU3dpZnRtYWls -ZXIgQ0ExFDASBgNVBAoMC1N3aWZ0bWFpbGVyMQ4wDAYDVQQHDAVQYXJpczELMAkG -A1UEBhMCRlIwHhcNMTQxMTIwMTMyNTQxWhcNMTgxMTE5MTMyNTQxWjBWMSEwHwYD -VQQDDBhTd2lmdG1haWxlciBJbnRlcm1lZGlhdGUxFDASBgNVBAoMC1N3aWZ0bWFp -bGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQDSgEhftX6f1wV+uqWl4J+zwCn8fHaLZT6GZ0Gs9ThE -4e+4mkLG1rvSEIJon8U0ic8Zph1UGa1Grveh5bgbldHlFxYSsCCyDGgixRvRWNhI -KuO+SxaIZChqqKwVn3aNQ4BZOSo/MjJ/jQyr9BMgMmdxlHR3e1wkkeAkW//sOsfu -xQGF1h9yeQvuu/GbG6K7vHSGOGd5O3G7bftfQ7l78TMqeJ7jV32AdJeuO5MD4dRn -W4CQLTaeribLN0MKn35UdSiFoZxKHqqWcgtl5xcJWPOmq6CsAJ2Eo90kW/BHOrLv -10h6Oan9R1PdXSvSCvVnXY3Kz30zofw305oA/KJk/hVzAgMBAAEwDQYJKoZIhvcN -AQEFBQADggEBABijZ2NNd05Js5VFNr4uyaydam9Yqu/nnrxbPRbAXPlCduydu2Gd -d1ekn3nblMJ87Bc7zVyHdAQD8/AfS1LOKuoWHpTzmlpIL+8T5sbCYG5J1jKdeLkh -7L/UD5v1ACgA33oKtN8GzcrIq8Zp73r0n+c3hFCfDYRSZRCxGyIf3qgU2LBOD0A3 -wTff/N8E/p3WaJX9VnuQ7xyRMOubDuqJnlo5YsFv7wjyGOIAz9afZzcEbH6czt/t -g0Xc/kGr/fkAjUu+z3ZfE4247Gut5m3hEVwWkpEEzQo4osX/BEX20Q2nPz9WBq4a -pK3qNNGwAqS4gdE3ihOExMWxAKgr9d2CcU4= ------END CERTIFICATE----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.key b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.key deleted file mode 100644 index 569eb0c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEA0oBIX7V+n9cFfrqlpeCfs8Ap/Hx2i2U+hmdBrPU4ROHvuJpC -xta70hCCaJ/FNInPGaYdVBmtRq73oeW4G5XR5RcWErAgsgxoIsUb0VjYSCrjvksW -iGQoaqisFZ92jUOAWTkqPzIyf40Mq/QTIDJncZR0d3tcJJHgJFv/7DrH7sUBhdYf -cnkL7rvxmxuiu7x0hjhneTtxu237X0O5e/EzKnie41d9gHSXrjuTA+HUZ1uAkC02 -nq4myzdDCp9+VHUohaGcSh6qlnILZecXCVjzpqugrACdhKPdJFvwRzqy79dIejmp -/UdT3V0r0gr1Z12Nys99M6H8N9OaAPyiZP4VcwIDAQABAoIBAQDLJiKyu2XIvKsA -8wCKZY262+mpUjTVso/1BhHL6Zy0XZgMgFORsgrxYB16+zZGzfiguD/1uhIP9Svn -gtt7Q8udW/phbrkfG/okFDYUg7m3bCz+qVjFqGOZC8+Hzq2LB2oGsbSj6L3zexyP -lq4elIZghvUfml4CrQW0EVWbld79/kF7XHABcIOk2+3f63XAQWkjdFNxj5+z6TR0 -52Rv7SmRioAsukW9wr77G3Luv/0cEzDFXgGW5s0wO+rJg28smlsIaj+Y0KsptTig -reQvReAT/S5ZxEp4H6WtXQ1WmaliMB0Gcu4TKB0yE8DoTeCePuslo9DqGokXYT66 -oqtcVMqBAoGBAPoOL9byNNU/bBNDWSCiq8PqhSjl0M4vYBGqtgMXM4GFOJU+W2nX -YRJbbxoSd/DKjnxEsR6V0vDTDHj4ZSkgmpEmVhEdAiwUwaZ0T8YUaCPhdiAENo5+ -zRBWVJcvAC2XKTK1hy5D7Z5vlC32HHygYqitU+JsK4ylvhrdeOcGx5cfAoGBANeB -X0JbeuqBEwwEHZqYSpzmtB+IEiuYc9ARTttHEvIWgCThK4ldAzbXhDUIQy3Hm0sL -PzDA33furNl2WwB+vmOuioYMNjArKrfg689Aim1byg4AHM5XVQcqoDSOABtI55iP -E0hYDe/d4ema2gk1uR/mT4pnLnk2VzRKsHUbP9stAoGBAKjyIuJwPMADnMqbC0Hg -hnrVHejW9TAJlDf7hgQqjdMppmQ3gF3PdjeH7VXJOp5GzOQrKRxIEABEJ74n3Xlf -HO+K3kWrusb7syb6mNd0/DOZ5kyVbCL0iypJmdeXmuAyrFQlj9LzdD1Cl/RBv1d4 -qY/bo7xsZzQc24edMU2uJ/XzAoGBAMHChA95iK5HlwR6vtM8kfk4REMFaLDhxV8R -8MCeyp33NQfzm91JT5aDd07nOt9yVGHInuwKveFrKuXq0C9FxZCCYfHcEOyGI0Zo -aBxTfyKMIMMtvriXNM/Yt2oJMndVuUUlfsTQxtcfu/r5S4h0URopTOK3msVI4mcV -sEnaUjORAoGAGDnslKYtROQMXTe4sh6CoJ32J8UZVV9M+8NLus9rO0v/eZ/pIFxo -MXGrrrl51ScqahCQ+DXHzpLvInsdlAJvDP3ymhb7H2xGsyvb3x2YgsLmr1YVOnli -ISbCssno3vZyFU1TDjeEIKqZHc92byHNMjMuhmlaA25g8kb0cCO76EA= ------END RSA PRIVATE KEY----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.crt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.crt deleted file mode 100644 index 15fd65d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDFjCCAf4CCQDULaNM+Q+g3DANBgkqhkiG9w0BAQUFADBMMRcwFQYDVQQDDA5T -d2lmdG1haWxlciBDQTEUMBIGA1UECgwLU3dpZnRtYWlsZXIxDjAMBgNVBAcMBVBh -cmlzMQswCQYDVQQGEwJGUjAeFw0xMzExMjcwODM5MTBaFw0xNzExMjYwODM5MTBa -ME4xGTAXBgNVBAMMEFN3aWZ0bWFpbGVyLVVzZXIxFDASBgNVBAoMC1N3aWZ0bWFp -bGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQCTe8ZouyjVGgqlljhaswYqLj7icMoHq+Qg13CE+zJg -tl2/UzyPhAd3WWOIvlQ0lu+E/n0bXrS6+q28DrQ3UgJ9BskzzLz15qUO12b92AvG -vLJ+9kKuiM5KXDljOAsXc7/A9UUGwEFA1D0mkeMmkHuiQavAMkzBLha22hGpg/hz -VbE6W9MGna0szd8yh38IY1M5uR+OZ0dG3KbVZb7H3N0OLOP8j8n+4YtAGAW+Onz/ -2CGPfZ1kaDMvY/WTZwyGeA4FwCPy1D8tfeswqKnWDB9Sfl8hns5VxnoJ3dqKQHeX -iC4OMfQ0U4CcuM5sVYJZRNNwP7/TeUh3HegnOnuZ1hy9AgMBAAEwDQYJKoZIhvcN -AQEFBQADggEBAAEPjGt98GIK6ecAEat52aG+8UP7TuZaxoH3cbZdhFTafrP8187F -Rk5G3LCPTeA/QIzbHppA4fPAiS07OVSwVCknpTJbtKKn0gmtTZxThacFHF2NlzTH -XxM5bIbkK3jzIF+WattyTSj34UHHfaNAmvmS7Jyq6MhjSDbcQ+/dZ9eo2tF/AmrC -+MBhyH8aUYwKhTOQQh8yC11niziHhGO99FQ4tpuD9AKlun5snHq4uK9AOFe8VhoR -q2CqX5g5v8OAtdlvzhp50IqD4BNOP+JrUxjGLHDG76BZZIK2Ai1eBz+GhRlIQru/ -8EhQzd94mdFEPblGbmuD2QXWLFFKLiYOwOc= ------END CERTIFICATE----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.key b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.key deleted file mode 100644 index b3d3c53..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAk3vGaLso1RoKpZY4WrMGKi4+4nDKB6vkINdwhPsyYLZdv1M8 -j4QHd1ljiL5UNJbvhP59G160uvqtvA60N1ICfQbJM8y89ealDtdm/dgLxryyfvZC -rojOSlw5YzgLF3O/wPVFBsBBQNQ9JpHjJpB7okGrwDJMwS4WttoRqYP4c1WxOlvT -Bp2tLM3fMod/CGNTObkfjmdHRtym1WW+x9zdDizj/I/J/uGLQBgFvjp8/9ghj32d -ZGgzL2P1k2cMhngOBcAj8tQ/LX3rMKip1gwfUn5fIZ7OVcZ6Cd3aikB3l4guDjH0 -NFOAnLjObFWCWUTTcD+/03lIdx3oJzp7mdYcvQIDAQABAoIBAH2vrw/T6GFrlwU0 -twP8q1VJIghCDLpq77hZQafilzU6VTxWyDaaUu6QPDXt1b8Xnjnd02p+1FDAj0zD -zyuR9VLtdIxzf9mj3KiAQ2IzOx3787YlUgCB0CQo4jM/MJyk5RahL1kogLOp7A8x -pr5XxTUq+B6L/0Nmbq8XupOXRyWp53amZ5N8sgWDv4oKh9fqgAhxbSG6KUkTmhYs -DLinWg86Q28pSn+eivf4dehR56YwtTBVguXW3WKO70+GW1RotSrS6e6SSxfKYksZ -a7/J1hCmJkEE3+4C8BpcI0MelgaK66ocN0pOqDF9ByxphARqyD7tYCfoS2P8gi81 -XoiZJaECgYEAwqx4AnDX63AANsfKuKVsEQfMSAG47SnKOVwHB7prTAgchTRcDph1 -EVOPtJ+4ssanosXzLcN/dCRlvqLEqnKYAOizy3C56CyRguCpO1AGbRpJjRmHTRgA -w8iArhM07HgJ3XLFn99V/0bsPCMxW8dje1ZMjKjoQtDrXRQMtWaVY+UCgYEAwfGi -f0If6z7wJj9gQUkGimWDAg/bxDkvEeh3nSD/PQyNiW0XDclcb3roNPQsal2ZoMwt -f1bwkclw7yUCIZBvXWEkZapjKCdseTp6nglScxr8GAzfN9p5KQl+OS3GzC6xZf6C -BsZQ5ucsHTHsCAi3WbwGK829z9c7x0qRwgwu9/kCgYEAsqwEwYi8Q/RZ3e1lXC9H -jiHwFi6ugc2XMyoJscghbnkLZB54V1UKLUraXFcz97FobnbsCJajxf8Z+uv9QMtI -Q51QV2ow1q0BKHP2HuAF5eD4nK5Phix/lzHRGPO74UUTGNKcG22pylBXxaIvTSMl -ZTABth/YfGqvepBKUbvDZRkCgYB5ykbUCW9H6D8glZ3ZgYU09ag+bD0CzTIs2cH7 -j1QZPz/GdBYNF00PyKv3TPpzVRH7cxyDIdJyioB7/M6Iy03T4wPbQBOCjLdGrZ2A -jrQTCngSlkq6pVx+k7KLL57ua8gFF70JihIV3kfKkaX6KZcSJ8vsSAgRc8TbUo2T -wNjh6QKBgDyxw4bG2ULs+LVaHcnp7nizLgRGXJsCkDICjla6y0eCgAnG8fSt8CcG -s5DIfJeVs/NXe/NVNuVrfwsUx0gBOirtFwQStvi5wJnY/maGAyjmgafisNFgAroT -aM5f+wyGPQeGCs7bj7JWY7Nx9lkyuUV7DdKBTZNMOe51K3+PTEL3 ------END RSA PRIVATE KEY----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.crt b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.crt deleted file mode 100644 index 44f4d9b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDGTCCAgECAQEwDQYJKoZIhvcNAQEFBQAwVjEhMB8GA1UEAwwYU3dpZnRtYWls -ZXIgSW50ZXJtZWRpYXRlMRQwEgYDVQQKDAtTd2lmdG1haWxlcjEOMAwGA1UEBwwF -UGFyaXMxCzAJBgNVBAYTAkZSMB4XDTE0MTEyMDEzMjYyNloXDTE4MTExOTEzMjYy -NlowTzEaMBgGA1UEAwwRU3dpZnRtYWlsZXItVXNlcjIxFDASBgNVBAoMC1N3aWZ0 -bWFpbGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQDbr1m4z/rzFS/DxUUQIhKNx19oAeGYLt3niaEP -twfvBMNB80gMgM9d+XtqrPAMPeY/2C8t5NlChNPKMcR70JBKdmlSH4/aTjaIfWmD -PoZJjvRRXINZgSHNKIt4ZGAN/EPFr19CBisV4iPxzu+lyIbbkaZJ/qtyatlP7m/q -8TnykFRlyxNEveCakpcXeRd3YTFGKWoED+/URhVc0cCPZVjoeSTtPHAYBnC29lG5 -VFbq6NBQiyF4tpjOHRarq6G8PtQFH9CpAZg5bPk3bqka9C8mEr5jWfrM4EHtUkTl -CwVLOQRBsz/nMBT27pXZh18GU0hc3geNDN4kqaeqgNBo0mblAgMBAAEwDQYJKoZI -hvcNAQEFBQADggEBAAHDMuv6oxWPsTQWWGWWFIk7QZu3iogMqFuxhhQxg8BE37CT -Vt1mBVEjYGMkWhMSwWBMWuP6yuOZecWtpp6eOie/UKGg1XoW7Y7zq2aQaP7YPug0 -8Lgq1jIo7iO2b6gZeMtLiTZrxyte0z1XzS3wy7ZC9mZjYd7QE7mZ+/rzQ0x5zjOp -G8b3msS/yYYJCMN+HtHln++HOGmm6uhvbsHTfvvZvtl7F5vJ5WhGGlUfjhanSEtZ -1RKx+cbgIv1eFOGO1OTuZfEuKdLb0T38d/rjLeI99nVVKEIGtLmX4dj327GHe/D3 -aPr2blF2gOvlzkfN9Vz6ZUE2s3rVBeCg2AVseYQ= ------END CERTIFICATE----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.key b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.key deleted file mode 100644 index ffb189b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEA269ZuM/68xUvw8VFECISjcdfaAHhmC7d54mhD7cH7wTDQfNI -DIDPXfl7aqzwDD3mP9gvLeTZQoTTyjHEe9CQSnZpUh+P2k42iH1pgz6GSY70UVyD -WYEhzSiLeGRgDfxDxa9fQgYrFeIj8c7vpciG25GmSf6rcmrZT+5v6vE58pBUZcsT -RL3gmpKXF3kXd2ExRilqBA/v1EYVXNHAj2VY6Hkk7TxwGAZwtvZRuVRW6ujQUIsh -eLaYzh0Wq6uhvD7UBR/QqQGYOWz5N26pGvQvJhK+Y1n6zOBB7VJE5QsFSzkEQbM/ -5zAU9u6V2YdfBlNIXN4HjQzeJKmnqoDQaNJm5QIDAQABAoIBAAM2FvuqnqJ7Bs23 -zoCj3t2PsodUr7WHydqemmoeZNFLoocORVlZcK6Q/QrcKE4lgX4hbN8g30QnqOjl -vVeJ/vH3tSZsK7AnQIjSPH6cpV3h5xRhY9IlHxdepltGLFlH/L2hCKVwbaTOP3RD -cCFeQwpmoKWoQV1UzoRqmdw3Vn+DMaUULomLVR9aSW9PnKeFL+tPWShf7GmVISfM -2H6xKw/qT0XAX59ZHA1laxSFVvbV5ZcKrBOFMV407Vzw2d3ojmfEzNsHjUVBXX8j -B5nK1VeJiTVmcoVhnRX7tXESDaZy+Kv38pqOmc8Svn70lDJ35SM2EpWnX39w5LsQ -29NsIUECgYEA/vNKiMfVmmZNQrpcuHQe5adlmz9+I4xJ4wbRzrS7czpbKF0/iaPf -dKoVz67yYHOJCBHTVaXWkElQsq1mkyuFt/cc0ReJXO8709+t+6ULsE50cLQm/HN5 -npg3gw0Ls/9dy/cHM5SdVIHMBm9oQ65rXup/dqWC8Dz2cAAOQhIPwx0CgYEA3Jbk -DPdUlrj4sXcE3V/CtmBuK9Xq1xolJt026fYCrle0YhdMKmchRBDCc6BzM+F/vDyC -llPfQu8TDXK40Oan7GbxMdoLqKK9gSIq1dvfG1YMMz8OrBcX8xKe61KFRWd7QSBJ -BcY575NzYHapOHVGnUJ68j8zCow0gfb7q6iK4GkCgYEAz2mUuKSCxYL21hORfUqT -HFjMU7oa38axEa6pn9XvLjZKlRMPruWP1HTPG9ADRa6Yy+TcnrA1V9sdeM+TRKXC -usCiRAU27lF+xccS30gNs1iQaGRX10gGqJzDhK1nWP+nClmlFTSRrn+OQan/FBjh -Jy31lsveM54VC1cwQlY5Vo0CgYEArtjfnLNzFiE55xjq/znHUd4vlYlzItrzddHE -lEBOsbiNH29ODRI/2P7b0uDsT8Q/BoqEC/ohLqHn3TIA8nzRv91880HdGecdBL17 -bJZiSv2yn/AshhWsAxzQYMDBKFk05lNb7jrIc3DR9DU6PqketsoaP+f+Yi7t89I8 -fD0VD3kCgYAaJCoQshng/ijiHF/RJXLrXXHJSUmaOfbweX/mzFup0YR1LxUjcv85 -cxvwc41Y2iI5MwUXyX97/GYKeoobzWZy3XflNWtg04rcInVaPsb/OOFDDqI+MkzT -B4PcCurOmjzcxHMVE34CYvl3YVwWrPb5JO1rYG9T2gKUJnLU6qG4Bw== ------END RSA PRIVATE KEY----- diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance.conf.php.default b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance.conf.php.default deleted file mode 100644 index 5717c98..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance.conf.php.default +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/* - Swift Mailer V4 accpetance test configuration. - - YOU ONLY NEED TO EDIT THIS FILE IF YOU WISH TO RUN THE ACCEPTANCE TESTS. - - The acceptance tests are run by default when "All Tests" are run with the - testing suite, however, without configuration options here only the unit tests - will be run and the acceptance tests will be skipped. - - You can fill out only the parts you know and leave the other bits. - */ - -/* - Defines: The name and port of a SMTP server you can connect to. - Recommended: smtp.gmail.com:25 - */ -define('SWIFT_SMTP_HOST', 'localhost:4456'); - -/* - Defines: An SMTP server and port which uses TLS encryption. - Recommended: smtp.gmail.com:465 - */ -define('SWIFT_TLS_HOST', 'smtp.gmail.com:465'); - -/* - Defines: An SMTP server and port which uses SSL encryption. - Recommended: smtp.gmail.com:465 - */ -define('SWIFT_SSL_HOST', 'smtp.gmail.com:465'); - -/* - Defines: The path to a sendmail binary (one which can run in -bs mode). - Recommended: /usr/sbin/sendmail - */ -define('SWIFT_SENDMAIL_PATH', '/usr/sbin/sendmail -bs'); diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/AttachmentAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/AttachmentAcceptanceTest.php deleted file mode 100644 index 5c0b826..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/AttachmentAcceptanceTest.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -require_once 'swift_required.php'; -require_once __DIR__.'/Mime/AttachmentAcceptanceTest.php'; - -class Swift_AttachmentAcceptanceTest extends Swift_Mime_AttachmentAcceptanceTest -{ - protected function _createAttachment() - { - return Swift_Attachment::newInstance(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/ByteStream/FileByteStreamAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/ByteStream/FileByteStreamAcceptanceTest.php deleted file mode 100644 index 49ad20a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/ByteStream/FileByteStreamAcceptanceTest.php +++ /dev/null @@ -1,162 +0,0 @@ -<?php - -class Swift_ByteStream_FileByteStreamAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_testFile; - - protected function setUp() - { - $this->_testFile = sys_get_temp_dir().'/swift-test-file'.__CLASS__; - file_put_contents($this->_testFile, 'abcdefghijklm'); - } - - protected function tearDown() - { - unlink($this->_testFile); - } - - public function testFileDataCanBeRead() - { - $file = $this->_createFileStream($this->_testFile); - $str = ''; - while (false !== $bytes = $file->read(8192)) { - $str .= $bytes; - } - $this->assertEquals('abcdefghijklm', $str); - } - - public function testFileDataCanBeReadSequentially() - { - $file = $this->_createFileStream($this->_testFile); - $this->assertEquals('abcde', $file->read(5)); - $this->assertEquals('fghijklm', $file->read(8)); - $this->assertFalse($file->read(1)); - } - - public function testFilenameIsReturned() - { - $file = $this->_createFileStream($this->_testFile); - $this->assertEquals($this->_testFile, $file->getPath()); - } - - public function testFileCanBeWrittenTo() - { - $file = $this->_createFileStream($this->_testFile, true); - $file->write('foobar'); - $this->assertEquals('foobar', $file->read(8192)); - } - - public function testReadingFromThenWritingToFile() - { - $file = $this->_createFileStream($this->_testFile, true); - $file->write('foobar'); - $this->assertEquals('foobar', $file->read(8192)); - $file->write('zipbutton'); - $this->assertEquals('zipbutton', $file->read(8192)); - } - - public function testWritingToFileWithCanonicalization() - { - $file = $this->_createFileStream($this->_testFile, true); - $file->addFilter($this->_createFilter(array("\r\n", "\r"), "\n"), 'allToLF'); - $file->write("foo\r\nbar\r"); - $file->write("\nzip\r\ntest\r"); - $file->flushBuffers(); - $this->assertEquals("foo\nbar\nzip\ntest\n", file_get_contents($this->_testFile)); - } - - public function testWritingWithFulleMessageLengthOfAMultipleOf8192() - { - $file = $this->_createFileStream($this->_testFile, true); - $file->addFilter($this->_createFilter(array("\r\n", "\r"), "\n"), 'allToLF'); - $file->write(''); - $file->flushBuffers(); - $this->assertEquals('', file_get_contents($this->_testFile)); - } - - public function testBindingOtherStreamsMirrorsWriteOperations() - { - $file = $this->_createFileStream($this->_testFile, true); - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->at(0)) - ->method('write') - ->with('x'); - $is2->expects($this->at(1)) - ->method('write') - ->with('y'); - - $file->bind($is1); - $file->bind($is2); - - $file->write('x'); - $file->write('y'); - } - - public function testBindingOtherStreamsMirrorsFlushOperations() - { - $file = $this->_createFileStream( - $this->_testFile, true - ); - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $is1->expects($this->once()) - ->method('flushBuffers'); - $is2->expects($this->once()) - ->method('flushBuffers'); - - $file->bind($is1); - $file->bind($is2); - - $file->flushBuffers(); - } - - public function testUnbindingStreamPreventsFurtherWrites() - { - $file = $this->_createFileStream($this->_testFile, true); - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->once()) - ->method('write') - ->with('x'); - - $file->bind($is1); - $file->bind($is2); - - $file->write('x'); - - $file->unbind($is2); - - $file->write('y'); - } - - private function _createFilter($search, $replace) - { - return new Swift_StreamFilters_StringReplacementFilter($search, $replace); - } - - private function _createMockInputStream() - { - return $this->getMockBuilder('Swift_InputByteStream')->getMock(); - } - - private function _createFileStream($file, $writable = false) - { - return new Swift_ByteStream_FileByteStream($file, $writable); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php deleted file mode 100644 index c13e570..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php +++ /dev/null @@ -1,179 +0,0 @@ -<?php - -class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_factory; - private $_prefix = 'Swift_CharacterReader_'; - - protected function setUp() - { - $this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - public function testCreatingUtf8Reader() - { - foreach (array('utf8', 'utf-8', 'UTF-8', 'UTF8') as $utf8) { - $reader = $this->_factory->getReaderFor($utf8); - $this->assertInstanceOf($this->_prefix.'Utf8Reader', $reader); - } - } - - public function testCreatingIso8859XReaders() - { - $charsets = array(); - foreach (range(1, 16) as $number) { - foreach (array('iso', 'iec') as $body) { - $charsets[] = $body.'-8859-'.$number; - $charsets[] = $body.'8859-'.$number; - $charsets[] = strtoupper($body).'-8859-'.$number; - $charsets[] = strtoupper($body).'8859-'.$number; - } - } - - foreach ($charsets as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingWindows125XReaders() - { - $charsets = array(); - foreach (range(0, 8) as $number) { - $charsets[] = 'windows-125'.$number; - $charsets[] = 'windows125'.$number; - $charsets[] = 'WINDOWS-125'.$number; - $charsets[] = 'WINDOWS125'.$number; - } - - foreach ($charsets as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingCodePageReaders() - { - $charsets = array(); - foreach (range(0, 8) as $number) { - $charsets[] = 'cp-125'.$number; - $charsets[] = 'cp125'.$number; - $charsets[] = 'CP-125'.$number; - $charsets[] = 'CP125'.$number; - } - - foreach (array(437, 737, 850, 855, 857, 858, 860, - 861, 863, 865, 866, 869, ) as $number) { - $charsets[] = 'cp-'.$number; - $charsets[] = 'cp'.$number; - $charsets[] = 'CP-'.$number; - $charsets[] = 'CP'.$number; - } - - foreach ($charsets as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingAnsiReader() - { - foreach (array('ansi', 'ANSI') as $ansi) { - $reader = $this->_factory->getReaderFor($ansi); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingMacintoshReader() - { - foreach (array('macintosh', 'MACINTOSH') as $mac) { - $reader = $this->_factory->getReaderFor($mac); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingKOIReaders() - { - $charsets = array(); - foreach (array('7', '8-r', '8-u', '8u', '8r') as $end) { - $charsets[] = 'koi-'.$end; - $charsets[] = 'koi'.$end; - $charsets[] = 'KOI-'.$end; - $charsets[] = 'KOI'.$end; - } - - foreach ($charsets as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingIsciiReaders() - { - foreach (array('iscii', 'ISCII', 'viscii', 'VISCII') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingMIKReader() - { - foreach (array('mik', 'MIK') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingCorkReader() - { - foreach (array('cork', 'CORK', 't1', 'T1') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingUcs2Reader() - { - foreach (array('ucs-2', 'UCS-2', 'ucs2', 'UCS2') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(2, $reader->getInitialByteSize()); - } - } - - public function testCreatingUtf16Reader() - { - foreach (array('utf-16', 'UTF-16', 'utf16', 'UTF16') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(2, $reader->getInitialByteSize()); - } - } - - public function testCreatingUcs4Reader() - { - foreach (array('ucs-4', 'UCS-4', 'ucs4', 'UCS4') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(4, $reader->getInitialByteSize()); - } - } - - public function testCreatingUtf32Reader() - { - foreach (array('utf-32', 'UTF-32', 'utf32', 'UTF32') as $charset) { - $reader = $this->_factory->getReaderFor($charset); - $this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(4, $reader->getInitialByteSize()); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php deleted file mode 100644 index e83c2bf..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -require_once 'swift_required.php'; - -//This is more of a "cross your fingers and hope it works" test! - -class Swift_DependencyContainerAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - public function testNoLookupsFail() - { - $di = Swift_DependencyContainer::getInstance(); - foreach ($di->listItems() as $itemName) { - try { - // to be removed in 6.0 - if ('transport.mail' === $itemName) { - continue; - } - $di->lookup($itemName); - } catch (Swift_DependencyException $e) { - $this->fail($e->getMessage()); - } - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php deleted file mode 100644 index fc5a814..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -require_once 'swift_required.php'; -require_once __DIR__.'/Mime/EmbeddedFileAcceptanceTest.php'; - -class Swift_EmbeddedFileAcceptanceTest extends Swift_Mime_EmbeddedFileAcceptanceTest -{ - protected function _createEmbeddedFile() - { - return Swift_EmbeddedFile::newInstance(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Base64EncoderAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Base64EncoderAcceptanceTest.php deleted file mode 100644 index bada509..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Base64EncoderAcceptanceTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -class Swift_Encoder_Base64EncoderAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_samplesDir; - private $_encoder; - - protected function setUp() - { - $this->_samplesDir = realpath(__DIR__.'/../../../_samples/charsets'); - $this->_encoder = new Swift_Encoder_Base64Encoder(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $sampleDir = $this->_samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - $encodedText = $this->_encoder->encodeString($text); - - $this->assertEquals( - base64_decode($encodedText), $text, - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php deleted file mode 100644 index 442d9a9..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -class Swift_Encoder_QpEncoderAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_samplesDir; - private $_factory; - - protected function setUp() - { - $this->_samplesDir = realpath(__DIR__.'/../../../_samples/charsets'); - $this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $encoding = $encodingDir; - $charStream = new Swift_CharacterStream_ArrayCharacterStream( - $this->_factory, $encoding); - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $sampleDir = $this->_samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - $encodedText = $encoder->encodeString($text); - - foreach (explode("\r\n", $encodedText) as $line) { - $this->assertLessThanOrEqual(76, strlen($line)); - } - - $this->assertEquals( - quoted_printable_decode($encodedText), $text, - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php deleted file mode 100644 index bcb6b95..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -class Swift_Encoder_Rfc2231EncoderAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_samplesDir; - private $_factory; - - protected function setUp() - { - $this->_samplesDir = realpath(__DIR__.'/../../../_samples/charsets'); - $this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $encoding = $encodingDir; - $charStream = new Swift_CharacterStream_ArrayCharacterStream( - $this->_factory, $encoding); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - - $sampleDir = $this->_samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - $encodedText = $encoder->encodeString($text); - - $this->assertEquals( - urldecode(implode('', explode("\r\n", $encodedText))), $text, - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EncodingAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EncodingAcceptanceTest.php deleted file mode 100644 index 6a4d05d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EncodingAcceptanceTest.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -require_once 'swift_required.php'; - -class Swift_EncodingAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - public function testGet7BitEncodingReturns7BitEncoder() - { - $encoder = Swift_Encoding::get7BitEncoding(); - $this->assertEquals('7bit', $encoder->getName()); - } - - public function testGet8BitEncodingReturns8BitEncoder() - { - $encoder = Swift_Encoding::get8BitEncoding(); - $this->assertEquals('8bit', $encoder->getName()); - } - - public function testGetQpEncodingReturnsQpEncoder() - { - $encoder = Swift_Encoding::getQpEncoding(); - $this->assertEquals('quoted-printable', $encoder->getName()); - } - - public function testGetBase64EncodingReturnsBase64Encoder() - { - $encoder = Swift_Encoding::getBase64Encoding(); - $this->assertEquals('base64', $encoder->getName()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php deleted file mode 100644 index 5fab14c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php +++ /dev/null @@ -1,173 +0,0 @@ -<?php - -class Swift_KeyCache_ArrayKeyCacheAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_cache; - private $_key1 = 'key1'; - private $_key2 = 'key2'; - - protected function setUp() - { - $this->_cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - } - - public function testStringDataCanBeSetAndFetched() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeOverwritten() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'foo', 'whatever', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('whatever', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeAppended() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'foo', 'ing', Swift_KeyCache::MODE_APPEND - ); - $this->assertEquals('testing', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testHasKeyReturnValue() - { - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyIsWellPartitioned() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key2, 'foo', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->_cache->getString($this->_key1, 'foo')); - $this->assertEquals('ing', $this->_cache->getString($this->_key2, 'foo')); - } - - public function testItemKeyIsWellPartitioned() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'bar', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->_cache->getString($this->_key1, 'foo')); - $this->assertEquals('ing', $this->_cache->getString($this->_key1, 'bar')); - } - - public function testByteStreamCanBeImported() - { - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('abcdef', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamCanBeAppended() - { - $os1 = new Swift_ByteStream_ArrayByteStream(); - $os1->write('abcdef'); - - $os2 = new Swift_ByteStream_ArrayByteStream(); - $os2->write('xyzuvw'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os1, Swift_KeyCache::MODE_APPEND - ); - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os2, Swift_KeyCache::MODE_APPEND - ); - - $this->assertEquals('abcdefxyzuvw', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamAndStringCanBeAppended() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_APPEND - ); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_APPEND - ); - $this->assertEquals('testabcdef', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testDataCanBeExportedToByteStream() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->_cache->exportToByteStream($this->_key1, 'foo', $is); - - $string = ''; - while (false !== $bytes = $is->read(8192)) { - $string .= $bytes; - } - - $this->assertEquals('test', $string); - } - - public function testKeyCanBeCleared() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - $this->_cache->clearKey($this->_key1, 'foo'); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyCanBeCleared() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'bar', 'xyz', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'bar')); - $this->_cache->clearAll($this->_key1); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'bar')); - } - - public function testKeyCacheInputStream() - { - $is = $this->_cache->getInputByteStream($this->_key1, 'foo'); - $is->write('abc'); - $is->write('xyz'); - $this->assertEquals('abcxyz', $this->_cache->getString($this->_key1, 'foo')); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php deleted file mode 100644 index 0e027c2..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php +++ /dev/null @@ -1,173 +0,0 @@ -<?php - -class Swift_KeyCache_DiskKeyCacheAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_cache; - private $_key1; - private $_key2; - - protected function setUp() - { - $this->_key1 = uniqid(microtime(true), true); - $this->_key2 = uniqid(microtime(true), true); - $this->_cache = new Swift_KeyCache_DiskKeyCache(new Swift_KeyCache_SimpleKeyCacheInputStream(), sys_get_temp_dir()); - } - - public function testStringDataCanBeSetAndFetched() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeOverwritten() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'foo', 'whatever', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('whatever', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeAppended() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'foo', 'ing', Swift_KeyCache::MODE_APPEND - ); - $this->assertEquals('testing', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testHasKeyReturnValue() - { - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyIsWellPartitioned() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key2, 'foo', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->_cache->getString($this->_key1, 'foo')); - $this->assertEquals('ing', $this->_cache->getString($this->_key2, 'foo')); - } - - public function testItemKeyIsWellPartitioned() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'bar', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->_cache->getString($this->_key1, 'foo')); - $this->assertEquals('ing', $this->_cache->getString($this->_key1, 'bar')); - } - - public function testByteStreamCanBeImported() - { - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('abcdef', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamCanBeAppended() - { - $os1 = new Swift_ByteStream_ArrayByteStream(); - $os1->write('abcdef'); - - $os2 = new Swift_ByteStream_ArrayByteStream(); - $os2->write('xyzuvw'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os1, Swift_KeyCache::MODE_APPEND - ); - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os2, Swift_KeyCache::MODE_APPEND - ); - - $this->assertEquals('abcdefxyzuvw', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamAndStringCanBeAppended() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_APPEND - ); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->_cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_APPEND - ); - $this->assertEquals('testabcdef', $this->_cache->getString($this->_key1, 'foo')); - } - - public function testDataCanBeExportedToByteStream() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->_cache->exportToByteStream($this->_key1, 'foo', $is); - - $string = ''; - while (false !== $bytes = $is->read(8192)) { - $string .= $bytes; - } - - $this->assertEquals('test', $string); - } - - public function testKeyCanBeCleared() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - $this->_cache->clearKey($this->_key1, 'foo'); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyCanBeCleared() - { - $this->_cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->_cache->setString( - $this->_key1, 'bar', 'xyz', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'foo')); - $this->assertTrue($this->_cache->hasKey($this->_key1, 'bar')); - $this->_cache->clearAll($this->_key1); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'foo')); - $this->assertFalse($this->_cache->hasKey($this->_key1, 'bar')); - } - - public function testKeyCacheInputStream() - { - $is = $this->_cache->getInputByteStream($this->_key1, 'foo'); - $is->write('abc'); - $is->write('xyz'); - $this->assertEquals('abcxyz', $this->_cache->getString($this->_key1, 'foo')); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php deleted file mode 100644 index 5f4e983..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -require_once 'swift_required.php'; -require_once __DIR__.'/Mime/SimpleMessageAcceptanceTest.php'; - -class Swift_MessageAcceptanceTest extends Swift_Mime_SimpleMessageAcceptanceTest -{ - public function testAddPartWrapper() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $message->addPart('foo', 'text/plain', 'iso-8859-1'); - $message->addPart('test <b>foo</b>', 'text/html', 'iso-8859-1'); - - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'test <b>foo</b>'. - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - protected function _createMessage() - { - Swift_DependencyContainer::getInstance() - ->register('properties.charset')->asValue(null); - - return Swift_Message::newInstance(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php deleted file mode 100644 index 7353d9d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php - -class Swift_Mime_AttachmentAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_contentEncoder; - private $_cache; - private $_grammar; - private $_headers; - - protected function setUp() - { - $this->_cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $this->_contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $this->_grammar = new Swift_Mime_Grammar(); - $this->_headers = new Swift_Mime_SimpleHeaderSet( - new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->_grammar) - ); - } - - public function testDispositionIsSetInHeader() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setDisposition('inline'); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: inline'."\r\n", - $attachment->toString() - ); - } - - public function testDispositionIsAttachmentByDefault() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment'."\r\n", - $attachment->toString() - ); - } - - public function testFilenameIsSetInHeader() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf'."\r\n", - $attachment->toString() - ); - } - - public function testSizeIsSetInHeader() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setSize(12340); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; size=12340'."\r\n", - $attachment->toString() - ); - } - - public function testMultipleParametersInHeader() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setSize(12340); - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf; size=12340'."\r\n", - $attachment->toString() - ); - } - - public function testEndToEnd() - { - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setSize(12340); - $attachment->setBody('abcd'); - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf; size=12340'."\r\n". - "\r\n". - base64_encode('abcd'), - $attachment->toString() - ); - } - - protected function _createAttachment() - { - $entity = new Swift_Mime_Attachment( - $this->_headers, - $this->_contentEncoder, - $this->_cache, - $this->_grammar - ); - - return $entity; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php deleted file mode 100644 index a72f5ff..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -class Swift_Mime_ContentEncoder_Base64ContentEncoderAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_samplesDir; - private $_encoder; - - protected function setUp() - { - $this->_samplesDir = realpath(__DIR__.'/../../../../_samples/charsets'); - $this->_encoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $sampleDir = $this->_samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->_encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEquals( - base64_decode($encoded), $text, - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php deleted file mode 100644 index 0dfc4e2..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -class Swift_Mime_ContentEncoder_NativeQpContentEncoderAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - protected $_samplesDir; - - /** - * @var Swift_Mime_ContentEncoder_NativeQpContentEncoder - */ - protected $_encoder; - - protected function setUp() - { - $this->_samplesDir = realpath(__DIR__.'/../../../../_samples/charsets'); - $this->_encoder = new Swift_Mime_ContentEncoder_NativeQpContentEncoder(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $sampleDir = $this->_samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - $this->_encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEquals( - quoted_printable_decode($encoded), - // CR and LF are converted to CRLF - preg_replace('~\r(?!\n)|(?<!\r)\n~', "\r\n", $text), - '%s: Encoded string should decode back to original string for sample '.$sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } - - public function testEncodingAndDecodingSamplesFromDiConfiguredInstance() - { - $encoder = $this->_createEncoderFromContainer(); - $this->assertSame('=C3=A4=C3=B6=C3=BC=C3=9F', $encoder->encodeString('äöüß')); - } - - /** - * @expectedException \RuntimeException - */ - public function testCharsetChangeNotImplemented() - { - $this->_encoder->charsetChanged('utf-8'); - $this->_encoder->charsetChanged('charset'); - $this->_encoder->encodeString('foo'); - } - - public function testGetName() - { - $this->assertSame('quoted-printable', $this->_encoder->getName()); - } - - private function _createEncoderFromContainer() - { - return Swift_DependencyContainer::getInstance() - ->lookup('mime.nativeqpcontentencoder') - ; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php deleted file mode 100644 index 5eff4e2..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -class Swift_Mime_ContentEncoder_PlainContentEncoderAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_samplesDir; - private $_encoder; - - protected function setUp() - { - $this->_samplesDir = realpath(__DIR__.'/../../../../_samples/charsets'); - $this->_encoder = new Swift_Mime_ContentEncoder_PlainContentEncoder('8bit'); - } - - public function testEncodingAndDecodingSamplesString() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $sampleDir = $this->_samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - $encodedText = $this->_encoder->encodeString($text); - - $this->assertEquals( - $encodedText, $text, - '%s: Encoded string should be identical to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } - - public function testEncodingAndDecodingSamplesByteStream() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $sampleDir = $this->_samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->_encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEquals( - $encoded, $text, - '%s: Encoded string should be identical to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php deleted file mode 100644 index a383b58..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,160 +0,0 @@ -<?php - -class Swift_Mime_ContentEncoder_QpContentEncoderAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_samplesDir; - private $_factory; - - protected function setUp() - { - $this->_samplesDir = realpath(__DIR__.'/../../../../_samples/charsets'); - $this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - protected function tearDown() - { - Swift_Preferences::getInstance()->setQPDotEscape(false); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $encoding = $encodingDir; - $charStream = new Swift_CharacterStream_NgCharacterStream( - $this->_factory, $encoding); - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - - $sampleDir = $this->_samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - $encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEquals( - quoted_printable_decode($encoded), $text, - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } - - public function testEncodingAndDecodingSamplesFromDiConfiguredInstance() - { - $sampleFp = opendir($this->_samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if (substr($encodingDir, 0, 1) == '.') { - continue; - } - - $encoding = $encodingDir; - $encoder = $this->_createEncoderFromContainer(); - - $sampleDir = $this->_samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if (substr($sampleFile, 0, 1) == '.') { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - $encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEquals( - str_replace("\r\n", "\n", quoted_printable_decode($encoded)), str_replace("\r\n", "\n", $text), - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } - - public function testEncodingLFTextWithDiConfiguredInstance() - { - $encoder = $this->_createEncoderFromContainer(); - $this->assertEquals("a\r\nb\r\nc", $encoder->encodeString("a\nb\nc")); - } - - public function testEncodingCRTextWithDiConfiguredInstance() - { - $encoder = $this->_createEncoderFromContainer(); - $this->assertEquals("a\r\nb\r\nc", $encoder->encodeString("a\rb\rc")); - } - - public function testEncodingLFCRTextWithDiConfiguredInstance() - { - $encoder = $this->_createEncoderFromContainer(); - $this->assertEquals("a\r\n\r\nb\r\n\r\nc", $encoder->encodeString("a\n\rb\n\rc")); - } - - public function testEncodingCRLFTextWithDiConfiguredInstance() - { - $encoder = $this->_createEncoderFromContainer(); - $this->assertEquals("a\r\nb\r\nc", $encoder->encodeString("a\r\nb\r\nc")); - } - - public function testEncodingDotStuffingWithDiConfiguredInstance() - { - // Enable DotEscaping - Swift_Preferences::getInstance()->setQPDotEscape(true); - $encoder = $this->_createEncoderFromContainer(); - $this->assertEquals("a=2E\r\n=2E\r\n=2Eb\r\nc", $encoder->encodeString("a.\r\n.\r\n.b\r\nc")); - // Return to default - Swift_Preferences::getInstance()->setQPDotEscape(false); - $encoder = $this->_createEncoderFromContainer(); - $this->assertEquals("a.\r\n.\r\n.b\r\nc", $encoder->encodeString("a.\r\n.\r\n.b\r\nc")); - } - - public function testDotStuffingEncodingAndDecodingSamplesFromDiConfiguredInstance() - { - // Enable DotEscaping - Swift_Preferences::getInstance()->setQPDotEscape(true); - $this->testEncodingAndDecodingSamplesFromDiConfiguredInstance(); - } - - private function _createEncoderFromContainer() - { - return Swift_DependencyContainer::getInstance() - ->lookup('mime.qpcontentencoder') - ; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php deleted file mode 100644 index 0f7aa72..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php - -class Swift_Mime_EmbeddedFileAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_contentEncoder; - private $_cache; - private $_grammar; - private $_headers; - - protected function setUp() - { - $this->_cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $this->_contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $this->_grammar = new Swift_Mime_Grammar(); - $this->_headers = new Swift_Mime_SimpleHeaderSet( - new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->_grammar) - ); - } - - public function testContentIdIsSetInHeader() - { - $file = $this->_createEmbeddedFile(); - $file->setContentType('application/pdf'); - $file->setId('foo@bar'); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <foo@bar>'."\r\n". - 'Content-Disposition: inline'."\r\n", - $file->toString() - ); - } - - public function testDispositionIsSetInHeader() - { - $file = $this->_createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setDisposition('attachment'); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$id.'>'."\r\n". - 'Content-Disposition: attachment'."\r\n", - $file->toString() - ); - } - - public function testFilenameIsSetInHeader() - { - $file = $this->_createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setFilename('foo.pdf'); - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$id.'>'."\r\n". - 'Content-Disposition: inline; filename=foo.pdf'."\r\n", - $file->toString() - ); - } - - public function testSizeIsSetInHeader() - { - $file = $this->_createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setSize(12340); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$id.'>'."\r\n". - 'Content-Disposition: inline; size=12340'."\r\n", - $file->toString() - ); - } - - public function testMultipleParametersInHeader() - { - $file = $this->_createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setFilename('foo.pdf'); - $file->setSize(12340); - - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$id.'>'."\r\n". - 'Content-Disposition: inline; filename=foo.pdf; size=12340'."\r\n", - $file->toString() - ); - } - - public function testEndToEnd() - { - $file = $this->_createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setFilename('foo.pdf'); - $file->setSize(12340); - $file->setBody('abcd'); - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$id.'>'."\r\n". - 'Content-Disposition: inline; filename=foo.pdf; size=12340'."\r\n". - "\r\n". - base64_encode('abcd'), - $file->toString() - ); - } - - protected function _createEmbeddedFile() - { - $entity = new Swift_Mime_EmbeddedFile( - $this->_headers, - $this->_contentEncoder, - $this->_cache, - $this->_grammar - ); - - return $entity; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php deleted file mode 100644 index e3fad6d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -class Swift_Mime_HeaderEncoder_Base64HeaderEncoderAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_encoder; - - protected function setUp() - { - $this->_encoder = new Swift_Mime_HeaderEncoder_Base64HeaderEncoder(); - } - - public function testEncodingJIS() - { - if (function_exists('mb_convert_encoding')) { - // base64_encode and split cannot handle long JIS text to fold - $subject = '長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い件名'; - - $encodedWrapperLength = strlen('=?iso-2022-jp?'.$this->_encoder->getName().'??='); - - $old = mb_internal_encoding(); - mb_internal_encoding('utf-8'); - $newstring = mb_encode_mimeheader($subject, 'iso-2022-jp', 'B', "\r\n"); - mb_internal_encoding($old); - - $encoded = $this->_encoder->encodeString($subject, 0, 75 - $encodedWrapperLength, 'iso-2022-jp'); - $this->assertEquals( - $encoded, $newstring, - 'Encoded string should decode back to original string for sample ' - ); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php deleted file mode 100644 index a7f6fc5..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php +++ /dev/null @@ -1,127 +0,0 @@ -<?php - -class Swift_Mime_MimePartAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - private $_contentEncoder; - private $_cache; - private $_grammar; - private $_headers; - - protected function setUp() - { - $this->_cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $this->_contentEncoder = new Swift_Mime_ContentEncoder_QpContentEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'), - new Swift_StreamFilters_ByteArrayReplacementFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ) - ); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $this->_grammar = new Swift_Mime_Grammar(); - $this->_headers = new Swift_Mime_SimpleHeaderSet( - new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->_grammar) - ); - } - - public function testCharsetIsSetInHeader() - { - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('utf-8'); - $part->setBody('foobar'); - $this->assertEquals( - 'Content-Type: text/plain; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foobar', - $part->toString() - ); - } - - public function testFormatIsSetInHeaders() - { - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setFormat('flowed'); - $part->setBody('> foobar'); - $this->assertEquals( - 'Content-Type: text/plain; format=flowed'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - '> foobar', - $part->toString() - ); - } - - public function testDelSpIsSetInHeaders() - { - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setDelSp(true); - $part->setBody('foobar'); - $this->assertEquals( - 'Content-Type: text/plain; delsp=yes'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foobar', - $part->toString() - ); - } - - public function testAll3ParamsInHeaders() - { - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('utf-8'); - $part->setFormat('fixed'); - $part->setDelSp(true); - $part->setBody('foobar'); - $this->assertEquals( - 'Content-Type: text/plain; charset=utf-8; format=fixed; delsp=yes'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foobar', - $part->toString() - ); - } - - public function testBodyIsCanonicalized() - { - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('utf-8'); - $part->setBody("foobar\r\rtest\ning\r"); - $this->assertEquals( - 'Content-Type: text/plain; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - "foobar\r\n". - "\r\n". - "test\r\n". - "ing\r\n", - $part->toString() - ); - } - - protected function _createMimePart() - { - $entity = new Swift_Mime_MimePart( - $this->_headers, - $this->_contentEncoder, - $this->_cache, - $this->_grammar - ); - - return $entity; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php deleted file mode 100644 index 912768e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php +++ /dev/null @@ -1,1249 +0,0 @@ -<?php - -class Swift_Mime_SimpleMessageAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - Swift_Preferences::getInstance()->setCharset(null); //TODO: Test with the charset defined - } - - public function testBasicHeaders() - { - /* -- RFC 2822, 3.6. - */ - - $message = $this->_createMessage(); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString(), - '%s: Only required headers, and non-empty headers should be displayed' - ); - } - - public function testSubjectIsDisplayedIfSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testDateCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $id = $message->getId(); - $message->setDate(1234); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', 1234)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMessageIdCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setId('foo@bar'); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <foo@bar>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testContentTypeCanBeChanged() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setContentType('text/html'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/html'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testCharsetCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setContentType('text/html'); - $message->setCharset('iso-8859-1'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testFormatCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFormat('flowed'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain; format=flowed'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testEncoderCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setContentType('text/html'); - $message->setEncoder( - new Swift_Mime_ContentEncoder_PlainContentEncoder('7bit') - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/html'."\r\n". - 'Content-Transfer-Encoding: 7bit'."\r\n", - $message->toString() - ); - } - - public function testFromAddressCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom('chris.corbyn@swiftmailer.org'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: chris.corbyn@swiftmailer.org'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testFromAddressCanBeSetWithName() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMultipleFromAddressesCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org', - )); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>, mark@swiftmailer.org'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testReturnPathAddressCanBeSet() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testEmptyReturnPathHeaderCanBeUsed() - { - $message = $this->_createMessage(); - $message->setReturnPath(''); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Return-Path: <>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testSenderCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setSender('chris.corbyn@swiftmailer.org'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Sender: chris.corbyn@swiftmailer.org'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testSenderCanBeSetWithName() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setSender(array('chris.corbyn@swiftmailer.org' => 'Chris')); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Sender: Chris <chris.corbyn@swiftmailer.org>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testReplyToCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org' => 'Chris')); - $message->setReplyTo(array('chris@w3style.co.uk' => 'Myself')); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris <chris.corbyn@swiftmailer.org>'."\r\n". - 'Reply-To: Myself <chris@w3style.co.uk>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMultipleReplyAddressCanBeUsed() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org' => 'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - )); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris <chris.corbyn@swiftmailer.org>'."\r\n". - 'Reply-To: Myself <chris@w3style.co.uk>, Me <my.other@address.com>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testToAddressCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org' => 'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - )); - $message->setTo('mark@swiftmailer.org'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris <chris.corbyn@swiftmailer.org>'."\r\n". - 'Reply-To: Myself <chris@w3style.co.uk>, Me <my.other@address.com>'."\r\n". - 'To: mark@swiftmailer.org'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMultipleToAddressesCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org' => 'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - )); - $message->setTo(array( - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn', - )); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris <chris.corbyn@swiftmailer.org>'."\r\n". - 'Reply-To: Myself <chris@w3style.co.uk>, Me <my.other@address.com>'."\r\n". - 'To: mark@swiftmailer.org, Chris Corbyn <chris@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testCcAddressCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org' => 'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - )); - $message->setTo(array( - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn', - )); - $message->setCc('john@some-site.com'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris <chris.corbyn@swiftmailer.org>'."\r\n". - 'Reply-To: Myself <chris@w3style.co.uk>, Me <my.other@address.com>'."\r\n". - 'To: mark@swiftmailer.org, Chris Corbyn <chris@swiftmailer.org>'."\r\n". - 'Cc: john@some-site.com'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMultipleCcAddressesCanBeSet() - { - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org' => 'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - )); - $message->setTo(array( - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn', - )); - $message->setCc(array( - 'john@some-site.com' => 'John West', - 'fred@another-site.co.uk' => 'Big Fred', - )); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris <chris.corbyn@swiftmailer.org>'."\r\n". - 'Reply-To: Myself <chris@w3style.co.uk>, Me <my.other@address.com>'."\r\n". - 'To: mark@swiftmailer.org, Chris Corbyn <chris@swiftmailer.org>'."\r\n". - 'Cc: John West <john@some-site.com>, Big Fred <fred@another-site.co.uk>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testBccAddressCanBeSet() - { - //Obviously Transports need to setBcc(array()) and send to each Bcc recipient - // separately in accordance with RFC 2822/2821 - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org' => 'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - )); - $message->setTo(array( - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn', - )); - $message->setCc(array( - 'john@some-site.com' => 'John West', - 'fred@another-site.co.uk' => 'Big Fred', - )); - $message->setBcc('x@alphabet.tld'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris <chris.corbyn@swiftmailer.org>'."\r\n". - 'Reply-To: Myself <chris@w3style.co.uk>, Me <my.other@address.com>'."\r\n". - 'To: mark@swiftmailer.org, Chris Corbyn <chris@swiftmailer.org>'."\r\n". - 'Cc: John West <john@some-site.com>, Big Fred <fred@another-site.co.uk>'."\r\n". - 'Bcc: x@alphabet.tld'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMultipleBccAddressesCanBeSet() - { - //Obviously Transports need to setBcc(array()) and send to each Bcc recipient - // separately in accordance with RFC 2822/2821 - $message = $this->_createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(array('chris.corbyn@swiftmailer.org' => 'Chris')); - $message->setReplyTo(array( - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - )); - $message->setTo(array( - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn', - )); - $message->setCc(array( - 'john@some-site.com' => 'John West', - 'fred@another-site.co.uk' => 'Big Fred', - )); - $message->setBcc(array('x@alphabet.tld', 'a@alphabet.tld' => 'A')); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris <chris.corbyn@swiftmailer.org>'."\r\n". - 'Reply-To: Myself <chris@w3style.co.uk>, Me <my.other@address.com>'."\r\n". - 'To: mark@swiftmailer.org, Chris Corbyn <chris@swiftmailer.org>'."\r\n". - 'Cc: John West <john@some-site.com>, Big Fred <fred@another-site.co.uk>'."\r\n". - 'Bcc: x@alphabet.tld, A <a@alphabet.tld>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testStringBodyIsAppended() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - $message->setBody( - 'just a test body'."\r\n". - 'with a new line' - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'just a test body'."\r\n". - 'with a new line', - $message->toString() - ); - } - - public function testStringBodyIsEncoded() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - $message->setBody( - 'Just s'.pack('C*', 0xC2, 0x01, 0x01).'me multi-'."\r\n". - 'line message!' - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'Just s=C2=01=01me multi-'."\r\n". - 'line message!', - $message->toString() - ); - } - - public function testChildrenCanBeAttached() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $part1 = $this->_createMimePart(); - $part1->setContentType('text/plain'); - $part1->setCharset('iso-8859-1'); - $part1->setBody('foo'); - - $message->attach($part1); - - $part2 = $this->_createMimePart(); - $part2->setContentType('text/html'); - $part2->setCharset('iso-8859-1'); - $part2->setBody('test <b>foo</b>'); - - $message->attach($part2); - - $this->assertEquals( - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'test <b>foo</b>'. - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - public function testAttachmentsBeingAttached() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo'); - - $message->attach($part); - - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody('<pdf data>'); - - $message->attach($attachment); - - $this->assertRegExp( - '~^'. - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf'."\r\n". - "\r\n". - preg_quote(base64_encode('<pdf data>'), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString() - ); - } - - public function testAttachmentsAndEmbeddedFilesBeingAttached() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo'); - - $message->attach($part); - - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody('<pdf data>'); - - $message->attach($attachment); - - $file = $this->_createEmbeddedFile(); - $file->setContentType('image/jpeg'); - $file->setFilename('myimage.jpg'); - $file->setBody('<image data>'); - - $message->attach($file); - - $cid = $file->getId(); - - $this->assertRegExp( - '~^'. - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\2'."\r\n". - 'Content-Type: image/jpeg; name=myimage.jpg'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$cid.'>'."\r\n". - 'Content-Disposition: inline; filename=myimage.jpg'."\r\n". - "\r\n". - preg_quote(base64_encode('<image data>'), '~'). - "\r\n\r\n". - '--\\2--'."\r\n". - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf'."\r\n". - "\r\n". - preg_quote(base64_encode('<pdf data>'), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString() - ); - } - - public function testComplexEmbeddingOfContent() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody('<pdf data>'); - - $message->attach($attachment); - - $file = $this->_createEmbeddedFile(); - $file->setContentType('image/jpeg'); - $file->setFilename('myimage.jpg'); - $file->setBody('<image data>'); - - $part = $this->_createMimePart(); - $part->setContentType('text/html'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo <img src="'.$message->embed($file).'" />'); - - $message->attach($part); - - $cid = $file->getId(); - - $this->assertRegExp( - '~^'. - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo <img src=3D"cid:'.$cid.'" />'.//=3D is just = in QP - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: image/jpeg; name=myimage.jpg'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$cid.'>'."\r\n". - 'Content-Disposition: inline; filename=myimage.jpg'."\r\n". - "\r\n". - preg_quote(base64_encode('<image data>'), '~'). - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf'."\r\n". - "\r\n". - preg_quote(base64_encode('<pdf data>'), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString() - ); - } - - public function testAttachingAndDetachingContent() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $part = $this->_createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo'); - - $message->attach($part); - - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody('<pdf data>'); - - $message->attach($attachment); - - $file = $this->_createEmbeddedFile(); - $file->setContentType('image/jpeg'); - $file->setFilename('myimage.jpg'); - $file->setBody('<image data>'); - - $message->attach($file); - - $cid = $file->getId(); - - $message->detach($attachment); - - $this->assertRegExp( - '~^'. - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: image/jpeg; name=myimage.jpg'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$cid.'>'."\r\n". - 'Content-Disposition: inline; filename=myimage.jpg'."\r\n". - "\r\n". - preg_quote(base64_encode('<image data>'), '~'). - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString(), - '%s: Attachment should have been detached' - ); - } - - public function testBoundaryDoesNotAppearAfterAllPartsAreDetached() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $part1 = $this->_createMimePart(); - $part1->setContentType('text/plain'); - $part1->setCharset('iso-8859-1'); - $part1->setBody('foo'); - - $message->attach($part1); - - $part2 = $this->_createMimePart(); - $part2->setContentType('text/html'); - $part2->setCharset('iso-8859-1'); - $part2->setBody('test <b>foo</b>'); - - $message->attach($part2); - - $message->detach($part1); - $message->detach($part2); - - $this->assertEquals( - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString(), - '%s: Message should be restored to orignal state after parts are detached' - ); - } - - public function testCharsetFormatOrDelSpAreNotShownWhenBoundaryIsSet() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - $message->setCharset('utf-8'); - $message->setFormat('flowed'); - $message->setDelSp(true); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $part1 = $this->_createMimePart(); - $part1->setContentType('text/plain'); - $part1->setCharset('iso-8859-1'); - $part1->setBody('foo'); - - $message->attach($part1); - - $part2 = $this->_createMimePart(); - $part2->setContentType('text/html'); - $part2->setCharset('iso-8859-1'); - $part2->setBody('test <b>foo</b>'); - - $message->attach($part2); - - $this->assertEquals( - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'test <b>foo</b>'. - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - public function testBodyCanBeSetWithAttachments() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - $message->setContentType('text/html'); - $message->setCharset('iso-8859-1'); - $message->setBody('foo'); - - $id = $message->getId(); - $date = date('r', $message->getDate()); - $boundary = $message->getBoundary(); - - $attachment = $this->_createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody('<pdf data>'); - - $message->attach($attachment); - - $this->assertEquals( - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf'."\r\n". - "\r\n". - base64_encode('<pdf data>'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - public function testHtmlPartAlwaysAppearsLast() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - - $id = $message->getId(); - $date = date('r', $message->getDate()); - $boundary = $message->getBoundary(); - - $part1 = $this->_createMimePart(); - $part1->setContentType('text/html'); - $part1->setBody('foo'); - - $part2 = $this->_createMimePart(); - $part2->setContentType('text/plain'); - $part2->setBody('bar'); - - $message->attach($part1); - $message->attach($part2); - - $this->assertEquals( - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'bar'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - public function testBodyBecomesPartIfOtherPartsAttached() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - $message->setContentType('text/html'); - $message->setBody('foo'); - - $id = $message->getId(); - $date = date('r', $message->getDate()); - $boundary = $message->getBoundary(); - - $part2 = $this->_createMimePart(); - $part2->setContentType('text/plain'); - $part2->setBody('bar'); - - $message->attach($part2); - - $this->assertEquals( - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'bar'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - public function testBodyIsCanonicalized() - { - $message = $this->_createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom(array( - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', )); - $message->setBody( - 'just a test body'."\n". - 'with a new line' - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Return-Path: <chris@w3style.co.uk>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.date('r', $date)."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn <chris.corbyn@swiftmailer.org>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'just a test body'."\r\n". - 'with a new line', - $message->toString() - ); - } - - protected function _createMessage() - { - return new Swift_Message(); - } - - protected function _createMimePart() - { - return new Swift_MimePart(); - } - - protected function _createAttachment() - { - return new Swift_Attachment(); - } - - protected function _createEmbeddedFile() - { - return new Swift_EmbeddedFile(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php deleted file mode 100644 index f42405d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -require_once 'swift_required.php'; -require_once __DIR__.'/Mime/MimePartAcceptanceTest.php'; - -class Swift_MimePartAcceptanceTest extends Swift_Mime_MimePartAcceptanceTest -{ - protected function _createMimePart() - { - Swift_DependencyContainer::getInstance() - ->register('properties.charset')->asValue(null); - - return Swift_MimePart::newInstance(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php deleted file mode 100644 index 21abc13..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php +++ /dev/null @@ -1,131 +0,0 @@ -<?php - -abstract class Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest extends \PHPUnit_Framework_TestCase -{ - protected $_buffer; - - abstract protected function _initializeBuffer(); - - protected function setUp() - { - if (true == getenv('TRAVIS')) { - $this->markTestSkipped( - 'Will fail on travis-ci if not skipped due to travis blocking '. - 'socket mailing tcp connections.' - ); - } - - $this->_buffer = new Swift_Transport_StreamBuffer( - $this->getMockBuilder('Swift_ReplacementFilterFactory')->getMock() - ); - } - - public function testReadLine() - { - $this->_initializeBuffer(); - - $line = $this->_buffer->readLine(0); - $this->assertRegExp('/^[0-9]{3}.*?\r\n$/D', $line); - $seq = $this->_buffer->write("QUIT\r\n"); - $this->assertTrue((bool) $seq); - $line = $this->_buffer->readLine($seq); - $this->assertRegExp('/^[0-9]{3}.*?\r\n$/D', $line); - $this->_buffer->terminate(); - } - - public function testWrite() - { - $this->_initializeBuffer(); - - $line = $this->_buffer->readLine(0); - $this->assertRegExp('/^[0-9]{3}.*?\r\n$/D', $line); - - $seq = $this->_buffer->write("HELO foo\r\n"); - $this->assertTrue((bool) $seq); - $line = $this->_buffer->readLine($seq); - $this->assertRegExp('/^[0-9]{3}.*?\r\n$/D', $line); - - $seq = $this->_buffer->write("QUIT\r\n"); - $this->assertTrue((bool) $seq); - $line = $this->_buffer->readLine($seq); - $this->assertRegExp('/^[0-9]{3}.*?\r\n$/D', $line); - $this->_buffer->terminate(); - } - - public function testBindingOtherStreamsMirrorsWriteOperations() - { - $this->_initializeBuffer(); - - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->at(0)) - ->method('write') - ->with('x'); - $is2->expects($this->at(1)) - ->method('write') - ->with('y'); - - $this->_buffer->bind($is1); - $this->_buffer->bind($is2); - - $this->_buffer->write('x'); - $this->_buffer->write('y'); - } - - public function testBindingOtherStreamsMirrorsFlushOperations() - { - $this->_initializeBuffer(); - - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $is1->expects($this->once()) - ->method('flushBuffers'); - $is2->expects($this->once()) - ->method('flushBuffers'); - - $this->_buffer->bind($is1); - $this->_buffer->bind($is2); - - $this->_buffer->flushBuffers(); - } - - public function testUnbindingStreamPreventsFurtherWrites() - { - $this->_initializeBuffer(); - - $is1 = $this->_createMockInputStream(); - $is2 = $this->_createMockInputStream(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->once()) - ->method('write') - ->with('x'); - - $this->_buffer->bind($is1); - $this->_buffer->bind($is2); - - $this->_buffer->write('x'); - - $this->_buffer->unbind($is2); - - $this->_buffer->write('y'); - } - - private function _createMockInputStream() - { - return $this->getMockBuilder('Swift_InputByteStream')->getMock(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php deleted file mode 100644 index 58f406c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -require_once __DIR__ . '/AbstractStreamBufferAcceptanceTest.php'; - -class Swift_Transport_StreamBuffer_BasicSocketAcceptanceTest extends Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest -{ - protected function setUp() - { - if (!defined('SWIFT_SMTP_HOST')) { - $this->markTestSkipped( - 'Cannot run test without an SMTP host to connect to (define '. - 'SWIFT_SMTP_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - parent::setUp(); - } - - protected function _initializeBuffer() - { - $parts = explode(':', SWIFT_SMTP_HOST); - $host = $parts[0]; - $port = isset($parts[1]) ? $parts[1] : 25; - - $this->_buffer->initialize(array( - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'tcp', - 'blocking' => 1, - 'timeout' => 15, - )); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php deleted file mode 100644 index 6abeb74..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -require_once __DIR__ . '/AbstractStreamBufferAcceptanceTest.php'; - -class Swift_Transport_StreamBuffer_ProcessAcceptanceTest extends Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest -{ - protected function setUp() - { - if (!defined('SWIFT_SENDMAIL_PATH')) { - $this->markTestSkipped( - 'Cannot run test without a path to sendmail (define '. - 'SWIFT_SENDMAIL_PATH in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - parent::setUp(); - } - - protected function _initializeBuffer() - { - $this->_buffer->initialize(array( - 'type' => Swift_Transport_IoBuffer::TYPE_PROCESS, - 'command' => SWIFT_SENDMAIL_PATH.' -bs', - )); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php deleted file mode 100644 index 59362b0..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -class Swift_Transport_StreamBuffer_SocketTimeoutTest extends \PHPUnit_Framework_TestCase -{ - protected $_buffer; - - protected $_randomHighPort; - - protected $_server; - - protected function setUp() - { - if (!defined('SWIFT_SMTP_HOST')) { - $this->markTestSkipped( - 'Cannot run test without an SMTP host to connect to (define '. - 'SWIFT_SMTP_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - $serverStarted = false; - for ($i = 0; $i < 5; ++$i) { - $this->_randomHighPort = rand(50000, 65000); - $this->_server = stream_socket_server('tcp://127.0.0.1:'.$this->_randomHighPort); - if ($this->_server) { - $serverStarted = true; - } - } - - $this->_buffer = new Swift_Transport_StreamBuffer( - $this->getMockBuilder('Swift_ReplacementFilterFactory')->getMock() - ); - } - - protected function _initializeBuffer() - { - $host = '127.0.0.1'; - $port = $this->_randomHighPort; - - $this->_buffer->initialize(array( - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'tcp', - 'blocking' => 1, - 'timeout' => 1, - )); - } - - public function testTimeoutException() - { - $this->_initializeBuffer(); - $e = null; - try { - $line = $this->_buffer->readLine(0); - } catch (Exception $e) { - } - $this->assertInstanceOf('Swift_IoException', $e, 'IO Exception Not Thrown On Connection Timeout'); - $this->assertRegExp('/Connection to .* Timed Out/', $e->getMessage()); - } - - protected function tearDown() - { - if ($this->_server) { - stream_socket_shutdown($this->_server, STREAM_SHUT_RDWR); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php deleted file mode 100644 index e766f41..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -require_once __DIR__ . '/AbstractStreamBufferAcceptanceTest.php'; - -class Swift_Transport_StreamBuffer_SslSocketAcceptanceTest extends Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest -{ - protected function setUp() - { - $streams = stream_get_transports(); - if (!in_array('ssl', $streams)) { - $this->markTestSkipped( - 'SSL is not configured for your system. It is not possible to run this test' - ); - } - if (!defined('SWIFT_SSL_HOST')) { - $this->markTestSkipped( - 'Cannot run test without an SSL enabled SMTP host to connect to (define '. - 'SWIFT_SSL_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - parent::setUp(); - } - - protected function _initializeBuffer() - { - $parts = explode(':', SWIFT_SSL_HOST); - $host = $parts[0]; - $port = isset($parts[1]) ? $parts[1] : 25; - - $this->_buffer->initialize(array( - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'ssl', - 'blocking' => 1, - 'timeout' => 15, - )); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php deleted file mode 100644 index dd3e09a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -require_once __DIR__ . '/AbstractStreamBufferAcceptanceTest.php'; - -class Swift_Transport_StreamBuffer_TlsSocketAcceptanceTest extends Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest -{ - protected function setUp() - { - $streams = stream_get_transports(); - if (!in_array('tls', $streams)) { - $this->markTestSkipped( - 'TLS is not configured for your system. It is not possible to run this test' - ); - } - if (!defined('SWIFT_TLS_HOST')) { - $this->markTestSkipped( - 'Cannot run test without a TLS enabled SMTP host to connect to (define '. - 'SWIFT_TLS_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - parent::setUp(); - } - - protected function _initializeBuffer() - { - $parts = explode(':', SWIFT_TLS_HOST); - $host = $parts[0]; - $port = isset($parts[1]) ? $parts[1] : 25; - - $this->_buffer->initialize(array( - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'tls', - 'blocking' => 1, - 'timeout' => 15, - )); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bootstrap.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bootstrap.php deleted file mode 100644 index 8710870..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bootstrap.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -require_once dirname(__DIR__).'/vendor/autoload.php'; - -// Disable garbage collector to prevent segfaults -gc_disable(); - -set_include_path(get_include_path().PATH_SEPARATOR.dirname(__DIR__).'/lib'); - -Mockery::getConfiguration()->allowMockingNonExistentMethods(true); - -if (is_file(__DIR__.'/acceptance.conf.php')) { - require_once __DIR__.'/acceptance.conf.php'; -} -if (is_file(__DIR__.'/smoke.conf.php')) { - require_once __DIR__.'/smoke.conf.php'; -} -require_once __DIR__ . '/StreamCollector.php'; -require_once __DIR__ . '/IdenticalBinaryConstraint.php'; -require_once __DIR__ . '/SwiftMailerTestCase.php'; -require_once __DIR__ . '/SwiftMailerSmokeTestCase.php'; diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php deleted file mode 100644 index ba29ba8..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -class Swift_Bug111Test extends \PHPUnit_Framework_TestCase -{ - public function testUnstructuredHeaderSlashesShouldNotBeEscaped() - { - $complicated_header = array( - 'to' => array( - 'email1@example.com', - 'email2@example.com', - 'email3@example.com', - 'email4@example.com', - 'email5@example.com', - ), - 'sub' => array( - '-name-' => array( - 'email1', - '"email2"', - 'email3\\', - 'email4', - 'email5', - ), - '-url-' => array( - 'http://google.com', - 'http://yahoo.com', - 'http://hotmail.com', - 'http://aol.com', - 'http://facebook.com', - ), - ), - ); - $json = json_encode($complicated_header); - - $message = new Swift_Message(); - $headers = $message->getHeaders(); - $headers->addTextHeader('X-SMTPAPI', $json); - $header = $headers->get('X-SMTPAPI'); - - $this->assertEquals('Swift_Mime_Headers_UnstructuredHeader', get_class($header)); - $this->assertEquals($json, $header->getFieldBody()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php deleted file mode 100644 index 40b5a77..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -class Swift_Bug118Test extends \PHPUnit_Framework_TestCase -{ - private $_message; - - protected function setUp() - { - $this->_message = new Swift_Message(); - } - - public function testCallingGenerateIdChangesTheMessageId() - { - $currentId = $this->_message->getId(); - $this->_message->generateId(); - $newId = $this->_message->getId(); - - $this->assertNotEquals($currentId, $newId); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php deleted file mode 100644 index 7563f4d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -class Swift_Bug206Test extends \PHPUnit_Framework_TestCase -{ - private $_factory; - - protected function setUp() - { - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $grammar = new Swift_Mime_Grammar(); - $this->_factory = new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $grammar); - } - - public function testMailboxHeaderEncoding() - { - $this->_testHeaderIsFullyEncoded('email@example.org', 'Family Name, Name', ' "Family Name, Name" <email@example.org>'); - $this->_testHeaderIsFullyEncoded('email@example.org', 'Family Namé, Name', ' Family =?utf-8?Q?Nam=C3=A9=2C?= Name'); - $this->_testHeaderIsFullyEncoded('email@example.org', 'Family Namé , Name', ' Family =?utf-8?Q?Nam=C3=A9_=2C?= Name'); - $this->_testHeaderIsFullyEncoded('email@example.org', 'Family Namé ;Name', ' Family =?utf-8?Q?Nam=C3=A9_=3BName?= '); - } - - private function _testHeaderIsFullyEncoded($email, $name, $expected) - { - $mailboxHeader = $this->_factory->createMailboxHeader('To', array( - $email => $name, - )); - - $headerBody = substr($mailboxHeader->toString(), 3, strlen($expected)); - - $this->assertEquals($expected, $headerBody); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php deleted file mode 100644 index f5f057a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -class Swift_Bug274Test extends \PHPUnit_Framework_TestCase -{ - public function testEmptyFileNameAsAttachment() - { - $message = new Swift_Message(); - $this->setExpectedException('Swift_IoException', 'The path cannot be empty'); - $message->attach(Swift_Attachment::fromPath('')); - } - - public function testNonEmptyFileNameAsAttachment() - { - $message = new Swift_Message(); - try { - $message->attach(Swift_Attachment::fromPath(__FILE__)); - } catch (Exception $e) { - $this->fail('Path should not be empty'); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php deleted file mode 100644 index 768bf3d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - -class Swift_Bug34Test extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - Swift_Preferences::getInstance()->setCharset('utf-8'); - } - - public function testEmbeddedFilesWithMultipartDataCreateMultipartRelatedContentAsAnAlternative() - { - $message = Swift_Message::newInstance(); - $message->setCharset('utf-8'); - $message->setSubject('test subject'); - $message->addPart('plain part', 'text/plain'); - - $image = Swift_Image::newInstance('<image data>', 'image.gif', 'image/gif'); - $cid = $message->embed($image); - - $message->setBody('<img src="'.$cid.'" />', 'text/html'); - - $message->setTo(array('user@domain.tld' => 'User')); - - $message->setFrom(array('other@domain.tld' => 'Other')); - $message->setSender(array('other@domain.tld' => 'Other')); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - $cidVal = $image->getId(); - - $this->assertRegExp( - '~^'. - 'Sender: Other <other@domain.tld>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: test subject'."\r\n". - 'From: Other <other@domain.tld>'."\r\n". - 'To: User <user@domain.tld>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'plain part'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/html; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - '<img.*?/>'. - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: image/gif; name=image.gif'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$cidVal.'>'."\r\n". - 'Content-Disposition: inline; filename=image.gif'."\r\n". - "\r\n". - preg_quote(base64_encode('<image data>'), '~'). - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString() - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php deleted file mode 100644 index 98999f0..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -class Swift_Bug35Test extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - Swift_Preferences::getInstance()->setCharset('utf-8'); - } - - public function testHTMLPartAppearsLastEvenWhenAttachmentsAdded() - { - $message = Swift_Message::newInstance(); - $message->setCharset('utf-8'); - $message->setSubject('test subject'); - $message->addPart('plain part', 'text/plain'); - - $attachment = Swift_Attachment::newInstance('<data>', 'image.gif', 'image/gif'); - $message->attach($attachment); - - $message->setBody('HTML part', 'text/html'); - - $message->setTo(array('user@domain.tld' => 'User')); - - $message->setFrom(array('other@domain.tld' => 'Other')); - $message->setSender(array('other@domain.tld' => 'Other')); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $this->assertRegExp( - '~^'. - 'Sender: Other <other@domain.tld>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: test subject'."\r\n". - 'From: Other <other@domain.tld>'."\r\n". - 'To: User <user@domain.tld>'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/plain; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'plain part'. - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/html; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'HTML part'. - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: image/gif; name=image.gif'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=image.gif'."\r\n". - "\r\n". - preg_quote(base64_encode('<data>'), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString() - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php deleted file mode 100644 index 534713a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php +++ /dev/null @@ -1,192 +0,0 @@ -<?php - -class Swift_Bug38Test extends \PHPUnit_Framework_TestCase -{ - private $_attFile; - private $_attFileName; - private $_attFileType; - - protected function setUp() - { - $this->_attFileName = 'data.txt'; - $this->_attFileType = 'text/plain'; - $this->_attFile = __DIR__ . '/../../_samples/files/data.txt'; - Swift_Preferences::getInstance()->setCharset('utf-8'); - } - - public function testWritingMessageToByteStreamProducesCorrectStructure() - { - $message = new Swift_Message(); - $message->setSubject('test subject'); - $message->setTo('user@domain.tld'); - $message->setCc('other@domain.tld'); - $message->setFrom('user@domain.tld'); - - $image = new Swift_Image('<data>', 'image.gif', 'image/gif'); - - $cid = $message->embed($image); - $message->setBody('HTML part', 'text/html'); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - $imgId = $image->getId(); - - $stream = new Swift_ByteStream_ArrayByteStream(); - - $message->toByteStream($stream); - - $this->assertPatternInStream( - '~^'. - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: test subject'."\r\n". - 'From: user@domain.tld'."\r\n". - 'To: user@domain.tld'."\r\n". - 'Cc: other@domain.tld'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'HTML part'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: image/gif; name=image.gif'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.preg_quote($imgId, '~').'>'."\r\n". - 'Content-Disposition: inline; filename=image.gif'."\r\n". - "\r\n". - preg_quote(base64_encode('<data>'), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $stream - ); - } - - public function testWritingMessageToByteStreamTwiceProducesCorrectStructure() - { - $message = new Swift_Message(); - $message->setSubject('test subject'); - $message->setTo('user@domain.tld'); - $message->setCc('other@domain.tld'); - $message->setFrom('user@domain.tld'); - - $image = new Swift_Image('<data>', 'image.gif', 'image/gif'); - - $cid = $message->embed($image); - $message->setBody('HTML part', 'text/html'); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - $imgId = $image->getId(); - - $pattern = '~^'. - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: test subject'."\r\n". - 'From: user@domain.tld'."\r\n". - 'To: user@domain.tld'."\r\n". - 'Cc: other@domain.tld'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'HTML part'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: image/gif; name=image.gif'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.preg_quote($imgId, '~').'>'."\r\n". - 'Content-Disposition: inline; filename=image.gif'."\r\n". - "\r\n". - preg_quote(base64_encode('<data>'), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D' - ; - - $streamA = new Swift_ByteStream_ArrayByteStream(); - $streamB = new Swift_ByteStream_ArrayByteStream(); - - $message->toByteStream($streamA); - $message->toByteStream($streamB); - - $this->assertPatternInStream($pattern, $streamA); - $this->assertPatternInStream($pattern, $streamB); - } - - public function testWritingMessageToByteStreamTwiceUsingAFileAttachment() - { - $message = new Swift_Message(); - $message->setSubject('test subject'); - $message->setTo('user@domain.tld'); - $message->setCc('other@domain.tld'); - $message->setFrom('user@domain.tld'); - - $attachment = Swift_Attachment::fromPath($this->_attFile); - - $message->attach($attachment); - - $message->setBody('HTML part', 'text/html'); - - $id = $message->getId(); - $date = preg_quote(date('r', $message->getDate()), '~'); - $boundary = $message->getBoundary(); - - $streamA = new Swift_ByteStream_ArrayByteStream(); - $streamB = new Swift_ByteStream_ArrayByteStream(); - - $pattern = '~^'. - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: test subject'."\r\n". - 'From: user@domain.tld'."\r\n". - 'To: user@domain.tld'."\r\n". - 'Cc: other@domain.tld'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'HTML part'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: '.$this->_attFileType.'; name='.$this->_attFileName."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename='.$this->_attFileName."\r\n". - "\r\n". - preg_quote(base64_encode(file_get_contents($this->_attFile)), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D' - ; - - $message->toByteStream($streamA); - $message->toByteStream($streamB); - - $this->assertPatternInStream($pattern, $streamA); - $this->assertPatternInStream($pattern, $streamB); - } - - public function assertPatternInStream($pattern, $stream, $message = '%s') - { - $string = ''; - while (false !== $bytes = $stream->read(8192)) { - $string .= $bytes; - } - $this->assertRegExp($pattern, $string, $message); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug518Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug518Test.php deleted file mode 100644 index b83984f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug518Test.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -use Mockery as m; - -class Swift_Bug518Test extends \PHPUnit_Framework_TestCase -{ - public function testIfEmailChangesAfterQueued() - { - $failedRecipients = 'value'; - $message = new Swift_Message(); - $message->setTo('foo@bar.com'); - - $that = $this; - $messageValidation = function ($m) use ($that) { - //the getTo should return the same value as we put in - $that->assertEquals('foo@bar.com', key($m->getTo()), 'The message has changed after it was put to the memory queue'); - - return true; - }; - - $transport = m::mock('Swift_Transport'); - $transport->shouldReceive('isStarted')->andReturn(true); - $transport->shouldReceive('send') - ->with(m::on($messageValidation), $failedRecipients) - ->andReturn(1); - - $memorySpool = new Swift_MemorySpool(); - $memorySpool->queueMessage($message); - - /* - * The message is queued in memory. - * Lets change the message - */ - $message->setTo('other@value.com'); - - $memorySpool->flushQueue($transport, $failedRecipients); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php deleted file mode 100644 index 48074f0..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -class Swift_Bug51Test extends \SwiftMailerTestCase -{ - private $_attachmentFile; - private $_outputFile; - - protected function setUp() - { - $this->_attachmentFile = sys_get_temp_dir().'/attach.rand.bin'; - file_put_contents($this->_attachmentFile, ''); - - $this->_outputFile = sys_get_temp_dir().'/attach.out.bin'; - file_put_contents($this->_outputFile, ''); - } - - protected function tearDown() - { - unlink($this->_attachmentFile); - unlink($this->_outputFile); - } - - public function testAttachmentsDoNotGetTruncatedUsingToByteStream() - { - //Run 100 times with 10KB attachments - for ($i = 0; $i < 10; ++$i) { - $message = $this->_createMessageWithRandomAttachment( - 10000, $this->_attachmentFile - ); - - file_put_contents($this->_outputFile, ''); - $message->toByteStream( - new Swift_ByteStream_FileByteStream($this->_outputFile, true) - ); - - $emailSource = file_get_contents($this->_outputFile); - - $this->assertAttachmentFromSourceMatches( - file_get_contents($this->_attachmentFile), - $emailSource - ); - } - } - - public function testAttachmentsDoNotGetTruncatedUsingToString() - { - //Run 100 times with 10KB attachments - for ($i = 0; $i < 10; ++$i) { - $message = $this->_createMessageWithRandomAttachment( - 10000, $this->_attachmentFile - ); - - $emailSource = $message->toString(); - - $this->assertAttachmentFromSourceMatches( - file_get_contents($this->_attachmentFile), - $emailSource - ); - } - } - - public function assertAttachmentFromSourceMatches($attachmentData, $source) - { - $encHeader = 'Content-Transfer-Encoding: base64'; - $base64declaration = strpos($source, $encHeader); - - $attachmentDataStart = strpos($source, "\r\n\r\n", $base64declaration); - $attachmentDataEnd = strpos($source, "\r\n--", $attachmentDataStart); - - if (false === $attachmentDataEnd) { - $attachmentBase64 = trim(substr($source, $attachmentDataStart)); - } else { - $attachmentBase64 = trim(substr( - $source, $attachmentDataStart, - $attachmentDataEnd - $attachmentDataStart - )); - } - - $this->assertIdenticalBinary($attachmentData, base64_decode($attachmentBase64)); - } - - private function _fillFileWithRandomBytes($byteCount, $file) - { - // I was going to use dd with if=/dev/random but this way seems more - // cross platform even if a hella expensive!! - - file_put_contents($file, ''); - $fp = fopen($file, 'wb'); - for ($i = 0; $i < $byteCount; ++$i) { - $byteVal = rand(0, 255); - fwrite($fp, pack('i', $byteVal)); - } - fclose($fp); - } - - private function _createMessageWithRandomAttachment($size, $attachmentPath) - { - $this->_fillFileWithRandomBytes($size, $attachmentPath); - - $message = Swift_Message::newInstance() - ->setSubject('test') - ->setBody('test') - ->setFrom('a@b.c') - ->setTo('d@e.f') - ->attach(Swift_Attachment::fromPath($attachmentPath)) - ; - - return $message; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug534Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug534Test.php deleted file mode 100644 index 263cae5..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug534Test.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -use Mockery as m; - -class Swift_Bug534Test extends \PHPUnit_Framework_TestCase -{ - public function testEmbeddedImagesAreEmbedded() - { - $message = Swift_Message::newInstance() - ->setFrom('from@example.com') - ->setTo('to@example.com') - ->setSubject('test') - ; - $cid = $message->embed(Swift_Image::fromPath(__DIR__.'/../../_samples/files/swiftmailer.png')); - $message->setBody('<img src="'.$cid.'" />', 'text/html'); - - $that = $this; - $messageValidation = function (Swift_Mime_Message $message) use ($that) { - preg_match('/cid:(.*)"/', $message->toString(), $matches); - $cid = $matches[1]; - preg_match('/Content-ID: <(.*)>/', $message->toString(), $matches); - $contentId = $matches[1]; - $that->assertEquals($cid, $contentId, 'cid in body and mime part Content-ID differ'); - - return true; - }; - - $failedRecipients = array(); - - $transport = m::mock('Swift_Transport'); - $transport->shouldReceive('isStarted')->andReturn(true); - $transport->shouldReceive('send')->with(m::on($messageValidation), $failedRecipients)->andReturn(1); - - $memorySpool = new Swift_MemorySpool(); - $memorySpool->queueMessage($message); - $memorySpool->flushQueue($transport, $failedRecipients); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug650Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug650Test.php deleted file mode 100644 index 3393fb8..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug650Test.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -class Swift_Bug650Test extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider encodingDataProvider - * - * @param string $name - * @param string $expectedEncodedName - */ - public function testMailboxHeaderEncoding($name, $expectedEncodedName) - { - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $charStream = new Swift_CharacterStream_NgCharacterStream($factory, 'utf-8'); - $encoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder($charStream); - $header = new Swift_Mime_Headers_MailboxHeader('To', $encoder, new Swift_Mime_Grammar()); - $header->setCharset('utf-8'); - - $header->setNameAddresses(array( - 'test@example.com' => $name, - )); - - $this->assertSame('To: '.$expectedEncodedName." <test@example.com>\r\n", $header->toString()); - } - - public function encodingDataProvider() - { - return array( - array('this is " a test ö', 'this is =?utf-8?Q?=22?= a test =?utf-8?Q?=C3=B6?='), - array(': this is a test ö', '=?utf-8?Q?=3A?= this is a test =?utf-8?Q?=C3=B6?='), - array('( test ö', '=?utf-8?Q?=28?= test =?utf-8?Q?=C3=B6?='), - array('[ test ö', '=?utf-8?Q?=5B?= test =?utf-8?Q?=C3=B6?='), - array('@ test ö)', '=?utf-8?Q?=40?= test =?utf-8?Q?=C3=B6=29?='), - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php deleted file mode 100644 index d58242f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -class Swift_Bug71Test extends \PHPUnit_Framework_TestCase -{ - private $_message; - - protected function setUp() - { - $this->_message = new Swift_Message('test'); - } - - public function testCallingToStringAfterSettingNewBodyReflectsChanges() - { - $this->_message->setBody('BODY1'); - $this->assertRegExp('/BODY1/', $this->_message->toString()); - - $this->_message->setBody('BODY2'); - $this->assertRegExp('/BODY2/', $this->_message->toString()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php deleted file mode 100644 index 899083c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -class Swift_Bug76Test extends \PHPUnit_Framework_TestCase -{ - private $_inputFile; - private $_outputFile; - private $_encoder; - - protected function setUp() - { - $this->_inputFile = sys_get_temp_dir().'/in.bin'; - file_put_contents($this->_inputFile, ''); - - $this->_outputFile = sys_get_temp_dir().'/out.bin'; - file_put_contents($this->_outputFile, ''); - - $this->_encoder = $this->_createEncoder(); - } - - protected function tearDown() - { - unlink($this->_inputFile); - unlink($this->_outputFile); - } - - public function testBase64EncodedLineLengthNeverExceeds76CharactersEvenIfArgsDo() - { - $this->_fillFileWithRandomBytes(1000, $this->_inputFile); - - $os = $this->_createStream($this->_inputFile); - $is = $this->_createStream($this->_outputFile); - - $this->_encoder->encodeByteStream($os, $is, 0, 80); //Exceeds 76 - - $this->assertMaxLineLength(76, $this->_outputFile, - '%s: Line length should not exceed 76 characters' - ); - } - - public function assertMaxLineLength($length, $filePath, $message = '%s') - { - $lines = file($filePath); - foreach ($lines as $line) { - $this->assertTrue((strlen(trim($line)) <= 76), $message); - } - } - - private function _fillFileWithRandomBytes($byteCount, $file) - { - // I was going to use dd with if=/dev/random but this way seems more - // cross platform even if a hella expensive!! - - file_put_contents($file, ''); - $fp = fopen($file, 'wb'); - for ($i = 0; $i < $byteCount; ++$i) { - $byteVal = rand(0, 255); - fwrite($fp, pack('i', $byteVal)); - } - fclose($fp); - } - - private function _createEncoder() - { - return new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - } - - private function _createStream($file) - { - return new Swift_ByteStream_FileByteStream($file, true); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php deleted file mode 100644 index 35733ec..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - - -class Swift_FileByteStreamConsecutiveReadCalls extends \PHPUnit_Framework_TestCase -{ - /** - * @test - * @expectedException \Swift_IoException - */ - public function shouldThrowExceptionOnConsecutiveRead() - { - $fbs = new \Swift_ByteStream_FileByteStream('does not exist'); - try { - $fbs->read(100); - } catch (\Swift_IoException $exc) { - $fbs->read(100); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/fixtures/MimeEntityFixture.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/fixtures/MimeEntityFixture.php deleted file mode 100644 index 159c2ae..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/fixtures/MimeEntityFixture.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -class MimeEntityFixture implements Swift_Mime_MimeEntity -{ - private $level; - private $string; - private $contentType; - - public function __construct($level = null, $string = '', $contentType = null) - { - $this->level = $level; - $this->string = $string; - $this->contentType = $contentType; - } - - public function getNestingLevel() - { - return $this->level; - } - - public function toString() - { - return $this->string; - } - - public function getContentType() - { - return $this->contentType; - } - - // These methods are here to account for the implemented interfaces - public function getId() - { - } - - public function getHeaders() - { - } - - public function getBody() - { - } - - public function setBody($body, $contentType = null) - { - } - - public function toByteStream(Swift_InputByteStream $is) - { - } - - public function charsetChanged($charset) - { - } - - public function encoderChanged(Swift_Mime_ContentEncoder $encoder) - { - } - - public function getChildren() - { - } - - public function setChildren(array $children) - { - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default deleted file mode 100644 index 0de2763..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -/* - Swift Mailer V4 smoke test configuration. - - YOU ONLY NEED TO EDIT THIS FILE IF YOU WISH TO RUN THE SMOKE TESTS. - - The smoke tests are run by default when "All Tests" are run with the - testing suite, however, without configuration options here only the unit tests - will be run and the smoke tests will be skipped. - */ - -/* - Defines: The an address which Swift can send to (it will also send "from" this address). - Recommended: (your own email address?) - */ -define('SWIFT_SMOKE_EMAIL_ADDRESS', 'test@swiftmailer.org'); - -/* - Defines: The specific transport you want to mail with. - Recommended: Any of 'smtp', 'sendmail' or 'mail' - */ -define('SWIFT_SMOKE_TRANSPORT_TYPE', 'smtp'); - -// SMTP-specific settings - -/* - Defines: An SMTP server to connect to - Recommended: smtp.your-isp.com (varies wildly!) - */ -define('SWIFT_SMOKE_SMTP_HOST', 'localhost'); - -/* - Defines: The SMTP port to connect to - Recommended: 25 - */ -define('SWIFT_SMOKE_SMTP_PORT', '4456'); - -/* - Defines: A username to authenticate with SMTP (if needed). - Recommended: (none) - */ -define('SWIFT_SMOKE_SMTP_USER', ''); - -/* - Defines: A password to authenticate with SMTP (if needed). - Recommended: (none) - */ -define('SWIFT_SMOKE_SMTP_PASS', ''); - -/* - Defines: The encryption needed on your SMTP server. - Recommended: (none), or 'tls' or 'ssl' - */ -define('SWIFT_SMOKE_SMTP_ENCRYPTION', ''); - -// Sendmail specific settings - -/* - Defines: The command to use when sending via sendmail - Recommended: /usr/sbin/sendmail -bs (or "-oi -t") - */ -define('SWIFT_SMOKE_SENDMAIL_COMMAND', '/usr/sbin/sendmail -bs'); diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php deleted file mode 100644 index 5a4ccde..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/** - * @group smoke - */ -class Swift_Smoke_AttachmentSmokeTest extends SwiftMailerSmokeTestCase -{ - private $_attFile; - - protected function setUp() - { - parent::setup(); // For skip - $this->_attFile = __DIR__.'/../../../_samples/files/textfile.zip'; - } - - public function testAttachmentSending() - { - $mailer = $this->_getMailer(); - $message = Swift_Message::newInstance() - ->setSubject('[Swift Mailer] AttachmentSmokeTest') - ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer')) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->setBody('This message should contain an attached ZIP file (named "textfile.zip").'.PHP_EOL. - 'When unzipped, the archive should produce a text file which reads:'.PHP_EOL. - '"This is part of a Swift Mailer v4 smoke test."' - ) - ->attach(Swift_Attachment::fromPath($this->_attFile)) - ; - $this->assertEquals(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php deleted file mode 100644 index c7501d4..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/** - * @group smoke - */ -class Swift_Smoke_BasicSmokeTest extends SwiftMailerSmokeTestCase -{ - public function testBasicSending() - { - $mailer = $this->_getMailer(); - $message = Swift_Message::newInstance() - ->setSubject('[Swift Mailer] BasicSmokeTest') - ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer')) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->setBody('One, two, three, four, five...'.PHP_EOL. - 'six, seven, eight...' - ) - ; - $this->assertEquals(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php deleted file mode 100644 index 3b13cc5..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * @group smoke - */ -class Swift_Smoke_HtmlWithAttachmentSmokeTest extends SwiftMailerSmokeTestCase -{ - private $_attFile; - - protected function setUp() - { - $this->_attFile = __DIR__.'/../../../_samples/files/textfile.zip'; - } - - public function testAttachmentSending() - { - $mailer = $this->_getMailer(); - $message = Swift_Message::newInstance('[Swift Mailer] HtmlWithAttachmentSmokeTest') - ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer')) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->attach(Swift_Attachment::fromPath($this->_attFile)) - ->setBody('<p>This HTML-formatted message should contain an attached ZIP file (named "textfile.zip").'.PHP_EOL. - 'When unzipped, the archive should produce a text file which reads:</p>'.PHP_EOL. - '<p><q>This is part of a Swift Mailer v4 smoke test.</q></p>', 'text/html' - ) - ; - $this->assertEquals(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php deleted file mode 100644 index b9ebef5..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/** - * @group smoke - */ -class Swift_Smoke_InternationalSmokeTest extends SwiftMailerSmokeTestCase -{ - private $_attFile; - - protected function setUp() - { - parent::setup(); // For skip - $this->_attFile = __DIR__.'/../../../_samples/files/textfile.zip'; - } - - public function testAttachmentSending() - { - $mailer = $this->_getMailer(); - $message = Swift_Message::newInstance() - ->setCharset('utf-8') - ->setSubject('[Swift Mailer] InternationalSmokeTest (διεθνής)') - ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Χριστοφορου (Swift Mailer)')) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->setBody('This message should contain an attached ZIP file (named "κείμενο, εδάφιο, θέμα.zip").'.PHP_EOL. - 'When unzipped, the archive should produce a text file which reads:'.PHP_EOL. - '"This is part of a Swift Mailer v4 smoke test."'.PHP_EOL. - PHP_EOL. - 'Following is some arbitrary Greek text:'.PHP_EOL. - 'Δεν βρέθηκαν λέξεις.' - ) - ->attach(Swift_Attachment::fromPath($this->_attFile) - ->setContentType('application/zip') - ->setFilename('κείμενο, εδάφιο, θέμα.zip') - ) - ; - $this->assertEquals(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php deleted file mode 100644 index 60ebb66..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php +++ /dev/null @@ -1,201 +0,0 @@ -<?php - -class Swift_ByteStream_ArrayByteStreamTest extends \PHPUnit_Framework_TestCase -{ - public function testReadingSingleBytesFromBaseInput() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - $output = array(); - while (false !== $bytes = $bs->read(1)) { - $output[] = $bytes; - } - $this->assertEquals($input, $output, - '%s: Bytes read from stream should be the same as bytes in constructor' - ); - } - - public function testReadingMultipleBytesFromBaseInput() - { - $input = array('a', 'b', 'c', 'd'); - $bs = $this->_createArrayStream($input); - $output = array(); - while (false !== $bytes = $bs->read(2)) { - $output[] = $bytes; - } - $this->assertEquals(array('ab', 'cd'), $output, - '%s: Bytes read from stream should be in pairs' - ); - } - - public function testReadingOddOffsetOnLastByte() - { - $input = array('a', 'b', 'c', 'd', 'e'); - $bs = $this->_createArrayStream($input); - $output = array(); - while (false !== $bytes = $bs->read(2)) { - $output[] = $bytes; - } - $this->assertEquals(array('ab', 'cd', 'e'), $output, - '%s: Bytes read from stream should be in pairs except final read' - ); - } - - public function testSettingPointerPartway() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - $bs->setReadPointer(1); - $this->assertEquals('b', $bs->read(1), - '%s: Byte should be second byte since pointer as at offset 1' - ); - } - - public function testResettingPointerAfterExhaustion() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - while (false !== $bs->read(1)); - - $bs->setReadPointer(0); - $this->assertEquals('a', $bs->read(1), - '%s: Byte should be first byte since pointer as at offset 0' - ); - } - - public function testPointerNeverSetsBelowZero() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - - $bs->setReadPointer(-1); - $this->assertEquals('a', $bs->read(1), - '%s: Byte should be first byte since pointer should be at offset 0' - ); - } - - public function testPointerNeverSetsAboveStackSize() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - - $bs->setReadPointer(3); - $this->assertFalse($bs->read(1), - '%s: Stream should be at end and thus return false' - ); - } - - public function testBytesCanBeWrittenToStream() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - - $bs->write('de'); - - $output = array(); - while (false !== $bytes = $bs->read(1)) { - $output[] = $bytes; - } - $this->assertEquals(array('a', 'b', 'c', 'd', 'e'), $output, - '%s: Bytes read from stream should be from initial stack + written' - ); - } - - public function testContentsCanBeFlushed() - { - $input = array('a', 'b', 'c'); - $bs = $this->_createArrayStream($input); - - $bs->flushBuffers(); - - $this->assertFalse($bs->read(1), - '%s: Contents have been flushed so read() should return false' - ); - } - - public function testConstructorCanTakeStringArgument() - { - $bs = $this->_createArrayStream('abc'); - $output = array(); - while (false !== $bytes = $bs->read(1)) { - $output[] = $bytes; - } - $this->assertEquals(array('a', 'b', 'c'), $output, - '%s: Bytes read from stream should be the same as bytes in constructor' - ); - } - - public function testBindingOtherStreamsMirrorsWriteOperations() - { - $bs = $this->_createArrayStream(''); - $is1 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - $is2 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->at(0)) - ->method('write') - ->with('x'); - $is2->expects($this->at(1)) - ->method('write') - ->with('y'); - - $bs->bind($is1); - $bs->bind($is2); - - $bs->write('x'); - $bs->write('y'); - } - - public function testBindingOtherStreamsMirrorsFlushOperations() - { - $bs = $this->_createArrayStream(''); - $is1 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - $is2 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - - $is1->expects($this->once()) - ->method('flushBuffers'); - $is2->expects($this->once()) - ->method('flushBuffers'); - - $bs->bind($is1); - $bs->bind($is2); - - $bs->flushBuffers(); - } - - public function testUnbindingStreamPreventsFurtherWrites() - { - $bs = $this->_createArrayStream(''); - $is1 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - $is2 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->once()) - ->method('write') - ->with('x'); - - $bs->bind($is1); - $bs->bind($is2); - - $bs->write('x'); - - $bs->unbind($is2); - - $bs->write('y'); - } - - private function _createArrayStream($input) - { - return new Swift_ByteStream_ArrayByteStream($input); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php deleted file mode 100644 index 3f7a46c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -class Swift_CharacterReader_GenericFixedWidthReaderTest extends \PHPUnit_Framework_TestCase -{ - public function testInitialByteSizeMatchesWidth() - { - $reader = new Swift_CharacterReader_GenericFixedWidthReader(1); - $this->assertSame(1, $reader->getInitialByteSize()); - - $reader = new Swift_CharacterReader_GenericFixedWidthReader(4); - $this->assertSame(4, $reader->getInitialByteSize()); - } - - public function testValidationValueIsBasedOnOctetCount() - { - $reader = new Swift_CharacterReader_GenericFixedWidthReader(4); - - $this->assertSame( - 1, $reader->validateByteSequence(array(0x01, 0x02, 0x03), 3) - ); //3 octets - - $this->assertSame( - 2, $reader->validateByteSequence(array(0x01, 0x0A), 2) - ); //2 octets - - $this->assertSame( - 3, $reader->validateByteSequence(array(0xFE), 1) - ); //1 octet - - $this->assertSame( - 0, $reader->validateByteSequence(array(0xFE, 0x03, 0x67, 0x9A), 4) - ); //All 4 octets - } - - public function testValidationFailsIfTooManyOctets() - { - $reader = new Swift_CharacterReader_GenericFixedWidthReader(6); - - $this->assertSame(-1, $reader->validateByteSequence( - array(0xFE, 0x03, 0x67, 0x9A, 0x10, 0x09, 0x85), 7 - )); //7 octets - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php deleted file mode 100644 index 0d56736..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -class Swift_CharacterReader_UsAsciiReaderTest extends \PHPUnit_Framework_TestCase -{ - /* - - for ($c = '', $size = 1; false !== $bytes = $os->read($size); ) { - $c .= $bytes; - $size = $v->validateCharacter($c); - if (-1 == $size) { - throw new Exception( ... invalid char .. ); - } elseif (0 == $size) { - return $c; //next character in $os - } - } - - */ - - private $_reader; - - protected function setUp() - { - $this->_reader = new Swift_CharacterReader_UsAsciiReader(); - } - - public function testAllValidAsciiCharactersReturnZero() - { - for ($ordinal = 0x00; $ordinal <= 0x7F; ++$ordinal) { - $this->assertSame( - 0, $this->_reader->validateByteSequence(array($ordinal), 1) - ); - } - } - - public function testMultipleBytesAreInvalid() - { - for ($ordinal = 0x00; $ordinal <= 0x7F; $ordinal += 2) { - $this->assertSame( - -1, $this->_reader->validateByteSequence(array($ordinal, $ordinal + 1), 2) - ); - } - } - - public function testBytesAboveAsciiRangeAreInvalid() - { - for ($ordinal = 0x80; $ordinal <= 0xFF; ++$ordinal) { - $this->assertSame( - -1, $this->_reader->validateByteSequence(array($ordinal), 1) - ); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php deleted file mode 100644 index ec17eeb..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -class Swift_CharacterReader_Utf8ReaderTest extends \PHPUnit_Framework_TestCase -{ - private $_reader; - - protected function setUp() - { - $this->_reader = new Swift_CharacterReader_Utf8Reader(); - } - - public function testLeading7BitOctetCausesReturnZero() - { - for ($ordinal = 0x00; $ordinal <= 0x7F; ++$ordinal) { - $this->assertSame( - 0, $this->_reader->validateByteSequence(array($ordinal), 1) - ); - } - } - - public function testLeadingByteOf2OctetCharCausesReturn1() - { - for ($octet = 0xC0; $octet <= 0xDF; ++$octet) { - $this->assertSame( - 1, $this->_reader->validateByteSequence(array($octet), 1) - ); - } - } - - public function testLeadingByteOf3OctetCharCausesReturn2() - { - for ($octet = 0xE0; $octet <= 0xEF; ++$octet) { - $this->assertSame( - 2, $this->_reader->validateByteSequence(array($octet), 1) - ); - } - } - - public function testLeadingByteOf4OctetCharCausesReturn3() - { - for ($octet = 0xF0; $octet <= 0xF7; ++$octet) { - $this->assertSame( - 3, $this->_reader->validateByteSequence(array($octet), 1) - ); - } - } - - public function testLeadingByteOf5OctetCharCausesReturn4() - { - for ($octet = 0xF8; $octet <= 0xFB; ++$octet) { - $this->assertSame( - 4, $this->_reader->validateByteSequence(array($octet), 1) - ); - } - } - - public function testLeadingByteOf6OctetCharCausesReturn5() - { - for ($octet = 0xFC; $octet <= 0xFD; ++$octet) { - $this->assertSame( - 5, $this->_reader->validateByteSequence(array($octet), 1) - ); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php deleted file mode 100644 index 977051e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php +++ /dev/null @@ -1,358 +0,0 @@ -<?php - -class Swift_CharacterStream_ArrayCharacterStreamTest extends \SwiftMailerTestCase -{ - public function testValidatorAlgorithmOnImportString() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - - $stream->importString(pack('C*', - 0xD0, 0x94, - 0xD0, 0xB6, - 0xD0, 0xBE, - 0xD1, 0x8D, - 0xD0, 0xBB, - 0xD0, 0xB0 - ) - ); - } - - public function testCharactersWrittenUseValidator() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1), 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->write(pack('C*', - 0xD0, 0xBB, - 0xD1, 0x8E, - 0xD0, 0xB1, - 0xD1, 0x8B, - 0xD1, 0x85 - ) - ); - } - - public function testReadCharactersAreInTact() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - //String - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - //Stream - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1), 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->write(pack('C*', - 0xD0, 0xBB, - 0xD1, 0x8E, - 0xD0, 0xB1, - 0xD1, 0x8B, - 0xD1, 0x85 - ) - ); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - $this->assertIdenticalBinary( - pack('C*', 0xD0, 0xB6, 0xD0, 0xBE), $stream->read(2) - ); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBB), $stream->read(1)); - $this->assertIdenticalBinary( - pack('C*', 0xD1, 0x8E, 0xD0, 0xB1, 0xD1, 0x8B), $stream->read(3) - ); - $this->assertIdenticalBinary(pack('C*', 0xD1, 0x85), $stream->read(1)); - - $this->assertFalse($stream->read(1)); - } - - public function testCharactersCanBeReadAsByteArrays() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - //String - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - //Stream - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1), 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->write(pack('C*', - 0xD0, 0xBB, - 0xD1, 0x8E, - 0xD0, 0xB1, - 0xD1, 0x8B, - 0xD1, 0x85 - ) - ); - - $this->assertEquals(array(0xD0, 0x94), $stream->readBytes(1)); - $this->assertEquals(array(0xD0, 0xB6, 0xD0, 0xBE), $stream->readBytes(2)); - $this->assertEquals(array(0xD0, 0xBB), $stream->readBytes(1)); - $this->assertEquals( - array(0xD1, 0x8E, 0xD0, 0xB1, 0xD1, 0x8B), $stream->readBytes(3) - ); - $this->assertEquals(array(0xD1, 0x85), $stream->readBytes(1)); - - $this->assertFalse($stream->readBytes(1)); - } - - public function testRequestingLargeCharCountPastEndOfStream() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE), - $stream->read(100) - ); - - $this->assertFalse($stream->read(1)); - } - - public function testRequestingByteArrayCountPastEndOfStream() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $this->assertEquals(array(0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE), - $stream->readBytes(100) - ); - - $this->assertFalse($stream->readBytes(1)); - } - - public function testPointerOffsetCanBeSet() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - - $stream->setPointer(0); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - - $stream->setPointer(2); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBE), $stream->read(1)); - } - - public function testContentsCanBeFlushed() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->flushContents(); - - $this->assertFalse($stream->read(1)); - } - - public function testByteStreamCanBeImportingUsesValidator() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - $os = $this->_getByteStream(); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $os->shouldReceive('setReadPointer') - ->between(0, 1) - ->with(0); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0x94)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xB6)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xBE)); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - - $stream->importByteStream($os); - } - - public function testImportingStreamProducesCorrectCharArray() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - $os = $this->_getByteStream(); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $os->shouldReceive('setReadPointer') - ->between(0, 1) - ->with(0); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0x94)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xB6)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xBE)); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0), 1)->andReturn(1); - - $stream->importByteStream($os); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xB6), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBE), $stream->read(1)); - - $this->assertFalse($stream->read(1)); - } - - public function testAlgorithmWithFixedWidthCharsets() - { - $reader = $this->_getReader(); - $factory = $this->_getFactory($reader); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(2); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD1, 0x8D), 2); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0, 0xBB), 2); - $reader->shouldReceive('validateByteSequence')->once()->with(array(0xD0, 0xB0), 2); - - $stream = new Swift_CharacterStream_ArrayCharacterStream( - $factory, 'utf-8' - ); - $stream->importString(pack('C*', 0xD1, 0x8D, 0xD0, 0xBB, 0xD0, 0xB0)); - - $this->assertIdenticalBinary(pack('C*', 0xD1, 0x8D), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBB), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xB0), $stream->read(1)); - - $this->assertFalse($stream->read(1)); - } - - private function _getReader() - { - return $this->getMockery('Swift_CharacterReader'); - } - - private function _getFactory($reader) - { - $factory = $this->getMockery('Swift_CharacterReaderFactory'); - $factory->shouldReceive('getReaderFor') - ->zeroOrMoreTimes() - ->with('utf-8') - ->andReturn($reader); - - return $factory; - } - - private function _getByteStream() - { - return $this->getMockery('Swift_OutputByteStream'); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php deleted file mode 100644 index ccd14f6..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php +++ /dev/null @@ -1,176 +0,0 @@ -<?php - -class One -{ - public $arg1; - public $arg2; - - public function __construct($arg1 = null, $arg2 = null) - { - $this->arg1 = $arg1; - $this->arg2 = $arg2; - } -} - -class Swift_DependencyContainerTest extends \PHPUnit_Framework_TestCase -{ - private $_container; - - protected function setUp() - { - $this->_container = new Swift_DependencyContainer(); - } - - public function testRegisterAndLookupValue() - { - $this->_container->register('foo')->asValue('bar'); - $this->assertEquals('bar', $this->_container->lookup('foo')); - } - - public function testHasReturnsTrueForRegisteredValue() - { - $this->_container->register('foo')->asValue('bar'); - $this->assertTrue($this->_container->has('foo')); - } - - public function testHasReturnsFalseForUnregisteredValue() - { - $this->assertFalse($this->_container->has('foo')); - } - - public function testRegisterAndLookupNewInstance() - { - $this->_container->register('one')->asNewInstanceOf('One'); - $this->assertInstanceOf('One', $this->_container->lookup('one')); - } - - public function testHasReturnsTrueForRegisteredInstance() - { - $this->_container->register('one')->asNewInstanceOf('One'); - $this->assertTrue($this->_container->has('one')); - } - - public function testNewInstanceIsAlwaysNew() - { - $this->_container->register('one')->asNewInstanceOf('One'); - $a = $this->_container->lookup('one'); - $b = $this->_container->lookup('one'); - $this->assertEquals($a, $b); - } - - public function testRegisterAndLookupSharedInstance() - { - $this->_container->register('one')->asSharedInstanceOf('One'); - $this->assertInstanceOf('One', $this->_container->lookup('one')); - } - - public function testHasReturnsTrueForSharedInstance() - { - $this->_container->register('one')->asSharedInstanceOf('One'); - $this->assertTrue($this->_container->has('one')); - } - - public function testMultipleSharedInstancesAreSameInstance() - { - $this->_container->register('one')->asSharedInstanceOf('One'); - $a = $this->_container->lookup('one'); - $b = $this->_container->lookup('one'); - $this->assertEquals($a, $b); - } - - public function testNewInstanceWithDependencies() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('one')->asNewInstanceOf('One') - ->withDependencies(array('foo')); - $obj = $this->_container->lookup('one'); - $this->assertSame('FOO', $obj->arg1); - } - - public function testNewInstanceWithMultipleDependencies() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('bar')->asValue(42); - $this->_container->register('one')->asNewInstanceOf('One') - ->withDependencies(array('foo', 'bar')); - $obj = $this->_container->lookup('one'); - $this->assertSame('FOO', $obj->arg1); - $this->assertSame(42, $obj->arg2); - } - - public function testNewInstanceWithInjectedObjects() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('one')->asNewInstanceOf('One'); - $this->_container->register('two')->asNewInstanceOf('One') - ->withDependencies(array('one', 'foo')); - $obj = $this->_container->lookup('two'); - $this->assertEquals($this->_container->lookup('one'), $obj->arg1); - $this->assertSame('FOO', $obj->arg2); - } - - public function testNewInstanceWithAddConstructorValue() - { - $this->_container->register('one')->asNewInstanceOf('One') - ->addConstructorValue('x') - ->addConstructorValue(99); - $obj = $this->_container->lookup('one'); - $this->assertSame('x', $obj->arg1); - $this->assertSame(99, $obj->arg2); - } - - public function testNewInstanceWithAddConstructorLookup() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('bar')->asValue(42); - $this->_container->register('one')->asNewInstanceOf('One') - ->addConstructorLookup('foo') - ->addConstructorLookup('bar'); - - $obj = $this->_container->lookup('one'); - $this->assertSame('FOO', $obj->arg1); - $this->assertSame(42, $obj->arg2); - } - - public function testResolvedDependenciesCanBeLookedUp() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('one')->asNewInstanceOf('One'); - $this->_container->register('two')->asNewInstanceOf('One') - ->withDependencies(array('one', 'foo')); - $deps = $this->_container->createDependenciesFor('two'); - $this->assertEquals( - array($this->_container->lookup('one'), 'FOO'), $deps - ); - } - - public function testArrayOfDependenciesCanBeSpecified() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('one')->asNewInstanceOf('One'); - $this->_container->register('two')->asNewInstanceOf('One') - ->withDependencies(array(array('one', 'foo'), 'foo')); - - $obj = $this->_container->lookup('two'); - $this->assertEquals(array($this->_container->lookup('one'), 'FOO'), $obj->arg1); - $this->assertSame('FOO', $obj->arg2); - } - - public function testAliasCanBeSet() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('bar')->asAliasOf('foo'); - - $this->assertSame('FOO', $this->_container->lookup('bar')); - } - - public function testAliasOfAliasCanBeSet() - { - $this->_container->register('foo')->asValue('FOO'); - $this->_container->register('bar')->asAliasOf('foo'); - $this->_container->register('zip')->asAliasOf('bar'); - $this->_container->register('button')->asAliasOf('zip'); - - $this->assertSame('FOO', $this->_container->lookup('button')); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php deleted file mode 100644 index b89eb9f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php +++ /dev/null @@ -1,173 +0,0 @@ -<?php - -class Swift_Encoder_Base64EncoderTest extends \PHPUnit_Framework_TestCase -{ - private $_encoder; - - protected function setUp() - { - $this->_encoder = new Swift_Encoder_Base64Encoder(); - } - - /* - There's really no point in testing the entire base64 encoding to the - level QP encoding has been tested. base64_encode() has been in PHP for - years. - */ - - public function testInputOutputRatioIs3to4Bytes() - { - /* - RFC 2045, 6.8 - - The encoding process represents 24-bit groups of input bits as output - strings of 4 encoded characters. Proceeding from left to right, a - 24-bit input group is formed by concatenating 3 8bit input groups. - These 24 bits are then treated as 4 concatenated 6-bit groups, each - of which is translated into a single digit in the base64 alphabet. - */ - - $this->assertEquals( - 'MTIz', $this->_encoder->encodeString('123'), - '%s: 3 bytes of input should yield 4 bytes of output' - ); - $this->assertEquals( - 'MTIzNDU2', $this->_encoder->encodeString('123456'), - '%s: 6 bytes in input should yield 8 bytes of output' - ); - $this->assertEquals( - 'MTIzNDU2Nzg5', $this->_encoder->encodeString('123456789'), - '%s: 9 bytes in input should yield 12 bytes of output' - ); - } - - public function testPadLength() - { - /* - RFC 2045, 6.8 - - Special processing is performed if fewer than 24 bits are available - at the end of the data being encoded. A full encoding quantum is - always completed at the end of a body. When fewer than 24 input bits - are available in an input group, zero bits are added (on the right) - to form an integral number of 6-bit groups. Padding at the end of - the data is performed using the "=" character. Since all base64 - input is an integral number of octets, only the following cases can - arise: (1) the final quantum of encoding input is an integral - multiple of 24 bits; here, the final unit of encoded output will be - an integral multiple of 4 characters with no "=" padding, (2) the - final quantum of encoding input is exactly 8 bits; here, the final - unit of encoded output will be two characters followed by two "=" - padding characters, or (3) the final quantum of encoding input is - exactly 16 bits; here, the final unit of encoded output will be three - characters followed by one "=" padding character. - */ - - for ($i = 0; $i < 30; ++$i) { - $input = pack('C', rand(0, 255)); - $this->assertRegExp( - '~^[a-zA-Z0-9/\+]{2}==$~', $this->_encoder->encodeString($input), - '%s: A single byte should have 2 bytes of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $input = pack('C*', rand(0, 255), rand(0, 255)); - $this->assertRegExp( - '~^[a-zA-Z0-9/\+]{3}=$~', $this->_encoder->encodeString($input), - '%s: Two bytes should have 1 byte of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $input = pack('C*', rand(0, 255), rand(0, 255), rand(0, 255)); - $this->assertRegExp( - '~^[a-zA-Z0-9/\+]{4}$~', $this->_encoder->encodeString($input), - '%s: Three bytes should have no padding' - ); - } - } - - public function testMaximumLineLengthIs76Characters() - { - /* - The encoded output stream must be represented in lines of no more - than 76 characters each. All line breaks or other characters not - found in Table 1 must be ignored by decoding software. - */ - - $input = - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $output = - 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQk'.//38 - 'NERUZHSElKS0xNTk9QUVJTVFVWV1hZWjEyMzQ1'."\r\n".//76 * - 'Njc4OTBhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3'.//38 - 'h5ekFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFla'."\r\n".//76 * - 'MTIzNDU2Nzg5MEFCQ0RFRkdISUpLTE1OT1BRUl'.//38 - 'NUVVZXWFla'; //48 - - $this->assertEquals( - $output, $this->_encoder->encodeString($input), - '%s: Lines should be no more than 76 characters' - ); - } - - public function testMaximumLineLengthCanBeSpecified() - { - $input = - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $output = - 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQk'.//38 - 'NERUZHSElKS0'."\r\n".//50 * - 'xNTk9QUVJTVFVWV1hZWjEyMzQ1Njc4OTBhYmNk'.//38 - 'ZWZnaGlqa2xt'."\r\n".//50 * - 'bm9wcXJzdHV2d3h5ekFCQ0RFRkdISUpLTE1OT1'.//38 - 'BRUlNUVVZXWF'."\r\n".//50 * - 'laMTIzNDU2Nzg5MEFCQ0RFRkdISUpLTE1OT1BR'.//38 - 'UlNUVVZXWFla'; //50 * - - $this->assertEquals( - $output, $this->_encoder->encodeString($input, 0, 50), - '%s: Lines should be no more than 100 characters' - ); - } - - public function testFirstLineLengthCanBeDifferent() - { - $input = - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $output = - 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQk'.//38 - 'NERUZHSElKS0xNTk9QU'."\r\n".//57 * - 'VJTVFVWV1hZWjEyMzQ1Njc4OTBhYmNkZWZnaGl'.//38 - 'qa2xtbm9wcXJzdHV2d3h5ekFCQ0RFRkdISUpLT'."\r\n".//76 * - 'E1OT1BRUlNUVVZXWFlaMTIzNDU2Nzg5MEFCQ0R'.//38 - 'FRkdISUpLTE1OT1BRUlNUVVZXWFla'; //67 - - $this->assertEquals( - $output, $this->_encoder->encodeString($input, 19), - '%s: First line offset is 19 so first line should be 57 chars long' - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php deleted file mode 100644 index 6740f22..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php +++ /dev/null @@ -1,400 +0,0 @@ -<?php - -class Swift_Encoder_QpEncoderTest extends \SwiftMailerTestCase -{ - /* -- RFC 2045, 6.7 -- - (1) (General 8bit representation) Any octet, except a CR or - LF that is part of a CRLF line break of the canonical - (standard) form of the data being encoded, may be - represented by an "=" followed by a two digit - hexadecimal representation of the octet's value. The - digits of the hexadecimal alphabet, for this purpose, - are "0123456789ABCDEF". Uppercase letters must be - used; lowercase letters are not allowed. Thus, for - example, the decimal value 12 (US-ASCII form feed) can - be represented by "=0C", and the decimal value 61 (US- - ASCII EQUAL SIGN) can be represented by "=3D". This - rule must be followed except when the following rules - allow an alternative encoding. - */ - - public function testPermittedCharactersAreNotEncoded() - { - /* -- RFC 2045, 6.7 -- - (2) (Literal representation) Octets with decimal values of - 33 through 60 inclusive, and 62 through 126, inclusive, - MAY be represented as the US-ASCII characters which - correspond to those octets (EXCLAMATION POINT through - LESS THAN, and GREATER THAN through TILDE, - respectively). - */ - - foreach (array_merge(range(33, 60), range(62, 126)) as $ordinal) { - $char = chr($ordinal); - - $charStream = $this->_createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($char); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array($ordinal)); - $charStream->shouldReceive('readBytes') - ->atLeast()->times(1) - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertIdenticalBinary($char, $encoder->encodeString($char)); - } - } - - public function testWhiteSpaceAtLineEndingIsEncoded() - { - /* -- RFC 2045, 6.7 -- - (3) (White Space) Octets with values of 9 and 32 MAY be - represented as US-ASCII TAB (HT) and SPACE characters, - respectively, but MUST NOT be so represented at the end - of an encoded line. Any TAB (HT) or SPACE characters - on an encoded line MUST thus be followed on that line - by a printable character. In particular, an "=" at the - end of an encoded line, indicating a soft line break - (see rule #5) may follow one or more TAB (HT) or SPACE - characters. It follows that an octet with decimal - value 9 or 32 appearing at the end of an encoded line - must be represented according to Rule #1. This rule is - necessary because some MTAs (Message Transport Agents, - programs which transport messages from one user to - another, or perform a portion of such transfers) are - known to pad lines of text with SPACEs, and others are - known to remove "white space" characters from the end - of a line. Therefore, when decoding a Quoted-Printable - body, any trailing white space on a line must be - deleted, as it will necessarily have been added by - intermediate transport agents. - */ - - $HT = chr(0x09); //9 - $SPACE = chr(0x20); //32 - - //HT - $string = 'a'.$HT.$HT."\r\n".'b'; - - $charStream = $this->_createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - - $charStream->shouldReceive('readBytes')->once()->andReturn(array(ord('a'))); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x09)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x09)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x0D)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x0A)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(ord('b'))); - $charStream->shouldReceive('readBytes')->once()->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals( - 'a'.$HT.'=09'."\r\n".'b', - $encoder->encodeString($string) - ); - - //SPACE - $string = 'a'.$SPACE.$SPACE."\r\n".'b'; - - $charStream = $this->_createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - - $charStream->shouldReceive('readBytes')->once()->andReturn(array(ord('a'))); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x20)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x20)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x0D)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x0A)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(ord('b'))); - $charStream->shouldReceive('readBytes')->once()->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals( - 'a'.$SPACE.'=20'."\r\n".'b', - $encoder->encodeString($string) - ); - } - - public function testCRLFIsLeftAlone() - { - /* - (4) (Line Breaks) A line break in a text body, represented - as a CRLF sequence in the text canonical form, must be - represented by a (RFC 822) line break, which is also a - CRLF sequence, in the Quoted-Printable encoding. Since - the canonical representation of media types other than - text do not generally include the representation of - line breaks as CRLF sequences, no hard line breaks - (i.e. line breaks that are intended to be meaningful - and to be displayed to the user) can occur in the - quoted-printable encoding of such types. Sequences - like "=0D", "=0A", "=0A=0D" and "=0D=0A" will routinely - appear in non-text data represented in quoted- - printable, of course. - - Note that many implementations may elect to encode the - local representation of various content types directly - rather than converting to canonical form first, - encoding, and then converting back to local - representation. In particular, this may apply to plain - text material on systems that use newline conventions - other than a CRLF terminator sequence. Such an - implementation optimization is permissible, but only - when the combined canonicalization-encoding step is - equivalent to performing the three steps separately. - */ - - $string = 'a'."\r\n".'b'."\r\n".'c'."\r\n"; - - $charStream = $this->_createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - - $charStream->shouldReceive('readBytes')->once()->andReturn(array(ord('a'))); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x0D)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x0A)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(ord('b'))); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x0D)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x0A)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(ord('c'))); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x0D)); - $charStream->shouldReceive('readBytes')->once()->andReturn(array(0x0A)); - $charStream->shouldReceive('readBytes')->once()->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals($string, $encoder->encodeString($string)); - } - - public function testLinesLongerThan76CharactersAreSoftBroken() - { - /* - (5) (Soft Line Breaks) The Quoted-Printable encoding - REQUIRES that encoded lines be no more than 76 - characters long. If longer lines are to be encoded - with the Quoted-Printable encoding, "soft" line breaks - must be used. An equal sign as the last character on a - encoded line indicates such a non-significant ("soft") - line break in the encoded text. - */ - - $input = str_repeat('a', 140); - - $charStream = $this->_createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($input); - - $output = ''; - for ($i = 0; $i < 140; ++$i) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - - if (75 == $i) { - $output .= "=\r\n"; - } - $output .= 'a'; - } - - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals($output, $encoder->encodeString($input)); - } - - public function testMaxLineLengthCanBeSpecified() - { - $input = str_repeat('a', 100); - - $charStream = $this->_createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($input); - - $output = ''; - for ($i = 0; $i < 100; ++$i) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - - if (53 == $i) { - $output .= "=\r\n"; - } - $output .= 'a'; - } - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals($output, $encoder->encodeString($input, 0, 54)); - } - - public function testBytesBelowPermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(0, 32) as $ordinal) { - $char = chr($ordinal); - - $charStream = $this->_createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($char); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array($ordinal)); - $charStream->shouldReceive('readBytes') - ->atLeast()->times(1) - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertEquals( - sprintf('=%02X', $ordinal), $encoder->encodeString($char) - ); - } - } - - public function testDecimalByte61IsEncoded() - { - /* - According to Rule (1 & 2) - */ - - $char = '='; - - $charStream = $this->_createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($char); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(61)); - $charStream->shouldReceive('readBytes') - ->atLeast()->times(1) - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertEquals('=3D', $encoder->encodeString('=')); - } - - public function testBytesAbovePermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(127, 255) as $ordinal) { - $char = chr($ordinal); - - $charStream = $this->_createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($char); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array($ordinal)); - $charStream->shouldReceive('readBytes') - ->atLeast()->times(1) - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertEquals( - sprintf('=%02X', $ordinal), $encoder->encodeString($char) - ); - } - } - - public function testFirstLineLengthCanBeDifferent() - { - $input = str_repeat('a', 140); - - $charStream = $this->_createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($input); - - $output = ''; - for ($i = 0; $i < 140; ++$i) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - - if (53 == $i || 53 + 75 == $i) { - $output .= "=\r\n"; - } - $output .= 'a'; - } - - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals( - $output, $encoder->encodeString($input, 22), - '%s: First line should start at offset 22 so can only have max length 54' - ); - } - - public function testTextIsPreWrapped() - { - $encoder = $this->createEncoder(); - - $input = str_repeat('a', 70)."\r\n". - str_repeat('a', 70)."\r\n". - str_repeat('a', 70); - - $this->assertEquals( - $input, $encoder->encodeString($input) - ); - } - - private function _createCharStream() - { - return $this->getMockery('Swift_CharacterStream')->shouldIgnoreMissing(); - } - - private function createEncoder() - { - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $charStream = new Swift_CharacterStream_NgCharacterStream($factory, 'utf-8'); - - return new Swift_Encoder_QpEncoder($charStream); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php deleted file mode 100644 index 28eae6f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php - -class Swift_Encoder_Rfc2231EncoderTest extends \SwiftMailerTestCase -{ - private $_rfc2045Token = '/^[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7E]+$/D'; - - /* -- - This algorithm is described in RFC 2231, but is barely touched upon except - for mentioning bytes can be represented as their octet values (e.g. %20 for - the SPACE character). - - The tests here focus on how to use that representation to always generate text - which matches RFC 2045's definition of "token". - */ - - public function testEncodingAsciiCharactersProducesValidToken() - { - $charStream = $this->getMockery('Swift_CharacterStream'); - - $string = ''; - foreach (range(0x00, 0x7F) as $octet) { - $char = pack('C', $octet); - $string .= $char; - $charStream->shouldReceive('read') - ->once() - ->andReturn($char); - } - - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - $charStream->shouldReceive('read') - ->atLeast()->times(1) - ->andReturn(false); - - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - $encoded = $encoder->encodeString($string); - - foreach (explode("\r\n", $encoded) as $line) { - $this->assertRegExp($this->_rfc2045Token, $line, - '%s: Encoder should always return a valid RFC 2045 token.'); - } - } - - public function testEncodingNonAsciiCharactersProducesValidToken() - { - $charStream = $this->getMockery('Swift_CharacterStream'); - - $string = ''; - foreach (range(0x80, 0xFF) as $octet) { - $char = pack('C', $octet); - $string .= $char; - $charStream->shouldReceive('read') - ->once() - ->andReturn($char); - } - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - $charStream->shouldReceive('read') - ->atLeast()->times(1) - ->andReturn(false); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - - $encoded = $encoder->encodeString($string); - - foreach (explode("\r\n", $encoded) as $line) { - $this->assertRegExp($this->_rfc2045Token, $line, - '%s: Encoder should always return a valid RFC 2045 token.'); - } - } - - public function testMaximumLineLengthCanBeSet() - { - $charStream = $this->getMockery('Swift_CharacterStream'); - - $string = ''; - for ($x = 0; $x < 200; ++$x) { - $char = 'a'; - $string .= $char; - $charStream->shouldReceive('read') - ->once() - ->andReturn($char); - } - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - $charStream->shouldReceive('read') - ->atLeast()->times(1) - ->andReturn(false); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - - $encoded = $encoder->encodeString($string, 0, 75); - - $this->assertEquals( - str_repeat('a', 75)."\r\n". - str_repeat('a', 75)."\r\n". - str_repeat('a', 50), - $encoded, - '%s: Lines should be wrapped at each 75 characters' - ); - } - - public function testFirstLineCanHaveShorterLength() - { - $charStream = $this->getMockery('Swift_CharacterStream'); - - $string = ''; - for ($x = 0; $x < 200; ++$x) { - $char = 'a'; - $string .= $char; - $charStream->shouldReceive('read') - ->once() - ->andReturn($char); - } - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - $charStream->shouldReceive('read') - ->atLeast()->times(1) - ->andReturn(false); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - $encoded = $encoder->encodeString($string, 25, 75); - - $this->assertEquals( - str_repeat('a', 50)."\r\n". - str_repeat('a', 75)."\r\n". - str_repeat('a', 75), - $encoded, - '%s: First line should be 25 bytes shorter than the others.' - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php deleted file mode 100644 index a78bc3a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -class Swift_Events_CommandEventTest extends \PHPUnit_Framework_TestCase -{ - public function testCommandCanBeFetchedByGetter() - { - $evt = $this->_createEvent($this->_createTransport(), "FOO\r\n"); - $this->assertEquals("FOO\r\n", $evt->getCommand()); - } - - public function testSuccessCodesCanBeFetchedViaGetter() - { - $evt = $this->_createEvent($this->_createTransport(), "FOO\r\n", array(250)); - $this->assertEquals(array(250), $evt->getSuccessCodes()); - } - - public function testSourceIsBuffer() - { - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport, "FOO\r\n"); - $ref = $evt->getSource(); - $this->assertEquals($transport, $ref); - } - - private function _createEvent(Swift_Transport $source, $command, $successCodes = array()) - { - return new Swift_Events_CommandEvent($source, $command, $successCodes); - } - - private function _createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php deleted file mode 100644 index 0cfe3ca..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -class Swift_Events_EventObjectTest extends \PHPUnit_Framework_TestCase -{ - public function testEventSourceCanBeReturnedViaGetter() - { - $source = new stdClass(); - $evt = $this->_createEvent($source); - $ref = $evt->getSource(); - $this->assertEquals($source, $ref); - } - - public function testEventDoesNotHaveCancelledBubbleWhenNew() - { - $source = new stdClass(); - $evt = $this->_createEvent($source); - $this->assertFalse($evt->bubbleCancelled()); - } - - public function testBubbleCanBeCancelledInEvent() - { - $source = new stdClass(); - $evt = $this->_createEvent($source); - $evt->cancelBubble(); - $this->assertTrue($evt->bubbleCancelled()); - } - - private function _createEvent($source) - { - return new Swift_Events_EventObject($source); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php deleted file mode 100644 index 6f611ac..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -class Swift_Events_ResponseEventTest extends \PHPUnit_Framework_TestCase -{ - public function testResponseCanBeFetchViaGetter() - { - $evt = $this->_createEvent($this->_createTransport(), "250 Ok\r\n", true); - $this->assertEquals("250 Ok\r\n", $evt->getResponse(), - '%s: Response should be available via getResponse()' - ); - } - - public function testResultCanBeFetchedViaGetter() - { - $evt = $this->_createEvent($this->_createTransport(), "250 Ok\r\n", false); - $this->assertFalse($evt->isValid(), - '%s: Result should be checkable via isValid()' - ); - } - - public function testSourceIsBuffer() - { - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport, "250 Ok\r\n", true); - $ref = $evt->getSource(); - $this->assertEquals($transport, $ref); - } - - private function _createEvent(Swift_Transport $source, $response, $result) - { - return new Swift_Events_ResponseEvent($source, $response, $result); - } - - private function _createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php deleted file mode 100644 index c4a6a7e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php - -class Swift_Events_SendEventTest extends \PHPUnit_Framework_TestCase -{ - public function testMessageCanBeFetchedViaGetter() - { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - - $ref = $evt->getMessage(); - $this->assertEquals($message, $ref, - '%s: Message should be returned from getMessage()' - ); - } - - public function testTransportCanBeFetchViaGetter() - { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - - $ref = $evt->getTransport(); - $this->assertEquals($transport, $ref, - '%s: Transport should be returned from getTransport()' - ); - } - - public function testTransportCanBeFetchViaGetSource() - { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - - $ref = $evt->getSource(); - $this->assertEquals($transport, $ref, - '%s: Transport should be returned from getSource()' - ); - } - - public function testResultCanBeSetAndGet() - { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - - $evt->setResult( - Swift_Events_SendEvent::RESULT_SUCCESS | Swift_Events_SendEvent::RESULT_TENTATIVE - ); - - $this->assertTrue((bool) ($evt->getResult() & Swift_Events_SendEvent::RESULT_SUCCESS)); - $this->assertTrue((bool) ($evt->getResult() & Swift_Events_SendEvent::RESULT_TENTATIVE)); - } - - public function testFailedRecipientsCanBeSetAndGet() - { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - - $evt->setFailedRecipients(array('foo@bar', 'zip@button')); - - $this->assertEquals(array('foo@bar', 'zip@button'), $evt->getFailedRecipients(), - '%s: FailedRecipients should be returned from getter' - ); - } - - public function testFailedRecipientsGetsPickedUpCorrectly() - { - $message = $this->_createMessage(); - $transport = $this->_createTransport(); - - $evt = $this->_createEvent($transport, $message); - $this->assertEquals(array(), $evt->getFailedRecipients()); - } - - private function _createEvent(Swift_Transport $source, - Swift_Mime_Message $message) - { - return new Swift_Events_SendEvent($source, $message); - } - - private function _createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } - - private function _createMessage() - { - return $this->getMockBuilder('Swift_Mime_Message')->getMock(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php deleted file mode 100644 index 3f063ff..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php +++ /dev/null @@ -1,142 +0,0 @@ -<?php - -class Swift_Events_SimpleEventDispatcherTest extends \PHPUnit_Framework_TestCase -{ - private $_dispatcher; - - protected function setUp() - { - $this->_dispatcher = new Swift_Events_SimpleEventDispatcher(); - } - - public function testSendEventCanBeCreated() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - $message = $this->getMockBuilder('Swift_Mime_Message')->getMock(); - $evt = $this->_dispatcher->createSendEvent($transport, $message); - $this->assertInstanceOf('Swift_Events_SendEvent', $evt); - $this->assertSame($message, $evt->getMessage()); - $this->assertSame($transport, $evt->getTransport()); - } - - public function testCommandEventCanBeCreated() - { - $buf = $this->getMockBuilder('Swift_Transport')->getMock(); - $evt = $this->_dispatcher->createCommandEvent($buf, "FOO\r\n", array(250)); - $this->assertInstanceOf('Swift_Events_CommandEvent', $evt); - $this->assertSame($buf, $evt->getSource()); - $this->assertEquals("FOO\r\n", $evt->getCommand()); - $this->assertEquals(array(250), $evt->getSuccessCodes()); - } - - public function testResponseEventCanBeCreated() - { - $buf = $this->getMockBuilder('Swift_Transport')->getMock(); - $evt = $this->_dispatcher->createResponseEvent($buf, "250 Ok\r\n", true); - $this->assertInstanceOf('Swift_Events_ResponseEvent', $evt); - $this->assertSame($buf, $evt->getSource()); - $this->assertEquals("250 Ok\r\n", $evt->getResponse()); - $this->assertTrue($evt->isValid()); - } - - public function testTransportChangeEventCanBeCreated() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - $evt = $this->_dispatcher->createTransportChangeEvent($transport); - $this->assertInstanceOf('Swift_Events_TransportChangeEvent', $evt); - $this->assertSame($transport, $evt->getSource()); - } - - public function testTransportExceptionEventCanBeCreated() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - $ex = new Swift_TransportException(''); - $evt = $this->_dispatcher->createTransportExceptionEvent($transport, $ex); - $this->assertInstanceOf('Swift_Events_TransportExceptionEvent', $evt); - $this->assertSame($transport, $evt->getSource()); - $this->assertSame($ex, $evt->getException()); - } - - public function testListenersAreNotifiedOfDispatchedEvent() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - - $evt = $this->_dispatcher->createTransportChangeEvent($transport); - - $listenerA = $this->getMockBuilder('Swift_Events_TransportChangeListener')->getMock(); - $listenerB = $this->getMockBuilder('Swift_Events_TransportChangeListener')->getMock(); - - $this->_dispatcher->bindEventListener($listenerA); - $this->_dispatcher->bindEventListener($listenerB); - - $listenerA->expects($this->once()) - ->method('transportStarted') - ->with($evt); - $listenerB->expects($this->once()) - ->method('transportStarted') - ->with($evt); - - $this->_dispatcher->dispatchEvent($evt, 'transportStarted'); - } - - public function testListenersAreOnlyCalledIfImplementingCorrectInterface() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - $message = $this->getMockBuilder('Swift_Mime_Message')->getMock(); - - $evt = $this->_dispatcher->createSendEvent($transport, $message); - - $targetListener = $this->getMockBuilder('Swift_Events_SendListener')->getMock(); - $otherListener = $this->getMockBuilder('DummyListener')->getMock(); - - $this->_dispatcher->bindEventListener($targetListener); - $this->_dispatcher->bindEventListener($otherListener); - - $targetListener->expects($this->once()) - ->method('sendPerformed') - ->with($evt); - $otherListener->expects($this->never()) - ->method('sendPerformed'); - - $this->_dispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - public function testListenersCanCancelBubblingOfEvent() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - $message = $this->getMockBuilder('Swift_Mime_Message')->getMock(); - - $evt = $this->_dispatcher->createSendEvent($transport, $message); - - $listenerA = $this->getMockBuilder('Swift_Events_SendListener')->getMock(); - $listenerB = $this->getMockBuilder('Swift_Events_SendListener')->getMock(); - - $this->_dispatcher->bindEventListener($listenerA); - $this->_dispatcher->bindEventListener($listenerB); - - $listenerA->expects($this->once()) - ->method('sendPerformed') - ->with($evt) - ->will($this->returnCallback(function ($object) { - $object->cancelBubble(true); - })); - $listenerB->expects($this->never()) - ->method('sendPerformed'); - - $this->_dispatcher->dispatchEvent($evt, 'sendPerformed'); - - $this->assertTrue($evt->bubbleCancelled()); - } - - private function _createDispatcher(array $map) - { - return new Swift_Events_SimpleEventDispatcher($map); - } -} - -class DummyListener implements Swift_Events_EventListener -{ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php deleted file mode 100644 index a260ccb..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -class Swift_Events_TransportChangeEventTest extends \PHPUnit_Framework_TestCase -{ - public function testGetTransportReturnsTransport() - { - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport); - $ref = $evt->getTransport(); - $this->assertEquals($transport, $ref); - } - - public function testSourceIsTransport() - { - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport); - $ref = $evt->getSource(); - $this->assertEquals($transport, $ref); - } - - private function _createEvent(Swift_Transport $source) - { - return new Swift_Events_TransportChangeEvent($source); - } - - private function _createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php deleted file mode 100644 index 731dfad..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -class Swift_Events_TransportExceptionEventTest extends \PHPUnit_Framework_TestCase -{ - public function testExceptionCanBeFetchViaGetter() - { - $ex = $this->_createException(); - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport, $ex); - $ref = $evt->getException(); - $this->assertEquals($ex, $ref, - '%s: Exception should be available via getException()' - ); - } - - public function testSourceIsTransport() - { - $ex = $this->_createException(); - $transport = $this->_createTransport(); - $evt = $this->_createEvent($transport, $ex); - $ref = $evt->getSource(); - $this->assertEquals($transport, $ref, - '%s: Transport should be available via getSource()' - ); - } - - private function _createEvent(Swift_Transport $transport, Swift_TransportException $ex) - { - return new Swift_Events_TransportExceptionEvent($transport, $ex); - } - - private function _createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } - - private function _createException() - { - return new Swift_TransportException(''); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php deleted file mode 100644 index f2ed5dd..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php +++ /dev/null @@ -1,240 +0,0 @@ -<?php - -class Swift_KeyCache_ArrayKeyCacheTest extends \PHPUnit_Framework_TestCase -{ - private $_key1 = 'key1'; - private $_key2 = 'key2'; - - public function testStringDataCanBeSetAndFetched() - { - $is = $this->_createKeyCacheInputStream(); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeOverwritten() - { - $is = $this->_createKeyCacheInputStream(); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->_key1, 'foo', 'whatever', Swift_KeyCache::MODE_WRITE - ); - - $this->assertEquals('whatever', $cache->getString($this->_key1, 'foo')); - } - - public function testStringDataCanBeAppended() - { - $is = $this->_createKeyCacheInputStream(); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->_key1, 'foo', 'ing', Swift_KeyCache::MODE_APPEND - ); - - $this->assertEquals('testing', $cache->getString($this->_key1, 'foo')); - } - - public function testHasKeyReturnValue() - { - $is = $this->_createKeyCacheInputStream(); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $this->assertTrue($cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyIsWellPartitioned() - { - $is = $this->_createKeyCacheInputStream(); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->_key2, 'foo', 'ing', Swift_KeyCache::MODE_WRITE - ); - - $this->assertEquals('test', $cache->getString($this->_key1, 'foo')); - $this->assertEquals('ing', $cache->getString($this->_key2, 'foo')); - } - - public function testItemKeyIsWellPartitioned() - { - $is = $this->_createKeyCacheInputStream(); - $cache = $this->_createCache($is); - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->_key1, 'bar', 'ing', Swift_KeyCache::MODE_WRITE - ); - - $this->assertEquals('test', $cache->getString($this->_key1, 'foo')); - $this->assertEquals('ing', $cache->getString($this->_key1, 'bar')); - } - - public function testByteStreamCanBeImported() - { - $os = $this->_createOutputStream(); - $os->expects($this->at(0)) - ->method('read') - ->will($this->returnValue('abc')); - $os->expects($this->at(1)) - ->method('read') - ->will($this->returnValue('def')); - $os->expects($this->at(2)) - ->method('read') - ->will($this->returnValue(false)); - - $is = $this->_createKeyCacheInputStream(); - $cache = $this->_createCache($is); - $cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('abcdef', $cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamCanBeAppended() - { - $os1 = $this->_createOutputStream(); - $os1->expects($this->at(0)) - ->method('read') - ->will($this->returnValue('abc')); - $os1->expects($this->at(1)) - ->method('read') - ->will($this->returnValue('def')); - $os1->expects($this->at(2)) - ->method('read') - ->will($this->returnValue(false)); - - $os2 = $this->_createOutputStream(); - $os2->expects($this->at(0)) - ->method('read') - ->will($this->returnValue('xyz')); - $os2->expects($this->at(1)) - ->method('read') - ->will($this->returnValue('uvw')); - $os2->expects($this->at(2)) - ->method('read') - ->will($this->returnValue(false)); - - $is = $this->_createKeyCacheInputStream(true); - - $cache = $this->_createCache($is); - - $cache->importFromByteStream( - $this->_key1, 'foo', $os1, Swift_KeyCache::MODE_APPEND - ); - $cache->importFromByteStream( - $this->_key1, 'foo', $os2, Swift_KeyCache::MODE_APPEND - ); - - $this->assertEquals('abcdefxyzuvw', $cache->getString($this->_key1, 'foo')); - } - - public function testByteStreamAndStringCanBeAppended() - { - $os = $this->_createOutputStream(); - $os->expects($this->at(0)) - ->method('read') - ->will($this->returnValue('abc')); - $os->expects($this->at(1)) - ->method('read') - ->will($this->returnValue('def')); - $os->expects($this->at(2)) - ->method('read') - ->will($this->returnValue(false)); - - $is = $this->_createKeyCacheInputStream(true); - - $cache = $this->_createCache($is); - - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_APPEND - ); - $cache->importFromByteStream( - $this->_key1, 'foo', $os, Swift_KeyCache::MODE_APPEND - ); - $this->assertEquals('testabcdef', $cache->getString($this->_key1, 'foo')); - } - - public function testDataCanBeExportedToByteStream() - { - //See acceptance test for more detail - $is = $this->_createInputStream(); - $is->expects($this->atLeastOnce()) - ->method('write'); - - $kcis = $this->_createKeyCacheInputStream(true); - - $cache = $this->_createCache($kcis); - - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $cache->exportToByteStream($this->_key1, 'foo', $is); - } - - public function testKeyCanBeCleared() - { - $is = $this->_createKeyCacheInputStream(); - $cache = $this->_createCache($is); - - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($cache->hasKey($this->_key1, 'foo')); - $cache->clearKey($this->_key1, 'foo'); - $this->assertFalse($cache->hasKey($this->_key1, 'foo')); - } - - public function testNsKeyCanBeCleared() - { - $is = $this->_createKeyCacheInputStream(); - $cache = $this->_createCache($is); - - $cache->setString( - $this->_key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->_key1, 'bar', 'xyz', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($cache->hasKey($this->_key1, 'foo')); - $this->assertTrue($cache->hasKey($this->_key1, 'bar')); - $cache->clearAll($this->_key1); - $this->assertFalse($cache->hasKey($this->_key1, 'foo')); - $this->assertFalse($cache->hasKey($this->_key1, 'bar')); - } - - private function _createCache($is) - { - return new Swift_KeyCache_ArrayKeyCache($is); - } - - private function _createKeyCacheInputStream() - { - return $this->getMockBuilder('Swift_KeyCache_KeyCacheInputStream')->getMock(); - } - - private function _createOutputStream() - { - return $this->getMockBuilder('Swift_OutputByteStream')->getMock(); - } - - private function _createInputStream() - { - return $this->getMockBuilder('Swift_InputByteStream')->getMock(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php deleted file mode 100644 index 38fbc0d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -class Swift_KeyCache_SimpleKeyCacheInputStreamTest extends \PHPUnit_Framework_TestCase -{ - private $_nsKey = 'ns1'; - - public function testStreamWritesToCacheInAppendMode() - { - $cache = $this->getMockBuilder('Swift_KeyCache')->getMock(); - $cache->expects($this->at(0)) - ->method('setString') - ->with($this->_nsKey, 'foo', 'a', Swift_KeyCache::MODE_APPEND); - $cache->expects($this->at(1)) - ->method('setString') - ->with($this->_nsKey, 'foo', 'b', Swift_KeyCache::MODE_APPEND); - $cache->expects($this->at(2)) - ->method('setString') - ->with($this->_nsKey, 'foo', 'c', Swift_KeyCache::MODE_APPEND); - - $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); - $stream->setKeyCache($cache); - $stream->setNsKey($this->_nsKey); - $stream->setItemKey('foo'); - - $stream->write('a'); - $stream->write('b'); - $stream->write('c'); - } - - public function testFlushContentClearsKey() - { - $cache = $this->getMockBuilder('Swift_KeyCache')->getMock(); - $cache->expects($this->once()) - ->method('clearKey') - ->with($this->_nsKey, 'foo'); - - $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); - $stream->setKeyCache($cache); - $stream->setNsKey($this->_nsKey); - $stream->setItemKey('foo'); - - $stream->flushBuffers(); - } - - public function testClonedStreamStillReferencesSameCache() - { - $cache = $this->getMockBuilder('Swift_KeyCache')->getMock(); - $cache->expects($this->at(0)) - ->method('setString') - ->with($this->_nsKey, 'foo', 'a', Swift_KeyCache::MODE_APPEND); - $cache->expects($this->at(1)) - ->method('setString') - ->with($this->_nsKey, 'foo', 'b', Swift_KeyCache::MODE_APPEND); - $cache->expects($this->at(2)) - ->method('setString') - ->with('test', 'bar', 'x', Swift_KeyCache::MODE_APPEND); - - $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); - $stream->setKeyCache($cache); - $stream->setNsKey($this->_nsKey); - $stream->setItemKey('foo'); - - $stream->write('a'); - $stream->write('b'); - - $newStream = clone $stream; - $newStream->setKeyCache($cache); - $newStream->setNsKey('test'); - $newStream->setItemKey('bar'); - - $newStream->write('x'); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php deleted file mode 100644 index ff0bce4..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -class Swift_Mailer_ArrayRecipientIteratorTest extends \PHPUnit_Framework_TestCase -{ - public function testHasNextReturnsFalseForEmptyArray() - { - $it = new Swift_Mailer_ArrayRecipientIterator(array()); - $this->assertFalse($it->hasNext()); - } - - public function testHasNextReturnsTrueIfItemsLeft() - { - $it = new Swift_Mailer_ArrayRecipientIterator(array('foo@bar' => 'Foo')); - $this->assertTrue($it->hasNext()); - } - - public function testReadingToEndOfListCausesHasNextToReturnFalse() - { - $it = new Swift_Mailer_ArrayRecipientIterator(array('foo@bar' => 'Foo')); - $this->assertTrue($it->hasNext()); - $it->nextRecipient(); - $this->assertFalse($it->hasNext()); - } - - public function testReturnedValueHasPreservedKeyValuePair() - { - $it = new Swift_Mailer_ArrayRecipientIterator(array('foo@bar' => 'Foo')); - $this->assertEquals(array('foo@bar' => 'Foo'), $it->nextRecipient()); - } - - public function testIteratorMovesNextAfterEachIteration() - { - $it = new Swift_Mailer_ArrayRecipientIterator(array( - 'foo@bar' => 'Foo', - 'zip@button' => 'Zip thing', - 'test@test' => null, - )); - $this->assertEquals(array('foo@bar' => 'Foo'), $it->nextRecipient()); - $this->assertEquals(array('zip@button' => 'Zip thing'), $it->nextRecipient()); - $this->assertEquals(array('test@test' => null), $it->nextRecipient()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php deleted file mode 100644 index 74951a7..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php +++ /dev/null @@ -1,145 +0,0 @@ -<?php - -class Swift_MailerTest extends \SwiftMailerTestCase -{ - public function testTransportIsStartedWhenSending() - { - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - - $started = false; - $transport->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$started) { - return $started; - }); - $transport->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$started) { - $started = true; - - return; - }); - - $mailer = $this->_createMailer($transport); - $mailer->send($message); - } - - public function testTransportIsOnlyStartedOnce() - { - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - - $started = false; - $transport->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$started) { - return $started; - }); - $transport->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$started) { - $started = true; - - return; - }); - - $mailer = $this->_createMailer($transport); - for ($i = 0; $i < 10; ++$i) { - $mailer->send($message); - } - } - - public function testMessageIsPassedToTransport() - { - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - $transport->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()); - - $mailer = $this->_createMailer($transport); - $mailer->send($message); - } - - public function testSendReturnsCountFromTransport() - { - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - $transport->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturn(57); - - $mailer = $this->_createMailer($transport); - $this->assertEquals(57, $mailer->send($message)); - } - - public function testFailedRecipientReferenceIsPassedToTransport() - { - $failures = array(); - - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - $transport->shouldReceive('send') - ->once() - ->with($message, $failures) - ->andReturn(57); - - $mailer = $this->_createMailer($transport); - $mailer->send($message, $failures); - } - - public function testSendRecordsRfcComplianceExceptionAsEntireSendFailure() - { - $failures = array(); - - $rfcException = new Swift_RfcComplianceException('test'); - $transport = $this->_createTransport(); - $message = $this->_createMessage(); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo&invalid' => 'Foo', 'bar@valid.tld' => 'Bar')); - $transport->shouldReceive('send') - ->once() - ->with($message, $failures) - ->andThrow($rfcException); - - $mailer = $this->_createMailer($transport); - $this->assertEquals(0, $mailer->send($message, $failures), '%s: Should return 0'); - $this->assertEquals(array('foo&invalid', 'bar@valid.tld'), $failures, '%s: Failures should contain all addresses since the entire message failed to compile'); - } - - public function testRegisterPluginDelegatesToTransport() - { - $plugin = $this->_createPlugin(); - $transport = $this->_createTransport(); - $mailer = $this->_createMailer($transport); - - $transport->shouldReceive('registerPlugin') - ->once() - ->with($plugin); - - $mailer->registerPlugin($plugin); - } - - private function _createPlugin() - { - return $this->getMockery('Swift_Events_EventListener')->shouldIgnoreMissing(); - } - - private function _createTransport() - { - return $this->getMockery('Swift_Transport')->shouldIgnoreMissing(); - } - - private function _createMessage() - { - return $this->getMockery('Swift_Mime_Message')->shouldIgnoreMissing(); - } - - private function _createMailer(Swift_Transport $transport) - { - return new Swift_Mailer($transport); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MessageTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MessageTest.php deleted file mode 100644 index 9cec33e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MessageTest.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php - -class Swift_MessageTest extends \PHPUnit_Framework_TestCase -{ - public function testCloning() - { - $message1 = new Swift_Message('subj', 'body', 'ctype'); - $message2 = new Swift_Message('subj', 'body', 'ctype'); - $message1_clone = clone $message1; - - $this->_recursiveObjectCloningCheck($message1, $message2, $message1_clone); - } - - public function testCloningWithSigners() - { - $message1 = new Swift_Message('subj', 'body', 'ctype'); - $signer = new Swift_Signers_DKIMSigner(dirname(dirname(__DIR__)) . '/_samples/dkim/dkim.test.priv', 'test.example', 'example'); - $message1->attachSigner($signer); - $message2 = new Swift_Message('subj', 'body', 'ctype'); - $signer = new Swift_Signers_DKIMSigner(dirname(dirname(__DIR__)) . '/_samples/dkim/dkim.test.priv', 'test.example', 'example'); - $message2->attachSigner($signer); - $message1_clone = clone $message1; - - $this->_recursiveObjectCloningCheck($message1, $message2, $message1_clone); - } - - public function testBodySwap() - { - $message1 = new Swift_Message('Test'); - $html = Swift_MimePart::newInstance('<html></html>', 'text/html'); - $html->getHeaders()->addTextHeader('X-Test-Remove', 'Test-Value'); - $html->getHeaders()->addTextHeader('X-Test-Alter', 'Test-Value'); - $message1->attach($html); - $source = $message1->toString(); - $message2 = clone $message1; - $message2->setSubject('Message2'); - foreach ($message2->getChildren() as $child) { - $child->setBody('Test'); - $child->getHeaders()->removeAll('X-Test-Remove'); - $child->getHeaders()->get('X-Test-Alter')->setValue('Altered'); - } - $final = $message1->toString(); - if ($source != $final) { - $this->fail("Difference although object cloned \n [".$source."]\n[".$final."]\n"); - } - $final = $message2->toString(); - if ($final == $source) { - $this->fail('Two body matches although they should differ'."\n [".$source."]\n[".$final."]\n"); - } - $id_1 = $message1->getId(); - $id_2 = $message2->getId(); - $this->assertEquals($id_1, $id_2, 'Message Ids differ'); - $id_2 = $message2->generateId(); - $this->assertNotEquals($id_1, $id_2, 'Message Ids are the same'); - } - - protected function _recursiveObjectCloningCheck($obj1, $obj2, $obj1_clone) - { - $obj1_properties = (array) $obj1; - $obj2_properties = (array) $obj2; - $obj1_clone_properties = (array) $obj1_clone; - - foreach ($obj1_properties as $property => $value) { - if (is_object($value)) { - $obj1_value = $obj1_properties[$property]; - $obj2_value = $obj2_properties[$property]; - $obj1_clone_value = $obj1_clone_properties[$property]; - - if ($obj1_value !== $obj2_value) { - // two separetely instanciated objects property not referencing same object - $this->assertFalse( - // but object's clone does - not everything copied - $obj1_value === $obj1_clone_value, - "Property `$property` cloning error: source and cloned objects property is referencing same object" - ); - } else { - // two separetely instanciated objects have same reference - $this->assertFalse( - // but object's clone doesn't - overdone making copies - $obj1_value !== $obj1_clone_value, - "Property `$property` not properly cloned: it should reference same object as cloning source (overdone copping)" - ); - } - // recurse - $this->_recursiveObjectCloningCheck($obj1_value, $obj2_value, $obj1_clone_value); - } elseif (is_array($value)) { - $obj1_value = $obj1_properties[$property]; - $obj2_value = $obj2_properties[$property]; - $obj1_clone_value = $obj1_clone_properties[$property]; - - return $this->_recursiveArrayCloningCheck($obj1_value, $obj2_value, $obj1_clone_value); - } - } - } - - protected function _recursiveArrayCloningCheck($array1, $array2, $array1_clone) - { - foreach ($array1 as $key => $value) { - if (is_object($value)) { - $arr1_value = $array1[$key]; - $arr2_value = $array2[$key]; - $arr1_clone_value = $array1_clone[$key]; - if ($arr1_value !== $arr2_value) { - // two separetely instanciated objects property not referencing same object - $this->assertFalse( - // but object's clone does - not everything copied - $arr1_value === $arr1_clone_value, - "Key `$key` cloning error: source and cloned objects property is referencing same object" - ); - } else { - // two separetely instanciated objects have same reference - $this->assertFalse( - // but object's clone doesn't - overdone making copies - $arr1_value !== $arr1_clone_value, - "Key `$key` not properly cloned: it should reference same object as cloning source (overdone copping)" - ); - } - // recurse - $this->_recursiveObjectCloningCheck($arr1_value, $arr2_value, $arr1_clone_value); - } elseif (is_array($value)) { - $arr1_value = $array1[$key]; - $arr2_value = $array2[$key]; - $arr1_clone_value = $array1_clone[$key]; - - return $this->_recursiveArrayCloningCheck($arr1_value, $arr2_value, $arr1_clone_value); - } - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php deleted file mode 100644 index 9bdeffa..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php +++ /dev/null @@ -1,1092 +0,0 @@ -<?php - -require_once dirname(dirname(dirname(__DIR__))) . '/fixtures/MimeEntityFixture.php'; - -abstract class Swift_Mime_AbstractMimeEntityTest extends \SwiftMailerTestCase -{ - public function testGetHeadersReturnsHeaderSet() - { - $headers = $this->_createHeaderSet(); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $this->assertSame($headers, $entity->getHeaders()); - } - - public function testContentTypeIsReturnedFromHeader() - { - $ctype = $this->_createHeader('Content-Type', 'image/jpeg-test'); - $headers = $this->_createHeaderSet(array('Content-Type' => $ctype)); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $this->assertEquals('image/jpeg-test', $entity->getContentType()); - } - - public function testContentTypeIsSetInHeader() - { - $ctype = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $headers = $this->_createHeaderSet(array('Content-Type' => $ctype)); - - $ctype->shouldReceive('setFieldBodyModel') - ->once() - ->with('image/jpeg'); - $ctype->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes() - ->with(\Mockery::not('image/jpeg')); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setContentType('image/jpeg'); - } - - public function testContentTypeHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addParameterizedHeader') - ->once() - ->with('Content-Type', 'image/jpeg'); - $headers->shouldReceive('addParameterizedHeader') - ->zeroOrMoreTimes(); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setContentType('image/jpeg'); - } - - public function testContentTypeCanBeSetViaSetBody() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addParameterizedHeader') - ->once() - ->with('Content-Type', 'text/html'); - $headers->shouldReceive('addParameterizedHeader') - ->zeroOrMoreTimes(); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBody('<b>foo</b>', 'text/html'); - } - - public function testGetEncoderFromConstructor() - { - $encoder = $this->_createEncoder('base64'); - $entity = $this->_createEntity($this->_createHeaderSet(), $encoder, - $this->_createCache() - ); - $this->assertSame($encoder, $entity->getEncoder()); - } - - public function testSetAndGetEncoder() - { - $encoder = $this->_createEncoder('base64'); - $headers = $this->_createHeaderSet(); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setEncoder($encoder); - $this->assertSame($encoder, $entity->getEncoder()); - } - - public function testSettingEncoderUpdatesTransferEncoding() - { - $encoder = $this->_createEncoder('base64'); - $encoding = $this->_createHeader( - 'Content-Transfer-Encoding', '8bit', array(), false - ); - $headers = $this->_createHeaderSet(array( - 'Content-Transfer-Encoding' => $encoding, - )); - $encoding->shouldReceive('setFieldBodyModel') - ->once() - ->with('base64'); - $encoding->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setEncoder($encoder); - } - - public function testSettingEncoderAddsEncodingHeaderIfNonePresent() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addTextHeader') - ->once() - ->with('Content-Transfer-Encoding', 'something'); - $headers->shouldReceive('addTextHeader') - ->zeroOrMoreTimes(); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setEncoder($this->_createEncoder('something')); - } - - public function testIdIsReturnedFromHeader() - { - /* -- RFC 2045, 7. - In constructing a high-level user agent, it may be desirable to allow - one body to make reference to another. Accordingly, bodies may be - labelled using the "Content-ID" header field, which is syntactically - identical to the "Message-ID" header field - */ - - $cid = $this->_createHeader('Content-ID', 'zip@button'); - $headers = $this->_createHeaderSet(array('Content-ID' => $cid)); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $this->assertEquals('zip@button', $entity->getId()); - } - - public function testIdIsSetInHeader() - { - $cid = $this->_createHeader('Content-ID', 'zip@button', array(), false); - $headers = $this->_createHeaderSet(array('Content-ID' => $cid)); - - $cid->shouldReceive('setFieldBodyModel') - ->once() - ->with('foo@bar'); - $cid->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setId('foo@bar'); - } - - public function testIdIsAutoGenerated() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertRegExp('/^.*?@.*?$/D', $entity->getId()); - } - - public function testGenerateIdCreatesNewId() - { - $headers = $this->_createHeaderSet(); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $id1 = $entity->generateId(); - $id2 = $entity->generateId(); - $this->assertNotEquals($id1, $id2); - } - - public function testGenerateIdSetsNewId() - { - $headers = $this->_createHeaderSet(); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $id = $entity->generateId(); - $this->assertEquals($id, $entity->getId()); - } - - public function testDescriptionIsReadFromHeader() - { - /* -- RFC 2045, 8. - The ability to associate some descriptive information with a given - body is often desirable. For example, it may be useful to mark an - "image" body as "a picture of the Space Shuttle Endeavor." Such text - may be placed in the Content-Description header field. This header - field is always optional. - */ - - $desc = $this->_createHeader('Content-Description', 'something'); - $headers = $this->_createHeaderSet(array('Content-Description' => $desc)); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $this->assertEquals('something', $entity->getDescription()); - } - - public function testDescriptionIsSetInHeader() - { - $desc = $this->_createHeader('Content-Description', '', array(), false); - $desc->shouldReceive('setFieldBodyModel')->once()->with('whatever'); - - $headers = $this->_createHeaderSet(array('Content-Description' => $desc)); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setDescription('whatever'); - } - - public function testDescriptionHeaderIsAddedIfNotPresent() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addTextHeader') - ->once() - ->with('Content-Description', 'whatever'); - $headers->shouldReceive('addTextHeader') - ->zeroOrMoreTimes(); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setDescription('whatever'); - } - - public function testSetAndGetMaxLineLength() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setMaxLineLength(60); - $this->assertEquals(60, $entity->getMaxLineLength()); - } - - public function testEncoderIsUsedForStringGeneration() - { - $encoder = $this->_createEncoder('base64', false); - $encoder->expects($this->once()) - ->method('encodeString') - ->with('blah'); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $encoder, $this->_createCache() - ); - $entity->setBody('blah'); - $entity->toString(); - } - - public function testMaxLineLengthIsProvidedWhenEncoding() - { - $encoder = $this->_createEncoder('base64', false); - $encoder->expects($this->once()) - ->method('encodeString') - ->with('blah', 0, 65); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $encoder, $this->_createCache() - ); - $entity->setBody('blah'); - $entity->setMaxLineLength(65); - $entity->toString(); - } - - public function testHeadersAppearInString() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('toString') - ->once() - ->andReturn( - "Content-Type: text/plain; charset=utf-8\r\n". - "X-MyHeader: foobar\r\n" - ); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $this->assertEquals( - "Content-Type: text/plain; charset=utf-8\r\n". - "X-MyHeader: foobar\r\n", - $entity->toString() - ); - } - - public function testSetAndGetBody() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setBody("blah\r\nblah!"); - $this->assertEquals("blah\r\nblah!", $entity->getBody()); - } - - public function testBodyIsAppended() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('toString') - ->once() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBody("blah\r\nblah!"); - $this->assertEquals( - "Content-Type: text/plain; charset=utf-8\r\n". - "\r\n". - "blah\r\nblah!", - $entity->toString() - ); - } - - public function testGetBodyReturnsStringFromByteStream() - { - $os = $this->_createOutputStream('byte stream string'); - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setBody($os); - $this->assertEquals('byte stream string', $entity->getBody()); - } - - public function testByteStreamBodyIsAppended() - { - $headers = $this->_createHeaderSet(array(), false); - $os = $this->_createOutputStream('streamed'); - $headers->shouldReceive('toString') - ->once() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBody($os); - $this->assertEquals( - "Content-Type: text/plain; charset=utf-8\r\n". - "\r\n". - 'streamed', - $entity->toString() - ); - } - - public function testBoundaryCanBeRetrieved() - { - /* -- RFC 2046, 5.1.1. - boundary := 0*69<bchars> bcharsnospace - - bchars := bcharsnospace / " " - - bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / - "+" / "_" / "," / "-" / "." / - "/" / ":" / "=" / "?" - */ - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertRegExp( - '/^[a-zA-Z0-9\'\(\)\+_\-,\.\/:=\?\ ]{0,69}[a-zA-Z0-9\'\(\)\+_\-,\.\/:=\?]$/D', - $entity->getBoundary() - ); - } - - public function testBoundaryNeverChanges() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $firstBoundary = $entity->getBoundary(); - for ($i = 0; $i < 10; ++$i) { - $this->assertEquals($firstBoundary, $entity->getBoundary()); - } - } - - public function testBoundaryCanBeSet() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setBoundary('foobar'); - $this->assertEquals('foobar', $entity->getBoundary()); - } - - public function testAddingChildrenGeneratesBoundaryInHeaders() - { - $child = $this->_createChild(); - $cType = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $cType->shouldReceive('setParameter') - ->once() - ->with('boundary', \Mockery::any()); - $cType->shouldReceive('setParameter') - ->zeroOrMoreTimes(); - - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType, - )), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - } - - public function testChildrenOfLevelAttachmentAndLessCauseMultipartMixed() - { - for ($level = Swift_Mime_MimeEntity::LEVEL_MIXED; - $level > Swift_Mime_MimeEntity::LEVEL_TOP; $level /= 2) { - $child = $this->_createChild($level); - $cType = $this->_createHeader( - 'Content-Type', 'text/plain', array(), false - ); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with('multipart/mixed'); - $cType->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - } - } - - public function testChildrenOfLevelAlternativeAndLessCauseMultipartAlternative() - { - for ($level = Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE; - $level > Swift_Mime_MimeEntity::LEVEL_MIXED; $level /= 2) { - $child = $this->_createChild($level); - $cType = $this->_createHeader( - 'Content-Type', 'text/plain', array(), false - ); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with('multipart/alternative'); - $cType->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - } - } - - public function testChildrenOfLevelRelatedAndLessCauseMultipartRelated() - { - for ($level = Swift_Mime_MimeEntity::LEVEL_RELATED; - $level > Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE; $level /= 2) { - $child = $this->_createChild($level); - $cType = $this->_createHeader( - 'Content-Type', 'text/plain', array(), false - ); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with('multipart/related'); - $cType->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - } - } - - public function testHighestLevelChildDeterminesContentType() - { - $combinations = array( - array('levels' => array(Swift_Mime_MimeEntity::LEVEL_MIXED, - Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - Swift_Mime_MimeEntity::LEVEL_RELATED, - ), - 'type' => 'multipart/mixed', - ), - array('levels' => array(Swift_Mime_MimeEntity::LEVEL_MIXED, - Swift_Mime_MimeEntity::LEVEL_RELATED, - ), - 'type' => 'multipart/mixed', - ), - array('levels' => array(Swift_Mime_MimeEntity::LEVEL_MIXED, - Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - ), - 'type' => 'multipart/mixed', - ), - array('levels' => array(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - Swift_Mime_MimeEntity::LEVEL_RELATED, - ), - 'type' => 'multipart/alternative', - ), - ); - - foreach ($combinations as $combination) { - $children = array(); - foreach ($combination['levels'] as $level) { - $children[] = $this->_createChild($level); - } - - $cType = $this->_createHeader( - 'Content-Type', 'text/plain', array(), false - ); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with($combination['type']); - - $headerSet = $this->_createHeaderSet(array('Content-Type' => $cType)); - $headerSet->shouldReceive('newInstance') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use ($headerSet) { - return $headerSet; - }); - $entity = $this->_createEntity($headerSet, - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren($children); - } - } - - public function testChildrenAppearNestedInString() - { - /* -- RFC 2046, 5.1.1. - (excerpt too verbose to paste here) - */ - - $headers = $this->_createHeaderSet(array(), false); - - $child1 = new MimeEntityFixture(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n". - "\r\n". - 'foobar', 'text/plain' - ); - - $child2 = new MimeEntityFixture(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/html\r\n". - "\r\n". - '<b>foobar</b>', 'text/html' - ); - - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: multipart/alternative; boundary=\"xxx\"\r\n"); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren(array($child1, $child2)); - - $this->assertEquals( - "Content-Type: multipart/alternative; boundary=\"xxx\"\r\n". - "\r\n". - "\r\n--xxx\r\n". - "Content-Type: text/plain\r\n". - "\r\n". - "foobar\r\n". - "\r\n--xxx\r\n". - "Content-Type: text/html\r\n". - "\r\n". - "<b>foobar</b>\r\n". - "\r\n--xxx--\r\n", - $entity->toString() - ); - } - - public function testMixingLevelsIsHierarchical() - { - $headers = $this->_createHeaderSet(array(), false); - $newHeaders = $this->_createHeaderSet(array(), false); - - $part = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n". - "\r\n". - 'foobar' - ); - - $attachment = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_MIXED, - "Content-Type: application/octet-stream\r\n". - "\r\n". - 'data' - ); - - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: multipart/mixed; boundary=\"xxx\"\r\n"); - $headers->shouldReceive('newInstance') - ->zeroOrMoreTimes() - ->andReturn($newHeaders); - $newHeaders->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: multipart/alternative; boundary=\"yyy\"\r\n"); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren(array($part, $attachment)); - - $this->assertRegExp( - '~^'. - "Content-Type: multipart/mixed; boundary=\"xxx\"\r\n". - "\r\n\r\n--xxx\r\n". - "Content-Type: multipart/alternative; boundary=\"yyy\"\r\n". - "\r\n\r\n--(.*?)\r\n". - "Content-Type: text/plain\r\n". - "\r\n". - 'foobar'. - "\r\n\r\n--\\1--\r\n". - "\r\n\r\n--xxx\r\n". - "Content-Type: application/octet-stream\r\n". - "\r\n". - 'data'. - "\r\n\r\n--xxx--\r\n". - '$~', - $entity->toString() - ); - } - - public function testSettingEncoderNotifiesChildren() - { - $child = $this->_createChild(0, '', false); - $encoder = $this->_createEncoder('base64'); - - $child->shouldReceive('encoderChanged') - ->once() - ->with($encoder); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - $entity->setEncoder($encoder); - } - - public function testReceiptOfEncoderChangeNotifiesChildren() - { - $child = $this->_createChild(0, '', false); - $encoder = $this->_createEncoder('base64'); - - $child->shouldReceive('encoderChanged') - ->once() - ->with($encoder); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - $entity->encoderChanged($encoder); - } - - public function testReceiptOfCharsetChangeNotifiesChildren() - { - $child = $this->_createChild(0, '', false); - $child->shouldReceive('charsetChanged') - ->once() - ->with('windows-874'); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $entity->setChildren(array($child)); - $entity->charsetChanged('windows-874'); - } - - public function testEntityIsWrittenToByteStream() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $is = $this->_createInputStream(false); - $is->expects($this->atLeastOnce()) - ->method('write'); - - $entity->toByteStream($is); - } - - public function testEntityHeadersAreComittedToByteStream() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $is = $this->_createInputStream(false); - $is->expects($this->atLeastOnce()) - ->method('write'); - $is->expects($this->atLeastOnce()) - ->method('commit'); - - $entity->toByteStream($is); - } - - public function testOrderingTextBeforeHtml() - { - $htmlChild = new MimeEntityFixture(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/html\r\n". - "\r\n". - 'HTML PART', - 'text/html' - ); - $textChild = new MimeEntityFixture(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n". - "\r\n". - 'TEXT PART', - 'text/plain' - ); - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: multipart/alternative; boundary=\"xxx\"\r\n"); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren(array($htmlChild, $textChild)); - - $this->assertEquals( - "Content-Type: multipart/alternative; boundary=\"xxx\"\r\n". - "\r\n\r\n--xxx\r\n". - "Content-Type: text/plain\r\n". - "\r\n". - 'TEXT PART'. - "\r\n\r\n--xxx\r\n". - "Content-Type: text/html\r\n". - "\r\n". - 'HTML PART'. - "\r\n\r\n--xxx--\r\n", - $entity->toString() - ); - } - - public function testOrderingEqualContentTypesMaintainsOriginalOrdering() - { - $firstChild = new MimeEntityFixture(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n". - "\r\n". - 'PART 1', - 'text/plain' - ); - $secondChild = new MimeEntityFixture(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n". - "\r\n". - 'PART 2', - 'text/plain' - ); - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: multipart/alternative; boundary=\"xxx\"\r\n"); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $this->_createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren(array($firstChild, $secondChild)); - - $this->assertEquals( - "Content-Type: multipart/alternative; boundary=\"xxx\"\r\n". - "\r\n\r\n--xxx\r\n". - "Content-Type: text/plain\r\n". - "\r\n". - 'PART 1'. - "\r\n\r\n--xxx\r\n". - "Content-Type: text/plain\r\n". - "\r\n". - 'PART 2'. - "\r\n\r\n--xxx--\r\n", - $entity->toString() - ); - } - - public function testUnsettingChildrenRestoresContentType() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $child = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE); - - $cType->shouldReceive('setFieldBodyModel') - ->twice() - ->with('image/jpeg'); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with('multipart/alternative'); - $cType->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes() - ->with(\Mockery::not('multipart/alternative', 'image/jpeg')); - - $entity = $this->_createEntity($this->_createHeaderSet(array( - 'Content-Type' => $cType, - )), - $this->_createEncoder(), $this->_createCache() - ); - - $entity->setContentType('image/jpeg'); - $entity->setChildren(array($child)); - $entity->setChildren(array()); - } - - public function testBodyIsReadFromCacheWhenUsingToStringIfPresent() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->_createCache(false); - $cache->shouldReceive('hasKey') - ->once() - ->with(\Mockery::any(), 'body') - ->andReturn(true); - $cache->shouldReceive('getString') - ->once() - ->with(\Mockery::any(), 'body') - ->andReturn("\r\ncache\r\ncache!"); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $this->assertEquals( - "Content-Type: text/plain; charset=utf-8\r\n". - "\r\n". - "cache\r\ncache!", - $entity->toString() - ); - } - - public function testBodyIsAddedToCacheWhenUsingToString() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->_createCache(false); - $cache->shouldReceive('hasKey') - ->once() - ->with(\Mockery::any(), 'body') - ->andReturn(false); - $cache->shouldReceive('setString') - ->once() - ->with(\Mockery::any(), 'body', "\r\nblah\r\nblah!", Swift_KeyCache::MODE_WRITE); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - } - - public function testBodyIsClearedFromCacheIfNewBodySet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->_createCache(false); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - // We set the expectation at this point because we only care what happens when calling setBody() - $cache->shouldReceive('clearKey') - ->once() - ->with(\Mockery::any(), 'body'); - - $entity->setBody("new\r\nnew!"); - } - - public function testBodyIsNotClearedFromCacheIfSameBodySet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->_createCache(false); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - // We set the expectation at this point because we only care what happens when calling setBody() - $cache->shouldReceive('clearKey') - ->never(); - - $entity->setBody("blah\r\nblah!"); - } - - public function testBodyIsClearedFromCacheIfNewEncoderSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->_createCache(false); - $otherEncoder = $this->_createEncoder(); - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - // We set the expectation at this point because we only care what happens when calling setEncoder() - $cache->shouldReceive('clearKey') - ->once() - ->with(\Mockery::any(), 'body'); - - $entity->setEncoder($otherEncoder); - } - - public function testBodyIsReadFromCacheWhenUsingToByteStreamIfPresent() - { - $is = $this->_createInputStream(); - $cache = $this->_createCache(false); - $cache->shouldReceive('hasKey') - ->once() - ->with(\Mockery::any(), 'body') - ->andReturn(true); - $cache->shouldReceive('exportToByteStream') - ->once() - ->with(\Mockery::any(), 'body', $is); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $cache - ); - $entity->setBody('foo'); - - $entity->toByteStream($is); - } - - public function testBodyIsAddedToCacheWhenUsingToByteStream() - { - $is = $this->_createInputStream(); - $cache = $this->_createCache(false); - $cache->shouldReceive('hasKey') - ->once() - ->with(\Mockery::any(), 'body') - ->andReturn(false); - $cache->shouldReceive('getInputByteStream') - ->once() - ->with(\Mockery::any(), 'body'); - - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $cache - ); - $entity->setBody('foo'); - - $entity->toByteStream($is); - } - - public function testFluidInterface() - { - $entity = $this->_createEntity($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $this->assertSame($entity, - $entity - ->setContentType('text/plain') - ->setEncoder($this->_createEncoder()) - ->setId('foo@bar') - ->setDescription('my description') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren(array()) - ); - } - - abstract protected function _createEntity($headers, $encoder, $cache); - - protected function _createChild($level = null, $string = '', $stub = true) - { - $child = $this->getMockery('Swift_Mime_MimeEntity')->shouldIgnoreMissing(); - if (isset($level)) { - $child->shouldReceive('getNestingLevel') - ->zeroOrMoreTimes() - ->andReturn($level); - } - $child->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn($string); - - return $child; - } - - protected function _createEncoder($name = 'quoted-printable', $stub = true) - { - $encoder = $this->getMockBuilder('Swift_Mime_ContentEncoder')->getMock(); - $encoder->expects($this->any()) - ->method('getName') - ->will($this->returnValue($name)); - $encoder->expects($this->any()) - ->method('encodeString') - ->will($this->returnCallback(function () { - $args = func_get_args(); - - return array_shift($args); - })); - - return $encoder; - } - - protected function _createCache($stub = true) - { - return $this->getMockery('Swift_KeyCache')->shouldIgnoreMissing(); - } - - protected function _createHeaderSet($headers = array(), $stub = true) - { - $set = $this->getMockery('Swift_Mime_HeaderSet')->shouldIgnoreMissing(); - $set->shouldReceive('get') - ->zeroOrMoreTimes() - ->andReturnUsing(function ($key) use ($headers) { - return $headers[$key]; - }); - $set->shouldReceive('has') - ->zeroOrMoreTimes() - ->andReturnUsing(function ($key) use ($headers) { - return array_key_exists($key, $headers); - }); - - return $set; - } - - protected function _createHeader($name, $model = null, $params = array(), $stub = true) - { - $header = $this->getMockery('Swift_Mime_ParameterizedHeader')->shouldIgnoreMissing(); - $header->shouldReceive('getFieldName') - ->zeroOrMoreTimes() - ->andReturn($name); - $header->shouldReceive('getFieldBodyModel') - ->zeroOrMoreTimes() - ->andReturn($model); - $header->shouldReceive('getParameter') - ->zeroOrMoreTimes() - ->andReturnUsing(function ($key) use ($params) { - return $params[$key]; - }); - - return $header; - } - - protected function _createOutputStream($data = null, $stub = true) - { - $os = $this->getMockery('Swift_OutputByteStream'); - if (isset($data)) { - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use ($data) { - static $first = true; - if (!$first) { - return false; - } - - $first = false; - - return $data; - }); - $os->shouldReceive('setReadPointer') - ->zeroOrMoreTimes(); - } - - return $os; - } - - protected function _createInputStream($stub = true) - { - return $this->getMockBuilder('Swift_InputByteStream')->getMock(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php deleted file mode 100644 index 2c1e581..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php +++ /dev/null @@ -1,318 +0,0 @@ -<?php - -class Swift_Mime_AttachmentTest extends Swift_Mime_AbstractMimeEntityTest -{ - public function testNestingLevelIsAttachment() - { - $attachment = $this->_createAttachment($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals( - Swift_Mime_MimeEntity::LEVEL_MIXED, $attachment->getNestingLevel() - ); - } - - public function testDispositionIsReturnedFromHeader() - { - /* -- RFC 2183, 2.1, 2.2. - */ - - $disposition = $this->_createHeader('Content-Disposition', 'attachment'); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, )), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals('attachment', $attachment->getDisposition()); - } - - public function testDispositionIsSetInHeader() - { - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array(), false - ); - $disposition->shouldReceive('setFieldBodyModel') - ->once() - ->with('inline'); - $disposition->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, )), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setDisposition('inline'); - } - - public function testDispositionIsAddedIfNonePresent() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addParameterizedHeader') - ->once() - ->with('Content-Disposition', 'inline'); - $headers->shouldReceive('addParameterizedHeader') - ->zeroOrMoreTimes(); - - $attachment = $this->_createAttachment($headers, $this->_createEncoder(), - $this->_createCache() - ); - $attachment->setDisposition('inline'); - } - - public function testDispositionIsAutoDefaultedToAttachment() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addParameterizedHeader') - ->once() - ->with('Content-Disposition', 'attachment'); - $headers->shouldReceive('addParameterizedHeader') - ->zeroOrMoreTimes(); - - $attachment = $this->_createAttachment($headers, $this->_createEncoder(), - $this->_createCache() - ); - } - - public function testDefaultContentTypeInitializedToOctetStream() - { - $cType = $this->_createHeader('Content-Type', '', - array(), false - ); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with('application/octet-stream'); - $cType->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - } - - public function testFilenameIsReturnedFromHeader() - { - /* -- RFC 2183, 2.3. - */ - - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('filename' => 'foo.txt') - ); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, )), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals('foo.txt', $attachment->getFilename()); - } - - public function testFilenameIsSetInHeader() - { - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('filename' => 'foo.txt'), false - ); - $disposition->shouldReceive('setParameter') - ->once() - ->with('filename', 'bar.txt'); - $disposition->shouldReceive('setParameter') - ->zeroOrMoreTimes(); - - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, )), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setFilename('bar.txt'); - } - - public function testSettingFilenameSetsNameInContentType() - { - /* - This is a legacy requirement which isn't covered by up-to-date RFCs. - */ - - $cType = $this->_createHeader('Content-Type', 'text/plain', - array(), false - ); - $cType->shouldReceive('setParameter') - ->once() - ->with('name', 'bar.txt'); - $cType->shouldReceive('setParameter') - ->zeroOrMoreTimes(); - - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setFilename('bar.txt'); - } - - public function testSizeIsReturnedFromHeader() - { - /* -- RFC 2183, 2.7. - */ - - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('size' => 1234) - ); - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, )), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals(1234, $attachment->getSize()); - } - - public function testSizeIsSetInHeader() - { - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array(), false - ); - $disposition->shouldReceive('setParameter') - ->once() - ->with('size', 12345); - $disposition->shouldReceive('setParameter') - ->zeroOrMoreTimes(); - - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, )), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setSize(12345); - } - - public function testFilnameCanBeReadFromFileStream() - { - $file = $this->_createFileStream('/bar/file.ext', ''); - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('filename' => 'foo.txt'), false - ); - $disposition->shouldReceive('setParameter') - ->once() - ->with('filename', 'file.ext'); - - $attachment = $this->_createAttachment($this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, )), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setFile($file); - } - - public function testContentTypeCanBeSetViaSetFile() - { - $file = $this->_createFileStream('/bar/file.ext', ''); - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('filename' => 'foo.txt'), false - ); - $disposition->shouldReceive('setParameter') - ->once() - ->with('filename', 'file.ext'); - - $ctype = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $ctype->shouldReceive('setFieldBodyModel') - ->once() - ->with('text/html'); - $ctype->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $headers = $this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, - 'Content-Type' => $ctype, - )); - - $attachment = $this->_createAttachment($headers, $this->_createEncoder(), - $this->_createCache() - ); - $attachment->setFile($file, 'text/html'); - } - - public function XtestContentTypeCanBeLookedUpFromCommonListIfNotProvided() - { - $file = $this->_createFileStream('/bar/file.zip', ''); - $disposition = $this->_createHeader('Content-Disposition', 'attachment', - array('filename' => 'foo.zip'), false - ); - $disposition->shouldReceive('setParameter') - ->once() - ->with('filename', 'file.zip'); - - $ctype = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $ctype->shouldReceive('setFieldBodyModel') - ->once() - ->with('application/zip'); - $ctype->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $headers = $this->_createHeaderSet(array( - 'Content-Disposition' => $disposition, - 'Content-Type' => $ctype, - )); - - $attachment = $this->_createAttachment($headers, $this->_createEncoder(), - $this->_createCache(), array('zip' => 'application/zip', 'txt' => 'text/plain') - ); - $attachment->setFile($file); - } - - public function testDataCanBeReadFromFile() - { - $file = $this->_createFileStream('/foo/file.ext', '<some data>'); - $attachment = $this->_createAttachment($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $attachment->setFile($file); - $this->assertEquals('<some data>', $attachment->getBody()); - } - - public function testFluidInterface() - { - $attachment = $this->_createAttachment($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertSame($attachment, - $attachment - ->setContentType('application/pdf') - ->setEncoder($this->_createEncoder()) - ->setId('foo@bar') - ->setDescription('my pdf') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren(array()) - ->setDisposition('inline') - ->setFilename('afile.txt') - ->setSize(123) - ->setFile($this->_createFileStream('foo.txt', '')) - ); - } - - protected function _createEntity($headers, $encoder, $cache) - { - return $this->_createAttachment($headers, $encoder, $cache); - } - - protected function _createAttachment($headers, $encoder, $cache, $mimeTypes = array()) - { - return new Swift_Mime_Attachment($headers, $encoder, $cache, new Swift_Mime_Grammar(), $mimeTypes); - } - - protected function _createFileStream($path, $data, $stub = true) - { - $file = $this->getMockery('Swift_FileStream'); - $file->shouldReceive('getPath') - ->zeroOrMoreTimes() - ->andReturn($path); - $file->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use ($data) { - static $first = true; - if (!$first) { - return false; - } - - $first = false; - - return $data; - }); - $file->shouldReceive('setReadPointer') - ->zeroOrMoreTimes(); - - return $file; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php deleted file mode 100644 index 1571fce..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php +++ /dev/null @@ -1,323 +0,0 @@ -<?php - -class Swift_Mime_ContentEncoder_Base64ContentEncoderTest extends \SwiftMailerTestCase -{ - private $_encoder; - - protected function setUp() - { - $this->_encoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - } - - public function testNameIsBase64() - { - $this->assertEquals('base64', $this->_encoder->getName()); - } - - /* - There's really no point in testing the entire base64 encoding to the - level QP encoding has been tested. base64_encode() has been in PHP for - years. - */ - - public function testInputOutputRatioIs3to4Bytes() - { - /* - RFC 2045, 6.8 - - The encoding process represents 24-bit groups of input bits as output - strings of 4 encoded characters. Proceeding from left to right, a - 24-bit input group is formed by concatenating 3 8bit input groups. - These 24 bits are then treated as 4 concatenated 6-bit groups, each - of which is translated into a single digit in the base64 alphabet. - */ - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('123'); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->_encoder->encodeByteStream($os, $is); - $this->assertEquals('MTIz', $collection->content); - } - - public function testPadLength() - { - /* - RFC 2045, 6.8 - - Special processing is performed if fewer than 24 bits are available - at the end of the data being encoded. A full encoding quantum is - always completed at the end of a body. When fewer than 24 input bits - are available in an input group, zero bits are added (on the right) - to form an integral number of 6-bit groups. Padding at the end of - the data is performed using the "=" character. Since all base64 - input is an integral number of octets, only the following cases can - arise: (1) the final quantum of encoding input is an integral - multiple of 24 bits; here, the final unit of encoded output will be - an integral multiple of 4 characters with no "=" padding, (2) the - final quantum of encoding input is exactly 8 bits; here, the final - unit of encoded output will be two characters followed by two "=" - padding characters, or (3) the final quantum of encoding input is - exactly 16 bits; here, the final unit of encoded output will be three - characters followed by one "=" padding character. - */ - - for ($i = 0; $i < 30; ++$i) { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn(pack('C', rand(0, 255))); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->_encoder->encodeByteStream($os, $is); - $this->assertRegExp('~^[a-zA-Z0-9/\+]{2}==$~', $collection->content, - '%s: A single byte should have 2 bytes of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn(pack('C*', rand(0, 255), rand(0, 255))); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->_encoder->encodeByteStream($os, $is); - $this->assertRegExp('~^[a-zA-Z0-9/\+]{3}=$~', $collection->content, - '%s: Two bytes should have 1 byte of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn(pack('C*', rand(0, 255), rand(0, 255), rand(0, 255))); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->_encoder->encodeByteStream($os, $is); - $this->assertRegExp('~^[a-zA-Z0-9/\+]{4}$~', $collection->content, - '%s: Three bytes should have no padding' - ); - } - } - - public function testMaximumLineLengthIs76Characters() - { - /* - The encoded output stream must be represented in lines of no more - than 76 characters each. All line breaks or other characters not - found in Table 1 must be ignored by decoding software. - */ - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //12 - $os->shouldReceive('read') - ->once() - ->andReturn('mnopqrstuvwx'); //24 - $os->shouldReceive('read') - ->once() - ->andReturn('yzabc1234567'); //36 - $os->shouldReceive('read') - ->once() - ->andReturn('890ABCDEFGHI'); //48 - $os->shouldReceive('read') - ->once() - ->andReturn('JKLMNOPQRSTU'); //60 - $os->shouldReceive('read') - ->once() - ->andReturn('VWXYZ1234567'); //72 - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //84 - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->_encoder->encodeByteStream($os, $is); - $this->assertEquals( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDREVGR0hJSktMTU5PUFFS\r\n". - 'U1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts', - $collection->content - ); - } - - public function testMaximumLineLengthCanBeDifferent() - { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //12 - $os->shouldReceive('read') - ->once() - ->andReturn('mnopqrstuvwx'); //24 - $os->shouldReceive('read') - ->once() - ->andReturn('yzabc1234567'); //36 - $os->shouldReceive('read') - ->once() - ->andReturn('890ABCDEFGHI'); //48 - $os->shouldReceive('read') - ->once() - ->andReturn('JKLMNOPQRSTU'); //60 - $os->shouldReceive('read') - ->once() - ->andReturn('VWXYZ1234567'); //72 - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //84 - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->_encoder->encodeByteStream($os, $is, 0, 50); - $this->assertEquals( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3OD\r\n". - "kwQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVoxMjM0NTY3YWJj\r\n". - 'ZGVmZ2hpamts', - $collection->content - ); - } - - public function testMaximumLineLengthIsNeverMoreThan76Chars() - { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //12 - $os->shouldReceive('read') - ->once() - ->andReturn('mnopqrstuvwx'); //24 - $os->shouldReceive('read') - ->once() - ->andReturn('yzabc1234567'); //36 - $os->shouldReceive('read') - ->once() - ->andReturn('890ABCDEFGHI'); //48 - $os->shouldReceive('read') - ->once() - ->andReturn('JKLMNOPQRSTU'); //60 - $os->shouldReceive('read') - ->once() - ->andReturn('VWXYZ1234567'); //72 - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //84 - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->_encoder->encodeByteStream($os, $is, 0, 100); - $this->assertEquals( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDREVGR0hJSktMTU5PUFFS\r\n". - 'U1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts', - $collection->content - ); - } - - public function testFirstLineLengthCanBeDifferent() - { - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //12 - $os->shouldReceive('read') - ->once() - ->andReturn('mnopqrstuvwx'); //24 - $os->shouldReceive('read') - ->once() - ->andReturn('yzabc1234567'); //36 - $os->shouldReceive('read') - ->once() - ->andReturn('890ABCDEFGHI'); //48 - $os->shouldReceive('read') - ->once() - ->andReturn('JKLMNOPQRSTU'); //60 - $os->shouldReceive('read') - ->once() - ->andReturn('VWXYZ1234567'); //72 - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //84 - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->_encoder->encodeByteStream($os, $is, 19); - $this->assertEquals( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDR\r\n". - 'EVGR0hJSktMTU5PUFFSU1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts', - $collection->content - ); - } - - private function _createOutputByteStream($stub = false) - { - return $this->getMockery('Swift_OutputByteStream')->shouldIgnoreMissing(); - } - - private function _createInputByteStream($stub = false) - { - return $this->getMockery('Swift_InputByteStream')->shouldIgnoreMissing(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php deleted file mode 100644 index ca44e11..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php +++ /dev/null @@ -1,171 +0,0 @@ -<?php - -class Swift_Mime_ContentEncoder_PlainContentEncoderTest extends \SwiftMailerTestCase -{ - public function testNameCanBeSpecifiedInConstructor() - { - $encoder = $this->_getEncoder('7bit'); - $this->assertEquals('7bit', $encoder->getName()); - - $encoder = $this->_getEncoder('8bit'); - $this->assertEquals('8bit', $encoder->getName()); - } - - public function testNoOctetsAreModifiedInString() - { - $encoder = $this->_getEncoder('7bit'); - foreach (range(0x00, 0xFF) as $octet) { - $byte = pack('C', $octet); - $this->assertIdenticalBinary($byte, $encoder->encodeString($byte)); - } - } - - public function testNoOctetsAreModifiedInByteStream() - { - $encoder = $this->_getEncoder('7bit'); - foreach (range(0x00, 0xFF) as $octet) { - $byte = pack('C', $octet); - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn($byte); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder->encodeByteStream($os, $is); - $this->assertIdenticalBinary($byte, $collection->content); - } - } - - public function testLineLengthCanBeSpecified() - { - $encoder = $this->_getEncoder('7bit'); - - $chars = array(); - for ($i = 0; $i < 50; ++$i) { - $chars[] = 'a'; - } - $input = implode(' ', $chars); //99 chars long - - $this->assertEquals( - 'a a a a a a a a a a a a a a a a a a a a a a a a a '."\r\n".//50 * - 'a a a a a a a a a a a a a a a a a a a a a a a a a', //99 - $encoder->encodeString($input, 0, 50), - '%s: Lines should be wrapped at 50 chars' - ); - } - - public function testLineLengthCanBeSpecifiedInByteStream() - { - $encoder = $this->_getEncoder('7bit'); - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - - for ($i = 0; $i < 50; ++$i) { - $os->shouldReceive('read') - ->once() - ->andReturn('a '); - } - - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder->encodeByteStream($os, $is, 0, 50); - $this->assertEquals( - str_repeat('a ', 25)."\r\n".str_repeat('a ', 25), - $collection->content - ); - } - - public function testencodeStringGeneratesCorrectCrlf() - { - $encoder = $this->_getEncoder('7bit', true); - $this->assertEquals("a\r\nb", $encoder->encodeString("a\rb"), - '%s: Line endings should be standardized' - ); - $this->assertEquals("a\r\nb", $encoder->encodeString("a\nb"), - '%s: Line endings should be standardized' - ); - $this->assertEquals("a\r\n\r\nb", $encoder->encodeString("a\n\rb"), - '%s: Line endings should be standardized' - ); - $this->assertEquals("a\r\n\r\nb", $encoder->encodeString("a\r\rb"), - '%s: Line endings should be standardized' - ); - $this->assertEquals("a\r\n\r\nb", $encoder->encodeString("a\n\nb"), - '%s: Line endings should be standardized' - ); - } - - public function crlfProvider() - { - return array( - array("\r", "a\r\nb"), - array("\n", "a\r\nb"), - array("\n\r", "a\r\n\r\nb"), - array("\n\n", "a\r\n\r\nb"), - array("\r\r", "a\r\n\r\nb"), - ); - } - - /** - * @dataProvider crlfProvider - */ - public function testCanonicEncodeByteStreamGeneratesCorrectCrlf($test, $expected) - { - $encoder = $this->_getEncoder('7bit', true); - - $os = $this->_createOutputByteStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('a'); - $os->shouldReceive('read') - ->once() - ->andReturn($test); - $os->shouldReceive('read') - ->once() - ->andReturn('b'); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder->encodeByteStream($os, $is); - $this->assertEquals($expected, $collection->content); - } - - private function _getEncoder($name, $canonical = false) - { - return new Swift_Mime_ContentEncoder_PlainContentEncoder($name, $canonical); - } - - private function _createOutputByteStream($stub = false) - { - return $this->getMockery('Swift_OutputByteStream')->shouldIgnoreMissing(); - } - - private function _createInputByteStream($stub = false) - { - return $this->getMockery('Swift_InputByteStream')->shouldIgnoreMissing(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php deleted file mode 100644 index 7762bbe..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php +++ /dev/null @@ -1,516 +0,0 @@ -<?php - -class Swift_Mime_ContentEncoder_QpContentEncoderTest extends \SwiftMailerTestCase -{ - public function testNameIsQuotedPrintable() - { - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder( - $this->_createCharacterStream(true) - ); - $this->assertEquals('quoted-printable', $encoder->getName()); - } - - /* -- RFC 2045, 6.7 -- - (1) (General 8bit representation) Any octet, except a CR or - LF that is part of a CRLF line break of the canonical - (standard) form of the data being encoded, may be - represented by an "=" followed by a two digit - hexadecimal representation of the octet's value. The - digits of the hexadecimal alphabet, for this purpose, - are "0123456789ABCDEF". Uppercase letters must be - used; lowercase letters are not allowed. Thus, for - example, the decimal value 12 (US-ASCII form feed) can - be represented by "=0C", and the decimal value 61 (US- - ASCII EQUAL SIGN) can be represented by "=3D". This - rule must be followed except when the following rules - allow an alternative encoding. - */ - - public function testPermittedCharactersAreNotEncoded() - { - /* -- RFC 2045, 6.7 -- - (2) (Literal representation) Octets with decimal values of - 33 through 60 inclusive, and 62 through 126, inclusive, - MAY be represented as the US-ASCII characters which - correspond to those octets (EXCLAMATION POINT through - LESS THAN, and GREATER THAN through TILDE, - respectively). - */ - - foreach (array_merge(range(33, 60), range(62, 126)) as $ordinal) { - $char = chr($ordinal); - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array($ordinal)); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertIdenticalBinary($char, $collection->content); - } - } - - public function testLinearWhiteSpaceAtLineEndingIsEncoded() - { - /* -- RFC 2045, 6.7 -- - (3) (White Space) Octets with values of 9 and 32 MAY be - represented as US-ASCII TAB (HT) and SPACE characters, - respectively, but MUST NOT be so represented at the end - of an encoded line. Any TAB (HT) or SPACE characters - on an encoded line MUST thus be followed on that line - by a printable character. In particular, an "=" at the - end of an encoded line, indicating a soft line break - (see rule #5) may follow one or more TAB (HT) or SPACE - characters. It follows that an octet with decimal - value 9 or 32 appearing at the end of an encoded line - must be represented according to Rule #1. This rule is - necessary because some MTAs (Message Transport Agents, - programs which transport messages from one user to - another, or perform a portion of such transfers) are - known to pad lines of text with SPACEs, and others are - known to remove "white space" characters from the end - of a line. Therefore, when decoding a Quoted-Printable - body, any trailing white space on a line must be - deleted, as it will necessarily have been added by - intermediate transport agents. - */ - - $HT = chr(0x09); //9 - $SPACE = chr(0x20); //32 - - //HT - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x09)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x09)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x0D)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x0A)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('b'))); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - - $this->assertEquals("a\t=09\r\nb", $collection->content); - - //SPACE - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x20)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x20)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x0D)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x0A)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('b'))); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - - $this->assertEquals("a =20\r\nb", $collection->content); - } - - public function testCRLFIsLeftAlone() - { - /* - (4) (Line Breaks) A line break in a text body, represented - as a CRLF sequence in the text canonical form, must be - represented by a (RFC 822) line break, which is also a - CRLF sequence, in the Quoted-Printable encoding. Since - the canonical representation of media types other than - text do not generally include the representation of - line breaks as CRLF sequences, no hard line breaks - (i.e. line breaks that are intended to be meaningful - and to be displayed to the user) can occur in the - quoted-printable encoding of such types. Sequences - like "=0D", "=0A", "=0A=0D" and "=0D=0A" will routinely - appear in non-text data represented in quoted- - printable, of course. - - Note that many implementations may elect to encode the - local representation of various content types directly - rather than converting to canonical form first, - encoding, and then converting back to local - representation. In particular, this may apply to plain - text material on systems that use newline conventions - other than a CRLF terminator sequence. Such an - implementation optimization is permissible, but only - when the combined canonicalization-encoding step is - equivalent to performing the three steps separately. - */ - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x0D)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x0A)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('b'))); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x0D)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x0A)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('c'))); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x0D)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x0A)); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEquals("a\r\nb\r\nc\r\n", $collection->content); - } - - public function testLinesLongerThan76CharactersAreSoftBroken() - { - /* - (5) (Soft Line Breaks) The Quoted-Printable encoding - REQUIRES that encoded lines be no more than 76 - characters long. If longer lines are to be encoded - with the Quoted-Printable encoding, "soft" line breaks - must be used. An equal sign as the last character on a - encoded line indicates such a non-significant ("soft") - line break in the encoded text. - */ - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - - for ($seq = 0; $seq <= 140; ++$seq) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - } - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEquals(str_repeat('a', 75)."=\r\n".str_repeat('a', 66), $collection->content); - } - - public function testMaxLineLengthCanBeSpecified() - { - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - - for ($seq = 0; $seq <= 100; ++$seq) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - } - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is, 0, 54); - $this->assertEquals(str_repeat('a', 53)."=\r\n".str_repeat('a', 48), $collection->content); - } - - public function testBytesBelowPermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(0, 32) as $ordinal) { - $char = chr($ordinal); - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array($ordinal)); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEquals(sprintf('=%02X', $ordinal), $collection->content); - } - } - - public function testDecimalByte61IsEncoded() - { - /* - According to Rule (1 & 2) - */ - - $char = chr(61); - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(61)); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEquals(sprintf('=%02X', 61), $collection->content); - } - - public function testBytesAbovePermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(127, 255) as $ordinal) { - $char = chr($ordinal); - - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array($ordinal)); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEquals(sprintf('=%02X', $ordinal), $collection->content); - } - } - - public function testFirstLineLengthCanBeDifferent() - { - $os = $this->_createOutputByteStream(true); - $charStream = $this->_createCharacterStream(); - $is = $this->_createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - - for ($seq = 0; $seq <= 140; ++$seq) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - } - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is, 22); - $this->assertEquals( - str_repeat('a', 53)."=\r\n".str_repeat('a', 75)."=\r\n".str_repeat('a', 13), - $collection->content - ); - } - - public function testObserverInterfaceCanChangeCharset() - { - $stream = $this->_createCharacterStream(); - $stream->shouldReceive('setCharacterSet') - ->once() - ->with('windows-1252'); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($stream); - $encoder->charsetChanged('windows-1252'); - } - - public function testTextIsPreWrapped() - { - $encoder = $this->createEncoder(); - - $input = str_repeat('a', 70)."\r\n". - str_repeat('a', 70)."\r\n". - str_repeat('a', 70); - - $os = new Swift_ByteStream_ArrayByteStream(); - $is = new Swift_ByteStream_ArrayByteStream(); - $is->write($input); - - $encoder->encodeByteStream($is, $os); - - $this->assertEquals( - $input, $os->read(PHP_INT_MAX) - ); - } - - private function _createCharacterStream($stub = false) - { - return $this->getMockery('Swift_CharacterStream')->shouldIgnoreMissing(); - } - - private function createEncoder() - { - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $charStream = new Swift_CharacterStream_NgCharacterStream($factory, 'utf-8'); - - return new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - } - - private function _createOutputByteStream($stub = false) - { - return $this->getMockery('Swift_OutputByteStream')->shouldIgnoreMissing(); - } - - private function _createInputByteStream($stub = false) - { - return $this->getMockery('Swift_InputByteStream')->shouldIgnoreMissing(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php deleted file mode 100644 index 3a1fc51..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -class Swift_Mime_EmbeddedFileTest extends Swift_Mime_AttachmentTest -{ - public function testNestingLevelIsAttachment() - { - //Overridden - } - - public function testNestingLevelIsEmbedded() - { - $file = $this->_createEmbeddedFile($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals( - Swift_Mime_MimeEntity::LEVEL_RELATED, $file->getNestingLevel() - ); - } - - public function testIdIsAutoGenerated() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addIdHeader') - ->once() - ->with('Content-ID', '/^.*?@.*?$/D'); - - $file = $this->_createEmbeddedFile($headers, $this->_createEncoder(), - $this->_createCache() - ); - } - - public function testDefaultDispositionIsInline() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addParameterizedHeader') - ->once() - ->with('Content-Disposition', 'inline'); - $headers->shouldReceive('addParameterizedHeader') - ->zeroOrMoreTimes(); - - $file = $this->_createEmbeddedFile($headers, $this->_createEncoder(), - $this->_createCache() - ); - } - - protected function _createAttachment($headers, $encoder, $cache, $mimeTypes = array()) - { - return $this->_createEmbeddedFile($headers, $encoder, $cache, $mimeTypes); - } - - private function _createEmbeddedFile($headers, $encoder, $cache) - { - return new Swift_Mime_EmbeddedFile($headers, $encoder, $cache, new Swift_Mime_Grammar()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php deleted file mode 100644 index 3580155..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -class Swift_Mime_HeaderEncoder_Base64HeaderEncoderTest extends \PHPUnit_Framework_TestCase -{ - //Most tests are already covered in Base64EncoderTest since this subclass only - // adds a getName() method - - public function testNameIsB() - { - $encoder = new Swift_Mime_HeaderEncoder_Base64HeaderEncoder(); - $this->assertEquals('B', $encoder->getName()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php deleted file mode 100644 index b5a10fe..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php +++ /dev/null @@ -1,221 +0,0 @@ -<?php - -class Swift_Mime_HeaderEncoder_QpHeaderEncoderTest extends \SwiftMailerTestCase -{ - //Most tests are already covered in QpEncoderTest since this subclass only - // adds a getName() method - - public function testNameIsQ() - { - $encoder = $this->_createEncoder( - $this->_createCharacterStream(true) - ); - $this->assertEquals('Q', $encoder->getName()); - } - - public function testSpaceAndTabNeverAppear() - { - /* -- RFC 2047, 4. - Only a subset of the printable ASCII characters may be used in - 'encoded-text'. Space and tab characters are not allowed, so that - the beginning and end of an 'encoded-word' are obvious. - */ - - $charStream = $this->_createCharacterStream(); - $charStream->shouldReceive('readBytes') - ->atLeast()->times(6) - ->andReturn(array(ord('a')), array(0x20), array(0x09), array(0x20), array(ord('b')), false); - - $encoder = $this->_createEncoder($charStream); - $this->assertNotRegExp('~[ \t]~', $encoder->encodeString("a \t b"), - '%s: encoded-words in headers cannot contain LWSP as per RFC 2047.' - ); - } - - public function testSpaceIsRepresentedByUnderscore() - { - /* -- RFC 2047, 4.2. - (2) The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be - represented as "_" (underscore, ASCII 95.). (This character may - not pass through some internetwork mail gateways, but its use - will greatly enhance readability of "Q" encoded data with mail - readers that do not support this encoding.) Note that the "_" - always represents hexadecimal 20, even if the SPACE character - occupies a different code position in the character set in use. - */ - $charStream = $this->_createCharacterStream(); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(0x20)); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('b'))); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = $this->_createEncoder($charStream); - $this->assertEquals('a_b', $encoder->encodeString('a b'), - '%s: Spaces can be represented by more readable underscores as per RFC 2047.' - ); - } - - public function testEqualsAndQuestionAndUnderscoreAreEncoded() - { - /* -- RFC 2047, 4.2. - (3) 8-bit values which correspond to printable ASCII characters other - than "=", "?", and "_" (underscore), MAY be represented as those - characters. (But see section 5 for restrictions.) In - particular, SPACE and TAB MUST NOT be represented as themselves - within encoded words. - */ - $charStream = $this->_createCharacterStream(); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('='))); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('?'))); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('_'))); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = $this->_createEncoder($charStream); - $this->assertEquals('=3D=3F=5F', $encoder->encodeString('=?_'), - '%s: Chars =, ? and _ (underscore) may not appear as per RFC 2047.' - ); - } - - public function testParensAndQuotesAreEncoded() - { - /* -- RFC 2047, 5 (2). - A "Q"-encoded 'encoded-word' which appears in a 'comment' MUST NOT - contain the characters "(", ")" or " - */ - - $charStream = $this->_createCharacterStream(); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('('))); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('"'))); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord(')'))); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = $this->_createEncoder($charStream); - $this->assertEquals('=28=22=29', $encoder->encodeString('(")'), - '%s: Chars (, " (DQUOTE) and ) may not appear as per RFC 2047.' - ); - } - - public function testOnlyCharactersAllowedInPhrasesAreUsed() - { - /* -- RFC 2047, 5. - (3) As a replacement for a 'word' entity within a 'phrase', for example, - one that precedes an address in a From, To, or Cc header. The ABNF - definition for 'phrase' from RFC 822 thus becomes: - - phrase = 1*( encoded-word / word ) - - In this case the set of characters that may be used in a "Q"-encoded - 'encoded-word' is restricted to: <upper and lower case ASCII - letters, decimal digits, "!", "*", "+", "-", "/", "=", and "_" - (underscore, ASCII 95.)>. An 'encoded-word' that appears within a - 'phrase' MUST be separated from any adjacent 'word', 'text' or - 'special' by 'linear-white-space'. - */ - - $allowedBytes = array_merge( - range(ord('a'), ord('z')), range(ord('A'), ord('Z')), - range(ord('0'), ord('9')), - array(ord('!'), ord('*'), ord('+'), ord('-'), ord('/')) - ); - - foreach (range(0x00, 0xFF) as $byte) { - $char = pack('C', $byte); - - $charStream = $this->_createCharacterStream(); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array($byte)); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = $this->_createEncoder($charStream); - $encodedChar = $encoder->encodeString($char); - - if (in_array($byte, $allowedBytes)) { - $this->assertEquals($char, $encodedChar, - '%s: Character '.$char.' should not be encoded.' - ); - } elseif (0x20 == $byte) { - //Special case - $this->assertEquals('_', $encodedChar, - '%s: Space character should be replaced.' - ); - } else { - $this->assertEquals(sprintf('=%02X', $byte), $encodedChar, - '%s: Byte '.$byte.' should be encoded.' - ); - } - } - } - - public function testEqualsNeverAppearsAtEndOfLine() - { - /* -- RFC 2047, 5 (3). - The 'encoded-text' in an 'encoded-word' must be self-contained; - 'encoded-text' MUST NOT be continued from one 'encoded-word' to - another. This implies that the 'encoded-text' portion of a "B" - 'encoded-word' will be a multiple of 4 characters long; for a "Q" - 'encoded-word', any "=" character that appears in the 'encoded-text' - portion will be followed by two hexadecimal characters. - */ - - $input = str_repeat('a', 140); - - $charStream = $this->_createCharacterStream(); - - $output = ''; - $seq = 0; - for (; $seq < 140; ++$seq) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(array(ord('a'))); - - if (75 == $seq) { - $output .= "\r\n"; // =\r\n - } - $output .= 'a'; - } - - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = $this->_createEncoder($charStream); - $this->assertEquals($output, $encoder->encodeString($input)); - } - - private function _createEncoder($charStream) - { - return new Swift_Mime_HeaderEncoder_QpHeaderEncoder($charStream); - } - - private function _createCharacterStream($stub = false) - { - return $this->getMockery('Swift_CharacterStream')->shouldIgnoreMissing(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php deleted file mode 100644 index 1822ea6..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -class Swift_Mime_Headers_DateHeaderTest extends \PHPUnit_Framework_TestCase -{ - /* -- - The following tests refer to RFC 2822, section 3.6.1 and 3.3. - */ - - public function testTypeIsDateHeader() - { - $header = $this->_getHeader('Date'); - $this->assertEquals(Swift_Mime_Header::TYPE_DATE, $header->getFieldType()); - } - - public function testGetTimestamp() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setTimestamp($timestamp); - $this->assertSame($timestamp, $header->getTimestamp()); - } - - public function testTimestampCanBeSetBySetter() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setTimestamp($timestamp); - $this->assertSame($timestamp, $header->getTimestamp()); - } - - public function testIntegerTimestampIsConvertedToRfc2822Date() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setTimestamp($timestamp); - $this->assertEquals(date('r', $timestamp), $header->getFieldBody()); - } - - public function testSetBodyModel() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setFieldBodyModel($timestamp); - $this->assertEquals(date('r', $timestamp), $header->getFieldBody()); - } - - public function testGetBodyModel() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setTimestamp($timestamp); - $this->assertEquals($timestamp, $header->getFieldBodyModel()); - } - - public function testToString() - { - $timestamp = time(); - $header = $this->_getHeader('Date'); - $header->setTimestamp($timestamp); - $this->assertEquals('Date: '.date('r', $timestamp)."\r\n", - $header->toString() - ); - } - - private function _getHeader($name) - { - return new Swift_Mime_Headers_DateHeader($name, new Swift_Mime_Grammar()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php deleted file mode 100644 index 93b3f60..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php +++ /dev/null @@ -1,189 +0,0 @@ -<?php - -class Swift_Mime_Headers_IdentificationHeaderTest extends \PHPUnit_Framework_TestCase -{ - public function testTypeIsIdHeader() - { - $header = $this->_getHeader('Message-ID'); - $this->assertEquals(Swift_Mime_Header::TYPE_ID, $header->getFieldType()); - } - - public function testValueMatchesMsgIdSpec() - { - /* -- RFC 2822, 3.6.4. - message-id = "Message-ID:" msg-id CRLF - - in-reply-to = "In-Reply-To:" 1*msg-id CRLF - - references = "References:" 1*msg-id CRLF - - msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS] - - id-left = dot-atom-text / no-fold-quote / obs-id-left - - id-right = dot-atom-text / no-fold-literal / obs-id-right - - no-fold-quote = DQUOTE *(qtext / quoted-pair) DQUOTE - - no-fold-literal = "[" *(dtext / quoted-pair) "]" - */ - - $header = $this->_getHeader('Message-ID'); - $header->setId('id-left@id-right'); - $this->assertEquals('<id-left@id-right>', $header->getFieldBody()); - } - - public function testIdCanBeRetrievedVerbatim() - { - $header = $this->_getHeader('Message-ID'); - $header->setId('id-left@id-right'); - $this->assertEquals('id-left@id-right', $header->getId()); - } - - public function testMultipleIdsCanBeSet() - { - $header = $this->_getHeader('References'); - $header->setIds(array('a@b', 'x@y')); - $this->assertEquals(array('a@b', 'x@y'), $header->getIds()); - } - - public function testSettingMultipleIdsProducesAListValue() - { - /* -- RFC 2822, 3.6.4. - The "References:" and "In-Reply-To:" field each contain one or more - unique message identifiers, optionally separated by CFWS. - - .. SNIP .. - - in-reply-to = "In-Reply-To:" 1*msg-id CRLF - - references = "References:" 1*msg-id CRLF - */ - - $header = $this->_getHeader('References'); - $header->setIds(array('a@b', 'x@y')); - $this->assertEquals('<a@b> <x@y>', $header->getFieldBody()); - } - - public function testIdLeftCanBeQuoted() - { - /* -- RFC 2822, 3.6.4. - id-left = dot-atom-text / no-fold-quote / obs-id-left - */ - - $header = $this->_getHeader('References'); - $header->setId('"ab"@c'); - $this->assertEquals('"ab"@c', $header->getId()); - $this->assertEquals('<"ab"@c>', $header->getFieldBody()); - } - - public function testIdLeftCanContainAnglesAsQuotedPairs() - { - /* -- RFC 2822, 3.6.4. - no-fold-quote = DQUOTE *(qtext / quoted-pair) DQUOTE - */ - - $header = $this->_getHeader('References'); - $header->setId('"a\\<\\>b"@c'); - $this->assertEquals('"a\\<\\>b"@c', $header->getId()); - $this->assertEquals('<"a\\<\\>b"@c>', $header->getFieldBody()); - } - - public function testIdLeftCanBeDotAtom() - { - $header = $this->_getHeader('References'); - $header->setId('a.b+&%$.c@d'); - $this->assertEquals('a.b+&%$.c@d', $header->getId()); - $this->assertEquals('<a.b+&%$.c@d>', $header->getFieldBody()); - } - - public function testInvalidIdLeftThrowsException() - { - try { - $header = $this->_getHeader('References'); - $header->setId('a b c@d'); - $this->fail( - 'Exception should be thrown since "a b c" is not valid id-left.' - ); - } catch (Exception $e) { - } - } - - public function testIdRightCanBeDotAtom() - { - /* -- RFC 2822, 3.6.4. - id-right = dot-atom-text / no-fold-literal / obs-id-right - */ - - $header = $this->_getHeader('References'); - $header->setId('a@b.c+&%$.d'); - $this->assertEquals('a@b.c+&%$.d', $header->getId()); - $this->assertEquals('<a@b.c+&%$.d>', $header->getFieldBody()); - } - - public function testIdRightCanBeLiteral() - { - /* -- RFC 2822, 3.6.4. - no-fold-literal = "[" *(dtext / quoted-pair) "]" - */ - - $header = $this->_getHeader('References'); - $header->setId('a@[1.2.3.4]'); - $this->assertEquals('a@[1.2.3.4]', $header->getId()); - $this->assertEquals('<a@[1.2.3.4]>', $header->getFieldBody()); - } - - public function testInvalidIdRightThrowsException() - { - try { - $header = $this->_getHeader('References'); - $header->setId('a@b c d'); - $this->fail( - 'Exception should be thrown since "b c d" is not valid id-right.' - ); - } catch (Exception $e) { - } - } - - public function testMissingAtSignThrowsException() - { - /* -- RFC 2822, 3.6.4. - msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS] - */ - - try { - $header = $this->_getHeader('References'); - $header->setId('abc'); - $this->fail( - 'Exception should be thrown since "abc" is does not contain @.' - ); - } catch (Exception $e) { - } - } - - public function testSetBodyModel() - { - $header = $this->_getHeader('Message-ID'); - $header->setFieldBodyModel('a@b'); - $this->assertEquals(array('a@b'), $header->getIds()); - } - - public function testGetBodyModel() - { - $header = $this->_getHeader('Message-ID'); - $header->setId('a@b'); - $this->assertEquals(array('a@b'), $header->getFieldBodyModel()); - } - - public function testStringValue() - { - $header = $this->_getHeader('References'); - $header->setIds(array('a@b', 'x@y')); - $this->assertEquals('References: <a@b> <x@y>'."\r\n", $header->toString()); - } - - private function _getHeader($name) - { - return new Swift_Mime_Headers_IdentificationHeader($name, new Swift_Mime_Grammar()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php deleted file mode 100644 index 0713ff4..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php +++ /dev/null @@ -1,327 +0,0 @@ -<?php - -class Swift_Mime_Headers_MailboxHeaderTest extends \SwiftMailerTestCase -{ - /* -- RFC 2822, 3.6.2 for all tests. - */ - - private $_charset = 'utf-8'; - - public function testTypeIsMailboxHeader() - { - $header = $this->_getHeader('To', $this->_getEncoder('Q', true)); - $this->assertEquals(Swift_Mime_Header::TYPE_MAILBOX, $header->getFieldType()); - } - - public function testMailboxIsSetForAddress() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses('chris@swiftmailer.org'); - $this->assertEquals(array('chris@swiftmailer.org'), - $header->getNameAddressStrings() - ); - } - - public function testMailboxIsRenderedForNameAddress() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array('chris@swiftmailer.org' => 'Chris Corbyn')); - $this->assertEquals( - array('Chris Corbyn <chris@swiftmailer.org>'), $header->getNameAddressStrings() - ); - } - - public function testAddressCanBeReturnedForAddress() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses('chris@swiftmailer.org'); - $this->assertEquals(array('chris@swiftmailer.org'), $header->getAddresses()); - } - - public function testAddressCanBeReturnedForNameAddress() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array('chris@swiftmailer.org' => 'Chris Corbyn')); - $this->assertEquals(array('chris@swiftmailer.org'), $header->getAddresses()); - } - - public function testQuotesInNameAreQuoted() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn, "DHE"', - )); - $this->assertEquals( - array('"Chris Corbyn, \"DHE\"" <chris@swiftmailer.org>'), - $header->getNameAddressStrings() - ); - } - - public function testEscapeCharsInNameAreQuoted() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn, \\escaped\\', - )); - $this->assertEquals( - array('"Chris Corbyn, \\\\escaped\\\\" <chris@swiftmailer.org>'), - $header->getNameAddressStrings() - ); - } - - public function testGetMailboxesReturnsNameValuePairs() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn, DHE', - )); - $this->assertEquals( - array('chris@swiftmailer.org' => 'Chris Corbyn, DHE'), $header->getNameAddresses() - ); - } - - public function testMultipleAddressesCanBeSetAndFetched() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses(array( - 'chris@swiftmailer.org', 'mark@swiftmailer.org', - )); - $this->assertEquals( - array('chris@swiftmailer.org', 'mark@swiftmailer.org'), - $header->getAddresses() - ); - } - - public function testMultipleAddressesAsMailboxes() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses(array( - 'chris@swiftmailer.org', 'mark@swiftmailer.org', - )); - $this->assertEquals( - array('chris@swiftmailer.org' => null, 'mark@swiftmailer.org' => null), - $header->getNameAddresses() - ); - } - - public function testMultipleAddressesAsMailboxStrings() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses(array( - 'chris@swiftmailer.org', 'mark@swiftmailer.org', - )); - $this->assertEquals( - array('chris@swiftmailer.org', 'mark@swiftmailer.org'), - $header->getNameAddressStrings() - ); - } - - public function testMultipleNamedMailboxesReturnsMultipleAddresses() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - )); - $this->assertEquals( - array('chris@swiftmailer.org', 'mark@swiftmailer.org'), - $header->getAddresses() - ); - } - - public function testMultipleNamedMailboxesReturnsMultipleMailboxes() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - )); - $this->assertEquals(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - ), - $header->getNameAddresses() - ); - } - - public function testMultipleMailboxesProducesMultipleMailboxStrings() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - )); - $this->assertEquals(array( - 'Chris Corbyn <chris@swiftmailer.org>', - 'Mark Corbyn <mark@swiftmailer.org>', - ), - $header->getNameAddressStrings() - ); - } - - public function testSetAddressesOverwritesAnyMailboxes() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - )); - $this->assertEquals( - array('chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', ), - $header->getNameAddresses() - ); - $this->assertEquals( - array('chris@swiftmailer.org', 'mark@swiftmailer.org'), - $header->getAddresses() - ); - - $header->setAddresses(array('chris@swiftmailer.org', 'mark@swiftmailer.org')); - - $this->assertEquals( - array('chris@swiftmailer.org' => null, 'mark@swiftmailer.org' => null), - $header->getNameAddresses() - ); - $this->assertEquals( - array('chris@swiftmailer.org', 'mark@swiftmailer.org'), - $header->getAddresses() - ); - } - - public function testNameIsEncodedIfNonAscii() - { - $name = 'C'.pack('C', 0x8F).'rbyn'; - - $encoder = $this->_getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($name, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('C=8Frbyn'); - - $header = $this->_getHeader('From', $encoder); - $header->setNameAddresses(array('chris@swiftmailer.org' => 'Chris '.$name)); - - $addresses = $header->getNameAddressStrings(); - $this->assertEquals( - 'Chris =?'.$this->_charset.'?Q?C=8Frbyn?= <chris@swiftmailer.org>', - array_shift($addresses) - ); - } - - public function testEncodingLineLengthCalculations() - { - /* -- RFC 2047, 2. - An 'encoded-word' may not be more than 75 characters long, including - 'charset', 'encoding', 'encoded-text', and delimiters. - */ - - $name = 'C'.pack('C', 0x8F).'rbyn'; - - $encoder = $this->_getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($name, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('C=8Frbyn'); - - $header = $this->_getHeader('From', $encoder); - $header->setNameAddresses(array('chris@swiftmailer.org' => 'Chris '.$name)); - - $header->getNameAddressStrings(); - } - - public function testGetValueReturnsMailboxStringValue() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - )); - $this->assertEquals( - 'Chris Corbyn <chris@swiftmailer.org>', $header->getFieldBody() - ); - } - - public function testGetValueReturnsMailboxStringValueForMultipleMailboxes() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - )); - $this->assertEquals( - 'Chris Corbyn <chris@swiftmailer.org>, Mark Corbyn <mark@swiftmailer.org>', - $header->getFieldBody() - ); - } - - public function testRemoveAddressesWithSingleValue() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - )); - $header->removeAddresses('chris@swiftmailer.org'); - $this->assertEquals(array('mark@swiftmailer.org'), - $header->getAddresses() - ); - } - - public function testRemoveAddressesWithList() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - )); - $header->removeAddresses( - array('chris@swiftmailer.org', 'mark@swiftmailer.org') - ); - $this->assertEquals(array(), $header->getAddresses()); - } - - public function testSetBodyModel() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setFieldBodyModel('chris@swiftmailer.org'); - $this->assertEquals(array('chris@swiftmailer.org' => null), $header->getNameAddresses()); - } - - public function testGetBodyModel() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setAddresses(array('chris@swiftmailer.org')); - $this->assertEquals(array('chris@swiftmailer.org' => null), $header->getFieldBodyModel()); - } - - public function testToString() - { - $header = $this->_getHeader('From', $this->_getEncoder('Q', true)); - $header->setNameAddresses(array( - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - )); - $this->assertEquals( - 'From: Chris Corbyn <chris@swiftmailer.org>, '. - 'Mark Corbyn <mark@swiftmailer.org>'."\r\n", - $header->toString() - ); - } - - private function _getHeader($name, $encoder) - { - $header = new Swift_Mime_Headers_MailboxHeader($name, $encoder, new Swift_Mime_Grammar()); - $header->setCharset($this->_charset); - - return $header; - } - - private function _getEncoder($type, $stub = false) - { - $encoder = $this->getMockery('Swift_Mime_HeaderEncoder')->shouldIgnoreMissing(); - $encoder->shouldReceive('getName') - ->zeroOrMoreTimes() - ->andReturn($type); - - return $encoder; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php deleted file mode 100644 index cd027cc..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php +++ /dev/null @@ -1,398 +0,0 @@ -<?php - -class Swift_Mime_Headers_ParameterizedHeaderTest extends \SwiftMailerTestCase -{ - private $_charset = 'utf-8'; - private $_lang = 'en-us'; - - public function testTypeIsParameterizedHeader() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $this->assertEquals(Swift_Mime_Header::TYPE_PARAMETERIZED, $header->getFieldType()); - } - - public function testValueIsReturnedVerbatim() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setValue('text/plain'); - $this->assertEquals('text/plain', $header->getValue()); - } - - public function testParametersAreAppended() - { - /* -- RFC 2045, 5.1 - parameter := attribute "=" value - - attribute := token - ; Matching of attributes - ; is ALWAYS case-insensitive. - - value := token / quoted-string - - token := 1*<any (US-ASCII) CHAR except SPACE, CTLs, - or tspecials> - - tspecials := "(" / ")" / "<" / ">" / "@" / - "," / ";" / ":" / "\" / <"> - "/" / "[" / "]" / "?" / "=" - ; Must be in quoted-string, - ; to use within parameter values - */ - - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setValue('text/plain'); - $header->setParameters(array('charset' => 'utf-8')); - $this->assertEquals('text/plain; charset=utf-8', $header->getFieldBody()); - } - - public function testSpaceInParamResultsInQuotedString() - { - $header = $this->_getHeader('Content-Disposition', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setValue('attachment'); - $header->setParameters(array('filename' => 'my file.txt')); - $this->assertEquals('attachment; filename="my file.txt"', - $header->getFieldBody() - ); - } - - public function testLongParamsAreBrokenIntoMultipleAttributeStrings() - { - /* -- RFC 2231, 3. - The asterisk character ("*") followed - by a decimal count is employed to indicate that multiple parameters - are being used to encapsulate a single parameter value. The count - starts at 0 and increments by 1 for each subsequent section of the - parameter value. Decimal values are used and neither leading zeroes - nor gaps in the sequence are allowed. - - The original parameter value is recovered by concatenating the - various sections of the parameter, in order. For example, the - content-type field - - Content-Type: message/external-body; access-type=URL; - URL*0="ftp://"; - URL*1="cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" - - is semantically identical to - - Content-Type: message/external-body; access-type=URL; - URL="ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" - - Note that quotes around parameter values are part of the value - syntax; they are NOT part of the value itself. Furthermore, it is - explicitly permitted to have a mixture of quoted and unquoted - continuation fields. - */ - - $value = str_repeat('a', 180); - - $encoder = $this->_getParameterEncoder(); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), 63, \Mockery::any()) - ->andReturn(str_repeat('a', 63)."\r\n". - str_repeat('a', 63)."\r\n".str_repeat('a', 54)); - - $header = $this->_getHeader('Content-Disposition', - $this->_getHeaderEncoder('Q', true), $encoder - ); - $header->setValue('attachment'); - $header->setParameters(array('filename' => $value)); - $header->setMaxLineLength(78); - $this->assertEquals( - 'attachment; '. - 'filename*0*=utf-8\'\''.str_repeat('a', 63).";\r\n ". - 'filename*1*='.str_repeat('a', 63).";\r\n ". - 'filename*2*='.str_repeat('a', 54), - $header->getFieldBody() - ); - } - - public function testEncodedParamDataIncludesCharsetAndLanguage() - { - /* -- RFC 2231, 4. - Asterisks ("*") are reused to provide the indicator that language and - character set information is present and encoding is being used. A - single quote ("'") is used to delimit the character set and language - information at the beginning of the parameter value. Percent signs - ("%") are used as the encoding flag, which agrees with RFC 2047. - - Specifically, an asterisk at the end of a parameter name acts as an - indicator that character set and language information may appear at - the beginning of the parameter value. A single quote is used to - separate the character set, language, and actual value information in - the parameter value string, and an percent sign is used to flag - octets encoded in hexadecimal. For example: - - Content-Type: application/x-stuff; - title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A - - Note that it is perfectly permissible to leave either the character - set or language field blank. Note also that the single quote - delimiters MUST be present even when one of the field values is - omitted. - */ - - $value = str_repeat('a', 20).pack('C', 0x8F).str_repeat('a', 10); - - $encoder = $this->_getParameterEncoder(); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, 12, 62, \Mockery::any()) - ->andReturn(str_repeat('a', 20).'%8F'.str_repeat('a', 10)); - - $header = $this->_getHeader('Content-Disposition', - $this->_getHeaderEncoder('Q', true), $encoder - ); - $header->setValue('attachment'); - $header->setParameters(array('filename' => $value)); - $header->setMaxLineLength(78); - $header->setLanguage($this->_lang); - $this->assertEquals( - 'attachment; filename*='.$this->_charset."'".$this->_lang."'". - str_repeat('a', 20).'%8F'.str_repeat('a', 10), - $header->getFieldBody() - ); - } - - public function testMultipleEncodedParamLinesAreFormattedCorrectly() - { - /* -- RFC 2231, 4.1. - Character set and language information may be combined with the - parameter continuation mechanism. For example: - - Content-Type: application/x-stuff - title*0*=us-ascii'en'This%20is%20even%20more%20 - title*1*=%2A%2A%2Afun%2A%2A%2A%20 - title*2="isn't it!" - - Note that: - - (1) Language and character set information only appear at - the beginning of a given parameter value. - - (2) Continuations do not provide a facility for using more - than one character set or language in the same - parameter value. - - (3) A value presented using multiple continuations may - contain a mixture of encoded and unencoded segments. - - (4) The first segment of a continuation MUST be encoded if - language and character set information are given. - - (5) If the first segment of a continued parameter value is - encoded the language and character set field delimiters - MUST be present even when the fields are left blank. - */ - - $value = str_repeat('a', 20).pack('C', 0x8F).str_repeat('a', 60); - - $encoder = $this->_getParameterEncoder(); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, 12, 62, \Mockery::any()) - ->andReturn(str_repeat('a', 20).'%8F'.str_repeat('a', 28)."\r\n". - str_repeat('a', 32)); - - $header = $this->_getHeader('Content-Disposition', - $this->_getHeaderEncoder('Q', true), $encoder - ); - $header->setValue('attachment'); - $header->setParameters(array('filename' => $value)); - $header->setMaxLineLength(78); - $header->setLanguage($this->_lang); - $this->assertEquals( - 'attachment; filename*0*='.$this->_charset."'".$this->_lang."'". - str_repeat('a', 20).'%8F'.str_repeat('a', 28).";\r\n ". - 'filename*1*='.str_repeat('a', 32), - $header->getFieldBody() - ); - } - - public function testToString() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setValue('text/html'); - $header->setParameters(array('charset' => 'utf-8')); - $this->assertEquals('Content-Type: text/html; charset=utf-8'."\r\n", - $header->toString() - ); - } - - public function testValueCanBeEncodedIfNonAscii() - { - $value = 'fo'.pack('C', 0x8F).'bar'; - - $encoder = $this->_getHeaderEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo=8Fbar'); - - $header = $this->_getHeader('X-Foo', $encoder, $this->_getParameterEncoder(true)); - $header->setValue($value); - $header->setParameters(array('lookslike' => 'foobar')); - $this->assertEquals('X-Foo: =?utf-8?Q?fo=8Fbar?=; lookslike=foobar'."\r\n", - $header->toString() - ); - } - - public function testValueAndParamCanBeEncodedIfNonAscii() - { - $value = 'fo'.pack('C', 0x8F).'bar'; - - $encoder = $this->_getHeaderEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo=8Fbar'); - - $paramEncoder = $this->_getParameterEncoder(); - $paramEncoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo%8Fbar'); - - $header = $this->_getHeader('X-Foo', $encoder, $paramEncoder); - $header->setValue($value); - $header->setParameters(array('says' => $value)); - $this->assertEquals("X-Foo: =?utf-8?Q?fo=8Fbar?=; says*=utf-8''fo%8Fbar\r\n", - $header->toString() - ); - } - - public function testParamsAreEncodedWithEncodedWordsIfNoParamEncoderSet() - { - $value = 'fo'.pack('C', 0x8F).'bar'; - - $encoder = $this->_getHeaderEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo=8Fbar'); - - $header = $this->_getHeader('X-Foo', $encoder, null); - $header->setValue('bar'); - $header->setParameters(array('says' => $value)); - $this->assertEquals("X-Foo: bar; says=\"=?utf-8?Q?fo=8Fbar?=\"\r\n", - $header->toString() - ); - } - - public function testLanguageInformationAppearsInEncodedWords() - { - /* -- RFC 2231, 5. - 5. Language specification in Encoded Words - - RFC 2047 provides support for non-US-ASCII character sets in RFC 822 - message header comments, phrases, and any unstructured text field. - This is done by defining an encoded word construct which can appear - in any of these places. Given that these are fields intended for - display, it is sometimes necessary to associate language information - with encoded words as well as just the character set. This - specification extends the definition of an encoded word to allow the - inclusion of such information. This is simply done by suffixing the - character set specification with an asterisk followed by the language - tag. For example: - - From: =?US-ASCII*EN?Q?Keith_Moore?= <moore@cs.utk.edu> - */ - - $value = 'fo'.pack('C', 0x8F).'bar'; - - $encoder = $this->_getHeaderEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo=8Fbar'); - - $paramEncoder = $this->_getParameterEncoder(); - $paramEncoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo%8Fbar'); - - $header = $this->_getHeader('X-Foo', $encoder, $paramEncoder); - $header->setLanguage('en'); - $header->setValue($value); - $header->setParameters(array('says' => $value)); - $this->assertEquals("X-Foo: =?utf-8*en?Q?fo=8Fbar?=; says*=utf-8'en'fo%8Fbar\r\n", - $header->toString() - ); - } - - public function testSetBodyModel() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setFieldBodyModel('text/html'); - $this->assertEquals('text/html', $header->getValue()); - } - - public function testGetBodyModel() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setValue('text/plain'); - $this->assertEquals('text/plain', $header->getFieldBodyModel()); - } - - public function testSetParameter() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setParameters(array('charset' => 'utf-8', 'delsp' => 'yes')); - $header->setParameter('delsp', 'no'); - $this->assertEquals(array('charset' => 'utf-8', 'delsp' => 'no'), - $header->getParameters() - ); - } - - public function testGetParameter() - { - $header = $this->_getHeader('Content-Type', - $this->_getHeaderEncoder('Q', true), $this->_getParameterEncoder(true) - ); - $header->setParameters(array('charset' => 'utf-8', 'delsp' => 'yes')); - $this->assertEquals('utf-8', $header->getParameter('charset')); - } - - private function _getHeader($name, $encoder, $paramEncoder) - { - $header = new Swift_Mime_Headers_ParameterizedHeader($name, $encoder, - $paramEncoder, new Swift_Mime_Grammar() - ); - $header->setCharset($this->_charset); - - return $header; - } - - private function _getHeaderEncoder($type, $stub = false) - { - $encoder = $this->getMockery('Swift_Mime_HeaderEncoder')->shouldIgnoreMissing(); - $encoder->shouldReceive('getName') - ->zeroOrMoreTimes() - ->andReturn($type); - - return $encoder; - } - - private function _getParameterEncoder($stub = false) - { - return $this->getMockery('Swift_Encoder')->shouldIgnoreMissing(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php deleted file mode 100644 index a9f35e9..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -class Swift_Mime_Headers_PathHeaderTest extends \PHPUnit_Framework_TestCase -{ - public function testTypeIsPathHeader() - { - $header = $this->_getHeader('Return-Path'); - $this->assertEquals(Swift_Mime_Header::TYPE_PATH, $header->getFieldType()); - } - - public function testSingleAddressCanBeSetAndFetched() - { - $header = $this->_getHeader('Return-Path'); - $header->setAddress('chris@swiftmailer.org'); - $this->assertEquals('chris@swiftmailer.org', $header->getAddress()); - } - - public function testAddressMustComplyWithRfc2822() - { - try { - $header = $this->_getHeader('Return-Path'); - $header->setAddress('chr is@swiftmailer.org'); - $this->fail('Addresses not valid according to RFC 2822 addr-spec grammar must be rejected.'); - } catch (Exception $e) { - } - } - - public function testValueIsAngleAddrWithValidAddress() - { - /* -- RFC 2822, 3.6.7. - - return = "Return-Path:" path CRLF - - path = ([CFWS] "<" ([CFWS] / addr-spec) ">" [CFWS]) / - obs-path - */ - - $header = $this->_getHeader('Return-Path'); - $header->setAddress('chris@swiftmailer.org'); - $this->assertEquals('<chris@swiftmailer.org>', $header->getFieldBody()); - } - - public function testValueIsEmptyAngleBracketsIfEmptyAddressSet() - { - $header = $this->_getHeader('Return-Path'); - $header->setAddress(''); - $this->assertEquals('<>', $header->getFieldBody()); - } - - public function testSetBodyModel() - { - $header = $this->_getHeader('Return-Path'); - $header->setFieldBodyModel('foo@bar.tld'); - $this->assertEquals('foo@bar.tld', $header->getAddress()); - } - - public function testGetBodyModel() - { - $header = $this->_getHeader('Return-Path'); - $header->setAddress('foo@bar.tld'); - $this->assertEquals('foo@bar.tld', $header->getFieldBodyModel()); - } - - public function testToString() - { - $header = $this->_getHeader('Return-Path'); - $header->setAddress('chris@swiftmailer.org'); - $this->assertEquals('Return-Path: <chris@swiftmailer.org>'."\r\n", - $header->toString() - ); - } - - private function _getHeader($name) - { - return new Swift_Mime_Headers_PathHeader($name, new Swift_Mime_Grammar()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php deleted file mode 100644 index 2e1dc8c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php +++ /dev/null @@ -1,355 +0,0 @@ -<?php - -class Swift_Mime_Headers_UnstructuredHeaderTest extends \SwiftMailerTestCase -{ - private $_charset = 'utf-8'; - - public function testTypeIsTextHeader() - { - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $this->assertEquals(Swift_Mime_Header::TYPE_TEXT, $header->getFieldType()); - } - - public function testGetNameReturnsNameVerbatim() - { - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $this->assertEquals('Subject', $header->getFieldName()); - } - - public function testGetValueReturnsValueVerbatim() - { - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $header->setValue('Test'); - $this->assertEquals('Test', $header->getValue()); - } - - public function testBasicStructureIsKeyValuePair() - { - /* -- RFC 2822, 2.2 - Header fields are lines composed of a field name, followed by a colon - (":"), followed by a field body, and terminated by CRLF. - */ - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $header->setValue('Test'); - $this->assertEquals('Subject: Test'."\r\n", $header->toString()); - } - - public function testLongHeadersAreFoldedAtWordBoundary() - { - /* -- RFC 2822, 2.2.3 - Each header field is logically a single line of characters comprising - the field name, the colon, and the field body. For convenience - however, and to deal with the 998/78 character limitations per line, - the field body portion of a header field can be split into a multiple - line representation; this is called "folding". The general rule is - that wherever this standard allows for folding white space (not - simply WSP characters), a CRLF may be inserted before any WSP. - */ - - $value = 'The quick brown fox jumped over the fence, he was a very very '. - 'scary brown fox with a bushy tail'; - $header = $this->_getHeader('X-Custom-Header', - $this->_getEncoder('Q', true) - ); - $header->setValue($value); - $header->setMaxLineLength(78); //A safe [RFC 2822, 2.2.3] default - /* - X-Custom-Header: The quick brown fox jumped over the fence, he was a very very - scary brown fox with a bushy tail - */ - $this->assertEquals( - 'X-Custom-Header: The quick brown fox jumped over the fence, he was a'. - ' very very'."\r\n".//Folding - ' scary brown fox with a bushy tail'."\r\n", - $header->toString(), '%s: The header should have been folded at 78th char' - ); - } - - public function testPrintableAsciiOnlyAppearsInHeaders() - { - /* -- RFC 2822, 2.2. - A field name MUST be composed of printable US-ASCII characters (i.e., - characters that have values between 33 and 126, inclusive), except - colon. A field body may be composed of any US-ASCII characters, - except for CR and LF. - */ - - $nonAsciiChar = pack('C', 0x8F); - $header = $this->_getHeader('X-Test', $this->_getEncoder('Q', true)); - $header->setValue($nonAsciiChar); - $this->assertRegExp( - '~^[^:\x00-\x20\x80-\xFF]+: [^\x80-\xFF\r\n]+\r\n$~s', - $header->toString() - ); - } - - public function testEncodedWordsFollowGeneralStructure() - { - /* -- RFC 2047, 1. - Generally, an "encoded-word" is a sequence of printable ASCII - characters that begins with "=?", ends with "?=", and has two "?"s in - between. - */ - - $nonAsciiChar = pack('C', 0x8F); - $header = $this->_getHeader('X-Test', $this->_getEncoder('Q', true)); - $header->setValue($nonAsciiChar); - $this->assertRegExp( - '~^X-Test: \=?.*?\?.*?\?.*?\?=\r\n$~s', - $header->toString() - ); - } - - public function testEncodedWordIncludesCharsetAndEncodingMethodAndText() - { - /* -- RFC 2047, 2. - An 'encoded-word' is defined by the following ABNF grammar. The - notation of RFC 822 is used, with the exception that white space - characters MUST NOT appear between components of an 'encoded-word'. - - encoded-word = "=?" charset "?" encoding "?" encoded-text "?=" - */ - - $nonAsciiChar = pack('C', 0x8F); - - $encoder = $this->_getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($nonAsciiChar, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('=8F'); - - $header = $this->_getHeader('X-Test', $encoder); - $header->setValue($nonAsciiChar); - $this->assertEquals( - 'X-Test: =?'.$this->_charset.'?Q?=8F?='."\r\n", - $header->toString() - ); - } - - public function testEncodedWordsAreUsedToEncodedNonPrintableAscii() - { - //SPACE and TAB permitted - $nonPrintableBytes = array_merge( - range(0x00, 0x08), range(0x10, 0x19), array(0x7F) - ); - - foreach ($nonPrintableBytes as $byte) { - $char = pack('C', $byte); - $encodedChar = sprintf('=%02X', $byte); - - $encoder = $this->_getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($char, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn($encodedChar); - - $header = $this->_getHeader('X-A', $encoder); - $header->setValue($char); - - $this->assertEquals( - 'X-A: =?'.$this->_charset.'?Q?'.$encodedChar.'?='."\r\n", - $header->toString(), '%s: Non-printable ascii should be encoded' - ); - } - } - - public function testEncodedWordsAreUsedToEncode8BitOctets() - { - $_8BitBytes = range(0x80, 0xFF); - - foreach ($_8BitBytes as $byte) { - $char = pack('C', $byte); - $encodedChar = sprintf('=%02X', $byte); - - $encoder = $this->_getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($char, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn($encodedChar); - - $header = $this->_getHeader('X-A', $encoder); - $header->setValue($char); - - $this->assertEquals( - 'X-A: =?'.$this->_charset.'?Q?'.$encodedChar.'?='."\r\n", - $header->toString(), '%s: 8-bit octets should be encoded' - ); - } - } - - public function testEncodedWordsAreNoMoreThan75CharsPerLine() - { - /* -- RFC 2047, 2. - An 'encoded-word' may not be more than 75 characters long, including - 'charset', 'encoding', 'encoded-text', and delimiters. - - ... SNIP ... - - While there is no limit to the length of a multiple-line header - field, each line of a header field that contains one or more - 'encoded-word's is limited to 76 characters. - */ - - $nonAsciiChar = pack('C', 0x8F); - - $encoder = $this->_getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($nonAsciiChar, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('=8F'); - //Note that multi-line headers begin with LWSP which makes 75 + 1 = 76 - //Note also that =?utf-8?q??= is 12 chars which makes 75 - 12 = 63 - - //* X-Test: is 8 chars - $header = $this->_getHeader('X-Test', $encoder); - $header->setValue($nonAsciiChar); - - $this->assertEquals( - 'X-Test: =?'.$this->_charset.'?Q?=8F?='."\r\n", - $header->toString() - ); - } - - public function testFWSPIsUsedWhenEncoderReturnsMultipleLines() - { - /* --RFC 2047, 2. - If it is desirable to encode more text than will fit in an 'encoded-word' of - 75 characters, multiple 'encoded-word's (separated by CRLF SPACE) may - be used. - */ - - //Note the Mock does NOT return 8F encoded, the 8F merely triggers - // encoding for the sake of testing - $nonAsciiChar = pack('C', 0x8F); - - $encoder = $this->_getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($nonAsciiChar, 8, 63, \Mockery::any()) - ->andReturn('line_one_here'."\r\n".'line_two_here'); - - //Note that multi-line headers begin with LWSP which makes 75 + 1 = 76 - //Note also that =?utf-8?q??= is 12 chars which makes 75 - 12 = 63 - - //* X-Test: is 8 chars - $header = $this->_getHeader('X-Test', $encoder); - $header->setValue($nonAsciiChar); - - $this->assertEquals( - 'X-Test: =?'.$this->_charset.'?Q?line_one_here?='."\r\n". - ' =?'.$this->_charset.'?Q?line_two_here?='."\r\n", - $header->toString() - ); - } - - public function testAdjacentWordsAreEncodedTogether() - { - /* -- RFC 2047, 5 (1) - Ordinary ASCII text and 'encoded-word's may appear together in the - same header field. However, an 'encoded-word' that appears in a - header field defined as '*text' MUST be separated from any adjacent - 'encoded-word' or 'text' by 'linear-white-space'. - - -- RFC 2047, 2. - IMPORTANT: 'encoded-word's are designed to be recognized as 'atom's - by an RFC 822 parser. As a consequence, unencoded white space - characters (such as SPACE and HTAB) are FORBIDDEN within an - 'encoded-word'. - */ - - //It would be valid to encode all words needed, however it's probably - // easiest to encode the longest amount required at a time - - $word = 'w'.pack('C', 0x8F).'rd'; - $text = 'start '.$word.' '.$word.' then end '.$word; - // 'start', ' word word', ' and end', ' word' - - $encoder = $this->_getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($word.' '.$word, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('w=8Frd_w=8Frd'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($word, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('w=8Frd'); - - $header = $this->_getHeader('X-Test', $encoder); - $header->setValue($text); - - $headerString = $header->toString(); - - $this->assertEquals('X-Test: start =?'.$this->_charset.'?Q?'. - 'w=8Frd_w=8Frd?= then end =?'.$this->_charset.'?Q?'. - 'w=8Frd?='."\r\n", $headerString, - '%s: Adjacent encoded words should appear grouped with WSP encoded' - ); - } - - public function testLanguageInformationAppearsInEncodedWords() - { - /* -- RFC 2231, 5. - 5. Language specification in Encoded Words - - RFC 2047 provides support for non-US-ASCII character sets in RFC 822 - message header comments, phrases, and any unstructured text field. - This is done by defining an encoded word construct which can appear - in any of these places. Given that these are fields intended for - display, it is sometimes necessary to associate language information - with encoded words as well as just the character set. This - specification extends the definition of an encoded word to allow the - inclusion of such information. This is simply done by suffixing the - character set specification with an asterisk followed by the language - tag. For example: - - From: =?US-ASCII*EN?Q?Keith_Moore?= <moore@cs.utk.edu> - */ - - $value = 'fo'.pack('C', 0x8F).'bar'; - - $encoder = $this->_getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo=8Fbar'); - - $header = $this->_getHeader('Subject', $encoder); - $header->setLanguage('en'); - $header->setValue($value); - $this->assertEquals("Subject: =?utf-8*en?Q?fo=8Fbar?=\r\n", - $header->toString() - ); - } - - public function testSetBodyModel() - { - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $header->setFieldBodyModel('test'); - $this->assertEquals('test', $header->getValue()); - } - - public function testGetBodyModel() - { - $header = $this->_getHeader('Subject', $this->_getEncoder('Q', true)); - $header->setValue('test'); - $this->assertEquals('test', $header->getFieldBodyModel()); - } - - private function _getHeader($name, $encoder) - { - $header = new Swift_Mime_Headers_UnstructuredHeader($name, $encoder, new Swift_Mime_Grammar()); - $header->setCharset($this->_charset); - - return $header; - } - - private function _getEncoder($type, $stub = false) - { - $encoder = $this->getMockery('Swift_Mime_HeaderEncoder')->shouldIgnoreMissing(); - $encoder->shouldReceive('getName') - ->zeroOrMoreTimes() - ->andReturn($type); - - return $encoder; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php deleted file mode 100644 index 738ac68..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php +++ /dev/null @@ -1,231 +0,0 @@ -<?php - -class Swift_Mime_MimePartTest extends Swift_Mime_AbstractMimeEntityTest -{ - public function testNestingLevelIsSubpart() - { - $part = $this->_createMimePart($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals( - Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, $part->getNestingLevel() - ); - } - - public function testCharsetIsReturnedFromHeader() - { - /* -- RFC 2046, 4.1.2. - A critical parameter that may be specified in the Content-Type field - for "text/plain" data is the character set. This is specified with a - "charset" parameter, as in: - - Content-type: text/plain; charset=iso-8859-1 - - Unlike some other parameter values, the values of the charset - parameter are NOT case sensitive. The default character set, which - must be assumed in the absence of a charset parameter, is US-ASCII. - */ - - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('charset' => 'iso-8859-1') - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals('iso-8859-1', $part->getCharset()); - } - - public function testCharsetIsSetInHeader() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('charset' => 'iso-8859-1'), false - ); - $cType->shouldReceive('setParameter')->once()->with('charset', 'utf-8'); - - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $part->setCharset('utf-8'); - } - - public function testCharsetIsSetInHeaderIfPassedToSetBody() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('charset' => 'iso-8859-1'), false - ); - $cType->shouldReceive('setParameter')->once()->with('charset', 'utf-8'); - - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $part->setBody('', 'text/plian', 'utf-8'); - } - - public function testSettingCharsetNotifiesEncoder() - { - $encoder = $this->_createEncoder('quoted-printable', false); - $encoder->expects($this->once()) - ->method('charsetChanged') - ->with('utf-8'); - - $part = $this->_createMimePart($this->_createHeaderSet(), - $encoder, $this->_createCache() - ); - $part->setCharset('utf-8'); - } - - public function testSettingCharsetNotifiesHeaders() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('charsetChanged') - ->zeroOrMoreTimes() - ->with('utf-8'); - - $part = $this->_createMimePart($headers, $this->_createEncoder(), - $this->_createCache() - ); - $part->setCharset('utf-8'); - } - - public function testSettingCharsetNotifiesChildren() - { - $child = $this->_createChild(0, '', false); - $child->shouldReceive('charsetChanged') - ->once() - ->with('windows-874'); - - $part = $this->_createMimePart($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $part->setChildren(array($child)); - $part->setCharset('windows-874'); - } - - public function testCharsetChangeUpdatesCharset() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('charset' => 'iso-8859-1'), false - ); - $cType->shouldReceive('setParameter')->once()->with('charset', 'utf-8'); - - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $part->charsetChanged('utf-8'); - } - - public function testSettingCharsetClearsCache() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->_createCache(false); - - $entity = $this->_createEntity($headers, $this->_createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - // Initialize the expectation here because we only care about what happens in setCharset() - $cache->shouldReceive('clearKey') - ->once() - ->with(\Mockery::any(), 'body'); - - $entity->setCharset('iso-2022'); - } - - public function testFormatIsReturnedFromHeader() - { - /* -- RFC 3676. - */ - - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('format' => 'flowed') - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals('flowed', $part->getFormat()); - } - - public function testFormatIsSetInHeader() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $cType->shouldReceive('setParameter')->once()->with('format', 'fixed'); - - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $part->setFormat('fixed'); - } - - public function testDelSpIsReturnedFromHeader() - { - /* -- RFC 3676. - */ - - $cType = $this->_createHeader('Content-Type', 'text/plain', - array('delsp' => 'no') - ); - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertFalse($part->getDelSp()); - } - - public function testDelSpIsSetInHeader() - { - $cType = $this->_createHeader('Content-Type', 'text/plain', array(), false); - $cType->shouldReceive('setParameter')->once()->with('delsp', 'yes'); - - $part = $this->_createMimePart($this->_createHeaderSet(array( - 'Content-Type' => $cType, )), - $this->_createEncoder(), $this->_createCache() - ); - $part->setDelSp(true); - } - - public function testFluidInterface() - { - $part = $this->_createMimePart($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $this->assertSame($part, - $part - ->setContentType('text/plain') - ->setEncoder($this->_createEncoder()) - ->setId('foo@bar') - ->setDescription('my description') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren(array()) - ->setCharset('utf-8') - ->setFormat('flowed') - ->setDelSp(true) - ); - } - - //abstract - protected function _createEntity($headers, $encoder, $cache) - { - return $this->_createMimePart($headers, $encoder, $cache); - } - - protected function _createMimePart($headers, $encoder, $cache) - { - return new Swift_Mime_MimePart($headers, $encoder, $cache, new Swift_Mime_Grammar()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php deleted file mode 100644 index 6a87abf..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php +++ /dev/null @@ -1,166 +0,0 @@ -<?php - -class Swift_Mime_SimpleHeaderFactoryTest extends \PHPUnit_Framework_TestCase -{ - private $_factory; - - protected function setUp() - { - $this->_factory = $this->_createFactory(); - } - - public function testMailboxHeaderIsCorrectType() - { - $header = $this->_factory->createMailboxHeader('X-Foo'); - $this->assertInstanceOf('Swift_Mime_Headers_MailboxHeader', $header); - } - - public function testMailboxHeaderHasCorrectName() - { - $header = $this->_factory->createMailboxHeader('X-Foo'); - $this->assertEquals('X-Foo', $header->getFieldName()); - } - - public function testMailboxHeaderHasCorrectModel() - { - $header = $this->_factory->createMailboxHeader('X-Foo', - array('foo@bar' => 'FooBar') - ); - $this->assertEquals(array('foo@bar' => 'FooBar'), $header->getFieldBodyModel()); - } - - public function testDateHeaderHasCorrectType() - { - $header = $this->_factory->createDateHeader('X-Date'); - $this->assertInstanceOf('Swift_Mime_Headers_DateHeader', $header); - } - - public function testDateHeaderHasCorrectName() - { - $header = $this->_factory->createDateHeader('X-Date'); - $this->assertEquals('X-Date', $header->getFieldName()); - } - - public function testDateHeaderHasCorrectModel() - { - $header = $this->_factory->createDateHeader('X-Date', 123); - $this->assertEquals(123, $header->getFieldBodyModel()); - } - - public function testTextHeaderHasCorrectType() - { - $header = $this->_factory->createTextHeader('X-Foo'); - $this->assertInstanceOf('Swift_Mime_Headers_UnstructuredHeader', $header); - } - - public function testTextHeaderHasCorrectName() - { - $header = $this->_factory->createTextHeader('X-Foo'); - $this->assertEquals('X-Foo', $header->getFieldName()); - } - - public function testTextHeaderHasCorrectModel() - { - $header = $this->_factory->createTextHeader('X-Foo', 'bar'); - $this->assertEquals('bar', $header->getFieldBodyModel()); - } - - public function testParameterizedHeaderHasCorrectType() - { - $header = $this->_factory->createParameterizedHeader('X-Foo'); - $this->assertInstanceOf('Swift_Mime_Headers_ParameterizedHeader', $header); - } - - public function testParameterizedHeaderHasCorrectName() - { - $header = $this->_factory->createParameterizedHeader('X-Foo'); - $this->assertEquals('X-Foo', $header->getFieldName()); - } - - public function testParameterizedHeaderHasCorrectModel() - { - $header = $this->_factory->createParameterizedHeader('X-Foo', 'bar'); - $this->assertEquals('bar', $header->getFieldBodyModel()); - } - - public function testParameterizedHeaderHasCorrectParams() - { - $header = $this->_factory->createParameterizedHeader('X-Foo', 'bar', - array('zip' => 'button') - ); - $this->assertEquals(array('zip' => 'button'), $header->getParameters()); - } - - public function testIdHeaderHasCorrectType() - { - $header = $this->_factory->createIdHeader('X-ID'); - $this->assertInstanceOf('Swift_Mime_Headers_IdentificationHeader', $header); - } - - public function testIdHeaderHasCorrectName() - { - $header = $this->_factory->createIdHeader('X-ID'); - $this->assertEquals('X-ID', $header->getFieldName()); - } - - public function testIdHeaderHasCorrectModel() - { - $header = $this->_factory->createIdHeader('X-ID', 'xyz@abc'); - $this->assertEquals(array('xyz@abc'), $header->getFieldBodyModel()); - } - - public function testPathHeaderHasCorrectType() - { - $header = $this->_factory->createPathHeader('X-Path'); - $this->assertInstanceOf('Swift_Mime_Headers_PathHeader', $header); - } - - public function testPathHeaderHasCorrectName() - { - $header = $this->_factory->createPathHeader('X-Path'); - $this->assertEquals('X-Path', $header->getFieldName()); - } - - public function testPathHeaderHasCorrectModel() - { - $header = $this->_factory->createPathHeader('X-Path', 'foo@bar'); - $this->assertEquals('foo@bar', $header->getFieldBodyModel()); - } - - public function testCharsetChangeNotificationNotifiesEncoders() - { - $encoder = $this->_createHeaderEncoder(); - $encoder->expects($this->once()) - ->method('charsetChanged') - ->with('utf-8'); - $paramEncoder = $this->_createParamEncoder(); - $paramEncoder->expects($this->once()) - ->method('charsetChanged') - ->with('utf-8'); - - $factory = $this->_createFactory($encoder, $paramEncoder); - - $factory->charsetChanged('utf-8'); - } - - private function _createFactory($encoder = null, $paramEncoder = null) - { - return new Swift_Mime_SimpleHeaderFactory( - $encoder - ? $encoder : $this->_createHeaderEncoder(), - $paramEncoder - ? $paramEncoder : $this->_createParamEncoder(), - new Swift_Mime_Grammar() - ); - } - - private function _createHeaderEncoder() - { - return $this->getMockBuilder('Swift_Mime_HeaderEncoder')->getMock(); - } - - private function _createParamEncoder() - { - return $this->getMockBuilder('Swift_Encoder')->getMock(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php deleted file mode 100644 index bed1c13..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php +++ /dev/null @@ -1,737 +0,0 @@ -<?php - -class Swift_Mime_SimpleHeaderSetTest extends \PHPUnit_Framework_TestCase -{ - public function testAddMailboxHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createMailboxHeader') - ->with('From', array('person@domain' => 'Person')) - ->will($this->returnValue($this->_createHeader('From'))); - - $set = $this->_createSet($factory); - $set->addMailboxHeader('From', array('person@domain' => 'Person')); - } - - public function testAddDateHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createDateHeader') - ->with('Date', 1234) - ->will($this->returnValue($this->_createHeader('Date'))); - - $set = $this->_createSet($factory); - $set->addDateHeader('Date', 1234); - } - - public function testAddTextHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createTextHeader') - ->with('Subject', 'some text') - ->will($this->returnValue($this->_createHeader('Subject'))); - - $set = $this->_createSet($factory); - $set->addTextHeader('Subject', 'some text'); - } - - public function testAddParameterizedHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createParameterizedHeader') - ->with('Content-Type', 'text/plain', array('charset' => 'utf-8')) - ->will($this->returnValue($this->_createHeader('Content-Type'))); - - $set = $this->_createSet($factory); - $set->addParameterizedHeader('Content-Type', 'text/plain', - array('charset' => 'utf-8') - ); - } - - public function testAddIdHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($this->_createHeader('Message-ID'))); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - } - - public function testAddPathHeaderDelegatesToFactory() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createPathHeader') - ->with('Return-Path', 'some@path') - ->will($this->returnValue($this->_createHeader('Return-Path'))); - - $set = $this->_createSet($factory); - $set->addPathHeader('Return-Path', 'some@path'); - } - - public function testHasReturnsFalseWhenNoHeaders() - { - $set = $this->_createSet($this->_createFactory()); - $this->assertFalse($set->has('Some-Header')); - } - - public function testAddedMailboxHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createMailboxHeader') - ->with('From', array('person@domain' => 'Person')) - ->will($this->returnValue($this->_createHeader('From'))); - - $set = $this->_createSet($factory); - $set->addMailboxHeader('From', array('person@domain' => 'Person')); - $this->assertTrue($set->has('From')); - } - - public function testAddedDateHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createDateHeader') - ->with('Date', 1234) - ->will($this->returnValue($this->_createHeader('Date'))); - - $set = $this->_createSet($factory); - $set->addDateHeader('Date', 1234); - $this->assertTrue($set->has('Date')); - } - - public function testAddedTextHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createTextHeader') - ->with('Subject', 'some text') - ->will($this->returnValue($this->_createHeader('Subject'))); - - $set = $this->_createSet($factory); - $set->addTextHeader('Subject', 'some text'); - $this->assertTrue($set->has('Subject')); - } - - public function testAddedParameterizedHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createParameterizedHeader') - ->with('Content-Type', 'text/plain', array('charset' => 'utf-8')) - ->will($this->returnValue($this->_createHeader('Content-Type'))); - - $set = $this->_createSet($factory); - $set->addParameterizedHeader('Content-Type', 'text/plain', - array('charset' => 'utf-8') - ); - $this->assertTrue($set->has('Content-Type')); - } - - public function testAddedIdHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($this->_createHeader('Message-ID'))); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertTrue($set->has('Message-ID')); - } - - public function testAddedPathHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createPathHeader') - ->with('Return-Path', 'some@path') - ->will($this->returnValue($this->_createHeader('Return-Path'))); - - $set = $this->_createSet($factory); - $set->addPathHeader('Return-Path', 'some@path'); - $this->assertTrue($set->has('Return-Path')); - } - - public function testNewlySetHeaderIsSeenByHas() - { - $factory = $this->_createFactory(); - $header = $this->_createHeader('X-Foo', 'bar'); - $set = $this->_createSet($factory); - $set->set($header); - $this->assertTrue($set->has('X-Foo')); - } - - public function testHasCanAcceptOffset() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($this->_createHeader('Message-ID'))); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertTrue($set->has('Message-ID', 0)); - } - - public function testHasWithIllegalOffsetReturnsFalse() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($this->_createHeader('Message-ID'))); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertFalse($set->has('Message-ID', 1)); - } - - public function testHasCanDistinguishMultipleHeaders() - { - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($this->_createHeader('Message-ID'))); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($this->_createHeader('Message-ID'))); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $this->assertTrue($set->has('Message-ID', 1)); - } - - public function testGetWithUnspecifiedOffset() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertSame($header, $set->get('Message-ID')); - } - - public function testGetWithSpeiciedOffset() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Message-ID'); - $header2 = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($header1)); - $factory->expects($this->at(2)) - ->method('createIdHeader') - ->with('Message-ID', 'more@id') - ->will($this->returnValue($header2)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->addIdHeader('Message-ID', 'more@id'); - $this->assertSame($header1, $set->get('Message-ID', 1)); - } - - public function testGetReturnsNullIfHeaderNotSet() - { - $set = $this->_createSet($this->_createFactory()); - $this->assertNull($set->get('Message-ID', 99)); - } - - public function testGetAllReturnsAllHeadersMatchingName() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Message-ID'); - $header2 = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($header1)); - $factory->expects($this->at(2)) - ->method('createIdHeader') - ->with('Message-ID', 'more@id') - ->will($this->returnValue($header2)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->addIdHeader('Message-ID', 'more@id'); - - $this->assertEquals(array($header0, $header1, $header2), - $set->getAll('Message-ID') - ); - } - - public function testGetAllReturnsAllHeadersIfNoArguments() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Subject'); - $header2 = $this->_createHeader('To'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Subject', 'thing') - ->will($this->returnValue($header1)); - $factory->expects($this->at(2)) - ->method('createIdHeader') - ->with('To', 'person@example.org') - ->will($this->returnValue($header2)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Subject', 'thing'); - $set->addIdHeader('To', 'person@example.org'); - - $this->assertEquals(array($header0, $header1, $header2), - $set->getAll() - ); - } - - public function testGetAllReturnsEmptyArrayIfNoneSet() - { - $set = $this->_createSet($this->_createFactory()); - $this->assertEquals(array(), $set->getAll('Received')); - } - - public function testRemoveWithUnspecifiedOffset() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->remove('Message-ID'); - $this->assertFalse($set->has('Message-ID')); - } - - public function testRemoveWithSpecifiedIndexRemovesHeader() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($header1)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->remove('Message-ID', 0); - $this->assertFalse($set->has('Message-ID', 0)); - $this->assertTrue($set->has('Message-ID', 1)); - $this->assertTrue($set->has('Message-ID')); - $set->remove('Message-ID', 1); - $this->assertFalse($set->has('Message-ID', 1)); - $this->assertFalse($set->has('Message-ID')); - } - - public function testRemoveWithSpecifiedIndexLeavesOtherHeaders() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($header1)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->remove('Message-ID', 1); - $this->assertTrue($set->has('Message-ID', 0)); - } - - public function testRemoveWithInvalidOffsetDoesNothing() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->remove('Message-ID', 50); - $this->assertTrue($set->has('Message-ID')); - } - - public function testRemoveAllRemovesAllHeadersWithName() - { - $header0 = $this->_createHeader('Message-ID'); - $header1 = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($header1)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->removeAll('Message-ID'); - $this->assertFalse($set->has('Message-ID', 0)); - $this->assertFalse($set->has('Message-ID', 1)); - } - - public function testHasIsNotCaseSensitive() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertTrue($set->has('message-id')); - } - - public function testGetIsNotCaseSensitive() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertSame($header, $set->get('message-id')); - } - - public function testGetAllIsNotCaseSensitive() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertEquals(array($header), $set->getAll('message-id')); - } - - public function testRemoveIsNotCaseSensitive() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->remove('message-id'); - $this->assertFalse($set->has('Message-ID')); - } - - public function testRemoveAllIsNotCaseSensitive() - { - $header = $this->_createHeader('Message-ID'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->_createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->removeAll('message-id'); - $this->assertFalse($set->has('Message-ID')); - } - - public function testNewInstance() - { - $set = $this->_createSet($this->_createFactory()); - $instance = $set->newInstance(); - $this->assertInstanceOf('Swift_Mime_HeaderSet', $instance); - } - - public function testToStringJoinsHeadersTogether() - { - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Foo', 'bar') - ->will($this->returnValue($this->_createHeader('Foo', 'bar'))); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('Zip', 'buttons') - ->will($this->returnValue($this->_createHeader('Zip', 'buttons'))); - - $set = $this->_createSet($factory); - $set->addTextHeader('Foo', 'bar'); - $set->addTextHeader('Zip', 'buttons'); - $this->assertEquals( - "Foo: bar\r\n". - "Zip: buttons\r\n", - $set->toString() - ); - } - - public function testHeadersWithoutBodiesAreNotDisplayed() - { - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Foo', 'bar') - ->will($this->returnValue($this->_createHeader('Foo', 'bar'))); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('Zip', '') - ->will($this->returnValue($this->_createHeader('Zip', ''))); - - $set = $this->_createSet($factory); - $set->addTextHeader('Foo', 'bar'); - $set->addTextHeader('Zip', ''); - $this->assertEquals( - "Foo: bar\r\n", - $set->toString() - ); - } - - public function testHeadersWithoutBodiesCanBeForcedToDisplay() - { - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Foo', '') - ->will($this->returnValue($this->_createHeader('Foo', ''))); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('Zip', '') - ->will($this->returnValue($this->_createHeader('Zip', ''))); - - $set = $this->_createSet($factory); - $set->addTextHeader('Foo', ''); - $set->addTextHeader('Zip', ''); - $set->setAlwaysDisplayed(array('Foo', 'Zip')); - $this->assertEquals( - "Foo: \r\n". - "Zip: \r\n", - $set->toString() - ); - } - - public function testHeaderSequencesCanBeSpecified() - { - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Third', 'three') - ->will($this->returnValue($this->_createHeader('Third', 'three'))); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('First', 'one') - ->will($this->returnValue($this->_createHeader('First', 'one'))); - $factory->expects($this->at(2)) - ->method('createTextHeader') - ->with('Second', 'two') - ->will($this->returnValue($this->_createHeader('Second', 'two'))); - - $set = $this->_createSet($factory); - $set->addTextHeader('Third', 'three'); - $set->addTextHeader('First', 'one'); - $set->addTextHeader('Second', 'two'); - - $set->defineOrdering(array('First', 'Second', 'Third')); - - $this->assertEquals( - "First: one\r\n". - "Second: two\r\n". - "Third: three\r\n", - $set->toString() - ); - } - - public function testUnsortedHeadersAppearAtEnd() - { - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Fourth', 'four') - ->will($this->returnValue($this->_createHeader('Fourth', 'four'))); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('Fifth', 'five') - ->will($this->returnValue($this->_createHeader('Fifth', 'five'))); - $factory->expects($this->at(2)) - ->method('createTextHeader') - ->with('Third', 'three') - ->will($this->returnValue($this->_createHeader('Third', 'three'))); - $factory->expects($this->at(3)) - ->method('createTextHeader') - ->with('First', 'one') - ->will($this->returnValue($this->_createHeader('First', 'one'))); - $factory->expects($this->at(4)) - ->method('createTextHeader') - ->with('Second', 'two') - ->will($this->returnValue($this->_createHeader('Second', 'two'))); - - $set = $this->_createSet($factory); - $set->addTextHeader('Fourth', 'four'); - $set->addTextHeader('Fifth', 'five'); - $set->addTextHeader('Third', 'three'); - $set->addTextHeader('First', 'one'); - $set->addTextHeader('Second', 'two'); - - $set->defineOrdering(array('First', 'Second', 'Third')); - - $this->assertEquals( - "First: one\r\n". - "Second: two\r\n". - "Third: three\r\n". - "Fourth: four\r\n". - "Fifth: five\r\n", - $set->toString() - ); - } - - public function testSettingCharsetNotifiesAlreadyExistingHeaders() - { - $subject = $this->_createHeader('Subject', 'some text'); - $xHeader = $this->_createHeader('X-Header', 'some text'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Subject', 'some text') - ->will($this->returnValue($subject)); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('X-Header', 'some text') - ->will($this->returnValue($xHeader)); - $subject->expects($this->once()) - ->method('setCharset') - ->with('utf-8'); - $xHeader->expects($this->once()) - ->method('setCharset') - ->with('utf-8'); - - $set = $this->_createSet($factory); - $set->addTextHeader('Subject', 'some text'); - $set->addTextHeader('X-Header', 'some text'); - - $set->setCharset('utf-8'); - } - - public function testCharsetChangeNotifiesAlreadyExistingHeaders() - { - $subject = $this->_createHeader('Subject', 'some text'); - $xHeader = $this->_createHeader('X-Header', 'some text'); - $factory = $this->_createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Subject', 'some text') - ->will($this->returnValue($subject)); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('X-Header', 'some text') - ->will($this->returnValue($xHeader)); - $subject->expects($this->once()) - ->method('setCharset') - ->with('utf-8'); - $xHeader->expects($this->once()) - ->method('setCharset') - ->with('utf-8'); - - $set = $this->_createSet($factory); - $set->addTextHeader('Subject', 'some text'); - $set->addTextHeader('X-Header', 'some text'); - - $set->charsetChanged('utf-8'); - } - - public function testCharsetChangeNotifiesFactory() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('charsetChanged') - ->with('utf-8'); - - $set = $this->_createSet($factory); - - $set->setCharset('utf-8'); - } - - private function _createSet($factory) - { - return new Swift_Mime_SimpleHeaderSet($factory); - } - - private function _createFactory() - { - return $this->getMockBuilder('Swift_Mime_HeaderFactory')->getMock(); - } - - private function _createHeader($name, $body = '') - { - $header = $this->getMockBuilder('Swift_Mime_Header')->getMock(); - $header->expects($this->any()) - ->method('getFieldName') - ->will($this->returnValue($name)); - $header->expects($this->any()) - ->method('toString') - ->will($this->returnValue(sprintf("%s: %s\r\n", $name, $body))); - $header->expects($this->any()) - ->method('getFieldBody') - ->will($this->returnValue($body)); - - return $header; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php deleted file mode 100644 index e5d225c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php +++ /dev/null @@ -1,827 +0,0 @@ -<?php - -class Swift_Mime_SimpleMessageTest extends Swift_Mime_MimePartTest -{ - public function testNestingLevelIsSubpart() - { - //Overridden - } - - public function testNestingLevelIsTop() - { - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals( - Swift_Mime_MimeEntity::LEVEL_TOP, $message->getNestingLevel() - ); - } - - public function testDateIsReturnedFromHeader() - { - $date = $this->_createHeader('Date', 123); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Date' => $date)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals(123, $message->getDate()); - } - - public function testDateIsSetInHeader() - { - $date = $this->_createHeader('Date', 123, array(), false); - $date->shouldReceive('setFieldBodyModel') - ->once() - ->with(1234); - $date->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Date' => $date)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setDate(1234); - } - - public function testDateHeaderIsCreatedIfNonePresent() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addDateHeader') - ->once() - ->with('Date', 1234); - $headers->shouldReceive('addDateHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setDate(1234); - } - - public function testDateHeaderIsAddedDuringConstruction() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addDateHeader') - ->once() - ->with('Date', '/^[0-9]+$/D'); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - } - - public function testIdIsReturnedFromHeader() - { - /* -- RFC 2045, 7. - In constructing a high-level user agent, it may be desirable to allow - one body to make reference to another. Accordingly, bodies may be - labelled using the "Content-ID" header field, which is syntactically - identical to the "Message-ID" header field - */ - - $messageId = $this->_createHeader('Message-ID', 'a@b'); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Message-ID' => $messageId)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals('a@b', $message->getId()); - } - - public function testIdIsSetInHeader() - { - $messageId = $this->_createHeader('Message-ID', 'a@b', array(), false); - $messageId->shouldReceive('setFieldBodyModel') - ->once() - ->with('x@y'); - $messageId->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Message-ID' => $messageId)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setId('x@y'); - } - - public function testIdIsAutoGenerated() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addIdHeader') - ->once() - ->with('Message-ID', '/^.*?@.*?$/D'); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - } - - public function testSubjectIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.5. - */ - - $subject = $this->_createHeader('Subject', 'example subject'); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Subject' => $subject)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals('example subject', $message->getSubject()); - } - - public function testSubjectIsSetInHeader() - { - $subject = $this->_createHeader('Subject', '', array(), false); - $subject->shouldReceive('setFieldBodyModel') - ->once() - ->with('foo'); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Subject' => $subject)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setSubject('foo'); - } - - public function testSubjectHeaderIsCreatedIfNotPresent() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addTextHeader') - ->once() - ->with('Subject', 'example subject'); - $headers->shouldReceive('addTextHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setSubject('example subject'); - } - - public function testReturnPathIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.7. - */ - - $path = $this->_createHeader('Return-Path', 'bounces@domain'); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Return-Path' => $path)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals('bounces@domain', $message->getReturnPath()); - } - - public function testReturnPathIsSetInHeader() - { - $path = $this->_createHeader('Return-Path', '', array(), false); - $path->shouldReceive('setFieldBodyModel') - ->once() - ->with('bounces@domain'); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Return-Path' => $path)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setReturnPath('bounces@domain'); - } - - public function testReturnPathHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addPathHeader') - ->once() - ->with('Return-Path', 'bounces@domain'); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setReturnPath('bounces@domain'); - } - - public function testSenderIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.2. - */ - - $sender = $this->_createHeader('Sender', array('sender@domain' => 'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Sender' => $sender)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals(array('sender@domain' => 'Name'), $message->getSender()); - } - - public function testSenderIsSetInHeader() - { - $sender = $this->_createHeader('Sender', array('sender@domain' => 'Name'), - array(), false - ); - $sender->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Sender' => $sender)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setSender(array('other@domain' => 'Other')); - } - - public function testSenderHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Sender', (array) 'sender@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setSender('sender@domain'); - } - - public function testNameCanBeUsedInSenderHeader() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Sender', array('sender@domain' => 'Name')); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setSender('sender@domain', 'Name'); - } - - public function testFromIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.2. - */ - - $from = $this->_createHeader('From', array('from@domain' => 'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('From' => $from)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals(array('from@domain' => 'Name'), $message->getFrom()); - } - - public function testFromIsSetInHeader() - { - $from = $this->_createHeader('From', array('from@domain' => 'Name'), - array(), false - ); - $from->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('From' => $from)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setFrom(array('other@domain' => 'Other')); - } - - public function testFromIsAddedToHeadersDuringAddFrom() - { - $from = $this->_createHeader('From', array('from@domain' => 'Name'), - array(), false - ); - $from->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('from@domain' => 'Name', 'other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('From' => $from)), - $this->_createEncoder(), $this->_createCache() - ); - $message->addFrom('other@domain', 'Other'); - } - - public function testFromHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('From', (array) 'from@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setFrom('from@domain'); - } - - public function testPersonalNameCanBeUsedInFromAddress() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('From', array('from@domain' => 'Name')); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setFrom('from@domain', 'Name'); - } - - public function testReplyToIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.2. - */ - - $reply = $this->_createHeader('Reply-To', array('reply@domain' => 'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Reply-To' => $reply)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals(array('reply@domain' => 'Name'), $message->getReplyTo()); - } - - public function testReplyToIsSetInHeader() - { - $reply = $this->_createHeader('Reply-To', array('reply@domain' => 'Name'), - array(), false - ); - $reply->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Reply-To' => $reply)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setReplyTo(array('other@domain' => 'Other')); - } - - public function testReplyToIsAddedToHeadersDuringAddReplyTo() - { - $replyTo = $this->_createHeader('Reply-To', array('from@domain' => 'Name'), - array(), false - ); - $replyTo->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('from@domain' => 'Name', 'other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Reply-To' => $replyTo)), - $this->_createEncoder(), $this->_createCache() - ); - $message->addReplyTo('other@domain', 'Other'); - } - - public function testReplyToHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Reply-To', (array) 'reply@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setReplyTo('reply@domain'); - } - - public function testNameCanBeUsedInReplyTo() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Reply-To', array('reply@domain' => 'Name')); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setReplyTo('reply@domain', 'Name'); - } - - public function testToIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.3. - */ - - $to = $this->_createHeader('To', array('to@domain' => 'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('To' => $to)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals(array('to@domain' => 'Name'), $message->getTo()); - } - - public function testToIsSetInHeader() - { - $to = $this->_createHeader('To', array('to@domain' => 'Name'), - array(), false - ); - $to->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('To' => $to)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setTo(array('other@domain' => 'Other')); - } - - public function testToIsAddedToHeadersDuringAddTo() - { - $to = $this->_createHeader('To', array('from@domain' => 'Name'), - array(), false - ); - $to->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('from@domain' => 'Name', 'other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('To' => $to)), - $this->_createEncoder(), $this->_createCache() - ); - $message->addTo('other@domain', 'Other'); - } - - public function testToHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('To', (array) 'to@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setTo('to@domain'); - } - - public function testNameCanBeUsedInToHeader() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('To', array('to@domain' => 'Name')); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setTo('to@domain', 'Name'); - } - - public function testCcIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.3. - */ - - $cc = $this->_createHeader('Cc', array('cc@domain' => 'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Cc' => $cc)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals(array('cc@domain' => 'Name'), $message->getCc()); - } - - public function testCcIsSetInHeader() - { - $cc = $this->_createHeader('Cc', array('cc@domain' => 'Name'), - array(), false - ); - $cc->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Cc' => $cc)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setCc(array('other@domain' => 'Other')); - } - - public function testCcIsAddedToHeadersDuringAddCc() - { - $cc = $this->_createHeader('Cc', array('from@domain' => 'Name'), - array(), false - ); - $cc->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('from@domain' => 'Name', 'other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Cc' => $cc)), - $this->_createEncoder(), $this->_createCache() - ); - $message->addCc('other@domain', 'Other'); - } - - public function testCcHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Cc', (array) 'cc@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setCc('cc@domain'); - } - - public function testNameCanBeUsedInCcHeader() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Cc', array('cc@domain' => 'Name')); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setCc('cc@domain', 'Name'); - } - - public function testBccIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.3. - */ - - $bcc = $this->_createHeader('Bcc', array('bcc@domain' => 'Name')); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Bcc' => $bcc)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals(array('bcc@domain' => 'Name'), $message->getBcc()); - } - - public function testBccIsSetInHeader() - { - $bcc = $this->_createHeader('Bcc', array('bcc@domain' => 'Name'), - array(), false - ); - $bcc->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Bcc' => $bcc)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setBcc(array('other@domain' => 'Other')); - } - - public function testBccIsAddedToHeadersDuringAddBcc() - { - $bcc = $this->_createHeader('Bcc', array('from@domain' => 'Name'), - array(), false - ); - $bcc->shouldReceive('setFieldBodyModel') - ->once() - ->with(array('from@domain' => 'Name', 'other@domain' => 'Other')); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Bcc' => $bcc)), - $this->_createEncoder(), $this->_createCache() - ); - $message->addBcc('other@domain', 'Other'); - } - - public function testBccHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Bcc', (array) 'bcc@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setBcc('bcc@domain'); - } - - public function testNameCanBeUsedInBcc() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Bcc', array('bcc@domain' => 'Name')); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setBcc('bcc@domain', 'Name'); - } - - public function testPriorityIsReadFromHeader() - { - $prio = $this->_createHeader('X-Priority', '2 (High)'); - $message = $this->_createMessage( - $this->_createHeaderSet(array('X-Priority' => $prio)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals(2, $message->getPriority()); - } - - public function testPriorityIsSetInHeader() - { - $prio = $this->_createHeader('X-Priority', '2 (High)', array(), false); - $prio->shouldReceive('setFieldBodyModel') - ->once() - ->with('5 (Lowest)'); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('X-Priority' => $prio)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setPriority($message::PRIORITY_LOWEST); - } - - public function testPriorityHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addTextHeader') - ->once() - ->with('X-Priority', '4 (Low)'); - $headers->shouldReceive('addTextHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setPriority($message::PRIORITY_LOW); - } - - public function testReadReceiptAddressReadFromHeader() - { - $rcpt = $this->_createHeader('Disposition-Notification-To', - array('chris@swiftmailer.org' => 'Chris') - ); - $message = $this->_createMessage( - $this->_createHeaderSet(array('Disposition-Notification-To' => $rcpt)), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertEquals(array('chris@swiftmailer.org' => 'Chris'), - $message->getReadReceiptTo() - ); - } - - public function testReadReceiptIsSetInHeader() - { - $rcpt = $this->_createHeader('Disposition-Notification-To', array(), array(), false); - $rcpt->shouldReceive('setFieldBodyModel') - ->once() - ->with('mark@swiftmailer.org'); - - $message = $this->_createMessage( - $this->_createHeaderSet(array('Disposition-Notification-To' => $rcpt)), - $this->_createEncoder(), $this->_createCache() - ); - $message->setReadReceiptTo('mark@swiftmailer.org'); - } - - public function testReadReceiptHeaderIsAddedIfNoneSet() - { - $headers = $this->_createHeaderSet(array(), false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Disposition-Notification-To', 'mark@swiftmailer.org'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->_createMessage($headers, $this->_createEncoder(), - $this->_createCache() - ); - $message->setReadReceiptTo('mark@swiftmailer.org'); - } - - public function testChildrenCanBeAttached() - { - $child1 = $this->_createChild(); - $child2 = $this->_createChild(); - - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $message->attach($child1); - $message->attach($child2); - - $this->assertEquals(array($child1, $child2), $message->getChildren()); - } - - public function testChildrenCanBeDetached() - { - $child1 = $this->_createChild(); - $child2 = $this->_createChild(); - - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $message->attach($child1); - $message->attach($child2); - - $message->detach($child1); - - $this->assertEquals(array($child2), $message->getChildren()); - } - - public function testEmbedAttachesChild() - { - $child = $this->_createChild(); - - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $message->embed($child); - - $this->assertEquals(array($child), $message->getChildren()); - } - - public function testEmbedReturnsValidCid() - { - $child = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_RELATED, '', - false - ); - $child->shouldReceive('getId') - ->zeroOrMoreTimes() - ->andReturn('foo@bar'); - - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - - $this->assertEquals('cid:foo@bar', $message->embed($child)); - } - - public function testFluidInterface() - { - $child = $this->_createChild(); - $message = $this->_createMessage($this->_createHeaderSet(), - $this->_createEncoder(), $this->_createCache() - ); - $this->assertSame($message, - $message - ->setContentType('text/plain') - ->setEncoder($this->_createEncoder()) - ->setId('foo@bar') - ->setDescription('my description') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren(array()) - ->setCharset('iso-8859-1') - ->setFormat('flowed') - ->setDelSp(false) - ->setSubject('subj') - ->setDate(123) - ->setReturnPath('foo@bar') - ->setSender('foo@bar') - ->setFrom(array('x@y' => 'XY')) - ->setReplyTo(array('ab@cd' => 'ABCD')) - ->setTo(array('chris@site.tld', 'mark@site.tld')) - ->setCc('john@somewhere.tld') - ->setBcc(array('one@site', 'two@site' => 'Two')) - ->setPriority($message::PRIORITY_LOW) - ->setReadReceiptTo('a@b') - ->attach($child) - ->detach($child) - ); - } - - //abstract - protected function _createEntity($headers, $encoder, $cache) - { - return $this->_createMessage($headers, $encoder, $cache); - } - - protected function _createMimePart($headers, $encoder, $cache) - { - return $this->_createMessage($headers, $encoder, $cache); - } - - private function _createMessage($headers, $encoder, $cache) - { - return new Swift_Mime_SimpleMessage($headers, $encoder, $cache, new Swift_Mime_Grammar()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php deleted file mode 100644 index fa2a8d4..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -class Swift_Mime_SimpleMimeEntityTest extends Swift_Mime_AbstractMimeEntityTest -{ - protected function _createEntity($headerFactory, $encoder, $cache) - { - return new Swift_Mime_SimpleMimeEntity($headerFactory, $encoder, $cache, new Swift_Mime_Grammar()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/AntiFloodPluginTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/AntiFloodPluginTest.php deleted file mode 100644 index 463e4eb..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/AntiFloodPluginTest.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -class Swift_Plugins_AntiFloodPluginTest extends \PHPUnit_Framework_TestCase -{ - public function testThresholdCanBeSetAndFetched() - { - $plugin = new Swift_Plugins_AntiFloodPlugin(10); - $this->assertEquals(10, $plugin->getThreshold()); - $plugin->setThreshold(100); - $this->assertEquals(100, $plugin->getThreshold()); - } - - public function testSleepTimeCanBeSetAndFetched() - { - $plugin = new Swift_Plugins_AntiFloodPlugin(10, 5); - $this->assertEquals(5, $plugin->getSleepTime()); - $plugin->setSleepTime(1); - $this->assertEquals(1, $plugin->getSleepTime()); - } - - public function testPluginStopsConnectionAfterThreshold() - { - $transport = $this->_createTransport(); - $transport->expects($this->once()) - ->method('start'); - $transport->expects($this->once()) - ->method('stop'); - - $evt = $this->_createSendEvent($transport); - - $plugin = new Swift_Plugins_AntiFloodPlugin(10); - for ($i = 0; $i < 12; ++$i) { - $plugin->sendPerformed($evt); - } - } - - public function testPluginCanStopAndStartMultipleTimes() - { - $transport = $this->_createTransport(); - $transport->expects($this->exactly(5)) - ->method('start'); - $transport->expects($this->exactly(5)) - ->method('stop'); - - $evt = $this->_createSendEvent($transport); - - $plugin = new Swift_Plugins_AntiFloodPlugin(2); - for ($i = 0; $i < 11; ++$i) { - $plugin->sendPerformed($evt); - } - } - - public function testPluginCanSleepDuringRestart() - { - $sleeper = $this->getMockBuilder('Swift_Plugins_Sleeper')->getMock(); - $sleeper->expects($this->once()) - ->method('sleep') - ->with(10); - - $transport = $this->_createTransport(); - $transport->expects($this->once()) - ->method('start'); - $transport->expects($this->once()) - ->method('stop'); - - $evt = $this->_createSendEvent($transport); - - $plugin = new Swift_Plugins_AntiFloodPlugin(99, 10, $sleeper); - for ($i = 0; $i < 101; ++$i) { - $plugin->sendPerformed($evt); - } - } - - private function _createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } - - private function _createSendEvent($transport) - { - $evt = $this->getMockBuilder('Swift_Events_SendEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getSource') - ->will($this->returnValue($transport)); - $evt->expects($this->any()) - ->method('getTransport') - ->will($this->returnValue($transport)); - - return $evt; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php deleted file mode 100644 index 869cfc8..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php - -class Swift_Plugins_BandwidthMonitorPluginTest extends \PHPUnit_Framework_TestCase -{ - private $_monitor; - - private $_bytes = 0; - - protected function setUp() - { - $this->_monitor = new Swift_Plugins_BandwidthMonitorPlugin(); - } - - public function testBytesOutIncreasesWhenCommandsSent() - { - $evt = $this->_createCommandEvent("RCPT TO:<foo@bar.com>\r\n"); - - $this->assertEquals(0, $this->_monitor->getBytesOut()); - $this->_monitor->commandSent($evt); - $this->assertEquals(23, $this->_monitor->getBytesOut()); - $this->_monitor->commandSent($evt); - $this->assertEquals(46, $this->_monitor->getBytesOut()); - } - - public function testBytesInIncreasesWhenResponsesReceived() - { - $evt = $this->_createResponseEvent("250 Ok\r\n"); - - $this->assertEquals(0, $this->_monitor->getBytesIn()); - $this->_monitor->responseReceived($evt); - $this->assertEquals(8, $this->_monitor->getBytesIn()); - $this->_monitor->responseReceived($evt); - $this->assertEquals(16, $this->_monitor->getBytesIn()); - } - - public function testCountersCanBeReset() - { - $evt = $this->_createResponseEvent("250 Ok\r\n"); - - $this->assertEquals(0, $this->_monitor->getBytesIn()); - $this->_monitor->responseReceived($evt); - $this->assertEquals(8, $this->_monitor->getBytesIn()); - $this->_monitor->responseReceived($evt); - $this->assertEquals(16, $this->_monitor->getBytesIn()); - - $evt = $this->_createCommandEvent("RCPT TO:<foo@bar.com>\r\n"); - - $this->assertEquals(0, $this->_monitor->getBytesOut()); - $this->_monitor->commandSent($evt); - $this->assertEquals(23, $this->_monitor->getBytesOut()); - $this->_monitor->commandSent($evt); - $this->assertEquals(46, $this->_monitor->getBytesOut()); - - $this->_monitor->reset(); - - $this->assertEquals(0, $this->_monitor->getBytesOut()); - $this->assertEquals(0, $this->_monitor->getBytesIn()); - } - - public function testBytesOutIncreasesAccordingToMessageLength() - { - $message = $this->_createMessageWithByteCount(6); - $evt = $this->_createSendEvent($message); - - $this->assertEquals(0, $this->_monitor->getBytesOut()); - $this->_monitor->sendPerformed($evt); - $this->assertEquals(6, $this->_monitor->getBytesOut()); - $this->_monitor->sendPerformed($evt); - $this->assertEquals(12, $this->_monitor->getBytesOut()); - } - - private function _createSendEvent($message) - { - $evt = $this->getMockBuilder('Swift_Events_SendEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getMessage') - ->will($this->returnValue($message)); - - return $evt; - } - - private function _createCommandEvent($command) - { - $evt = $this->getMockBuilder('Swift_Events_CommandEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getCommand') - ->will($this->returnValue($command)); - - return $evt; - } - - private function _createResponseEvent($response) - { - $evt = $this->getMockBuilder('Swift_Events_ResponseEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getResponse') - ->will($this->returnValue($response)); - - return $evt; - } - - private function _createMessageWithByteCount($bytes) - { - $this->_bytes = $bytes; - $msg = $this->getMockBuilder('Swift_Mime_Message')->getMock(); - $msg->expects($this->any()) - ->method('toByteStream') - ->will($this->returnCallback(array($this, '_write'))); - /* $this->_checking(Expectations::create() - -> ignoring($msg)->toByteStream(any()) -> calls(array($this, '_write')) - ); */ - - return $msg; - } - - public function _write($is) - { - for ($i = 0; $i < $this->_bytes; ++$i) { - $is->write('x'); - } - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php deleted file mode 100644 index 8019dfb..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php +++ /dev/null @@ -1,267 +0,0 @@ -<?php - -class Swift_Plugins_DecoratorPluginTest extends \SwiftMailerTestCase -{ - public function testMessageBodyReceivesReplacements() - { - $message = $this->_createMessage( - $this->_createHeaders(), - array('zip@button.tld' => 'Zipathon'), - array('chris.corbyn@swiftmailer.org' => 'Chris'), - 'Subject', - 'Hello {name}, you are customer #{id}' - ); - $message->shouldReceive('setBody') - ->once() - ->with('Hello Zip, you are customer #456'); - $message->shouldReceive('setBody') - ->zeroOrMoreTimes(); - - $plugin = $this->_createPlugin( - array('zip@button.tld' => array('{name}' => 'Zip', '{id}' => '456')) - ); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsCanBeAppliedToSameMessageMultipleTimes() - { - $message = $this->_createMessage( - $this->_createHeaders(), - array('zip@button.tld' => 'Zipathon', 'foo@bar.tld' => 'Foo'), - array('chris.corbyn@swiftmailer.org' => 'Chris'), - 'Subject', - 'Hello {name}, you are customer #{id}' - ); - $message->shouldReceive('setBody') - ->once() - ->with('Hello Zip, you are customer #456'); - $message->shouldReceive('setBody') - ->once() - ->with('Hello {name}, you are customer #{id}'); - $message->shouldReceive('setBody') - ->once() - ->with('Hello Foo, you are customer #123'); - $message->shouldReceive('setBody') - ->zeroOrMoreTimes(); - - $plugin = $this->_createPlugin( - array( - 'foo@bar.tld' => array('{name}' => 'Foo', '{id}' => '123'), - 'zip@button.tld' => array('{name}' => 'Zip', '{id}' => '456'), - ) - ); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsCanBeMadeInHeaders() - { - $headers = $this->_createHeaders(array( - $returnPathHeader = $this->_createHeader('Return-Path', 'foo-{id}@swiftmailer.org'), - $toHeader = $this->_createHeader('Subject', 'A message for {name}!'), - )); - - $message = $this->_createMessage( - $headers, - array('zip@button.tld' => 'Zipathon'), - array('chris.corbyn@swiftmailer.org' => 'Chris'), - 'A message for {name}!', - 'Hello {name}, you are customer #{id}' - ); - - $message->shouldReceive('setBody') - ->once() - ->with('Hello Zip, you are customer #456'); - $toHeader->shouldReceive('setFieldBodyModel') - ->once() - ->with('A message for Zip!'); - $returnPathHeader->shouldReceive('setFieldBodyModel') - ->once() - ->with('foo-456@swiftmailer.org'); - $message->shouldReceive('setBody') - ->zeroOrMoreTimes(); - $toHeader->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - $returnPathHeader->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $plugin = $this->_createPlugin( - array('zip@button.tld' => array('{name}' => 'Zip', '{id}' => '456')) - ); - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsAreMadeOnSubparts() - { - $part1 = $this->_createPart('text/plain', 'Your name is {name}?', '1@x'); - $part2 = $this->_createPart('text/html', 'Your <em>name</em> is {name}?', '2@x'); - $message = $this->_createMessage( - $this->_createHeaders(), - array('zip@button.tld' => 'Zipathon'), - array('chris.corbyn@swiftmailer.org' => 'Chris'), - 'A message for {name}!', - 'Subject' - ); - $message->shouldReceive('getChildren') - ->zeroOrMoreTimes() - ->andReturn(array($part1, $part2)); - $part1->shouldReceive('setBody') - ->once() - ->with('Your name is Zip?'); - $part2->shouldReceive('setBody') - ->once() - ->with('Your <em>name</em> is Zip?'); - $part1->shouldReceive('setBody') - ->zeroOrMoreTimes(); - $part2->shouldReceive('setBody') - ->zeroOrMoreTimes(); - - $plugin = $this->_createPlugin( - array('zip@button.tld' => array('{name}' => 'Zip', '{id}' => '456')) - ); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsCanBeTakenFromCustomReplacementsObject() - { - $message = $this->_createMessage( - $this->_createHeaders(), - array('foo@bar' => 'Foobar', 'zip@zap' => 'Zip zap'), - array('chris.corbyn@swiftmailer.org' => 'Chris'), - 'Subject', - 'Something {a}' - ); - - $replacements = $this->_createReplacements(); - - $message->shouldReceive('setBody') - ->once() - ->with('Something b'); - $message->shouldReceive('setBody') - ->once() - ->with('Something c'); - $message->shouldReceive('setBody') - ->zeroOrMoreTimes(); - $replacements->shouldReceive('getReplacementsFor') - ->once() - ->with('foo@bar') - ->andReturn(array('{a}' => 'b')); - $replacements->shouldReceive('getReplacementsFor') - ->once() - ->with('zip@zap') - ->andReturn(array('{a}' => 'c')); - - $plugin = $this->_createPlugin($replacements); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - private function _createMessage($headers, $to = array(), $from = null, $subject = null, - $body = null) - { - $message = $this->getMockery('Swift_Mime_Message')->shouldIgnoreMissing(); - foreach ($to as $addr => $name) { - $message->shouldReceive('getTo') - ->once() - ->andReturn(array($addr => $name)); - } - $message->shouldReceive('getHeaders') - ->zeroOrMoreTimes() - ->andReturn($headers); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn($from); - $message->shouldReceive('getSubject') - ->zeroOrMoreTimes() - ->andReturn($subject); - $message->shouldReceive('getBody') - ->zeroOrMoreTimes() - ->andReturn($body); - - return $message; - } - - private function _createPlugin($replacements) - { - return new Swift_Plugins_DecoratorPlugin($replacements); - } - - private function _createReplacements() - { - return $this->getMockery('Swift_Plugins_Decorator_Replacements')->shouldIgnoreMissing(); - } - - private function _createSendEvent(Swift_Mime_Message $message) - { - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $evt->shouldReceive('getMessage') - ->zeroOrMoreTimes() - ->andReturn($message); - - return $evt; - } - - private function _createPart($type, $body, $id) - { - $part = $this->getMockery('Swift_Mime_MimeEntity')->shouldIgnoreMissing(); - $part->shouldReceive('getContentType') - ->zeroOrMoreTimes() - ->andReturn($type); - $part->shouldReceive('getBody') - ->zeroOrMoreTimes() - ->andReturn($body); - $part->shouldReceive('getId') - ->zeroOrMoreTimes() - ->andReturn($id); - - return $part; - } - - private function _createHeaders($headers = array()) - { - $set = $this->getMockery('Swift_Mime_HeaderSet')->shouldIgnoreMissing(); - $set->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->andReturn($headers); - - foreach ($headers as $header) { - $set->set($header); - } - - return $set; - } - - private function _createHeader($name, $body = '') - { - $header = $this->getMockery('Swift_Mime_Header')->shouldIgnoreMissing(); - $header->shouldReceive('getFieldName') - ->zeroOrMoreTimes() - ->andReturn($name); - $header->shouldReceive('getFieldBodyModel') - ->zeroOrMoreTimes() - ->andReturn($body); - - return $header; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php deleted file mode 100644 index bfe4cb7..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php +++ /dev/null @@ -1,188 +0,0 @@ -<?php - -class Swift_Plugins_LoggerPluginTest extends \SwiftMailerTestCase -{ - public function testLoggerDelegatesAddingEntries() - { - $logger = $this->_createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with('foo'); - - $plugin = $this->_createPlugin($logger); - $plugin->add('foo'); - } - - public function testLoggerDelegatesDumpingEntries() - { - $logger = $this->_createLogger(); - $logger->expects($this->once()) - ->method('dump') - ->will($this->returnValue('foobar')); - - $plugin = $this->_createPlugin($logger); - $this->assertEquals('foobar', $plugin->dump()); - } - - public function testLoggerDelegatesClearingEntries() - { - $logger = $this->_createLogger(); - $logger->expects($this->once()) - ->method('clear'); - - $plugin = $this->_createPlugin($logger); - $plugin->clear(); - } - - public function testCommandIsSentToLogger() - { - $evt = $this->_createCommandEvent("foo\r\n"); - $logger = $this->_createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->regExp('~foo\r\n~')); - - $plugin = $this->_createPlugin($logger); - $plugin->commandSent($evt); - } - - public function testResponseIsSentToLogger() - { - $evt = $this->_createResponseEvent("354 Go ahead\r\n"); - $logger = $this->_createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->regExp('~354 Go ahead\r\n~')); - - $plugin = $this->_createPlugin($logger); - $plugin->responseReceived($evt); - } - - public function testTransportBeforeStartChangeIsSentToLogger() - { - $evt = $this->_createTransportChangeEvent(); - $logger = $this->_createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->anything()); - - $plugin = $this->_createPlugin($logger); - $plugin->beforeTransportStarted($evt); - } - - public function testTransportStartChangeIsSentToLogger() - { - $evt = $this->_createTransportChangeEvent(); - $logger = $this->_createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->anything()); - - $plugin = $this->_createPlugin($logger); - $plugin->transportStarted($evt); - } - - public function testTransportStopChangeIsSentToLogger() - { - $evt = $this->_createTransportChangeEvent(); - $logger = $this->_createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->anything()); - - $plugin = $this->_createPlugin($logger); - $plugin->transportStopped($evt); - } - - public function testTransportBeforeStopChangeIsSentToLogger() - { - $evt = $this->_createTransportChangeEvent(); - $logger = $this->_createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->anything()); - - $plugin = $this->_createPlugin($logger); - $plugin->beforeTransportStopped($evt); - } - - public function testExceptionsArePassedToDelegateAndLeftToBubbleUp() - { - $transport = $this->_createTransport(); - $evt = $this->_createTransportExceptionEvent(); - $logger = $this->_createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->anything()); - - $plugin = $this->_createPlugin($logger); - try { - $plugin->exceptionThrown($evt); - $this->fail('Exception should bubble up.'); - } catch (Swift_TransportException $ex) { - } - } - - private function _createLogger() - { - return $this->getMockBuilder('Swift_Plugins_Logger')->getMock(); - } - - private function _createPlugin($logger) - { - return new Swift_Plugins_LoggerPlugin($logger); - } - - private function _createCommandEvent($command) - { - $evt = $this->getMockBuilder('Swift_Events_CommandEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getCommand') - ->will($this->returnValue($command)); - - return $evt; - } - - private function _createResponseEvent($response) - { - $evt = $this->getMockBuilder('Swift_Events_ResponseEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getResponse') - ->will($this->returnValue($response)); - - return $evt; - } - - private function _createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } - - private function _createTransportChangeEvent() - { - $evt = $this->getMockBuilder('Swift_Events_TransportChangeEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getSource') - ->will($this->returnValue($this->_createTransport())); - - return $evt; - } - - public function _createTransportExceptionEvent() - { - $evt = $this->getMockBuilder('Swift_Events_TransportExceptionEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getException') - ->will($this->returnValue(new Swift_TransportException(''))); - - return $evt; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php deleted file mode 100644 index 880bb32..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -class Swift_Plugins_Loggers_ArrayLoggerTest extends \PHPUnit_Framework_TestCase -{ - public function testAddingSingleEntryDumpsSingleLine() - { - $logger = new Swift_Plugins_Loggers_ArrayLogger(); - $logger->add(">> Foo\r\n"); - $this->assertEquals(">> Foo\r\n", $logger->dump()); - } - - public function testAddingMultipleEntriesDumpsMultipleLines() - { - $logger = new Swift_Plugins_Loggers_ArrayLogger(); - $logger->add(">> FOO\r\n"); - $logger->add("<< 502 That makes no sense\r\n"); - $logger->add(">> RSET\r\n"); - $logger->add("<< 250 OK\r\n"); - - $this->assertEquals( - ">> FOO\r\n".PHP_EOL. - "<< 502 That makes no sense\r\n".PHP_EOL. - ">> RSET\r\n".PHP_EOL. - "<< 250 OK\r\n", - $logger->dump() - ); - } - - public function testLogCanBeCleared() - { - $logger = new Swift_Plugins_Loggers_ArrayLogger(); - $logger->add(">> FOO\r\n"); - $logger->add("<< 502 That makes no sense\r\n"); - $logger->add(">> RSET\r\n"); - $logger->add("<< 250 OK\r\n"); - - $this->assertEquals( - ">> FOO\r\n".PHP_EOL. - "<< 502 That makes no sense\r\n".PHP_EOL. - ">> RSET\r\n".PHP_EOL. - "<< 250 OK\r\n", - $logger->dump() - ); - - $logger->clear(); - - $this->assertEquals('', $logger->dump()); - } - - public function testLengthCanBeTruncated() - { - $logger = new Swift_Plugins_Loggers_ArrayLogger(2); - $logger->add(">> FOO\r\n"); - $logger->add("<< 502 That makes no sense\r\n"); - $logger->add(">> RSET\r\n"); - $logger->add("<< 250 OK\r\n"); - - $this->assertEquals( - ">> RSET\r\n".PHP_EOL. - "<< 250 OK\r\n", - $logger->dump(), - '%s: Log should be truncated to last 2 entries' - ); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php deleted file mode 100644 index 6134fe6..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -class Swift_Plugins_Loggers_EchoLoggerTest extends \PHPUnit_Framework_TestCase -{ - public function testAddingEntryDumpsSingleLineWithoutHtml() - { - $logger = new Swift_Plugins_Loggers_EchoLogger(false); - ob_start(); - $logger->add('>> Foo'); - $data = ob_get_clean(); - - $this->assertEquals('>> Foo'.PHP_EOL, $data); - } - - public function testAddingEntryDumpsEscapedLineWithHtml() - { - $logger = new Swift_Plugins_Loggers_EchoLogger(true); - ob_start(); - $logger->add('>> Foo'); - $data = ob_get_clean(); - - $this->assertEquals('>> Foo<br />'.PHP_EOL, $data); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php deleted file mode 100644 index cbd368f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php - -class Swift_Plugins_PopBeforeSmtpPluginTest extends \PHPUnit_Framework_TestCase -{ - public function testPluginConnectsToPop3HostBeforeTransportStarts() - { - $connection = $this->_createConnection(); - $connection->expects($this->once()) - ->method('connect'); - - $plugin = $this->_createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - - $transport = $this->_createTransport(); - $evt = $this->_createTransportChangeEvent($transport); - - $plugin->beforeTransportStarted($evt); - } - - public function testPluginDisconnectsFromPop3HostBeforeTransportStarts() - { - $connection = $this->_createConnection(); - $connection->expects($this->once()) - ->method('disconnect'); - - $plugin = $this->_createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - - $transport = $this->_createTransport(); - $evt = $this->_createTransportChangeEvent($transport); - - $plugin->beforeTransportStarted($evt); - } - - public function testPluginDoesNotConnectToSmtpIfBoundToDifferentTransport() - { - $connection = $this->_createConnection(); - $connection->expects($this->never()) - ->method('disconnect'); - $connection->expects($this->never()) - ->method('connect'); - - $smtp = $this->_createTransport(); - - $plugin = $this->_createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - $plugin->bindSmtp($smtp); - - $transport = $this->_createTransport(); - $evt = $this->_createTransportChangeEvent($transport); - - $plugin->beforeTransportStarted($evt); - } - - public function testPluginCanBindToSpecificTransport() - { - $connection = $this->_createConnection(); - $connection->expects($this->once()) - ->method('connect'); - - $smtp = $this->_createTransport(); - - $plugin = $this->_createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - $plugin->bindSmtp($smtp); - - $evt = $this->_createTransportChangeEvent($smtp); - - $plugin->beforeTransportStarted($evt); - } - - private function _createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } - - private function _createTransportChangeEvent($transport) - { - $evt = $this->getMockBuilder('Swift_Events_TransportChangeEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getSource') - ->will($this->returnValue($transport)); - $evt->expects($this->any()) - ->method('getTransport') - ->will($this->returnValue($transport)); - - return $evt; - } - - public function _createConnection() - { - return $this->getMockBuilder('Swift_Plugins_Pop_Pop3Connection')->getMock(); - } - - public function _createPlugin($host, $port, $crypto = null) - { - return new Swift_Plugins_PopBeforeSmtpPlugin($host, $port, $crypto); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php deleted file mode 100644 index bfd5669..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php +++ /dev/null @@ -1,183 +0,0 @@ -<?php - -class Swift_Plugins_RedirectingPluginTest extends \PHPUnit_Framework_TestCase -{ - public function testRecipientCanBeSetAndFetched() - { - $plugin = new Swift_Plugins_RedirectingPlugin('fabien@example.com'); - $this->assertEquals('fabien@example.com', $plugin->getRecipient()); - $plugin->setRecipient('chris@example.com'); - $this->assertEquals('chris@example.com', $plugin->getRecipient()); - } - - public function testPluginChangesRecipients() - { - $message = Swift_Message::newInstance() - ->setSubject('...') - ->setFrom(array('john@example.com' => 'John Doe')) - ->setTo($to = array( - 'fabien-to@example.com' => 'Fabien (To)', - 'chris-to@example.com' => 'Chris (To)', - )) - ->setCc($cc = array( - 'fabien-cc@example.com' => 'Fabien (Cc)', - 'chris-cc@example.com' => 'Chris (Cc)', - )) - ->setBcc($bcc = array( - 'fabien-bcc@example.com' => 'Fabien (Bcc)', - 'chris-bcc@example.com' => 'Chris (Bcc)', - )) - ->setBody('...') - ; - - $plugin = new Swift_Plugins_RedirectingPlugin('god@example.com'); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - - $this->assertEquals($message->getTo(), array('god@example.com' => '')); - $this->assertEquals($message->getCc(), array()); - $this->assertEquals($message->getBcc(), array()); - - $plugin->sendPerformed($evt); - - $this->assertEquals($message->getTo(), $to); - $this->assertEquals($message->getCc(), $cc); - $this->assertEquals($message->getBcc(), $bcc); - } - - public function testPluginRespectsUnsetToList() - { - $message = Swift_Message::newInstance() - ->setSubject('...') - ->setFrom(array('john@example.com' => 'John Doe')) - ->setCc($cc = array( - 'fabien-cc@example.com' => 'Fabien (Cc)', - 'chris-cc@example.com' => 'Chris (Cc)', - )) - ->setBcc($bcc = array( - 'fabien-bcc@example.com' => 'Fabien (Bcc)', - 'chris-bcc@example.com' => 'Chris (Bcc)', - )) - ->setBody('...') - ; - - $plugin = new Swift_Plugins_RedirectingPlugin('god@example.com'); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - - $this->assertEquals($message->getTo(), array('god@example.com' => '')); - $this->assertEquals($message->getCc(), array()); - $this->assertEquals($message->getBcc(), array()); - - $plugin->sendPerformed($evt); - - $this->assertEquals($message->getTo(), array()); - $this->assertEquals($message->getCc(), $cc); - $this->assertEquals($message->getBcc(), $bcc); - } - - public function testPluginRespectsAWhitelistOfPatterns() - { - $message = Swift_Message::newInstance() - ->setSubject('...') - ->setFrom(array('john@example.com' => 'John Doe')) - ->setTo($to = array( - 'fabien-to@example.com' => 'Fabien (To)', - 'chris-to@example.com' => 'Chris (To)', - 'lars-to@internal.com' => 'Lars (To)', - )) - ->setCc($cc = array( - 'fabien-cc@example.com' => 'Fabien (Cc)', - 'chris-cc@example.com' => 'Chris (Cc)', - 'lars-cc@internal.org' => 'Lars (Cc)', - )) - ->setBcc($bcc = array( - 'fabien-bcc@example.com' => 'Fabien (Bcc)', - 'chris-bcc@example.com' => 'Chris (Bcc)', - 'john-bcc@example.org' => 'John (Bcc)', - )) - ->setBody('...') - ; - - $recipient = 'god@example.com'; - $patterns = array('/^.*@internal.[a-z]+$/', '/^john-.*$/'); - - $plugin = new Swift_Plugins_RedirectingPlugin($recipient, $patterns); - - $this->assertEquals($recipient, $plugin->getRecipient()); - $this->assertEquals($plugin->getWhitelist(), $patterns); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - - $this->assertEquals($message->getTo(), array('lars-to@internal.com' => 'Lars (To)', 'god@example.com' => null)); - $this->assertEquals($message->getCc(), array('lars-cc@internal.org' => 'Lars (Cc)')); - $this->assertEquals($message->getBcc(), array('john-bcc@example.org' => 'John (Bcc)')); - - $plugin->sendPerformed($evt); - - $this->assertEquals($message->getTo(), $to); - $this->assertEquals($message->getCc(), $cc); - $this->assertEquals($message->getBcc(), $bcc); - } - - public function testArrayOfRecipientsCanBeExplicitlyDefined() - { - $message = Swift_Message::newInstance() - ->setSubject('...') - ->setFrom(array('john@example.com' => 'John Doe')) - ->setTo(array( - 'fabien@example.com' => 'Fabien', - 'chris@example.com' => 'Chris (To)', - 'lars-to@internal.com' => 'Lars (To)', - )) - ->setCc(array( - 'fabien@example.com' => 'Fabien', - 'chris-cc@example.com' => 'Chris (Cc)', - 'lars-cc@internal.org' => 'Lars (Cc)', - )) - ->setBcc(array( - 'fabien@example.com' => 'Fabien', - 'chris-bcc@example.com' => 'Chris (Bcc)', - 'john-bcc@example.org' => 'John (Bcc)', - )) - ->setBody('...') - ; - - $recipients = array('god@example.com', 'fabien@example.com'); - $patterns = array('/^.*@internal.[a-z]+$/'); - - $plugin = new Swift_Plugins_RedirectingPlugin($recipients, $patterns); - - $evt = $this->_createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - - $this->assertEquals( - $message->getTo(), - array('fabien@example.com' => 'Fabien', 'lars-to@internal.com' => 'Lars (To)', 'god@example.com' => null) - ); - $this->assertEquals( - $message->getCc(), - array('fabien@example.com' => 'Fabien', 'lars-cc@internal.org' => 'Lars (Cc)') - ); - $this->assertEquals($message->getBcc(), array('fabien@example.com' => 'Fabien')); - } - - private function _createSendEvent(Swift_Mime_Message $message) - { - $evt = $this->getMockBuilder('Swift_Events_SendEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getMessage') - ->will($this->returnValue($message)); - - return $evt; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php deleted file mode 100644 index 5ba5d5c..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -class Swift_Plugins_ReporterPluginTest extends \SwiftMailerTestCase -{ - public function testReportingPasses() - { - $message = $this->_createMessage(); - $evt = $this->_createSendEvent(); - $reporter = $this->_createReporter(); - - $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(array('foo@bar.tld' => 'Foo')); - $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); - $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(array()); - $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - public function testReportingFailedTo() - { - $message = $this->_createMessage(); - $evt = $this->_createSendEvent(); - $reporter = $this->_createReporter(); - - $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(array('foo@bar.tld' => 'Foo', 'zip@button' => 'Zip')); - $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); - $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(array('zip@button')); - $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); - $reporter->shouldReceive('notify')->once()->with($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - public function testReportingFailedCc() - { - $message = $this->_createMessage(); - $evt = $this->_createSendEvent(); - $reporter = $this->_createReporter(); - - $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(array('foo@bar.tld' => 'Foo')); - $message->shouldReceive('getCc')->zeroOrMoreTimes()->andReturn(array('zip@button' => 'Zip', 'test@test.com' => 'Test')); - $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); - $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(array('zip@button')); - $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); - $reporter->shouldReceive('notify')->once()->with($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL); - $reporter->shouldReceive('notify')->once()->with($message, 'test@test.com', Swift_Plugins_Reporter::RESULT_PASS); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - public function testReportingFailedBcc() - { - $message = $this->_createMessage(); - $evt = $this->_createSendEvent(); - $reporter = $this->_createReporter(); - - $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(array('foo@bar.tld' => 'Foo')); - $message->shouldReceive('getBcc')->zeroOrMoreTimes()->andReturn(array('zip@button' => 'Zip', 'test@test.com' => 'Test')); - $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); - $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(array('zip@button')); - $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); - $reporter->shouldReceive('notify')->once()->with($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL); - $reporter->shouldReceive('notify')->once()->with($message, 'test@test.com', Swift_Plugins_Reporter::RESULT_PASS); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - private function _createMessage() - { - return $this->getMockery('Swift_Mime_Message')->shouldIgnoreMissing(); - } - - private function _createSendEvent() - { - return $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - } - - private function _createReporter() - { - return $this->getMockery('Swift_Plugins_Reporter')->shouldIgnoreMissing(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php deleted file mode 100644 index 20aae57..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -class Swift_Plugins_Reporters_HitReporterTest extends \PHPUnit_Framework_TestCase -{ - private $_hitReporter; - private $_message; - - protected function setUp() - { - $this->_hitReporter = new Swift_Plugins_Reporters_HitReporter(); - $this->_message = $this->getMockBuilder('Swift_Mime_Message')->getMock(); - } - - public function testReportingFail() - { - $this->_hitReporter->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->assertEquals(array('foo@bar.tld'), - $this->_hitReporter->getFailedRecipients() - ); - } - - public function testMultipleReports() - { - $this->_hitReporter->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->_hitReporter->notify($this->_message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->assertEquals(array('foo@bar.tld', 'zip@button'), - $this->_hitReporter->getFailedRecipients() - ); - } - - public function testReportingPassIsIgnored() - { - $this->_hitReporter->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->_hitReporter->notify($this->_message, 'zip@button', - Swift_Plugins_Reporter::RESULT_PASS - ); - $this->assertEquals(array('foo@bar.tld'), - $this->_hitReporter->getFailedRecipients() - ); - } - - public function testBufferCanBeCleared() - { - $this->_hitReporter->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->_hitReporter->notify($this->_message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->assertEquals(array('foo@bar.tld', 'zip@button'), - $this->_hitReporter->getFailedRecipients() - ); - $this->_hitReporter->clear(); - $this->assertEquals(array(), $this->_hitReporter->getFailedRecipients()); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php deleted file mode 100644 index fb0bc97..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -class Swift_Plugins_Reporters_HtmlReporterTest extends \PHPUnit_Framework_TestCase -{ - private $_html; - private $_message; - - protected function setUp() - { - $this->_html = new Swift_Plugins_Reporters_HtmlReporter(); - $this->_message = $this->getMockBuilder('Swift_Mime_Message')->getMock(); - } - - public function testReportingPass() - { - ob_start(); - $this->_html->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_PASS - ); - $html = ob_get_clean(); - - $this->assertRegExp('~ok|pass~i', $html, '%s: Reporter should indicate pass'); - $this->assertRegExp('~foo@bar\.tld~', $html, '%s: Reporter should show address'); - } - - public function testReportingFail() - { - ob_start(); - $this->_html->notify($this->_message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $html = ob_get_clean(); - - $this->assertRegExp('~fail~i', $html, '%s: Reporter should indicate fail'); - $this->assertRegExp('~zip@button~', $html, '%s: Reporter should show address'); - } - - public function testMultipleReports() - { - ob_start(); - $this->_html->notify($this->_message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_PASS - ); - $this->_html->notify($this->_message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $html = ob_get_clean(); - - $this->assertRegExp('~ok|pass~i', $html, '%s: Reporter should indicate pass'); - $this->assertRegExp('~foo@bar\.tld~', $html, '%s: Reporter should show address'); - $this->assertRegExp('~fail~i', $html, '%s: Reporter should indicate fail'); - $this->assertRegExp('~zip@button~', $html, '%s: Reporter should show address'); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php deleted file mode 100644 index 309f506..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php - -class Swift_Plugins_ThrottlerPluginTest extends \SwiftMailerTestCase -{ - public function testBytesPerMinuteThrottling() - { - $sleeper = $this->_createSleeper(); - $timer = $this->_createTimer(); - - //10MB/min - $plugin = new Swift_Plugins_ThrottlerPlugin( - 10000000, Swift_Plugins_ThrottlerPlugin::BYTES_PER_MINUTE, - $sleeper, $timer - ); - - $timer->shouldReceive('getTimestamp')->once()->andReturn(0); - $timer->shouldReceive('getTimestamp')->once()->andReturn(1); //expected 0.6 - $timer->shouldReceive('getTimestamp')->once()->andReturn(1); //expected 1.2 (sleep 1) - $timer->shouldReceive('getTimestamp')->once()->andReturn(2); //expected 1.8 - $timer->shouldReceive('getTimestamp')->once()->andReturn(2); //expected 2.4 (sleep 1) - $sleeper->shouldReceive('sleep')->twice()->with(1); - - //10,000,000 bytes per minute - //100,000 bytes per email - - // .: (10,000,000/100,000)/60 emails per second = 1.667 emais/sec - - $message = $this->_createMessageWithByteCount(100000); //100KB - - $evt = $this->_createSendEvent($message); - - for ($i = 0; $i < 5; ++$i) { - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - } - - public function testMessagesPerMinuteThrottling() - { - $sleeper = $this->_createSleeper(); - $timer = $this->_createTimer(); - - //60/min - $plugin = new Swift_Plugins_ThrottlerPlugin( - 60, Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE, - $sleeper, $timer - ); - - $timer->shouldReceive('getTimestamp')->once()->andReturn(0); - $timer->shouldReceive('getTimestamp')->once()->andReturn(0); //expected 1 (sleep 1) - $timer->shouldReceive('getTimestamp')->once()->andReturn(2); //expected 2 - $timer->shouldReceive('getTimestamp')->once()->andReturn(2); //expected 3 (sleep 1) - $timer->shouldReceive('getTimestamp')->once()->andReturn(4); //expected 4 - $sleeper->shouldReceive('sleep')->twice()->with(1); - - //60 messages per minute - //1 message per second - - $message = $this->_createMessageWithByteCount(10); - - $evt = $this->_createSendEvent($message); - - for ($i = 0; $i < 5; ++$i) { - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - } - - private function _createSleeper() - { - return $this->getMockery('Swift_Plugins_Sleeper'); - } - - private function _createTimer() - { - return $this->getMockery('Swift_Plugins_Timer'); - } - - private function _createMessageWithByteCount($bytes) - { - $msg = $this->getMockery('Swift_Mime_Message'); - $msg->shouldReceive('toByteStream') - ->zeroOrMoreTimes() - ->andReturnUsing(function ($is) use ($bytes) { - for ($i = 0; $i < $bytes; ++$i) { - $is->write('x'); - } - }); - - return $msg; - } - - private function _createSendEvent($message) - { - $evt = $this->getMockery('Swift_Events_SendEvent'); - $evt->shouldReceive('getMessage') - ->zeroOrMoreTimes() - ->andReturn($message); - - return $evt; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/DKIMSignerTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/DKIMSignerTest.php deleted file mode 100644 index a8ea4fb..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/DKIMSignerTest.php +++ /dev/null @@ -1,225 +0,0 @@ -<?php - -class Swift_Signers_DKIMSignerTest extends \SwiftMailerTestCase -{ - protected function setUp() - { - if (PHP_VERSION_ID < 50400 && !defined('OPENSSL_ALGO_SHA256')) { - $this->markTestSkipped('skipping because of https://bugs.php.net/bug.php?id=61421'); - } - } - - public function testBasicSigningHeaderManipulation() - { - $headers = $this->_createHeaders(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))) . '/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - /* @var $signer Swift_Signers_HeaderSigner */ - $altered = $signer->getAlteredHeaders(); - $signer->reset(); - // Headers - $signer->setHeaders($headers); - // Body - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - // Signing - $signer->addSignature($headers); - } - - // SHA1 Signing - public function testSigningSHA1() - { - $headerSet = $this->_createHeaderSet(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))) . '/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - $signer->setHashAlgorithm('rsa-sha1'); - $signer->setSignatureTimestamp('1299879181'); - $altered = $signer->getAlteredHeaders(); - $this->assertEquals(array('DKIM-Signature'), $altered); - $signer->reset(); - $signer->setHeaders($headerSet); - $this->assertFalse($headerSet->has('DKIM-Signature')); - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - $signer->addSignature($headerSet); - $this->assertTrue($headerSet->has('DKIM-Signature')); - $dkim = $headerSet->getAll('DKIM-Signature'); - $sig = reset($dkim); - $this->assertEquals($sig->getValue(), 'v=1; a=rsa-sha1; bh=wlbYcY9O9OPInGJ4D0E/rGsvMLE=; d=dummy.nxdomain.be; h=; i=@dummy.nxdomain.be; s=dummySelector; t=1299879181; b=RMSNelzM2O5MAAnMjT3G3/VF36S3DGJXoPCXR001F1WDReu0prGphWjuzK/m6V1pwqQL8cCNg Hi74mTx2bvyAvmkjvQtJf1VMUOCc9WHGcm1Yec66I3ZWoNMGSWZ1EKAm2CtTzyG0IFw4ml9DI wSkyAFxlgicckDD6FibhqwX4w='); - } - - // SHA256 Signing - public function testSigning256() - { - $headerSet = $this->_createHeaderSet(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))) . '/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - $signer->setHashAlgorithm('rsa-sha256'); - $signer->setSignatureTimestamp('1299879181'); - $altered = $signer->getAlteredHeaders(); - $this->assertEquals(array('DKIM-Signature'), $altered); - $signer->reset(); - $signer->setHeaders($headerSet); - $this->assertFalse($headerSet->has('DKIM-Signature')); - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - $signer->addSignature($headerSet); - $this->assertTrue($headerSet->has('DKIM-Signature')); - $dkim = $headerSet->getAll('DKIM-Signature'); - $sig = reset($dkim); - $this->assertEquals($sig->getValue(), 'v=1; a=rsa-sha256; bh=f+W+hu8dIhf2VAni89o8lF6WKTXi7nViA4RrMdpD5/U=; d=dummy.nxdomain.be; h=; i=@dummy.nxdomain.be; s=dummySelector; t=1299879181; b=jqPmieHzF5vR9F4mXCAkowuphpO4iJ8IAVuioh1BFZ3VITXZj5jlOFxULJMBiiApm2keJirnh u4mzogj444QkpT3lJg8/TBGAYQPdcvkG3KC0jdyN6QpSgpITBJG2BwWa+keXsv2bkQgLRAzNx qRhP45vpHCKun0Tg9LrwW/KCg='); - } - - // Relaxed/Relaxed Hash Signing - public function testSigningRelaxedRelaxed256() - { - $headerSet = $this->_createHeaderSet(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))) . '/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - $signer->setHashAlgorithm('rsa-sha256'); - $signer->setSignatureTimestamp('1299879181'); - $signer->setBodyCanon('relaxed'); - $signer->setHeaderCanon('relaxed'); - $altered = $signer->getAlteredHeaders(); - $this->assertEquals(array('DKIM-Signature'), $altered); - $signer->reset(); - $signer->setHeaders($headerSet); - $this->assertFalse($headerSet->has('DKIM-Signature')); - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - $signer->addSignature($headerSet); - $this->assertTrue($headerSet->has('DKIM-Signature')); - $dkim = $headerSet->getAll('DKIM-Signature'); - $sig = reset($dkim); - $this->assertEquals($sig->getValue(), 'v=1; a=rsa-sha256; bh=f+W+hu8dIhf2VAni89o8lF6WKTXi7nViA4RrMdpD5/U=; d=dummy.nxdomain.be; h=; i=@dummy.nxdomain.be; s=dummySelector; c=relaxed/relaxed; t=1299879181; b=gzOI+PX6HpZKQFzwwmxzcVJsyirdLXOS+4pgfCpVHQIdqYusKLrhlLeFBTNoz75HrhNvGH6T0 Rt3w5aTqkrWfUuAEYt0Ns14GowLM7JojaFN+pZ4eYnRB3CBBgW6fee4NEMD5WPca3uS09tr1E 10RYh9ILlRtl+84sovhx5id3Y='); - } - - // Relaxed/Simple Hash Signing - public function testSigningRelaxedSimple256() - { - $headerSet = $this->_createHeaderSet(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))) . '/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - $signer->setHashAlgorithm('rsa-sha256'); - $signer->setSignatureTimestamp('1299879181'); - $signer->setHeaderCanon('relaxed'); - $altered = $signer->getAlteredHeaders(); - $this->assertEquals(array('DKIM-Signature'), $altered); - $signer->reset(); - $signer->setHeaders($headerSet); - $this->assertFalse($headerSet->has('DKIM-Signature')); - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - $signer->addSignature($headerSet); - $this->assertTrue($headerSet->has('DKIM-Signature')); - $dkim = $headerSet->getAll('DKIM-Signature'); - $sig = reset($dkim); - $this->assertEquals($sig->getValue(), 'v=1; a=rsa-sha256; bh=f+W+hu8dIhf2VAni89o8lF6WKTXi7nViA4RrMdpD5/U=; d=dummy.nxdomain.be; h=; i=@dummy.nxdomain.be; s=dummySelector; c=relaxed; t=1299879181; b=dLPJNec5v81oelyzGOY0qPqTlGnQeNfUNBOrV/JKbStr3NqWGI9jH4JAe2YvO2V32lfPNoby1 4MMzZ6EPkaZkZDDSPa+53YbCPQAlqiD9QZZIUe2UNM33HN8yAMgiWEF5aP7MbQnxeVZMfVLEl 9S8qOImu+K5JZqhQQTL0dgLwA='); - } - - // Simple/Relaxed Hash Signing - public function testSigningSimpleRelaxed256() - { - $headerSet = $this->_createHeaderSet(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))) . '/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - $signer->setHashAlgorithm('rsa-sha256'); - $signer->setSignatureTimestamp('1299879181'); - $signer->setBodyCanon('relaxed'); - $altered = $signer->getAlteredHeaders(); - $this->assertEquals(array('DKIM-Signature'), $altered); - $signer->reset(); - $signer->setHeaders($headerSet); - $this->assertFalse($headerSet->has('DKIM-Signature')); - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - $signer->addSignature($headerSet); - $this->assertTrue($headerSet->has('DKIM-Signature')); - $dkim = $headerSet->getAll('DKIM-Signature'); - $sig = reset($dkim); - $this->assertEquals($sig->getValue(), 'v=1; a=rsa-sha256; bh=f+W+hu8dIhf2VAni89o8lF6WKTXi7nViA4RrMdpD5/U=; d=dummy.nxdomain.be; h=; i=@dummy.nxdomain.be; s=dummySelector; c=simple/relaxed; t=1299879181; b=M5eomH/zamyzix9kOes+6YLzQZxuJdBP4x3nP9zF2N26eMLG2/cBKbnNyqiOTDhJdYfWPbLIa 1CWnjST0j5p4CpeOkGYuiE+M4TWEZwhRmRWootlPO3Ii6XpbBJKFk1o9zviS7OmXblUUE4aqb yRSIMDhtLdCK5GlaCneFLN7RQ='); - } - - private function _createHeaderSet() - { - $cache = new Swift_KeyCache_ArrayKeyCache(new Swift_KeyCache_SimpleKeyCacheInputStream()); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder(new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8')); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder(new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8')); - $grammar = new Swift_Mime_Grammar(); - $headers = new Swift_Mime_SimpleHeaderSet(new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $grammar)); - - return $headers; - } - - /** - * @return Swift_Mime_Headers - */ - private function _createHeaders() - { - $x = 0; - $cache = new Swift_KeyCache_ArrayKeyCache(new Swift_KeyCache_SimpleKeyCacheInputStream()); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder(new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8')); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder(new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8')); - $grammar = new Swift_Mime_Grammar(); - $headerFactory = new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $grammar); - $headers = $this->getMockery('Swift_Mime_HeaderSet'); - - $headers->shouldReceive('listAll') - ->zeroOrMoreTimes() - ->andReturn(array('From', 'To', 'Date', 'Subject')); - $headers->shouldReceive('has') - ->zeroOrMoreTimes() - ->with('From') - ->andReturn(true); - $headers->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->with('From') - ->andReturn(array($headerFactory->createMailboxHeader('From', 'test@test.test'))); - $headers->shouldReceive('has') - ->zeroOrMoreTimes() - ->with('To') - ->andReturn(true); - $headers->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->with('To') - ->andReturn(array($headerFactory->createMailboxHeader('To', 'test@test.test'))); - $headers->shouldReceive('has') - ->zeroOrMoreTimes() - ->with('Date') - ->andReturn(true); - $headers->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->with('Date') - ->andReturn(array($headerFactory->createTextHeader('Date', 'Fri, 11 Mar 2011 20:56:12 +0000 (GMT)'))); - $headers->shouldReceive('has') - ->zeroOrMoreTimes() - ->with('Subject') - ->andReturn(true); - $headers->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->with('Subject') - ->andReturn(array($headerFactory->createTextHeader('Subject', 'Foo Bar Text Message'))); - $headers->shouldReceive('addTextHeader') - ->zeroOrMoreTimes() - ->with('DKIM-Signature', \Mockery::any()) - ->andReturn(true); - $headers->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->with('DKIM-Signature') - ->andReturn(array($headerFactory->createTextHeader('DKIM-Signature', 'Foo Bar Text Message'))); - - return $headers; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/OpenDKIMSignerTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/OpenDKIMSignerTest.php deleted file mode 100644 index ce99bc6..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/OpenDKIMSignerTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/** - * @todo - */ -class Swift_Signers_OpenDKIMSignerTest extends \SwiftMailerTestCase -{ - protected function setUp() - { - if (!extension_loaded('opendkim')) { - $this->markTestSkipped( - 'Need OpenDKIM extension run these tests.' - ); - } - } - - public function testBasicSigningHeaderManipulation() - { - } - - // Default Signing - public function testSigningDefaults() - { - } - - // SHA256 Signing - public function testSigning256() - { - } - - // Relaxed/Relaxed Hash Signing - public function testSigningRelaxedRelaxed256() - { - } - - // Relaxed/Simple Hash Signing - public function testSigningRelaxedSimple256() - { - } - - // Simple/Relaxed Hash Signing - public function testSigningSimpleRelaxed256() - { - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/SMimeSignerTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/SMimeSignerTest.php deleted file mode 100644 index c7bf1f0..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/SMimeSignerTest.php +++ /dev/null @@ -1,554 +0,0 @@ -<?php - -class Swift_Signers_SMimeSignerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var Swift_StreamFilters_StringReplacementFilterFactory - */ - protected $replacementFactory; - - protected $samplesDir; - - protected function setUp() - { - $this->replacementFactory = Swift_DependencyContainer::getInstance() - ->lookup('transport.replacementfactory'); - - $this->samplesDir = str_replace('\\', '/', realpath(__DIR__ . '/../../../_samples/')).'/'; - } - - public function testUnSingedMessage() - { - $message = Swift_SignedMessage::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself'); - - $this->assertEquals('Here is the message itself', $message->getBody()); - } - - public function testSingedMessage() - { - $message = Swift_SignedMessage::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself'); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key'); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = <<<OEL -This is an S/MIME signed message - ---$boundary -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: quoted-printable - -Here is the message itself ---$boundary -Content-Type: application/(x\-)?pkcs7-signature; name="smime\.p7s" -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename="smime\.p7s" - -(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2}) - ---$boundary-- -OEL; - $this->assertValidVerify($expectedBody, $messageStream); - unset($messageStream); - } - - public function testSingedMessageExtraCerts() - { - $message = Swift_SignedMessage::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself'); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign2.crt', $this->samplesDir.'smime/sign2.key', PKCS7_DETACHED, $this->samplesDir.'smime/intermediate.crt'); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = <<<OEL -This is an S/MIME signed message - ---$boundary -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: quoted-printable - -Here is the message itself ---$boundary -Content-Type: application/(x\-)?pkcs7-signature; name="smime\.p7s" -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename="smime\.p7s" - -(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2}) - ---$boundary-- -OEL; - $this->assertValidVerify($expectedBody, $messageStream); - unset($messageStream); - } - - public function testSingedMessageBinary() - { - $message = Swift_SignedMessage::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself'); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key', PKCS7_BINARY); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!preg_match('#^application/(x\-)?pkcs7-mime; smime-type=signed\-data;#', $headers['content-type'])) { - $this->fail('Content-type does not match.'); - - return false; - } - - $this->assertEquals($headers['content-transfer-encoding'], 'base64'); - $this->assertEquals($headers['content-disposition'], 'attachment; filename="smime.p7m"'); - - $expectedBody = '(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})'; - - $messageStreamClean = $this->newFilteredStream(); - - $this->assertValidVerify($expectedBody, $messageStream); - unset($messageStreamClean, $messageStream); - } - - public function testSingedMessageWithAttachments() - { - $message = Swift_SignedMessage::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself'); - - $message->attach(Swift_Attachment::fromPath($this->samplesDir.'/files/textfile.zip')); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key'); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = <<<OEL -This is an S/MIME signed message - ---$boundary -Content-Type: multipart/mixed; - boundary="([a-z0-9\\'\\(\\)\\+_\\-,\\.\\/:=\\?\\ ]{0,69}[a-z0-9\\'\\(\\)\\+_\\-,\\.\\/:=\\?])" - - ---\\1 -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: quoted-printable - -Here is the message itself - ---\\1 -Content-Type: application/zip; name=textfile\\.zip -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename=textfile\\.zip - -UEsDBAoAAgAAAMi6VjiOTiKwLgAAAC4AAAAMABUAdGV4dGZpbGUudHh0VVQJAAN3vr5Hd76\\+R1V4 -BAD1AfUBVGhpcyBpcyBwYXJ0IG9mIGEgU3dpZnQgTWFpbGVyIHY0IHNtb2tlIHRlc3QuClBLAQIX -AwoAAgAAAMi6VjiOTiKwLgAAAC4AAAAMAA0AAAAAAAEAAACkgQAAAAB0ZXh0ZmlsZS50eHRVVAUA -A3e\\+vkdVeAAAUEsFBgAAAAABAAEARwAAAG0AAAAAAA== - ---\\1-- - ---$boundary -Content-Type: application/(x\-)?pkcs7-signature; name="smime\\.p7s" -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename="smime\\.p7s" - -(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2}) - ---$boundary-- -OEL; - - $this->assertValidVerify($expectedBody, $messageStream); - unset($messageStream); - } - - public function testEncryptedMessage() - { - $message = Swift_SignedMessage::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself'); - - $originalMessage = $this->cleanMessage($message->toString()); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setEncryptCertificate($this->samplesDir.'smime/encrypt.crt'); - $message->attachSigner($signer); - - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!preg_match('#^application/(x\-)?pkcs7-mime; smime-type=enveloped\-data;#', $headers['content-type'])) { - $this->fail('Content-type does not match.'); - - return false; - } - - $expectedBody = '(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})'; - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStream->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt.crt', array('file://'.$this->samplesDir.'smime/encrypt.key', 'swift'))) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $this->assertEquals($originalMessage, $decryptedMessageStream->getContent()); - unset($decryptedMessageStream, $messageStream); - } - - public function testEncryptedMessageWithMultipleCerts() - { - $message = Swift_SignedMessage::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself'); - - $originalMessage = $this->cleanMessage($message->toString()); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setEncryptCertificate(array($this->samplesDir.'smime/encrypt.crt', $this->samplesDir.'smime/encrypt2.crt')); - $message->attachSigner($signer); - - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!preg_match('#^application/(x\-)?pkcs7-mime; smime-type=enveloped\-data;#', $headers['content-type'])) { - $this->fail('Content-type does not match.'); - - return false; - } - - $expectedBody = '(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})'; - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStream->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt.crt', array('file://'.$this->samplesDir.'smime/encrypt.key', 'swift'))) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $this->assertEquals($originalMessage, $decryptedMessageStream->getContent()); - unset($decryptedMessageStream); - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStream->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt2.crt', array('file://'.$this->samplesDir.'smime/encrypt2.key', 'swift'))) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $this->assertEquals($originalMessage, $decryptedMessageStream->getContent()); - unset($decryptedMessageStream, $messageStream); - } - - public function testSignThenEncryptedMessage() - { - $message = Swift_SignedMessage::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself'); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key'); - $signer->setEncryptCertificate($this->samplesDir.'smime/encrypt.crt'); - $message->attachSigner($signer); - - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!preg_match('#^application/(x\-)?pkcs7-mime; smime-type=enveloped\-data;#', $headers['content-type'])) { - $this->fail('Content-type does not match.'); - - return false; - } - - $expectedBody = '(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})'; - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStream->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt.crt', array('file://'.$this->samplesDir.'smime/encrypt.key', 'swift'))) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $entityString = $decryptedMessageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = <<<OEL -This is an S/MIME signed message - ---$boundary -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: quoted-printable - -Here is the message itself ---$boundary -Content-Type: application/(x\-)?pkcs7-signature; name="smime\.p7s" -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename="smime\.p7s" - -(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2}) - ---$boundary-- -OEL; - - if (!$this->assertValidVerify($expectedBody, $decryptedMessageStream)) { - return false; - } - - unset($decryptedMessageStream, $messageStream); - } - - public function testEncryptThenSignMessage() - { - $message = Swift_SignedMessage::newInstance('Wonderful Subject') - ->setFrom(array('john@doe.com' => 'John Doe')) - ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) - ->setBody('Here is the message itself'); - - $originalMessage = $this->cleanMessage($message->toString()); - - $signer = Swift_Signers_SMimeSigner::newInstance(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key'); - $signer->setEncryptCertificate($this->samplesDir.'smime/encrypt.crt'); - $signer->setSignThenEncrypt(false); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = <<<OEL -This is an S/MIME signed message - ---$boundary -(?P<encrypted_message>MIME-Version: 1\.0 -Content-Disposition: attachment; filename="smime\.p7m" -Content-Type: application/(x\-)?pkcs7-mime; smime-type=enveloped-data; name="smime\.p7m" -Content-Transfer-Encoding: base64 - -(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2}) - - -)--$boundary -Content-Type: application/(x\-)?pkcs7-signature; name="smime\.p7s" -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename="smime\.p7s" - -(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2}) - ---$boundary-- -OEL; - - if (!$this->assertValidVerify($expectedBody, $messageStream)) { - return false; - } - - $expectedBody = str_replace("\n", "\r\n", $expectedBody); - if (!preg_match('%'.$expectedBody.'*%m', $entityString, $entities)) { - $this->fail('Failed regex match.'); - - return false; - } - - $messageStreamClean = new Swift_ByteStream_TemporaryFileByteStream(); - $messageStreamClean->write($entities['encrypted_message']); - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStreamClean->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt.crt', array('file://'.$this->samplesDir.'smime/encrypt.key', 'swift'))) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $this->assertEquals($originalMessage, $decryptedMessageStream->getContent()); - unset($messageStreamClean, $messageStream, $decryptedMessageStream); - } - - protected function assertValidVerify($expected, Swift_ByteStream_TemporaryFileByteStream $messageStream) - { - $actual = $messageStream->getContent(); - - // File is UNIX encoded so convert them to correct line ending - $expected = str_replace("\n", "\r\n", $expected); - - $actual = trim(self::getBodyOfMessage($actual)); - if (!$this->assertRegExp('%^'.$expected.'$\s*%m', $actual)) { - return false; - } - - $opensslOutput = new Swift_ByteStream_TemporaryFileByteStream(); - $verify = openssl_pkcs7_verify($messageStream->getPath(), null, $opensslOutput->getPath(), array($this->samplesDir.'smime/ca.crt')); - - if (false === $verify) { - $this->fail('Verification of the message failed.'); - - return false; - } elseif (-1 === $verify) { - $this->fail(sprintf('Verification of the message failed. Internal error "%s".', openssl_error_string())); - - return false; - } - - return true; - } - - protected function getBoundary($contentType) - { - if (!preg_match('/boundary=("[^"]+"|(?:[^\s]+|$))/is', $contentType, $contentTypeData)) { - $this->fail('Failed to find Boundary parameter'); - - return false; - } - - return trim($contentTypeData[1], '"'); - } - - protected function newFilteredStream() - { - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $messageStream->addFilter($this->replacementFactory->createFilter("\r\n", "\n"), 'CRLF to LF'); - $messageStream->addFilter($this->replacementFactory->createFilter("\n", "\r\n"), 'LF to CRLF'); - - return $messageStream; - } - - protected static function getBodyOfMessage($message) - { - return substr($message, strpos($message, "\r\n\r\n")); - } - - /** - * Strips of the sender headers and Mime-Version. - * - * @param Swift_ByteStream_TemporaryFileByteStream $messageStream - * @param Swift_ByteStream_TemporaryFileByteStream $inputStream - */ - protected function cleanMessage($content) - { - $newContent = ''; - - $headers = self::getHeadersOfMessage($content); - foreach ($headers as $headerName => $value) { - if (!in_array($headerName, array('content-type', 'content-transfer-encoding', 'content-disposition'))) { - continue; - } - - $headerName = explode('-', $headerName); - $headerName = array_map('ucfirst', $headerName); - $headerName = implode('-', $headerName); - - if (strlen($value) > 62) { - $value = wordwrap($value, 62, "\n "); - } - - $newContent .= "$headerName: $value\r\n"; - } - - return $newContent."\r\n".ltrim(self::getBodyOfMessage($content)); - } - - /** - * Returns the headers of the message. - * - * Header-names are lowercase. - * - * @param string $message - * - * @return array - */ - protected static function getHeadersOfMessage($message) - { - $headersPosEnd = strpos($message, "\r\n\r\n"); - $headerData = substr($message, 0, $headersPosEnd); - $headerLines = explode("\r\n", $headerData); - - if (empty($headerLines)) { - return array(); - } - - $headers = array(); - - foreach ($headerLines as $headerLine) { - if (ctype_space($headerLines[0]) || false === strpos($headerLine, ':')) { - $headers[$currentHeaderName] .= ' '.trim($headerLine); - continue; - } - - $header = explode(':', $headerLine, 2); - $currentHeaderName = strtolower($header[0]); - $headers[$currentHeaderName] = trim($header[1]); - } - - return $headers; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php deleted file mode 100644 index c85bdc1..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php - -class Swift_StreamFilters_ByteArrayReplacementFilterTest extends \PHPUnit_Framework_TestCase -{ - public function testBasicReplacementsAreMade() - { - $filter = $this->_createFilter(array(0x61, 0x62), array(0x63, 0x64)); - $this->assertEquals( - array(0x59, 0x60, 0x63, 0x64, 0x65), - $filter->filter(array(0x59, 0x60, 0x61, 0x62, 0x65)) - ); - } - - public function testShouldBufferReturnsTrueIfPartialMatchAtEndOfBuffer() - { - $filter = $this->_createFilter(array(0x61, 0x62), array(0x63, 0x64)); - $this->assertTrue($filter->shouldBuffer(array(0x59, 0x60, 0x61)), - '%s: Filter should buffer since 0x61 0x62 is the needle and the ending '. - '0x61 could be from 0x61 0x62' - ); - } - - public function testFilterCanMakeMultipleReplacements() - { - $filter = $this->_createFilter(array(array(0x61), array(0x62)), array(0x63)); - $this->assertEquals( - array(0x60, 0x63, 0x60, 0x63, 0x60), - $filter->filter(array(0x60, 0x61, 0x60, 0x62, 0x60)) - ); - } - - public function testMultipleReplacementsCanBeDifferent() - { - $filter = $this->_createFilter(array(array(0x61), array(0x62)), array(array(0x63), array(0x64))); - $this->assertEquals( - array(0x60, 0x63, 0x60, 0x64, 0x60), - $filter->filter(array(0x60, 0x61, 0x60, 0x62, 0x60)) - ); - } - - public function testShouldBufferReturnsFalseIfPartialMatchNotAtEndOfString() - { - $filter = $this->_createFilter(array(0x0D, 0x0A), array(0x0A)); - $this->assertFalse($filter->shouldBuffer(array(0x61, 0x62, 0x0D, 0x0A, 0x63)), - '%s: Filter should not buffer since x0Dx0A is the needle and is not at EOF' - ); - } - - public function testShouldBufferReturnsTrueIfAnyOfMultipleMatchesAtEndOfString() - { - $filter = $this->_createFilter(array(array(0x61, 0x62), array(0x63)), array(0x64)); - $this->assertTrue($filter->shouldBuffer(array(0x59, 0x60, 0x61)), - '%s: Filter should buffer since 0x61 0x62 is a needle and the ending '. - '0x61 could be from 0x61 0x62' - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsLF() - { - $filter = $this->_createFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ); - - $this->assertEquals( - array(0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63), - $filter->filter(array(0x60, 0x0A, 0x61, 0x0A, 0x62, 0x0A, 0x63)) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsCR() - { - $filter = $this->_createFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ); - - $this->assertEquals( - array(0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63), - $filter->filter(array(0x60, 0x0D, 0x61, 0x0D, 0x62, 0x0D, 0x63)) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsCRLF() - { - $filter = $this->_createFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ); - - $this->assertEquals( - array(0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63), - $filter->filter(array(0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63)) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsLFCR() - { - $filter = $this->_createFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ); - - $this->assertEquals( - array(0x60, 0x0D, 0x0A, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x0D, 0x0A, 0x63), - $filter->filter(array(0x60, 0x0A, 0x0D, 0x61, 0x0A, 0x0D, 0x62, 0x0A, 0x0D, 0x63)) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputContainsLFLF() - { - //Lighthouse Bug #23 - - $filter = $this->_createFilter( - array(array(0x0D, 0x0A), array(0x0D), array(0x0A)), - array(array(0x0A), array(0x0A), array(0x0D, 0x0A)) - ); - - $this->assertEquals( - array(0x60, 0x0D, 0x0A, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x0D, 0x0A, 0x63), - $filter->filter(array(0x60, 0x0A, 0x0A, 0x61, 0x0A, 0x0A, 0x62, 0x0A, 0x0A, 0x63)) - ); - } - - private function _createFilter($search, $replace) - { - return new Swift_StreamFilters_ByteArrayReplacementFilter($search, $replace); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php deleted file mode 100644 index c14d5dc..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -class Swift_StreamFilters_StringReplacementFilterFactoryTest extends \PHPUnit_Framework_TestCase -{ - public function testInstancesOfStringReplacementFilterAreCreated() - { - $factory = $this->_createFactory(); - $this->assertInstanceOf( - 'Swift_StreamFilters_StringReplacementFilter', - $factory->createFilter('a', 'b') - ); - } - - public function testSameInstancesAreCached() - { - $factory = $this->_createFactory(); - $filter1 = $factory->createFilter('a', 'b'); - $filter2 = $factory->createFilter('a', 'b'); - $this->assertSame($filter1, $filter2, '%s: Instances should be cached'); - } - - public function testDifferingInstancesAreNotCached() - { - $factory = $this->_createFactory(); - $filter1 = $factory->createFilter('a', 'b'); - $filter2 = $factory->createFilter('a', 'c'); - $this->assertNotEquals($filter1, $filter2, - '%s: Differing instances should not be cached' - ); - } - - private function _createFactory() - { - return new Swift_StreamFilters_StringReplacementFilterFactory(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php deleted file mode 100644 index 681e235..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -class Swift_StreamFilters_StringReplacementFilterTest extends \PHPUnit_Framework_TestCase -{ - public function testBasicReplacementsAreMade() - { - $filter = $this->_createFilter('foo', 'bar'); - $this->assertEquals('XbarYbarZ', $filter->filter('XfooYfooZ')); - } - - public function testShouldBufferReturnsTrueIfPartialMatchAtEndOfBuffer() - { - $filter = $this->_createFilter('foo', 'bar'); - $this->assertTrue($filter->shouldBuffer('XfooYf'), - '%s: Filter should buffer since "foo" is the needle and the ending '. - '"f" could be from "foo"' - ); - } - - public function testFilterCanMakeMultipleReplacements() - { - $filter = $this->_createFilter(array('a', 'b'), 'foo'); - $this->assertEquals('XfooYfooZ', $filter->filter('XaYbZ')); - } - - public function testMultipleReplacementsCanBeDifferent() - { - $filter = $this->_createFilter(array('a', 'b'), array('foo', 'zip')); - $this->assertEquals('XfooYzipZ', $filter->filter('XaYbZ')); - } - - public function testShouldBufferReturnsFalseIfPartialMatchNotAtEndOfString() - { - $filter = $this->_createFilter("\r\n", "\n"); - $this->assertFalse($filter->shouldBuffer("foo\r\nbar"), - '%s: Filter should not buffer since x0Dx0A is the needle and is not at EOF' - ); - } - - public function testShouldBufferReturnsTrueIfAnyOfMultipleMatchesAtEndOfString() - { - $filter = $this->_createFilter(array('foo', 'zip'), 'bar'); - $this->assertTrue($filter->shouldBuffer('XfooYzi'), - '%s: Filter should buffer since "zip" is a needle and the ending '. - '"zi" could be from "zip"' - ); - } - - public function testShouldBufferReturnsFalseOnEmptyBuffer() - { - $filter = $this->_createFilter("\r\n", "\n"); - $this->assertFalse($filter->shouldBuffer('')); - } - - private function _createFilter($search, $replace) - { - return new Swift_StreamFilters_StringReplacementFilter($search, $replace); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php deleted file mode 100644 index 462a03b..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php +++ /dev/null @@ -1,558 +0,0 @@ -<?php - -require_once __DIR__ . '/AbstractSmtpTest.php'; - -abstract class Swift_Transport_AbstractSmtpEventSupportTest extends Swift_Transport_AbstractSmtpTest -{ - public function testRegisterPluginLoadsPluginInEventDispatcher() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $listener = $this->getMockery('Swift_Events_EventListener'); - $smtp = $this->_getTransport($buf, $dispatcher); - $dispatcher->shouldReceive('bindEventListener') - ->once() - ->with($listener); - - $smtp->registerPlugin($listener); - } - - public function testSendingDispatchesBeforeSendEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $message = $this->_createMessage(); - $smtp = $this->_getTransport($buf, $dispatcher); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('chris@swiftmailer.org' => null)); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('mark@swiftmailer.org' => 'Mark')); - $dispatcher->shouldReceive('createSendEvent') - ->once() - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeSendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(1, $smtp->send($message)); - } - - public function testSendingDispatchesSendEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $message = $this->_createMessage(); - $smtp = $this->_getTransport($buf, $dispatcher); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('chris@swiftmailer.org' => null)); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('mark@swiftmailer.org' => 'Mark')); - $dispatcher->shouldReceive('createSendEvent') - ->once() - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'sendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(1, $smtp->send($message)); - } - - public function testSendEventCapturesFailures() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $smtp = $this->_getTransport($buf, $dispatcher); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('chris@swiftmailer.org' => null)); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('mark@swiftmailer.org' => 'Mark')); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<chris@swiftmailer.org>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<mark@swiftmailer.org>\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("500 Not now\r\n"); - $dispatcher->shouldReceive('createSendEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'sendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - $evt->shouldReceive('setFailedRecipients') - ->once() - ->with(array('mark@swiftmailer.org')); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(0, $smtp->send($message)); - } - - public function testSendEventHasResultFailedIfAllFailures() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $smtp = $this->_getTransport($buf, $dispatcher); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('chris@swiftmailer.org' => null)); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('mark@swiftmailer.org' => 'Mark')); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<chris@swiftmailer.org>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<mark@swiftmailer.org>\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("500 Not now\r\n"); - $dispatcher->shouldReceive('createSendEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'sendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - $evt->shouldReceive('setResult') - ->once() - ->with(Swift_Events_SendEvent::RESULT_FAILED); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(0, $smtp->send($message)); - } - - public function testSendEventHasResultTentativeIfSomeFailures() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $smtp = $this->_getTransport($buf, $dispatcher); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('chris@swiftmailer.org' => null)); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array( - 'mark@swiftmailer.org' => 'Mark', - 'chris@site.tld' => 'Chris', - )); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<chris@swiftmailer.org>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<mark@swiftmailer.org>\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("500 Not now\r\n"); - $dispatcher->shouldReceive('createSendEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'sendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - $evt->shouldReceive('setResult') - ->once() - ->with(Swift_Events_SendEvent::RESULT_TENTATIVE); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(1, $smtp->send($message)); - } - - public function testSendEventHasResultSuccessIfNoFailures() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $smtp = $this->_getTransport($buf, $dispatcher); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('chris@swiftmailer.org' => null)); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array( - 'mark@swiftmailer.org' => 'Mark', - 'chris@site.tld' => 'Chris', - )); - $dispatcher->shouldReceive('createSendEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'sendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - $evt->shouldReceive('setResult') - ->once() - ->with(Swift_Events_SendEvent::RESULT_SUCCESS); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(2, $smtp->send($message)); - } - - public function testCancellingEventBubbleBeforeSendStopsEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $smtp = $this->_getTransport($buf, $dispatcher); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('chris@swiftmailer.org' => null)); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('mark@swiftmailer.org' => 'Mark')); - $dispatcher->shouldReceive('createSendEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeSendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(true); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(0, $smtp->send($message)); - } - - public function testStartingTransportDispatchesTransportChangeEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'transportStarted'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(false); - - $this->_finishBuffer($buf); - $smtp->start(); - } - - public function testStartingTransportDispatchesBeforeTransportChangeEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeTransportStarted'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(false); - - $this->_finishBuffer($buf); - $smtp->start(); - } - - public function testCancellingBubbleBeforeTransportStartStopsEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeTransportStarted'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(true); - - $this->_finishBuffer($buf); - $smtp->start(); - - $this->assertFalse($smtp->isStarted(), - '%s: Transport should not be started since event bubble was cancelled' - ); - } - - public function testStoppingTransportDispatchesTransportChangeEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent')->shouldIgnoreMissing(); - $smtp = $this->_getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'transportStopped'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->stop(); - } - - public function testStoppingTransportDispatchesBeforeTransportChangeEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent')->shouldIgnoreMissing(); - $smtp = $this->_getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeTransportStopped'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->stop(); - } - - public function testCancellingBubbleBeforeTransportStoppedStopsEvent() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - - $hasRun = false; - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeTransportStopped') - ->andReturnUsing(function () use (&$hasRun) { - $hasRun = true; - }); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$hasRun) { - return $hasRun; - }); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->stop(); - - $this->assertTrue($smtp->isStarted(), - '%s: Transport should not be stopped since event bubble was cancelled' - ); - } - - public function testResponseEventsAreGenerated() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_ResponseEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createResponseEvent') - ->atLeast()->once() - ->with($smtp, \Mockery::any(), \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->atLeast()->once() - ->with($evt, 'responseReceived'); - - $this->_finishBuffer($buf); - $smtp->start(); - } - - public function testCommandEventsAreGenerated() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_CommandEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createCommandEvent') - ->once() - ->with($smtp, \Mockery::any(), \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'commandSent'); - - $this->_finishBuffer($buf); - $smtp->start(); - } - - public function testExceptionsCauseExceptionEvents() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportExceptionEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - - $buf->shouldReceive('readLine') - ->atLeast()->once() - ->andReturn("503 I'm sleepy, go away!\r\n"); - $dispatcher->shouldReceive('createTransportExceptionEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'exceptionThrown'); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(false); - - try { - $smtp->start(); - $this->fail('TransportException should be thrown on invalid response'); - } catch (Swift_TransportException $e) { - } - } - - public function testExceptionBubblesCanBeCancelled() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportExceptionEvent'); - $smtp = $this->_getTransport($buf, $dispatcher); - - $buf->shouldReceive('readLine') - ->atLeast()->once() - ->andReturn("503 I'm sleepy, go away!\r\n"); - $dispatcher->shouldReceive('createTransportExceptionEvent') - ->twice() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->twice() - ->with($evt, 'exceptionThrown'); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(true); - - $this->_finishBuffer($buf); - $smtp->start(); - } - - protected function _createEventDispatcher($stub = true) - { - return $this->getMockery('Swift_Events_EventDispatcher')->shouldIgnoreMissing(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php deleted file mode 100644 index f49b489..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php +++ /dev/null @@ -1,1249 +0,0 @@ -<?php - -abstract class Swift_Transport_AbstractSmtpTest extends \SwiftMailerTestCase -{ - /** Abstract test method */ - abstract protected function _getTransport($buf); - - public function testStartAccepts220ServiceGreeting() - { - /* -- RFC 2821, 4.2. - - Greeting = "220 " Domain [ SP text ] CRLF - - -- RFC 2822, 4.3.2. - - CONNECTION ESTABLISHMENT - S: 220 - E: 554 - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - - $this->_finishBuffer($buf); - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->assertTrue($smtp->isStarted(), '%s: start() should have started connection'); - } catch (Exception $e) { - $this->fail('220 is a valid SMTP greeting and should be accepted'); - } - } - - public function testBadGreetingCausesException() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("554 I'm busy\r\n"); - $this->_finishBuffer($buf); - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->fail('554 greeting indicates an error and should cause an exception'); - } catch (Exception $e) { - $this->assertFalse($smtp->isStarted(), '%s: start() should have failed'); - } - } - - public function testStartSendsHeloToInitiate() - { - /* -- RFC 2821, 3.2. - - 3.2 Client Initiation - - Once the server has sent the welcoming message and the client has - received it, the client normally sends the EHLO command to the - server, indicating the client's identity. In addition to opening the - session, use of EHLO indicates that the client is able to process - service extensions and requests that the server provide a list of the - extensions it supports. Older SMTP systems which are unable to - support service extensions and contemporary clients which do not - require service extensions in the mail session being initiated, MAY - use HELO instead of EHLO. Servers MUST NOT return the extended - EHLO-style response to a HELO command. For a particular connection - attempt, if the server returns a "command not recognized" response to - EHLO, the client SHOULD be able to fall back and send HELO. - - In the EHLO command the host sending the command identifies itself; - the command may be interpreted as saying "Hello, I am <domain>" (and, - in the case of EHLO, "and I support service extension requests"). - - -- RFC 2281, 4.1.1.1. - - ehlo = "EHLO" SP Domain CRLF - helo = "HELO" SP Domain CRLF - - -- RFC 2821, 4.3.2. - - EHLO or HELO - S: 250 - E: 504, 550 - - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^HELO .*?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 ServerName'."\r\n"); - - $this->_finishBuffer($buf); - try { - $smtp->start(); - } catch (Exception $e) { - $this->fail('Starting SMTP should send HELO and accept 250 response'); - } - } - - public function testInvalidHeloResponseCausesException() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^HELO .*?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('504 WTF'."\r\n"); - - $this->_finishBuffer($buf); - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->fail('Non 250 HELO response should raise Exception'); - } catch (Exception $e) { - $this->assertFalse($smtp->isStarted(), '%s: SMTP start() should have failed'); - } - } - - public function testDomainNameIsPlacedInHelo() - { - /* -- RFC 2821, 4.1.4. - - The SMTP client MUST, if possible, ensure that the domain parameter - to the EHLO command is a valid principal host name (not a CNAME or MX - name) for its host. If this is not possible (e.g., when the client's - address is dynamically assigned and the client does not have an - obvious name), an address literal SHOULD be substituted for the - domain name and supplemental information provided that will assist in - identifying the client. - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("HELO mydomain.com\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 ServerName'."\r\n"); - - $this->_finishBuffer($buf); - $smtp->setLocalDomain('mydomain.com'); - $smtp->start(); - } - - public function testSuccessfulMailCommand() - { - /* -- RFC 2821, 3.3. - - There are three steps to SMTP mail transactions. The transaction - starts with a MAIL command which gives the sender identification. - - ..... - - The first step in the procedure is the MAIL command. - - MAIL FROM:<reverse-path> [SP <mail-parameters> ] <CRLF> - - -- RFC 2821, 4.1.1.2. - - Syntax: - - "MAIL FROM:" ("<>" / Reverse-Path) - [SP Mail-parameters] CRLF - -- RFC 2821, 4.1.2. - - Reverse-path = Path - Forward-path = Path - Path = "<" [ A-d-l ":" ] Mailbox ">" - A-d-l = At-domain *( "," A-d-l ) - ; Note that this form, the so-called "source route", - ; MUST BE accepted, SHOULD NOT be generated, and SHOULD be - ; ignored. - At-domain = "@" domain - - -- RFC 2821, 4.3.2. - - MAIL - S: 250 - E: 552, 451, 452, 550, 553, 503 - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<me@domain.com>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - } catch (Exception $e) { - $this->fail('MAIL FROM should accept a 250 response'); - } - } - - public function testInvalidResponseCodeFromMailCausesException() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<me@domain.com>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('553 Bad'."\r\n"); - - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - $this->fail('MAIL FROM should accept a 250 response'); - } catch (Exception $e) { - } - } - - public function testSenderIsPreferredOverFrom() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getSender') - ->once() - ->andReturn(array('another@domain.com' => 'Someone')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<another@domain.com>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testReturnPathIsPreferredOverSender() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getSender') - ->once() - ->andReturn(array('another@domain.com' => 'Someone')); - $message->shouldReceive('getReturnPath') - ->once() - ->andReturn('more@domain.com'); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<more@domain.com>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testSuccessfulRcptCommandWith250Response() - { - /* -- RFC 2821, 3.3. - - The second step in the procedure is the RCPT command. - - RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF> - - The first or only argument to this command includes a forward-path - (normally a mailbox and domain, always surrounded by "<" and ">" - brackets) identifying one recipient. If accepted, the SMTP server - returns a 250 OK reply and stores the forward-path. If the recipient - is known not to be a deliverable address, the SMTP server returns a - 550 reply, typically with a string such as "no such user - " and the - mailbox name (other circumstances and reply codes are possible). - This step of the procedure can be repeated any number of times. - - -- RFC 2821, 4.1.1.3. - - This command is used to identify an individual recipient of the mail - data; multiple recipients are specified by multiple use of this - command. The argument field contains a forward-path and may contain - optional parameters. - - The forward-path normally consists of the required destination - mailbox. Sending systems SHOULD not generate the optional list of - hosts known as a source route. - - ....... - - "RCPT TO:" ("<Postmaster@" domain ">" / "<Postmaster>" / Forward-Path) - [SP Rcpt-parameters] CRLF - - -- RFC 2821, 4.2.2. - - 250 Requested mail action okay, completed - 251 User not local; will forward to <forward-path> - (See section 3.4) - 252 Cannot VRFY user, but will accept message and attempt - delivery - - -- RFC 2821, 4.3.2. - - RCPT - S: 250, 251 (but see section 3.4 for discussion of 251 and 551) - E: 550, 551, 552, 553, 450, 451, 452, 503, 550 - */ - - //We'll treat 252 as accepted since it isn't really a failure - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<me@domain.com>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<foo@bar>\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - } catch (Exception $e) { - $this->fail('RCPT TO should accept a 250 response'); - } - } - - public function testMailFromCommandIsOnlySentOncePerMessage() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<me@domain.com>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<foo@bar>\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->never() - ->with("MAIL FROM:<me@domain.com>\r\n"); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testMultipleRecipientsSendsMultipleRcpt() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array( - 'foo@bar' => null, - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - )); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<foo@bar>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<zip@button>\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<test@domain>\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn('250 OK'."\r\n"); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testCcRecipientsSendsMultipleRcpt() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $message->shouldReceive('getCc') - ->once() - ->andReturn(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - )); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<foo@bar>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<zip@button>\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<test@domain>\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn('250 OK'."\r\n"); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testSendReturnsNumberOfSuccessfulRecipients() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $message->shouldReceive('getCc') - ->once() - ->andReturn(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - )); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<foo@bar>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<zip@button>\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('501 Nobody here'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<test@domain>\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn('250 OK'."\r\n"); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(2, $smtp->send($message), - '%s: 1 of 3 recipients failed so 2 should be returned' - ); - } - - public function testRsetIsSentIfNoSuccessfulRecipients() - { - /* --RFC 2821, 4.1.1.5. - - This command specifies that the current mail transaction will be - aborted. Any stored sender, recipients, and mail data MUST be - discarded, and all buffers and state tables cleared. The receiver - MUST send a "250 OK" reply to a RSET command with no arguments. A - reset command may be issued by the client at any time. - - -- RFC 2821, 4.3.2. - - RSET - S: 250 - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<foo@bar>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('503 Bad'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RSET\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(0, $smtp->send($message), - '%s: 1 of 1 recipients failed so 0 should be returned' - ); - } - - public function testSuccessfulDataCommand() - { - /* -- RFC 2821, 3.3. - - The third step in the procedure is the DATA command (or some - alternative specified in a service extension). - - DATA <CRLF> - - If accepted, the SMTP server returns a 354 Intermediate reply and - considers all succeeding lines up to but not including the end of - mail data indicator to be the message text. - - -- RFC 2821, 4.1.1.4. - - The receiver normally sends a 354 response to DATA, and then treats - the lines (strings ending in <CRLF> sequences, as described in - section 2.3.7) following the command as mail data from the sender. - This command causes the mail data to be appended to the mail data - buffer. The mail data may contain any of the 128 ASCII character - codes, although experience has indicated that use of control - characters other than SP, HT, CR, and LF may cause problems and - SHOULD be avoided when possible. - - -- RFC 2821, 4.3.2. - - DATA - I: 354 -> data -> S: 250 - E: 552, 554, 451, 452 - E: 451, 554, 503 - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('write') - ->once() - ->with("DATA\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('354 Go ahead'."\r\n"); - - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - } catch (Exception $e) { - $this->fail('354 is the expected response to DATA'); - } - } - - public function testBadDataResponseCausesException() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('write') - ->once() - ->with("DATA\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('451 Bad'."\r\n"); - - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - $this->fail('354 is the expected response to DATA (not observed)'); - } catch (Exception $e) { - } - } - - public function testMessageIsStreamedToBufferForData() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('write') - ->once() - ->with("DATA\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('354 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("\r\n.\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testBadResponseAfterDataTransmissionCausesException() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->once() - ->andReturn(array('foo@bar' => null)); - $buf->shouldReceive('write') - ->once() - ->with("DATA\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('354 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("\r\n.\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('554 Error'."\r\n"); - - $this->_finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - $this->fail('250 is the expected response after a DATA transmission (not observed)'); - } catch (Exception $e) { - } - } - - public function testBccRecipientsAreRemovedFromHeaders() - { - /* -- RFC 2821, 7.2. - - Addresses that do not appear in the message headers may appear in the - RCPT commands to an SMTP server for a number of reasons. The two - most common involve the use of a mailing address as a "list exploder" - (a single address that resolves into multiple addresses) and the - appearance of "blind copies". Especially when more than one RCPT - command is present, and in order to avoid defeating some of the - purpose of these mechanisms, SMTP clients and servers SHOULD NOT copy - the full set of RCPT command arguments into the headers, either as - part of trace headers or as informational or private-extension - headers. Since this rule is often violated in practice, and cannot - be enforced, sending SMTP systems that are aware of "bcc" use MAY - find it helpful to send each blind copy as a separate message - transaction containing only a single RCPT command. - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => null)); - $message->shouldReceive('getBcc') - ->zeroOrMoreTimes() - ->andReturn(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - )); - $message->shouldReceive('setBcc') - ->once() - ->with(array()); - $message->shouldReceive('setBcc') - ->zeroOrMoreTimes(); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testEachBccRecipientIsSentASeparateMessage() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => null)); - $message->shouldReceive('getBcc') - ->zeroOrMoreTimes() - ->andReturn(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - )); - $message->shouldReceive('setBcc') - ->atLeast()->once() - ->with(array()); - $message->shouldReceive('setBcc') - ->once() - ->with(array('zip@button' => 'Zip Button')); - $message->shouldReceive('setBcc') - ->once() - ->with(array('test@domain' => 'Test user')); - $message->shouldReceive('setBcc') - ->atLeast()->once() - ->with(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - )); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:<me@domain.com>\r\n")->andReturn(1); - $buf->shouldReceive('readLine')->once()->with(1)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:<foo@bar>\r\n")->andReturn(2); - $buf->shouldReceive('readLine')->once()->with(2)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(3); - $buf->shouldReceive('readLine')->once()->with(3)->andReturn("354 OK\r\n"); - $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(4); - $buf->shouldReceive('readLine')->once()->with(4)->andReturn("250 OK\r\n"); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:<me@domain.com>\r\n")->andReturn(5); - $buf->shouldReceive('readLine')->once()->with(5)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:<zip@button>\r\n")->andReturn(6); - $buf->shouldReceive('readLine')->once()->with(6)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(7); - $buf->shouldReceive('readLine')->once()->with(7)->andReturn("354 OK\r\n"); - $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(8); - $buf->shouldReceive('readLine')->once()->with(8)->andReturn("250 OK\r\n"); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:<me@domain.com>\r\n")->andReturn(9); - $buf->shouldReceive('readLine')->once()->with(9)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:<test@domain>\r\n")->andReturn(10); - $buf->shouldReceive('readLine')->once()->with(10)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(11); - $buf->shouldReceive('readLine')->once()->with(11)->andReturn("354 OK\r\n"); - $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(12); - $buf->shouldReceive('readLine')->once()->with(12)->andReturn("250 OK\r\n"); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(3, $smtp->send($message)); - } - - public function testMessageStateIsRestoredOnFailure() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => null)); - $message->shouldReceive('getBcc') - ->zeroOrMoreTimes() - ->andReturn(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - )); - $message->shouldReceive('setBcc') - ->once() - ->with(array()); - $message->shouldReceive('setBcc') - ->once() - ->with(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - )); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<me@domain.com>\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<foo@bar>\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("DATA\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn("451 No\r\n"); - - $this->_finishBuffer($buf); - - $smtp->start(); - try { - $smtp->send($message); - $this->fail('A bad response was given so exception is expected'); - } catch (Exception $e) { - } - } - - public function testStopSendsQuitCommand() - { - /* -- RFC 2821, 4.1.1.10. - - This command specifies that the receiver MUST send an OK reply, and - then close the transmission channel. - - The receiver MUST NOT intentionally close the transmission channel - until it receives and replies to a QUIT command (even if there was an - error). The sender MUST NOT intentionally close the transmission - channel until it sends a QUIT command and SHOULD wait until it - receives the reply (even if there was an error response to a previous - command). If the connection is closed prematurely due to violations - of the above or system or network failure, the server MUST cancel any - pending transaction, but not undo any previously completed - transaction, and generally MUST act as if the command or transaction - in progress had received a temporary error (i.e., a 4yz response). - - The QUIT command may be issued at any time. - - Syntax: - "QUIT" CRLF - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('write') - ->once() - ->with("QUIT\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("221 Bye\r\n"); - $buf->shouldReceive('terminate') - ->once(); - - $this->_finishBuffer($buf); - - $this->assertFalse($smtp->isStarted()); - $smtp->start(); - $this->assertTrue($smtp->isStarted()); - $smtp->stop(); - $this->assertFalse($smtp->isStarted()); - } - - public function testBufferCanBeFetched() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ref = $smtp->getBuffer(); - $this->assertEquals($buf, $ref); - } - - public function testBufferCanBeWrittenToUsingExecuteCommand() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with("FOO\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with(1) - ->andReturn("250 OK\r\n"); - - $res = $smtp->executeCommand("FOO\r\n"); - $this->assertEquals("250 OK\r\n", $res); - } - - public function testResponseCodesAreValidated() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with("FOO\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with(1) - ->andReturn("551 Not ok\r\n"); - - try { - $smtp->executeCommand("FOO\r\n", array(250, 251)); - $this->fail('A 250 or 251 response was needed but 551 was returned.'); - } catch (Exception $e) { - } - } - - public function testFailedRecipientsCanBeCollectedByReference() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => null)); - $message->shouldReceive('getBcc') - ->zeroOrMoreTimes() - ->andReturn(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - )); - $message->shouldReceive('setBcc') - ->atLeast()->once() - ->with(array()); - $message->shouldReceive('setBcc') - ->once() - ->with(array('zip@button' => 'Zip Button')); - $message->shouldReceive('setBcc') - ->once() - ->with(array('test@domain' => 'Test user')); - $message->shouldReceive('setBcc') - ->atLeast()->once() - ->with(array( - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - )); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:<me@domain.com>\r\n")->andReturn(1); - $buf->shouldReceive('readLine')->once()->with(1)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:<foo@bar>\r\n")->andReturn(2); - $buf->shouldReceive('readLine')->once()->with(2)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(3); - $buf->shouldReceive('readLine')->once()->with(3)->andReturn("354 OK\r\n"); - $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(4); - $buf->shouldReceive('readLine')->once()->with(4)->andReturn("250 OK\r\n"); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:<me@domain.com>\r\n")->andReturn(5); - $buf->shouldReceive('readLine')->once()->with(5)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:<zip@button>\r\n")->andReturn(6); - $buf->shouldReceive('readLine')->once()->with(6)->andReturn("500 Bad\r\n"); - $buf->shouldReceive('write')->once()->with("RSET\r\n")->andReturn(7); - $buf->shouldReceive('readLine')->once()->with(7)->andReturn("250 OK\r\n"); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:<me@domain.com>\r\n")->andReturn(9); - $buf->shouldReceive('readLine')->once()->with(9)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:<test@domain>\r\n")->andReturn(10); - $buf->shouldReceive('readLine')->once()->with(10)->andReturn("500 Bad\r\n"); - $buf->shouldReceive('write')->once()->with("RSET\r\n")->andReturn(11); - $buf->shouldReceive('readLine')->once()->with(11)->andReturn("250 OK\r\n"); - - $this->_finishBuffer($buf); - $smtp->start(); - $this->assertEquals(1, $smtp->send($message, $failures)); - $this->assertEquals(array('zip@button', 'test@domain'), $failures, - '%s: Failures should be caught in an array' - ); - } - - public function testSendingRegeneratesMessageId() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $message = $this->_createMessage(); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('me@domain.com' => 'Me')); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => null)); - $message->shouldReceive('generateId') - ->once(); - - $this->_finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - protected function _getBuffer() - { - return $this->getMockery('Swift_Transport_IoBuffer')->shouldIgnoreMissing(); - } - - protected function _createMessage() - { - return $this->getMockery('Swift_Mime_Message')->shouldIgnoreMissing(); - } - - protected function _finishBuffer($buf) - { - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with(0) - ->andReturn('220 server.com foo'."\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with('~^(EH|HE)LO .*?\r\n$~D') - ->andReturn($x = uniqid()); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn('250 ServerName'."\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with('~^MAIL FROM:<.*?>\r\n$~D') - ->andReturn($x = uniqid()); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with('~^RCPT TO:<.*?>\r\n$~D') - ->andReturn($x = uniqid()); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with("DATA\r\n") - ->andReturn($x = uniqid()); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn("354 OK\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with("\r\n.\r\n") - ->andReturn($x = uniqid()); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with("RSET\r\n") - ->andReturn($x = uniqid()); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn("250 OK\r\n"); - - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturn(false); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->andReturn(false); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php deleted file mode 100644 index aca03a9..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -class Swift_Transport_Esmtp_Auth_CramMd5AuthenticatorTest extends \SwiftMailerTestCase -{ - private $_agent; - - protected function setUp() - { - $this->_agent = $this->getMockery('Swift_Transport_SmtpAgent')->shouldIgnoreMissing(); - } - - public function testKeywordIsCramMd5() - { - /* -- RFC 2195, 2. - The authentication type associated with CRAM is "CRAM-MD5". - */ - - $cram = $this->_getAuthenticator(); - $this->assertEquals('CRAM-MD5', $cram->getAuthKeyword()); - } - - public function testSuccessfulAuthentication() - { - $cram = $this->_getAuthenticator(); - - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with("AUTH CRAM-MD5\r\n", array(334)) - ->andReturn('334 '.base64_encode('<foo@bar>')."\r\n"); - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with(\Mockery::any(), array(235)); - - $this->assertTrue($cram->authenticate($this->_agent, 'jack', 'pass'), - '%s: The buffer accepted all commands authentication should succeed' - ); - } - - public function testAuthenticationFailureSendRsetAndReturnFalse() - { - $cram = $this->_getAuthenticator(); - - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with("AUTH CRAM-MD5\r\n", array(334)) - ->andReturn('334 '.base64_encode('<foo@bar>')."\r\n"); - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with(\Mockery::any(), array(235)) - ->andThrow(new Swift_TransportException('')); - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with("RSET\r\n", array(250)); - - $this->assertFalse($cram->authenticate($this->_agent, 'jack', 'pass'), - '%s: Authentication fails, so RSET should be sent' - ); - } - - private function _getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_CramMd5Authenticator(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php deleted file mode 100644 index 13f0209..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -class Swift_Transport_Esmtp_Auth_LoginAuthenticatorTest extends \SwiftMailerTestCase -{ - private $_agent; - - protected function setUp() - { - $this->_agent = $this->getMockery('Swift_Transport_SmtpAgent')->shouldIgnoreMissing(); - } - - public function testKeywordIsLogin() - { - $login = $this->_getAuthenticator(); - $this->assertEquals('LOGIN', $login->getAuthKeyword()); - } - - public function testSuccessfulAuthentication() - { - $login = $this->_getAuthenticator(); - - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with("AUTH LOGIN\r\n", array(334)); - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with(base64_encode('jack')."\r\n", array(334)); - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with(base64_encode('pass')."\r\n", array(235)); - - $this->assertTrue($login->authenticate($this->_agent, 'jack', 'pass'), - '%s: The buffer accepted all commands authentication should succeed' - ); - } - - public function testAuthenticationFailureSendRsetAndReturnFalse() - { - $login = $this->_getAuthenticator(); - - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with("AUTH LOGIN\r\n", array(334)); - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with(base64_encode('jack')."\r\n", array(334)); - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with(base64_encode('pass')."\r\n", array(235)) - ->andThrow(new Swift_TransportException('')); - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with("RSET\r\n", array(250)); - - $this->assertFalse($login->authenticate($this->_agent, 'jack', 'pass'), - '%s: Authentication fails, so RSET should be sent' - ); - } - - private function _getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_LoginAuthenticator(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php deleted file mode 100644 index 911d258..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php +++ /dev/null @@ -1,213 +0,0 @@ -<?php - -class Swift_Transport_Esmtp_Auth_NTLMAuthenticatorTest extends \SwiftMailerTestCase -{ - private $_message1 = '4e544c4d535350000100000007020000'; - private $_message2 = '4e544c4d53535000020000000c000c003000000035828980514246973ea892c10000000000000000460046003c00000054004500530054004e00540002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d0000000000'; - private $_message3 = '4e544c4d5353500003000000180018006000000076007600780000000c000c0040000000080008004c0000000c000c0054000000000000009a0000000102000054004500530054004e00540074006500730074004d0045004d00420045005200bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000'; - - protected function setUp() - { - if (!function_exists('openssl_encrypt') || !function_exists('openssl_random_pseudo_bytes') || !function_exists('bcmul') || !function_exists('iconv')) { - $this->markTestSkipped('One of the required functions is not available.'); - } - } - - public function testKeywordIsNtlm() - { - $login = $this->_getAuthenticator(); - $this->assertEquals('NTLM', $login->getAuthKeyword()); - } - - public function testMessage1Generator() - { - $login = $this->_getAuthenticator(); - $message1 = $this->_invokePrivateMethod('createMessage1', $login); - - $this->assertEquals($this->_message1, bin2hex($message1), '%s: We send the smallest ntlm message which should never fail.'); - } - - public function testLMv1Generator() - { - $password = 'test1234'; - $challenge = 'b019d38bad875c9d'; - $lmv1 = '1879f60127f8a877022132ec221bcbf3ca016a9f76095606'; - - $login = $this->_getAuthenticator(); - $lmv1Result = $this->_invokePrivateMethod('createLMPassword', $login, array($password, $this->hex2bin($challenge))); - - $this->assertEquals($lmv1, bin2hex($lmv1Result), '%s: The keys should be the same cause we use the same values to generate them.'); - } - - public function testLMv2Generator() - { - $username = 'user'; - $password = 'SecREt01'; - $domain = 'DOMAIN'; - $challenge = '0123456789abcdef'; - $lmv2 = 'd6e6152ea25d03b7c6ba6629c2d6aaf0ffffff0011223344'; - - $login = $this->_getAuthenticator(); - $lmv2Result = $this->_invokePrivateMethod('createLMv2Password', $login, array($password, $username, $domain, $this->hex2bin($challenge), $this->hex2bin('ffffff0011223344'))); - - $this->assertEquals($lmv2, bin2hex($lmv2Result), '%s: The keys should be the same cause we use the same values to generate them.'); - } - - public function testMessage3v1Generator() - { - $username = 'test'; - $domain = 'TESTNT'; - $workstation = 'MEMBER'; - $lmResponse = '1879f60127f8a877022132ec221bcbf3ca016a9f76095606'; - $ntlmResponse = 'e6285df3287c5d194f84df1a94817c7282d09754b6f9e02a'; - $message3T = '4e544c4d5353500003000000180018006000000018001800780000000c000c0040000000080008004c0000000c000c0054000000000000009a0000000102000054004500530054004e00540074006500730074004d0045004d004200450052001879f60127f8a877022132ec221bcbf3ca016a9f76095606e6285df3287c5d194f84df1a94817c7282d09754b6f9e02a'; - - $login = $this->_getAuthenticator(); - $message3 = $this->_invokePrivateMethod('createMessage3', $login, array($domain, $username, $workstation, $this->hex2bin($lmResponse), $this->hex2bin($ntlmResponse))); - - $this->assertEquals($message3T, bin2hex($message3), '%s: We send the same information as the example is created with so this should be the same'); - } - - public function testMessage3v2Generator() - { - $username = 'test'; - $domain = 'TESTNT'; - $workstation = 'MEMBER'; - $lmResponse = 'bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9'; - $ntlmResponse = 'caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000'; - - $login = $this->_getAuthenticator(); - $message3 = $this->_invokePrivateMethod('createMessage3', $login, array($domain, $username, $workstation, $this->hex2bin($lmResponse), $this->hex2bin($ntlmResponse))); - - $this->assertEquals($this->_message3, bin2hex($message3), '%s: We send the same information as the example is created with so this should be the same'); - } - - public function testGetDomainAndUsername() - { - $username = "DOMAIN\user"; - - $login = $this->_getAuthenticator(); - list($domain, $user) = $this->_invokePrivateMethod('getDomainAndUsername', $login, array($username)); - - $this->assertEquals('DOMAIN', $domain, '%s: the fetched domain did not match'); - $this->assertEquals('user', $user, '%s: the fetched user did not match'); - } - - public function testGetDomainAndUsernameWithExtension() - { - $username = "domain.com\user"; - - $login = $this->_getAuthenticator(); - list($domain, $user) = $this->_invokePrivateMethod('getDomainAndUsername', $login, array($username)); - - $this->assertEquals('domain.com', $domain, '%s: the fetched domain did not match'); - $this->assertEquals('user', $user, '%s: the fetched user did not match'); - } - - public function testGetDomainAndUsernameWithAtSymbol() - { - $username = 'user@DOMAIN'; - - $login = $this->_getAuthenticator(); - list($domain, $user) = $this->_invokePrivateMethod('getDomainAndUsername', $login, array($username)); - - $this->assertEquals('DOMAIN', $domain, '%s: the fetched domain did not match'); - $this->assertEquals('user', $user, '%s: the fetched user did not match'); - } - - public function testGetDomainAndUsernameWithAtSymbolAndExtension() - { - $username = 'user@domain.com'; - - $login = $this->_getAuthenticator(); - list($domain, $user) = $this->_invokePrivateMethod('getDomainAndUsername', $login, array($username)); - - $this->assertEquals('domain.com', $domain, '%s: the fetched domain did not match'); - $this->assertEquals('user', $user, '%s: the fetched user did not match'); - } - - public function testGetDomainAndUsernameWithoutDomain() - { - $username = 'user'; - - $login = $this->_getAuthenticator(); - list($domain, $user) = $this->_invokePrivateMethod('getDomainAndUsername', $login, array($username)); - - $this->assertEquals('', $domain, '%s: the fetched domain did not match'); - $this->assertEquals('user', $user, '%s: the fetched user did not match'); - } - - public function testSuccessfulAuthentication() - { - $domain = 'TESTNT'; - $username = 'test'; - $secret = 'test1234'; - - $ntlm = $this->_getAuthenticator(); - $agent = $this->_getAgent(); - $agent->shouldReceive('executeCommand') - ->once() - ->with('AUTH NTLM '.base64_encode( - $this->_invokePrivateMethod('createMessage1', $ntlm) - )."\r\n", array(334)) - ->andReturn('334 '.base64_encode($this->hex2bin('4e544c4d53535000020000000c000c003000000035828980514246973ea892c10000000000000000460046003c00000054004500530054004e00540002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d0000000000'))); - $agent->shouldReceive('executeCommand') - ->once() - ->with(base64_encode( - $this->_invokePrivateMethod('createMessage3', $ntlm, array($domain, $username, $this->hex2bin('4d0045004d00420045005200'), $this->hex2bin('bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9'), $this->hex2bin('caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000')) - ))."\r\n", array(235)); - - $this->assertTrue($ntlm->authenticate($agent, $username.'@'.$domain, $secret, $this->hex2bin('30fa7e3c677bc301'), $this->hex2bin('f5ce3d2401c8f6e9')), '%s: The buffer accepted all commands authentication should succeed'); - } - - public function testAuthenticationFailureSendRsetAndReturnFalse() - { - $domain = 'TESTNT'; - $username = 'test'; - $secret = 'test1234'; - - $ntlm = $this->_getAuthenticator(); - $agent = $this->_getAgent(); - $agent->shouldReceive('executeCommand') - ->once() - ->with('AUTH NTLM '.base64_encode( - $this->_invokePrivateMethod('createMessage1', $ntlm) - )."\r\n", array(334)) - ->andThrow(new Swift_TransportException('')); - $agent->shouldReceive('executeCommand') - ->once() - ->with("RSET\r\n", array(250)); - - $this->assertFalse($ntlm->authenticate($agent, $username.'@'.$domain, $secret, $this->hex2bin('30fa7e3c677bc301'), $this->hex2bin('f5ce3d2401c8f6e9')), '%s: Authentication fails, so RSET should be sent'); - } - - private function _getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_NTLMAuthenticator(); - } - - private function _getAgent() - { - return $this->getMockery('Swift_Transport_SmtpAgent')->shouldIgnoreMissing(); - } - - private function _invokePrivateMethod($method, $instance, array $args = array()) - { - $methodC = new ReflectionMethod($instance, trim($method)); - $methodC->setAccessible(true); - - return $methodC->invokeArgs($instance, $args); - } - - /** - * Hex2bin replacement for < PHP 5.4. - * - * @param string $hex - * - * @return string Binary - */ - protected function hex2bin($hex) - { - return function_exists('hex2bin') ? hex2bin($hex) : pack('H*', $hex); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php deleted file mode 100644 index 73a9062..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -class Swift_Transport_Esmtp_Auth_PlainAuthenticatorTest extends \SwiftMailerTestCase -{ - private $_agent; - - protected function setUp() - { - $this->_agent = $this->getMockery('Swift_Transport_SmtpAgent')->shouldIgnoreMissing(); - } - - public function testKeywordIsPlain() - { - /* -- RFC 4616, 1. - The name associated with this mechanism is "PLAIN". - */ - - $login = $this->_getAuthenticator(); - $this->assertEquals('PLAIN', $login->getAuthKeyword()); - } - - public function testSuccessfulAuthentication() - { - /* -- RFC 4616, 2. - The client presents the authorization identity (identity to act as), - followed by a NUL (U+0000) character, followed by the authentication - identity (identity whose password will be used), followed by a NUL - (U+0000) character, followed by the clear-text password. - */ - - $plain = $this->_getAuthenticator(); - - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with('AUTH PLAIN '.base64_encode( - 'jack'.chr(0).'jack'.chr(0).'pass' - )."\r\n", array(235)); - - $this->assertTrue($plain->authenticate($this->_agent, 'jack', 'pass'), - '%s: The buffer accepted all commands authentication should succeed' - ); - } - - public function testAuthenticationFailureSendRsetAndReturnFalse() - { - $plain = $this->_getAuthenticator(); - - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with('AUTH PLAIN '.base64_encode( - 'jack'.chr(0).'jack'.chr(0).'pass' - )."\r\n", array(235)) - ->andThrow(new Swift_TransportException('')); - $this->_agent->shouldReceive('executeCommand') - ->once() - ->with("RSET\r\n", array(250)); - - $this->assertFalse($plain->authenticate($this->_agent, 'jack', 'pass'), - '%s: Authentication fails, so RSET should be sent' - ); - } - - private function _getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_PlainAuthenticator(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php deleted file mode 100644 index d52328a..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php +++ /dev/null @@ -1,165 +0,0 @@ -<?php - -class Swift_Transport_Esmtp_AuthHandlerTest extends \SwiftMailerTestCase -{ - private $_agent; - - protected function setUp() - { - $this->_agent = $this->getMockery('Swift_Transport_SmtpAgent')->shouldIgnoreMissing(); - } - - public function testKeywordIsAuth() - { - $auth = $this->_createHandler(array()); - $this->assertEquals('AUTH', $auth->getHandledKeyword()); - } - - public function testUsernameCanBeSetAndFetched() - { - $auth = $this->_createHandler(array()); - $auth->setUsername('jack'); - $this->assertEquals('jack', $auth->getUsername()); - } - - public function testPasswordCanBeSetAndFetched() - { - $auth = $this->_createHandler(array()); - $auth->setPassword('pass'); - $this->assertEquals('pass', $auth->getPassword()); - } - - public function testAuthModeCanBeSetAndFetched() - { - $auth = $this->_createHandler(array()); - $auth->setAuthMode('PLAIN'); - $this->assertEquals('PLAIN', $auth->getAuthMode()); - } - - public function testMixinMethods() - { - $auth = $this->_createHandler(array()); - $mixins = $auth->exposeMixinMethods(); - $this->assertTrue(in_array('getUsername', $mixins), - '%s: getUsername() should be accessible via mixin' - ); - $this->assertTrue(in_array('setUsername', $mixins), - '%s: setUsername() should be accessible via mixin' - ); - $this->assertTrue(in_array('getPassword', $mixins), - '%s: getPassword() should be accessible via mixin' - ); - $this->assertTrue(in_array('setPassword', $mixins), - '%s: setPassword() should be accessible via mixin' - ); - $this->assertTrue(in_array('setAuthMode', $mixins), - '%s: setAuthMode() should be accessible via mixin' - ); - $this->assertTrue(in_array('getAuthMode', $mixins), - '%s: getAuthMode() should be accessible via mixin' - ); - } - - public function testAuthenticatorsAreCalledAccordingToParamsAfterEhlo() - { - $a1 = $this->_createMockAuthenticator('PLAIN'); - $a2 = $this->_createMockAuthenticator('LOGIN'); - - $a1->shouldReceive('authenticate') - ->never() - ->with($this->_agent, 'jack', 'pass'); - $a2->shouldReceive('authenticate') - ->once() - ->with($this->_agent, 'jack', 'pass') - ->andReturn(true); - - $auth = $this->_createHandler(array($a1, $a2)); - $auth->setUsername('jack'); - $auth->setPassword('pass'); - - $auth->setKeywordParams(array('CRAM-MD5', 'LOGIN')); - $auth->afterEhlo($this->_agent); - } - - public function testAuthenticatorsAreNotUsedIfNoUsernameSet() - { - $a1 = $this->_createMockAuthenticator('PLAIN'); - $a2 = $this->_createMockAuthenticator('LOGIN'); - - $a1->shouldReceive('authenticate') - ->never() - ->with($this->_agent, 'jack', 'pass'); - $a2->shouldReceive('authenticate') - ->never() - ->with($this->_agent, 'jack', 'pass') - ->andReturn(true); - - $auth = $this->_createHandler(array($a1, $a2)); - - $auth->setKeywordParams(array('CRAM-MD5', 'LOGIN')); - $auth->afterEhlo($this->_agent); - } - - public function testSeveralAuthenticatorsAreTriedIfNeeded() - { - $a1 = $this->_createMockAuthenticator('PLAIN'); - $a2 = $this->_createMockAuthenticator('LOGIN'); - - $a1->shouldReceive('authenticate') - ->once() - ->with($this->_agent, 'jack', 'pass') - ->andReturn(false); - $a2->shouldReceive('authenticate') - ->once() - ->with($this->_agent, 'jack', 'pass') - ->andReturn(true); - - $auth = $this->_createHandler(array($a1, $a2)); - $auth->setUsername('jack'); - $auth->setPassword('pass'); - - $auth->setKeywordParams(array('PLAIN', 'LOGIN')); - $auth->afterEhlo($this->_agent); - } - - public function testFirstAuthenticatorToPassBreaksChain() - { - $a1 = $this->_createMockAuthenticator('PLAIN'); - $a2 = $this->_createMockAuthenticator('LOGIN'); - $a3 = $this->_createMockAuthenticator('CRAM-MD5'); - - $a1->shouldReceive('authenticate') - ->once() - ->with($this->_agent, 'jack', 'pass') - ->andReturn(false); - $a2->shouldReceive('authenticate') - ->once() - ->with($this->_agent, 'jack', 'pass') - ->andReturn(true); - $a3->shouldReceive('authenticate') - ->never() - ->with($this->_agent, 'jack', 'pass'); - - $auth = $this->_createHandler(array($a1, $a2)); - $auth->setUsername('jack'); - $auth->setPassword('pass'); - - $auth->setKeywordParams(array('PLAIN', 'LOGIN', 'CRAM-MD5')); - $auth->afterEhlo($this->_agent); - } - - private function _createHandler($authenticators) - { - return new Swift_Transport_Esmtp_AuthHandler($authenticators); - } - - private function _createMockAuthenticator($type) - { - $authenticator = $this->getMockery('Swift_Transport_Esmtp_Authenticator')->shouldIgnoreMissing(); - $authenticator->shouldReceive('getAuthKeyword') - ->zeroOrMoreTimes() - ->andReturn($type); - - return $authenticator; - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php deleted file mode 100644 index c376336..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php +++ /dev/null @@ -1,529 +0,0 @@ -<?php - -require_once dirname(__DIR__) . '/EsmtpTransportTest.php'; - -interface Swift_Transport_EsmtpHandlerMixin extends Swift_Transport_EsmtpHandler -{ - public function setUsername($user); - - public function setPassword($pass); -} - -class Swift_Transport_EsmtpTransport_ExtensionSupportTest extends Swift_Transport_EsmtpTransportTest -{ - public function testExtensionHandlersAreSortedAsNeeded() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('STARTTLS') - ->andReturn(1); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext2->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('AUTH') - ->andReturn(-1); - $this->_finishBuffer($buf); - - $smtp->setExtensionHandlers(array($ext1, $ext2)); - $this->assertEquals(array($ext2, $ext1), $smtp->getExtensionHandlers()); - } - - public function testHandlersAreNotifiedOfParams() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .*?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('setKeywordParams') - ->once() - ->with(array('PLAIN', 'LOGIN')); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('setKeywordParams') - ->zeroOrMoreTimes() - ->with(array('123456')); - $this->_finishBuffer($buf); - - $smtp->setExtensionHandlers(array($ext1, $ext2)); - $smtp->start(); - } - - public function testSupportedExtensionHandlersAreRunAfterEhlo() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext3 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .*?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('afterEhlo') - ->once() - ->with($smtp); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('afterEhlo') - ->zeroOrMoreTimes() - ->with($smtp); - $ext3->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext3->shouldReceive('afterEhlo') - ->never() - ->with($smtp); - $this->_finishBuffer($buf); - - $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); - $smtp->start(); - } - - public function testExtensionsCanModifyMailFromParams() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(); - $smtp = new Swift_Transport_EsmtpTransport($buf, array(), $dispatcher); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext3 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('me@domain' => 'Me')); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => null)); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .*?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<me@domain> FOO ZIP\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<foo@bar>\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn("250 OK\r\n"); - $this->_finishBuffer($buf); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('getMailParams') - ->once() - ->andReturn('FOO'); - $ext1->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('AUTH') - ->andReturn(-1); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('getMailParams') - ->once() - ->andReturn('ZIP'); - $ext2->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('AUTH') - ->andReturn(1); - $ext3->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext3->shouldReceive('getMailParams') - ->never(); - - $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); - $smtp->start(); - $smtp->send($message); - } - - public function testExtensionsCanModifyRcptParams() - { - $buf = $this->_getBuffer(); - $dispatcher = $this->_createEventDispatcher(); - $smtp = new Swift_Transport_EsmtpTransport($buf, array(), $dispatcher); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext3 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $message = $this->_createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(array('me@domain' => 'Me')); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => null)); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:<me@domain>\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:<foo@bar> FOO ZIP\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn("250 OK\r\n"); - $this->_finishBuffer($buf); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('getRcptParams') - ->once() - ->andReturn('FOO'); - $ext1->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('AUTH') - ->andReturn(-1); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('getRcptParams') - ->once() - ->andReturn('ZIP'); - $ext2->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('AUTH') - ->andReturn(1); - $ext3->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext3->shouldReceive('getRcptParams') - ->never(); - - $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); - $smtp->start(); - $smtp->send($message); - } - - public function testExtensionsAreNotifiedOnCommand() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext3 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("FOO\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("250 Cool\r\n"); - $this->_finishBuffer($buf); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('onCommand') - ->once() - ->with($smtp, "FOO\r\n", array(250, 251), \Mockery::any(), \Mockery::any()); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('onCommand') - ->once() - ->with($smtp, "FOO\r\n", array(250, 251), \Mockery::any(), \Mockery::any()); - $ext3->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext3->shouldReceive('onCommand') - ->never() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); - $smtp->start(); - $smtp->executeCommand("FOO\r\n", array(250, 251)); - } - - public function testChainOfCommandAlgorithmWhenNotifyingExtensions() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext3 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - $buf->shouldReceive('write') - ->never() - ->with("FOO\r\n"); - $this->_finishBuffer($buf); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('onCommand') - ->once() - ->with($smtp, "FOO\r\n", array(250, 251), \Mockery::any(), \Mockery::any()) - ->andReturnUsing(function ($a, $b, $c, $d, &$e) { - $e = true; - - return '250 ok'; - }); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('onCommand') - ->never() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $ext3->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext3->shouldReceive('onCommand') - ->never() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); - $smtp->start(); - $smtp->executeCommand("FOO\r\n", array(250, 251)); - } - - public function testExtensionsCanExposeMixinMethods() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandlerMixin')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('exposeMixinMethods') - ->zeroOrMoreTimes() - ->andReturn(array('setUsername', 'setPassword')); - $ext1->shouldReceive('setUsername') - ->once() - ->with('mick'); - $ext1->shouldReceive('setPassword') - ->once() - ->with('pass'); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $this->_finishBuffer($buf); - - $smtp->setExtensionHandlers(array($ext1, $ext2)); - $smtp->setUsername('mick'); - $smtp->setPassword('pass'); - } - - public function testMixinMethodsBeginningWithSetAndNullReturnAreFluid() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandlerMixin')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('exposeMixinMethods') - ->zeroOrMoreTimes() - ->andReturn(array('setUsername', 'setPassword')); - $ext1->shouldReceive('setUsername') - ->once() - ->with('mick') - ->andReturn(null); - $ext1->shouldReceive('setPassword') - ->once() - ->with('pass') - ->andReturn(null); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $this->_finishBuffer($buf); - - $smtp->setExtensionHandlers(array($ext1, $ext2)); - $ret = $smtp->setUsername('mick'); - $this->assertEquals($smtp, $ret); - $ret = $smtp->setPassword('pass'); - $this->assertEquals($smtp, $ret); - } - - public function testMixinSetterWhichReturnValuesAreNotFluid() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandlerMixin')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('exposeMixinMethods') - ->zeroOrMoreTimes() - ->andReturn(array('setUsername', 'setPassword')); - $ext1->shouldReceive('setUsername') - ->once() - ->with('mick') - ->andReturn('x'); - $ext1->shouldReceive('setPassword') - ->once() - ->with('pass') - ->andReturn('x'); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $this->_finishBuffer($buf); - - $smtp->setExtensionHandlers(array($ext1, $ext2)); - $this->assertEquals('x', $smtp->setUsername('mick')); - $this->assertEquals('x', $smtp->setPassword('pass')); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php deleted file mode 100644 index e6cca15..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php +++ /dev/null @@ -1,297 +0,0 @@ -<?php - -class Swift_Transport_EsmtpTransportTest extends Swift_Transport_AbstractSmtpEventSupportTest -{ - protected function _getTransport($buf, $dispatcher = null) - { - if (!$dispatcher) { - $dispatcher = $this->_createEventDispatcher(); - } - - return new Swift_Transport_EsmtpTransport($buf, array(), $dispatcher); - } - - public function testHostCanBeSetAndFetched() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $smtp->setHost('foo'); - $this->assertEquals('foo', $smtp->getHost(), '%s: Host should be returned'); - } - - public function testPortCanBeSetAndFetched() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $smtp->setPort(25); - $this->assertEquals(25, $smtp->getPort(), '%s: Port should be returned'); - } - - public function testTimeoutCanBeSetAndFetched() - { - $buf = $this->_getBuffer(); - $buf->shouldReceive('setParam') - ->once() - ->with('timeout', 10); - - $smtp = $this->_getTransport($buf); - $smtp->setTimeout(10); - $this->assertEquals(10, $smtp->getTimeout(), '%s: Timeout should be returned'); - } - - public function testEncryptionCanBeSetAndFetched() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $smtp->setEncryption('tls'); - $this->assertEquals('tls', $smtp->getEncryption(), '%s: Crypto should be returned'); - } - - public function testStartSendsHeloToInitiate() - { - //Overridden for EHLO instead - } - - public function testStartSendsEhloToInitiate() - { - /* -- RFC 2821, 3.2. - - 3.2 Client Initiation - - Once the server has sent the welcoming message and the client has - received it, the client normally sends the EHLO command to the - server, indicating the client's identity. In addition to opening the - session, use of EHLO indicates that the client is able to process - service extensions and requests that the server provide a list of the - extensions it supports. Older SMTP systems which are unable to - support service extensions and contemporary clients which do not - require service extensions in the mail session being initiated, MAY - use HELO instead of EHLO. Servers MUST NOT return the extended - EHLO-style response to a HELO command. For a particular connection - attempt, if the server returns a "command not recognized" response to - EHLO, the client SHOULD be able to fall back and send HELO. - - In the EHLO command the host sending the command identifies itself; - the command may be interpreted as saying "Hello, I am <domain>" (and, - in the case of EHLO, "and I support service extension requests"). - - -- RFC 2281, 4.1.1.1. - - ehlo = "EHLO" SP Domain CRLF - helo = "HELO" SP Domain CRLF - - -- RFC 2821, 4.3.2. - - EHLO or HELO - S: 250 - E: 504, 550 - - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 ServerName'."\r\n"); - - $this->_finishBuffer($buf); - try { - $smtp->start(); - } catch (Exception $e) { - $this->fail('Starting Esmtp should send EHLO and accept 250 response'); - } - } - - public function testHeloIsUsedAsFallback() - { - /* -- RFC 2821, 4.1.4. - - If the EHLO command is not acceptable to the SMTP server, 501, 500, - or 502 failure replies MUST be returned as appropriate. The SMTP - server MUST stay in the same state after transmitting these replies - that it was in before the EHLO was received. - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('501 WTF'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^HELO .+?\r\n$~D') - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 HELO'."\r\n"); - - $this->_finishBuffer($buf); - try { - $smtp->start(); - } catch (Exception $e) { - $this->fail( - 'Starting Esmtp should fallback to HELO if needed and accept 250 response' - ); - } - } - - public function testInvalidHeloResponseCausesException() - { - //Overridden to first try EHLO - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('501 WTF'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^HELO .+?\r\n$~D') - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('504 WTF'."\r\n"); - $this->_finishBuffer($buf); - - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->fail('Non 250 HELO response should raise Exception'); - } catch (Exception $e) { - $this->assertFalse($smtp->isStarted(), '%s: SMTP start() should have failed'); - } - } - - public function testDomainNameIsPlacedInEhlo() - { - /* -- RFC 2821, 4.1.4. - - The SMTP client MUST, if possible, ensure that the domain parameter - to the EHLO command is a valid principal host name (not a CNAME or MX - name) for its host. If this is not possible (e.g., when the client's - address is dynamically assigned and the client does not have an - obvious name), an address literal SHOULD be substituted for the - domain name and supplemental information provided that will assist in - identifying the client. - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("EHLO mydomain.com\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 ServerName'."\r\n"); - - $this->_finishBuffer($buf); - $smtp->setLocalDomain('mydomain.com'); - $smtp->start(); - } - - public function testDomainNameIsPlacedInHelo() - { - //Overridden to include ESMTP - /* -- RFC 2821, 4.1.4. - - The SMTP client MUST, if possible, ensure that the domain parameter - to the EHLO command is a valid principal host name (not a CNAME or MX - name) for its host. If this is not possible (e.g., when the client's - address is dynamically assigned and the client does not have an - obvious name), an address literal SHOULD be substituted for the - domain name and supplemental information provided that will assist in - identifying the client. - */ - - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('501 WTF'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("HELO mydomain.com\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 ServerName'."\r\n"); - - $this->_finishBuffer($buf); - $smtp->setLocalDomain('mydomain.com'); - $smtp->start(); - } - - public function testFluidInterface() - { - $buf = $this->_getBuffer(); - $smtp = $this->_getTransport($buf); - $buf->shouldReceive('setParam') - ->once() - ->with('timeout', 30); - - $ref = $smtp - ->setHost('foo') - ->setPort(25) - ->setEncryption('tls') - ->setTimeout(30) - ; - $this->assertEquals($ref, $smtp); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php deleted file mode 100644 index e56e37f..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php +++ /dev/null @@ -1,518 +0,0 @@ -<?php - -class Swift_Transport_FailoverTransportTest extends \SwiftMailerTestCase -{ - public function testFirstTransportIsUsed() - { - $message1 = $this->getMockery('Swift_Mime_Message'); - $message2 = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState) { - return $connectionState; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState) { - if (!$connectionState) { - $connectionState = true; - } - }); - $t1->shouldReceive('send') - ->twice() - ->with(\Mockery::anyOf($message1, $message2), \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState) { - if ($connectionState) { - return 1; - } - }); - $t2->shouldReceive('start')->never(); - $t2->shouldReceive('send')->never(); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEquals(1, $transport->send($message1)); - $this->assertEquals(1, $transport->send($message2)); - } - - public function testMessageCanBeTriedOnNextTransportIfExceptionThrown() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - throw $e; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - return 1; - } - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEquals(1, $transport->send($message)); - } - - public function testZeroIsReturnedIfTransportReturnsZero() - { - $message = $this->getMockery('Swift_Mime_Message')->shouldIgnoreMissing(); - $t1 = $this->getMockery('Swift_Transport')->shouldIgnoreMissing(); - - $connectionState = false; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState) { - return $connectionState; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState) { - if (!$connectionState) { - $connectionState = true; - } - }); - $testCase = $this; - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState, $testCase) { - if (!$connectionState) { - $testCase->fail(); - } - - return 0; - }); - - $transport = $this->_getTransport(array($t1)); - $transport->start(); - $this->assertEquals(0, $transport->send($message)); - } - - public function testTransportsWhichThrowExceptionsAreNotRetried() - { - $e = new Swift_TransportException('maur b0rken'); - - $message1 = $this->getMockery('Swift_Mime_Message'); - $message2 = $this->getMockery('Swift_Mime_Message'); - $message3 = $this->getMockery('Swift_Mime_Message'); - $message4 = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - throw $e; - } - }); - $t1->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - $t1->shouldReceive('send') - ->never() - ->with($message3, \Mockery::any()); - $t1->shouldReceive('send') - ->never() - ->with($message4, \Mockery::any()); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->times(4) - ->with(\Mockery::anyOf($message1, $message2, $message3, $message4), \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - return 1; - } - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEquals(1, $transport->send($message1)); - $this->assertEquals(1, $transport->send($message2)); - $this->assertEquals(1, $transport->send($message3)); - $this->assertEquals(1, $transport->send($message4)); - } - - public function testExceptionIsThrownIfAllTransportsDie() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - throw $e; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - throw $e; - } - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - } - } - - public function testStoppingTransportStopsAllDelegates() - { - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $connectionState1 = true; - $connectionState2 = true; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('stop') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if ($connectionState1) { - $connectionState1 = false; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('stop') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if ($connectionState2) { - $connectionState2 = false; - } - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $transport->stop(); - } - - public function testTransportShowsAsNotStartedIfAllDelegatesDead() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - $connectionState1 = false; - throw $e; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - $connectionState2 = false; - throw $e; - } - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - } - - public function testRestartingTransportRestartsDeadDelegates() - { - $e = new Swift_TransportException('b0rken'); - - $message1 = $this->getMockery('Swift_Mime_Message'); - $message2 = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->twice() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - $connectionState1 = false; - throw $e; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message2, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1) { - if ($connectionState1) { - return 10; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - $connectionState2 = false; - throw $e; - } - }); - $t2->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message1); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - //Restart and re-try - $transport->start(); - $this->assertTrue($transport->isStarted()); - $this->assertEquals(10, $transport->send($message2)); - } - - public function testFailureReferenceIsPassedToDelegates() - { - $failures = array(); - - $message = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - - $connectionState = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use ($connectionState) { - return $connectionState; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use ($connectionState) { - if (!$connectionState) { - $connectionState = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, $failures) - ->andReturnUsing(function () use ($connectionState) { - if ($connectionState) { - return 1; - } - }); - - $transport = $this->_getTransport(array($t1)); - $transport->start(); - $transport->send($message, $failures); - } - - public function testRegisterPluginDelegatesToLoadedTransports() - { - $plugin = $this->_createPlugin(); - - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $t1->shouldReceive('registerPlugin') - ->once() - ->with($plugin); - $t2->shouldReceive('registerPlugin') - ->once() - ->with($plugin); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->registerPlugin($plugin); - } - - private function _getTransport(array $transports) - { - $transport = new Swift_Transport_FailoverTransport(); - $transport->setTransports($transports); - - return $transport; - } - - private function _createPlugin() - { - return $this->getMockery('Swift_Events_EventListener'); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php deleted file mode 100644 index f6bb819..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php +++ /dev/null @@ -1,749 +0,0 @@ -<?php - -class Swift_Transport_LoadBalancedTransportTest extends \SwiftMailerTestCase -{ - public function testEachTransportIsUsedInTurn() - { - $message1 = $this->getMockery('Swift_Mime_Message'); - $message2 = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $testCase) { - if ($connectionState1) { - return 1; - } - $testCase->fail(); - }); - $t1->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message2, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $testCase) { - if ($connectionState2) { - return 1; - } - $testCase->fail(); - }); - $t2->shouldReceive('send') - ->never() - ->with($message1, \Mockery::any()); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEquals(1, $transport->send($message1)); - $this->assertEquals(1, $transport->send($message2)); - } - - public function testTransportsAreReusedInRotatingFashion() - { - $message1 = $this->getMockery('Swift_Mime_Message'); - $message2 = $this->getMockery('Swift_Mime_Message'); - $message3 = $this->getMockery('Swift_Mime_Message'); - $message4 = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $testCase) { - if ($connectionState1) { - return 1; - } - $testCase->fail(); - }); - $t1->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - $t1->shouldReceive('send') - ->once() - ->with($message3, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $testCase) { - if ($connectionState1) { - return 1; - } - $testCase->fail(); - }); - $t1->shouldReceive('send') - ->never() - ->with($message4, \Mockery::any()); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message2, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $testCase) { - if ($connectionState2) { - return 1; - } - $testCase->fail(); - }); - $t2->shouldReceive('send') - ->never() - ->with($message1, \Mockery::any()); - $t2->shouldReceive('send') - ->once() - ->with($message4, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $testCase) { - if ($connectionState2) { - return 1; - } - $testCase->fail(); - }); - $t2->shouldReceive('send') - ->never() - ->with($message3, \Mockery::any()); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - - $this->assertEquals(1, $transport->send($message1)); - $this->assertEquals(1, $transport->send($message2)); - $this->assertEquals(1, $transport->send($message3)); - $this->assertEquals(1, $transport->send($message4)); - } - - public function testMessageCanBeTriedOnNextTransportIfExceptionThrown() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e, $testCase) { - if ($connectionState1) { - throw $e; - } - $testCase->fail(); - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $testCase) { - if ($connectionState2) { - return 1; - } - $testCase->fail(); - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEquals(1, $transport->send($message)); - } - - public function testMessageIsTriedOnNextTransportIfZeroReturned() - { - $message = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1) { - if ($connectionState1) { - return 0; - } - - return 1; - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2) { - if ($connectionState2) { - return 1; - } - - return 0; - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEquals(1, $transport->send($message)); - } - - public function testZeroIsReturnedIfAllTransportsReturnZero() - { - $message = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1) { - if ($connectionState1) { - return 0; - } - - return 1; - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2) { - if ($connectionState2) { - return 0; - } - - return 1; - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEquals(0, $transport->send($message)); - } - - public function testTransportsWhichThrowExceptionsAreNotRetried() - { - $e = new Swift_TransportException('maur b0rken'); - - $message1 = $this->getMockery('Swift_Mime_Message'); - $message2 = $this->getMockery('Swift_Mime_Message'); - $message3 = $this->getMockery('Swift_Mime_Message'); - $message4 = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e, $testCase) { - if ($connectionState1) { - throw $e; - } - $testCase->fail(); - }); - $t1->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - $t1->shouldReceive('send') - ->never() - ->with($message3, \Mockery::any()); - $t1->shouldReceive('send') - ->never() - ->with($message4, \Mockery::any()); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->times(4) - ->with(\Mockery::anyOf($message1, $message3, $message3, $message4), \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $testCase) { - if ($connectionState2) { - return 1; - } - $testCase->fail(); - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertEquals(1, $transport->send($message1)); - $this->assertEquals(1, $transport->send($message2)); - $this->assertEquals(1, $transport->send($message3)); - $this->assertEquals(1, $transport->send($message4)); - } - - public function testExceptionIsThrownIfAllTransportsDie() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - throw $e; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - throw $e; - } - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - } - } - - public function testStoppingTransportStopsAllDelegates() - { - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = true; - $connectionState2 = true; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('stop') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if ($connectionState1) { - $connectionState1 = false; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('stop') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if ($connectionState2) { - $connectionState2 = false; - } - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $transport->stop(); - } - - public function testTransportShowsAsNotStartedIfAllDelegatesDead() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - throw $e; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - throw $e; - } - }); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - } - - public function testRestartingTransportRestartsDeadDelegates() - { - $e = new Swift_TransportException('b0rken'); - - $message1 = $this->getMockery('Swift_Mime_Message'); - $message2 = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->twice() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - $connectionState1 = false; - throw $e; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message2, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - return 10; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - throw $e; - } - }); - $t2->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message1); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - //Restart and re-try - $transport->start(); - $this->assertTrue($transport->isStarted()); - $this->assertEquals(10, $transport->send($message2)); - } - - public function testFailureReferenceIsPassedToDelegates() - { - $failures = array(); - $testCase = $this; - - $message = $this->getMockery('Swift_Mime_Message'); - $t1 = $this->getMockery('Swift_Transport'); - $connectionState = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState) { - return $connectionState; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState) { - if (!$connectionState) { - $connectionState = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::on(function (&$var) use (&$failures, $testCase) { - return $testCase->varsAreReferences($var, $failures); - })) - ->andReturnUsing(function () use (&$connectionState) { - if ($connectionState) { - return 1; - } - }); - - $transport = $this->_getTransport(array($t1)); - $transport->start(); - $transport->send($message, $failures); - } - - public function testRegisterPluginDelegatesToLoadedTransports() - { - $plugin = $this->_createPlugin(); - - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $t1->shouldReceive('registerPlugin') - ->once() - ->with($plugin); - $t2->shouldReceive('registerPlugin') - ->once() - ->with($plugin); - - $transport = $this->_getTransport(array($t1, $t2)); - $transport->registerPlugin($plugin); - } - - /** - * Adapted from Yay_Matchers_ReferenceMatcher. - */ - public function varsAreReferences(&$ref1, &$ref2) - { - if (is_object($ref2)) { - return $ref1 === $ref2; - } - if ($ref1 !== $ref2) { - return false; - } - - $copy = $ref2; - $randomString = uniqid('yay'); - $ref2 = $randomString; - $isRef = ($ref1 === $ref2); - $ref2 = $copy; - - return $isRef; - } - - private function _getTransport(array $transports) - { - $transport = new Swift_Transport_LoadBalancedTransport(); - $transport->setTransports($transports); - - return $transport; - } - - private function _createPlugin() - { - return $this->getMockery('Swift_Events_EventListener'); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/MailTransportTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/MailTransportTest.php deleted file mode 100644 index 6672a3d..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/MailTransportTest.php +++ /dev/null @@ -1,533 +0,0 @@ -<?php - -/** - * @group legacy - */ -class Swift_Transport_MailTransportTest extends \SwiftMailerTestCase -{ - public function testTransportInvokesMailOncePerMessage() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessageWithRecipient($headers); - - $invoker->shouldReceive('mail') - ->once(); - - $transport->send($message); - } - - public function testTransportUsesToFieldBodyInSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $to = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'To' => $to, - )); - $message = $this->_createMessageWithRecipient($headers); - - $to->shouldReceive('getFieldBody') - ->zeroOrMoreTimes() - ->andReturn('Foo <foo@bar>'); - $invoker->shouldReceive('mail') - ->once() - ->with('Foo <foo@bar>', \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $transport->send($message); - } - - public function testTransportUsesSubjectFieldBodyInSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $subj = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'Subject' => $subj, - )); - $message = $this->_createMessageWithRecipient($headers); - - $subj->shouldReceive('getFieldBody') - ->zeroOrMoreTimes() - ->andReturn('Thing'); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), 'Thing', \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $transport->send($message); - } - - public function testTransportUsesBodyOfMessage() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessageWithRecipient($headers); - - $message->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn( - "To: Foo <foo@bar>\r\n". - "\r\n". - 'This body' - ); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), 'This body', \Mockery::any(), \Mockery::any()); - - $transport->send($message); - } - - public function testTransportSettingUsingReturnPathForExtraParams() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessageWithRecipient($headers); - - $message->shouldReceive('getReturnPath') - ->zeroOrMoreTimes() - ->andReturn( - 'foo@bar' - ); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), '-ffoo@bar'); - - $transport->send($message); - } - - public function testTransportSettingEmptyExtraParams() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessageWithRecipient($headers); - - $message->shouldReceive('getReturnPath') - ->zeroOrMoreTimes() - ->andReturn(null); - $message->shouldReceive('getSender') - ->zeroOrMoreTimes() - ->andReturn(null); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(null); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), null); - - $transport->send($message); - } - - public function testTransportSettingSettingExtraParamsWithF() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - $transport->setExtraParams('-x\'foo\' -f%s'); - - $headers = $this->_createHeaders(); - $message = $this->_createMessageWithRecipient($headers); - - $message->shouldReceive('getReturnPath') - ->zeroOrMoreTimes() - ->andReturn( - 'foo@bar' - ); - $message->shouldReceive('getSender') - ->zeroOrMoreTimes() - ->andReturn(null); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(null); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), '-x\'foo\' -ffoo@bar'); - - $transport->send($message); - } - - public function testTransportSettingSettingExtraParamsWithoutF() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - $transport->setExtraParams('-x\'foo\''); - - $headers = $this->_createHeaders(); - $message = $this->_createMessageWithRecipient($headers); - - $message->shouldReceive('getReturnPath') - ->zeroOrMoreTimes() - ->andReturn( - 'foo@bar' - ); - $message->shouldReceive('getSender') - ->zeroOrMoreTimes() - ->andReturn(null); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(null); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), '-x\'foo\''); - - $transport->send($message); - } - - public function testTransportSettingInvalidFromEmail() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessageWithRecipient($headers); - - $message->shouldReceive('getReturnPath') - ->zeroOrMoreTimes() - ->andReturn( - '"attacker\" -oQ/tmp/ -X/var/www/cache/phpcode.php "@email.com' - ); - $message->shouldReceive('getSender') - ->zeroOrMoreTimes() - ->andReturn(null); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(null); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), null); - - $transport->send($message); - } - - public function testTransportUsesHeadersFromMessage() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessageWithRecipient($headers); - - $message->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn( - "Subject: Stuff\r\n". - "\r\n". - 'This body' - ); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), 'Subject: Stuff'.PHP_EOL, \Mockery::any()); - - $transport->send($message); - } - - public function testTransportReturnsCountOfAllRecipientsIfInvokerReturnsTrue() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessage($headers); - - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => null, 'zip@button' => null)); - $message->shouldReceive('getCc') - ->zeroOrMoreTimes() - ->andReturn(array('test@test' => null)); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn(true); - - $this->assertEquals(3, $transport->send($message)); - } - - public function testTransportReturnsZeroIfInvokerReturnsFalse() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessage($headers); - - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => null, 'zip@button' => null)); - $message->shouldReceive('getCc') - ->zeroOrMoreTimes() - ->andReturn(array('test@test' => null)); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn(false); - - $this->assertEquals(0, $transport->send($message)); - } - - public function testToHeaderIsRemovedFromHeaderSetDuringSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $to = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'To' => $to, - )); - $message = $this->_createMessageWithRecipient($headers); - - $headers->shouldReceive('remove') - ->once() - ->with('To'); - $headers->shouldReceive('remove') - ->zeroOrMoreTimes(); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $transport->send($message); - } - - public function testSubjectHeaderIsRemovedFromHeaderSetDuringSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $subject = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'Subject' => $subject, - )); - $message = $this->_createMessageWithRecipient($headers); - - $headers->shouldReceive('remove') - ->once() - ->with('Subject'); - $headers->shouldReceive('remove') - ->zeroOrMoreTimes(); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $transport->send($message); - } - - public function testToHeaderIsPutBackAfterSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $to = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'To' => $to, - )); - $message = $this->_createMessageWithRecipient($headers); - - $headers->shouldReceive('set') - ->once() - ->with($to); - $headers->shouldReceive('set') - ->zeroOrMoreTimes(); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $transport->send($message); - } - - public function testSubjectHeaderIsPutBackAfterSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $subject = $this->_createHeader(); - $headers = $this->_createHeaders(array( - 'Subject' => $subject, - )); - $message = $this->_createMessageWithRecipient($headers); - - $headers->shouldReceive('set') - ->once() - ->with($subject); - $headers->shouldReceive('set') - ->zeroOrMoreTimes(); - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $transport->send($message); - } - - public function testMessageHeadersOnlyHavePHPEolsDuringSending() - { - $invoker = $this->_createInvoker(); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $subject = $this->_createHeader(); - $subject->shouldReceive('getFieldBody')->andReturn("Foo\r\nBar"); - - $headers = $this->_createHeaders(array( - 'Subject' => $subject, - )); - $message = $this->_createMessageWithRecipient($headers); - $message->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn( - "From: Foo\r\n<foo@bar>\r\n". - "\r\n". - "This\r\n". - 'body' - ); - - if ("\r\n" != PHP_EOL) { - $expectedHeaders = "From: Foo\n<foo@bar>\n"; - $expectedSubject = "Foo\nBar"; - $expectedBody = "This\nbody"; - } else { - $expectedHeaders = "From: Foo\r\n<foo@bar>\r\n"; - $expectedSubject = "Foo\r\nBar"; - $expectedBody = "This\r\nbody"; - } - - $invoker->shouldReceive('mail') - ->once() - ->with(\Mockery::any(), $expectedSubject, $expectedBody, $expectedHeaders, \Mockery::any()); - - $transport->send($message); - } - - /** - * @expectedException \Swift_TransportException - * @expectedExceptionMessage Cannot send message without a recipient - */ - public function testExceptionWhenNoRecipients() - { - $invoker = $this->_createInvoker(); - $invoker->shouldReceive('mail'); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessage($headers); - - $transport->send($message); - } - - public function noExceptionWhenRecipientsExistProvider() - { - return array( - array('To'), - array('Cc'), - array('Bcc'), - ); - } - - /** - * @dataProvider noExceptionWhenRecipientsExistProvider - * - * @param string $header - */ - public function testNoExceptionWhenRecipientsExist($header) - { - $invoker = $this->_createInvoker(); - $invoker->shouldReceive('mail'); - $dispatcher = $this->_createEventDispatcher(); - $transport = $this->_createTransport($invoker, $dispatcher); - - $headers = $this->_createHeaders(); - $message = $this->_createMessage($headers); - $message->shouldReceive(sprintf('get%s', $header))->andReturn(array('foo@bar' => 'Foo')); - - $transport->send($message); - } - - private function _createTransport($invoker, $dispatcher) - { - return new Swift_Transport_MailTransport($invoker, $dispatcher); - } - - private function _createEventDispatcher() - { - return $this->getMockery('Swift_Events_EventDispatcher')->shouldIgnoreMissing(); - } - - private function _createInvoker() - { - return $this->getMockery('Swift_Transport_MailInvoker'); - } - - private function _createMessage($headers) - { - $message = $this->getMockery('Swift_Mime_Message')->shouldIgnoreMissing(); - $message->shouldReceive('getHeaders') - ->zeroOrMoreTimes() - ->andReturn($headers); - - return $message; - } - - private function _createMessageWithRecipient($headers, $recipient = array('foo@bar' => 'Foo')) - { - $message = $this->_createMessage($headers); - $message->shouldReceive('getTo')->andReturn($recipient); - - return $message; - } - - private function _createHeaders($headers = array()) - { - $set = $this->getMockery('Swift_Mime_HeaderSet')->shouldIgnoreMissing(); - - if (count($headers) > 0) { - foreach ($headers as $name => $header) { - $set->shouldReceive('get') - ->zeroOrMoreTimes() - ->with($name) - ->andReturn($header); - $set->shouldReceive('has') - ->zeroOrMoreTimes() - ->with($name) - ->andReturn(true); - } - } - - $header = $this->_createHeader(); - $set->shouldReceive('get') - ->zeroOrMoreTimes() - ->andReturn($header); - $set->shouldReceive('has') - ->zeroOrMoreTimes() - ->andReturn(true); - - return $set; - } - - private function _createHeader() - { - return $this->getMockery('Swift_Mime_Header')->shouldIgnoreMissing(); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php deleted file mode 100644 index 9040f9e..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php +++ /dev/null @@ -1,151 +0,0 @@ -<?php - -class Swift_Transport_SendmailTransportTest extends Swift_Transport_AbstractSmtpEventSupportTest -{ - protected function _getTransport($buf, $dispatcher = null, $command = '/usr/sbin/sendmail -bs') - { - if (!$dispatcher) { - $dispatcher = $this->_createEventDispatcher(); - } - $transport = new Swift_Transport_SendmailTransport($buf, $dispatcher); - $transport->setCommand($command); - - return $transport; - } - - protected function _getSendmail($buf, $dispatcher = null) - { - if (!$dispatcher) { - $dispatcher = $this->_createEventDispatcher(); - } - $sendmail = new Swift_Transport_SendmailTransport($buf, $dispatcher); - - return $sendmail; - } - - public function testCommandCanBeSetAndFetched() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getSendmail($buf); - - $sendmail->setCommand('/usr/sbin/sendmail -bs'); - $this->assertEquals('/usr/sbin/sendmail -bs', $sendmail->getCommand()); - $sendmail->setCommand('/usr/sbin/sendmail -oi -t'); - $this->assertEquals('/usr/sbin/sendmail -oi -t', $sendmail->getCommand()); - } - - public function testSendingMessageIn_t_ModeUsesSimplePipe() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getSendmail($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => 'Foobar', 'zip@button' => 'Zippy')); - $message->shouldReceive('toByteStream') - ->once() - ->with($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('terminate') - ->once(); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(array("\r\n" => "\n", "\n." => "\n..")); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(array()); - - $sendmail->setCommand('/usr/sbin/sendmail -t'); - $this->assertEquals(2, $sendmail->send($message)); - } - - public function testSendingIn_t_ModeWith_i_FlagDoesntEscapeDot() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getSendmail($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => 'Foobar', 'zip@button' => 'Zippy')); - $message->shouldReceive('toByteStream') - ->once() - ->with($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('terminate') - ->once(); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(array("\r\n" => "\n")); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(array()); - - $sendmail->setCommand('/usr/sbin/sendmail -i -t'); - $this->assertEquals(2, $sendmail->send($message)); - } - - public function testSendingInTModeWith_oi_FlagDoesntEscapeDot() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getSendmail($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => 'Foobar', 'zip@button' => 'Zippy')); - $message->shouldReceive('toByteStream') - ->once() - ->with($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('terminate') - ->once(); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(array("\r\n" => "\n")); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(array()); - - $sendmail->setCommand('/usr/sbin/sendmail -oi -t'); - $this->assertEquals(2, $sendmail->send($message)); - } - - public function testSendingMessageRegeneratesId() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getSendmail($buf); - $message = $this->_createMessage(); - - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(array('foo@bar' => 'Foobar', 'zip@button' => 'Zippy')); - $message->shouldReceive('generateId'); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('terminate') - ->once(); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(array("\r\n" => "\n", "\n." => "\n..")); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(array()); - - $sendmail->setCommand('/usr/sbin/sendmail -t'); - $this->assertEquals(2, $sendmail->send($message)); - } - - public function testFluidInterface() - { - $buf = $this->_getBuffer(); - $sendmail = $this->_getTransport($buf); - - $ref = $sendmail->setCommand('/foo'); - $this->assertEquals($ref, $sendmail); - } -} diff --git a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php b/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php deleted file mode 100644 index 5109b56..0000000 --- a/boilerplate/test/src/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -class Swift_Transport_StreamBufferTest extends \PHPUnit_Framework_TestCase -{ - public function testSettingWriteTranslationsCreatesFilters() - { - $factory = $this->_createFactory(); - $factory->expects($this->once()) - ->method('createFilter') - ->with('a', 'b') - ->will($this->returnCallback(array($this, '_createFilter'))); - - $buffer = $this->_createBuffer($factory); - $buffer->setWriteTranslations(array('a' => 'b')); - } - - public function testOverridingTranslationsOnlyAddsNeededFilters() - { - $factory = $this->_createFactory(); - $factory->expects($this->exactly(2)) - ->method('createFilter') - ->will($this->returnCallback(array($this, '_createFilter'))); - - $buffer = $this->_createBuffer($factory); - $buffer->setWriteTranslations(array('a' => 'b')); - $buffer->setWriteTranslations(array('x' => 'y', 'a' => 'b')); - } - - private function _createBuffer($replacementFactory) - { - return new Swift_Transport_StreamBuffer($replacementFactory); - } - - private function _createFactory() - { - return $this->getMockBuilder('Swift_ReplacementFilterFactory')->getMock(); - } - - public function _createFilter() - { - return $this->getMockBuilder('Swift_StreamFilter')->getMock(); - } -} diff --git a/php/7.4-cli/Dockerfile b/php/7.4-cli/Dockerfile index 87ab2ab..1f275ce 100644 --- a/php/7.4-cli/Dockerfile +++ b/php/7.4-cli/Dockerfile @@ -1,5 +1,5 @@ # Use an official Python runtime as a base image -FROM php:7.3-cli +FROM php:7.4-cli RUN apt-get update && \ apt-get install --yes --force-yes \ diff --git a/php/8.0-cli/Dockerfile b/php/8.0-cli/Dockerfile new file mode 100644 index 0000000..bf91643 --- /dev/null +++ b/php/8.0-cli/Dockerfile @@ -0,0 +1,46 @@ +# Use an official Python runtime as a base image +FROM php:8.0-cli + +RUN apt-get update && \ + apt-get install --yes --force-yes \ + cron g++ gettext libicu-dev openssl \ + libc-client-dev libkrb5-dev \ + libxml2-dev libfreetype6-dev \ + libgd-dev libmcrypt-dev bzip2 \ + libbz2-dev libtidy-dev libcurl4-openssl-dev \ + libz-dev libmemcached-dev libxslt-dev git-core libpq-dev \ + libzip4 libzip-dev libwebp-dev + + +# PHP Configuration +RUN docker-php-ext-install bcmath bz2 calendar dba exif gettext intl soap tidy xsl zip&&\ + docker-php-ext-install mysqli pgsql pdo pdo_mysql pdo_pgsql &&\ + docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp &&\ + docker-php-ext-install gd &&\ + docker-php-ext-configure imap --with-kerberos --with-imap-ssl &&\ + docker-php-ext-install imap &&\ + docker-php-ext-configure hash --with-mhash &&\ + pecl install xdebug && docker-php-ext-enable xdebug &&\ + pecl install mongodb && docker-php-ext-enable mongodb &&\ + pecl install redis && docker-php-ext-enable redis && \ + curl -sS https://getcomposer.org/installer | php \ + && mv composer.phar /usr/bin/composer + +# Apache Configuration +#RUN a2enmod rewrite + +# SSL +#RUN mv /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-available/000-default-ssl.conf &&\ +# a2enmod ssl && \ +# a2ensite 000-default-ssl &&\ +# openssl req -subj '/CN=example.com/O=My Company Name LTD./C=US' -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem +# +#EXPOSE 443 + +# Imagemagick +#RUN apt-get install --yes --force-yes libmagickwand-dev libmagickcore-dev +#RUN yes '' | pecl install -f imagick &&\ +# docker-php-ext-enable imagick + +#COPY create_vhost start /usr/local/bin/ +COPY php.ini /usr/local/etc/php/ diff --git a/php/8.0-cli/README.md b/php/8.0-cli/README.md new file mode 100644 index 0000000..051e537 --- /dev/null +++ b/php/8.0-cli/README.md @@ -0,0 +1,5 @@ +# canals/php:7.1-cli, latest + +##Image docker PHP +Basée sur l'iamge officielle `php:7.1-cli` + diff --git a/php/8.0-cli/php.ini b/php/8.0-cli/php.ini new file mode 100644 index 0000000..b075fef --- /dev/null +++ b/php/8.0-cli/php.ini @@ -0,0 +1,1089 @@ +[PHP] + + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + + +engine = On +short_open_tag = Off +precision = 14 +output_buffering = 4096 +zlib.output_compression = Off +implicit_flush = Off + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +max_execution_time = 60 +max_input_time = 60 +memory_limit = 512M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +error_reporting = E_ALL +display_errors = On +display_startup_errors = On +log_errors = On +log_errors_max_len = 1024 +ignore_repeated_errors = Off +ignore_repeated_source = Off +report_memleaks = On + +html_errors = On + + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +variables_order = "GPCS" + +request_order = "GP" + +register_argc_argv = Off +auto_globals_jit = On + +post_max_size = 16M +default_mimetype = "text/html" +default_charset = "UTF-8" + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; +enable_dl = Off + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +file_uploads = On +upload_max_filesize = 8M +max_file_uploads = 25 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; +allow_url_fopen = On + +allow_url_include = Off + +default_socket_timeout = 60 + + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +;date.timezone = + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +;Enables or disables JIT compilation of patterns. This requires the PCRE +;library to be compiled with JIT support. +;pcre.jit=1 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[SQL] +; http://php.net/sql.safe-mode +sql.safe_mode = Off + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = On + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Set session ID character length. This value could be between 22 to 256. +; Shorter length than default is supported only for compatibility reason. +; Users should use 32 or more chars. +; http://php.net/session.sid-length +; Default Value: 32 +; Development Value: 26 +; Production Value: 26 +session.sid_length = 26 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; <form> is special; if you include them here, the rewriter will +; add a hidden <input> field with the info which is otherwise appended +; to URLs. <form> tag's action attribute URL will not be modified +; unless it is specified. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=" +; Development Value: "a=href,area=href,frame=src,form=" +; Production Value: "a=href,area=href,frame=src,form=" +; http://php.net/url-rewriter.tags +session.trans_sid_tags = "a=href,area=href,frame=src,form=" + +; URL rewriter does not rewrite absolute URLs by default. +; To enable rewrites for absolute pathes, target hosts must be specified +; at RUNTIME. i.e. use ini_set() +; <form> tags is special. PHP will check action attribute's URL regardless +; of session.trans_sid_tags setting. +; If no host is defined, HTTP_HOST will be used for allowed host. +; Example value: php.net,www.php.net,wiki.php.net +; Use "," for multiple hosts. No spaces are allowed. +; Default Value: "" +; Development Value: "" +; Production Value: "" +;session.trans_sid_hosts="" + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.sid_bits_per_character = 5 + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +; Only write session data when session data is changed. Enabled by default. +; http://php.net/session.lazy-write +;session.lazy_write = On + +[Assertion] +; Switch whether to compile assertions at all (to have no overhead at run-time) +; -1: Do not compile at all +; 0: Jump over assertion at run-time +; 1: Execute assertions +; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 +; http://php.net/zend.assertions +zend.assertions = 1 + +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Throw an AssertationException on failed assertions +; http://php.net/assert.exception +;assert.exception = On + +; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstring.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 1 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[mcrypt] +; For more information about mcrypt settings see http://php.net/mcrypt-module-open + +; Directory where to load mcrypt algorithms +; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) +;mcrypt.algorithms_dir= + +; Directory where to load mcrypt modes +; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) +;mcrypt.modes_dir= + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=0 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=8 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +; Depending on the used Memory Manager this may cause some incompatibilities. +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Allows calling OPcache API functions only from PHP scripts which path is +; started from specified string. The default "" means no restriction +;opcache.restrict_api= + +; Mapping base of shared memory segments (for Windows only). All the PHP +; processes have to map shared memory into the same address space. This +; directive allows to manually fix the "Unable to reattach to base address" +; errors. +;opcache.mmap_base= + +; Enables and sets the second level cache directory. +; It should improve performance when SHM memory is full, at server restart or +; SHM reset. The default "" disables file based caching. +;opcache.file_cache= + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; Enables or disables checksum validation when script loaded from file cache. +;opcache.file_cache_consistency_checks=1 + +; Implies opcache.file_cache_only=1 for a certain process that failed to +; reattach to the shared memory (for Windows only). Explicitly enabled file +; cache is required. +;opcache.file_cache_fallback=1 + +; Enables or disables copying of PHP code (text segment) into HUGE PAGES. +; This should improve performance, but requires appropriate OS configuration. +;opcache.huge_code_pages=0 + +; Validate cached file permissions. +;opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +;opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: diff --git a/php/8.0/Dockerfile b/php/8.0/Dockerfile new file mode 100644 index 0000000..5793e00 --- /dev/null +++ b/php/8.0/Dockerfile @@ -0,0 +1,49 @@ +# Use an official Python runtime as a base image +FROM php:8.0-apache + +RUN apt-get update && \ + apt-get install --yes --force-yes \ + cron g++ gettext libicu-dev openssl \ + libc-client-dev libkrb5-dev \ + libxml2-dev libfreetype6-dev \ + libgd-dev libmcrypt-dev bzip2 \ + libbz2-dev libtidy-dev libcurl4-openssl-dev \ + libz-dev libmemcached-dev libxslt-dev git-core libpq-dev \ + libzip4 libzip-dev libwebp-dev + + +# PHP Configuration +RUN docker-php-ext-install bcmath bz2 calendar dba exif gettext intl soap tidy xsl zip&&\ + docker-php-ext-install mysqli pgsql pdo pdo_mysql pdo_pgsql &&\ + docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp &&\ + docker-php-ext-install gd &&\ + docker-php-ext-configure imap --with-kerberos --with-imap-ssl &&\ + docker-php-ext-install imap &&\ + docker-php-ext-configure hash --with-mhash &&\ + pecl install xdebug && docker-php-ext-enable xdebug &&\ + pecl install mongodb && docker-php-ext-enable mongodb &&\ + pecl install redis && docker-php-ext-enable redis && \ + curl -sS https://getcomposer.org/installer | php \ + && mv composer.phar /usr/bin/composer + +# Apache Configuration +RUN a2enmod rewrite + +# SSL +RUN mv /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-available/000-default-ssl.conf &&\ + a2enmod ssl && \ + a2ensite 000-default-ssl &&\ + openssl req -subj '/CN=example.com/O=My Company Name LTD./C=US' -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem + +EXPOSE 443 + +# Imagemagick : install fails on 8.0 +RUN apt-get install --yes --force-yes libmagickwand-dev libmagickcore-dev +#RUN yes '' | pecl install -f imagick &&\ +# docker-php-ext-enable imagick + +COPY create_vhost config-vhost start /usr/local/bin/ +COPY php.ini /usr/local/etc/php/ + + +CMD ["start"] \ No newline at end of file diff --git a/php/8.0/README.md b/php/8.0/README.md new file mode 100644 index 0000000..31bec9e --- /dev/null +++ b/php/8.0/README.md @@ -0,0 +1,5 @@ +# canals/php:7.2, latest + +##Image docker PHP +Basée sur l'iamge officielle `php:7.2-apache` + diff --git a/php/8.0/config-vhost b/php/8.0/config-vhost new file mode 100755 index 0000000..a55c464 --- /dev/null +++ b/php/8.0/config-vhost @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +if [ -z "$VHOST_HOSTNAME" -o -z "$VHOST_DOCROOT" ]; then + echo "dont create vhost : hostname or docroot empty" +# +# +else + echo "configuring vhost : create_vhost -d $VHOST_DOCROOT -n $VHOST_HOSTNAME" + /usr/local/bin/create_vhost -d $VHOST_DOCROOT -n $VHOST_HOSTNAME +# echo "create cert : openssl req -subj '/CN=$VHOST_HOSTNAME/O=dev. team/C=fr' -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout /etc/ssl/private/$VHOST_HOSTNAME.key -out /etc/ssl/certs/$VHOST_HOSTNAME.pem" + openssl req -subj '/CN=$VHOST_HOSTNAME/O=dev. team/C=fr' -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout /etc/ssl/private/$VHOST_HOSTNAME.key -out /etc/ssl/certs/$VHOST_HOSTNAME.pem +# echo "create ssl vhost : create_vhost -d $VHOST_DOCROOT -s $VHOST_HOSTNAME" + /usr/local/bin/create_vhost -d $VHOST_DOCROOT -n $VHOST_HOSTNAME -s yes + +fi + +#echo "start apache foreground" +#apache2-foreground \ No newline at end of file diff --git a/php/8.0/create_vhost b/php/8.0/create_vhost new file mode 100755 index 0000000..25fa2d3 --- /dev/null +++ b/php/8.0/create_vhost @@ -0,0 +1,159 @@ +#!/usr/bin/env bash + +function show_usage { +cat <<- _EOF_ + +Create a new vHost in Debian/Ubuntu Server +Assumes /etc/apache2/sites-available and /etc/apache2/sites-enabled setup used + + -d DocumentRoot - i.e. /var/www/yoursite + -h Help - Show this menu. + -n ServerName - i.e. example.com or sub.example.com + -a ServerAlias - i.e. *.example.com or another domain altogether + -s ssl flag : if set to "yes", generate a key/certificate and enables ssl for the vhost + -c Certificate filename. "xip.io" becomes "xip.io.key" and "xip.io.crt". + if not set, the server name is used as a cert. name + Example Usage. + sudo create_vhost -d /var/www/api -n api.dev.local -s yes +_EOF_ +exit 1 +} +# +# Output vHost skeleton, fill with userinput +# To be outputted into new file +# +function create_vhost { +cat <<- _EOF_ +<VirtualHost *:80> + ServerAdmin webmaster@localhost + ServerName $ServerName + $ServerAlias + DocumentRoot $DocumentRoot + <Directory $DocumentRoot> + Options +Indexes +FollowSymLinks +MultiViews + AllowOverride All + Require all granted + #<FilesMatch \.php$> + # Change this "proxy:unix:/path/to/fpm.socket" + # if using a Unix socket + # SetHandler "proxy:fcgi://127.0.0.1:9000" + #</FilesMatch> + </Directory> + ErrorLog \${APACHE_LOG_DIR}/$ServerName-error.log + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + CustomLog \${APACHE_LOG_DIR}/$ServerName-access.log combined +</VirtualHost> +_EOF_ +} +function create_ssl_vhost { +cat <<- _EOF_ +<IfModule mod_ssl.c> +<VirtualHost *:443> + ServerAdmin webmaster@localhost + ServerName $ServerName + $ServerAlias + DocumentRoot $DocumentRoot + <Directory $DocumentRoot> + Options +Indexes +FollowSymLinks +MultiViews + AllowOverride All + Require all granted + #<FilesMatch \.php$> + # Change this "proxy:unix:/path/to/fpm.socket" + # if using a Unix socket + # SetHandler "proxy:fcgi://127.0.0.1:9000" + #</FilesMatch> + </Directory> + ErrorLog \${APACHE_LOG_DIR}/$ServerName-error.log + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + CustomLog \${APACHE_LOG_DIR}/$ServerName-access.log combined + SSLEngine on + SSLCertificateFile $CertPath/$CertName.pem + SSLCertificateKeyFile $KeyPath/$CertName.key + <FilesMatch "\.(cgi|shtml|phtml|php)$"> + SSLOptions +StdEnvVars + </FilesMatch> + <Directory /usr/lib/cgi-bin> + SSLOptions +StdEnvVars + </Directory> + BrowserMatch "MSIE [2-6]" \\ + nokeepalive ssl-unclean-shutdown \\ + downgrade-1.0 force-response-1.0 + # MSIE 7 and newer should be able to use keepalive + BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown +</VirtualHost> +</IfModule> +_EOF_ +} +#Sanity Check - are there two arguments with 2 values? +if [ "$#" -lt 4 ]; then + show_usage +fi +CertPath="/etc/ssl/certs" +KeyPath="/etc/ssl/private" +#WithSsl="no" +#Parse flags +while getopts "d:s:a:n:c:h" OPTION; do + case $OPTION in + h) + show_usage + ;; + d) + DocumentRoot=$OPTARG + ;; + n) + ServerName=$OPTARG + ;; + a) + Alias=$OPTARG + ;; + s) + WithSsl=$OPTARG + ;; + c) + CertName=$OPTARG + ;; + *) + show_usage + ;; + esac +done +# If alias is set: +if [ "$Alias" != "" ]; then + ServerAlias="ServerAlias "$Alias +else + ServerAlias="" +fi +# If CertName doesn't get set, set it to ServerName +if [ "$CertName" == "" ]; then + CertName=$ServerName +fi + +if [ ! -d $DocumentRoot ]; then + mkdir -p $DocumentRoot + #chown USER:USER $DocumentRoot #POSSIBLE IMPLEMENTATION, new flag -u ? +fi + +if [ -z "$WithSsl" ]; then + if [ -f "/etc/apache2/sites-enabled/$ServerName.conf" ]; then + echo 'vHost already exists. Aborting' + show_usage + else + create_vhost > /etc/apache2/sites-available/${ServerName}.conf + cd /etc/apache2/sites-available/ && a2ensite ${ServerName}.conf + fi +else + if [ -f "/etc/apache2/sites-enabled/$ServerName-ssl.conf" ]; then + echo 'vHost already exists. Aborting' + show_usage + else + create_ssl_vhost >> /etc/apache2/sites-available/${ServerName}-ssl.conf + fi + + # Enable Site + cd /etc/apache2/sites-available/ && a2ensite ${ServerName}-ssl.conf + #service apache2 reload +fi \ No newline at end of file diff --git a/php/8.0/php.ini b/php/8.0/php.ini new file mode 100644 index 0000000..1f70c1d --- /dev/null +++ b/php/8.0/php.ini @@ -0,0 +1,1084 @@ +[PHP] + + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + + +engine = On +short_open_tag = Off +precision = 14 +output_buffering = 4096 +zlib.output_compression = Off +implicit_flush = Off + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +max_execution_time = 60 +max_input_time = 60 +memory_limit = 512M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +error_reporting = E_ALL +display_errors = On +display_startup_errors = On +log_errors = On +log_errors_max_len = 1024 +ignore_repeated_errors = Off +ignore_repeated_source = Off +report_memleaks = On +html_errors = On + + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +variables_order = "GPCS" +request_order = "GP" +register_argc_argv = Off +auto_globals_jit = On + +post_max_size = 16M +default_mimetype = "text/html" +default_charset = "UTF-8" + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; +enable_dl = Off + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +file_uploads = On +upload_max_filesize = 8M +max_file_uploads = 25 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; +allow_url_fopen = On +allow_url_include = Off +default_socket_timeout = 60 + + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +;date.timezone = + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +;Enables or disables JIT compilation of patterns. This requires the PCRE +;library to be compiled with JIT support. +;pcre.jit=1 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[SQL] +; http://php.net/sql.safe-mode +sql.safe_mode = Off + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = On + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Set session ID character length. This value could be between 22 to 256. +; Shorter length than default is supported only for compatibility reason. +; Users should use 32 or more chars. +; http://php.net/session.sid-length +; Default Value: 32 +; Development Value: 26 +; Production Value: 26 +session.sid_length = 26 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; <form> is special; if you include them here, the rewriter will +; add a hidden <input> field with the info which is otherwise appended +; to URLs. <form> tag's action attribute URL will not be modified +; unless it is specified. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=" +; Development Value: "a=href,area=href,frame=src,form=" +; Production Value: "a=href,area=href,frame=src,form=" +; http://php.net/url-rewriter.tags +session.trans_sid_tags = "a=href,area=href,frame=src,form=" + +; URL rewriter does not rewrite absolute URLs by default. +; To enable rewrites for absolute pathes, target hosts must be specified +; at RUNTIME. i.e. use ini_set() +; <form> tags is special. PHP will check action attribute's URL regardless +; of session.trans_sid_tags setting. +; If no host is defined, HTTP_HOST will be used for allowed host. +; Example value: php.net,www.php.net,wiki.php.net +; Use "," for multiple hosts. No spaces are allowed. +; Default Value: "" +; Development Value: "" +; Production Value: "" +;session.trans_sid_hosts="" + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.sid_bits_per_character = 5 + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +; Only write session data when session data is changed. Enabled by default. +; http://php.net/session.lazy-write +;session.lazy_write = On + +[Assertion] +; Switch whether to compile assertions at all (to have no overhead at run-time) +; -1: Do not compile at all +; 0: Jump over assertion at run-time +; 1: Execute assertions +; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 +; http://php.net/zend.assertions +zend.assertions = 1 + +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Throw an AssertationException on failed assertions +; http://php.net/assert.exception +;assert.exception = On + +; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstring.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 1 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[mcrypt] +; For more information about mcrypt settings see http://php.net/mcrypt-module-open + +; Directory where to load mcrypt algorithms +; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) +;mcrypt.algorithms_dir= + +; Directory where to load mcrypt modes +; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) +;mcrypt.modes_dir= + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=0 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=8 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +; Depending on the used Memory Manager this may cause some incompatibilities. +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Allows calling OPcache API functions only from PHP scripts which path is +; started from specified string. The default "" means no restriction +;opcache.restrict_api= + +; Mapping base of shared memory segments (for Windows only). All the PHP +; processes have to map shared memory into the same address space. This +; directive allows to manually fix the "Unable to reattach to base address" +; errors. +;opcache.mmap_base= + +; Enables and sets the second level cache directory. +; It should improve performance when SHM memory is full, at server restart or +; SHM reset. The default "" disables file based caching. +;opcache.file_cache= + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; Enables or disables checksum validation when script loaded from file cache. +;opcache.file_cache_consistency_checks=1 + +; Implies opcache.file_cache_only=1 for a certain process that failed to +; reattach to the shared memory (for Windows only). Explicitly enabled file +; cache is required. +;opcache.file_cache_fallback=1 + +; Enables or disables copying of PHP code (text segment) into HUGE PAGES. +; This should improve performance, but requires appropriate OS configuration. +;opcache.huge_code_pages=0 + +; Validate cached file permissions. +;opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +;opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: diff --git a/php/8.0/start b/php/8.0/start new file mode 100755 index 0000000..9a6a965 --- /dev/null +++ b/php/8.0/start @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +config-vhost + +echo "start apache foreground" +apache2-foreground \ No newline at end of file -- GitLab