All Projects → alcaeus → Mongo Php Adapter

alcaeus / Mongo Php Adapter

Licence: mit
🔗 Adapter to provide ext-mongo interface on top of mongo-php-library

Projects that are alternatives of or similar to Mongo Php Adapter

Mongodb Adapter
MongoDB adapter for Casbin
Stars: ✭ 194 (-57.17%)
Mutual labels:  mongodb, adapter
Qmgo
Qmgo - The Go driver for MongoDB. It‘s based on official mongo-go-driver but easier to use like Mgo.
Stars: ✭ 444 (-1.99%)
Mutual labels:  mongodb
Mquery
Expressive MongoDB query builder
Stars: ✭ 409 (-9.71%)
Mutual labels:  mongodb
Mongo Express
Web-based MongoDB admin interface, written with Node.js and express
Stars: ✭ 4,403 (+871.96%)
Mutual labels:  mongodb
Play Reactivemongo
🍃 ReactiveMongo plugin for Playframework
Stars: ✭ 411 (-9.27%)
Mutual labels:  mongodb
Private Project
一些基于React、Vue、Node.js、MongoDB技术栈的实践项目
Stars: ✭ 438 (-3.31%)
Mutual labels:  mongodb
Spring Samples For All
spring、spring-boot、spring-cloud 常用整合用例
Stars: ✭ 401 (-11.48%)
Mutual labels:  mongodb
Middleware development learning
中间件、高性能服务器、分布式存储等(redis、memcache、nginx、大容量redis pika、rocksdb、mongodb、wiredtiger存储引擎、高性能代理中间件)二次开发、性能优化,逐步整理文档说明并配合demo指导--每周末定时更新2-3篇技术文章及程序demo--(技术交流QQ群:568892619)
Stars: ✭ 449 (-0.88%)
Mutual labels:  mongodb
Buji Pac4j
pac4j security library for Shiro: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 444 (-1.99%)
Mutual labels:  mongodb
Gimx
The GIMX software.
Stars: ✭ 421 (-7.06%)
Mutual labels:  adapter
Octblog
Yet another blog system powered by Flask and MongoDB
Stars: ✭ 421 (-7.06%)
Mutual labels:  mongodb
Run Aspnetcore Microservices
Microservices on .Net platforms which used Asp.Net Web API, Docker, RabbitMQ, MassTransit, Grpc, Ocelot API Gateway, MongoDB, Redis, PostgreSQL, SqlServer, Dapper, Entity Framework Core, CQRS and Clean Architecture implementation. Also includes Cross-Cutting concerns like Implementing Centralized Distributed Logging with Elasticsearch, Kibana and SeriLog, use the HealthChecks with Watchdog, Implement Retry and Circuit Breaker patterns with Polly and so on.. See Microservices Architecture and Step by Step Implementation on .NET Course w/ discount->
Stars: ✭ 406 (-10.38%)
Mutual labels:  mongodb
Meantorrent
meanTorrent - MEAN.JS BitTorrent Private Tracker - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js, A BitTorrent Private Tracker CMS with Multilingual, and IRC announce support, CloudFlare support. Demo at:
Stars: ✭ 438 (-3.31%)
Mutual labels:  mongodb
Tutorial
Java全栈知识架构体系总结
Stars: ✭ 407 (-10.15%)
Mutual labels:  mongodb
Monger
Monger is an idiomatic Clojure MongoDB driver with sane defaults, batteries included, well documented, low overhead
Stars: ✭ 447 (-1.32%)
Mutual labels:  mongodb
Compass
The GUI for MongoDB.
Stars: ✭ 402 (-11.26%)
Mutual labels:  mongodb
Mongolass
Elegant MongoDB driver for Node.js.
Stars: ✭ 421 (-7.06%)
Mutual labels:  mongodb
Vj4
The online judge service with millions of submissions, since 2005.
Stars: ✭ 430 (-5.08%)
Mutual labels:  mongodb
Curriculum
Dive into our 7-month web development program covering HTML, CSS, Javascript, Node, and React!
Stars: ✭ 453 (+0%)
Mutual labels:  mongodb
Pb
pb is a formerly-lightweight pastebin and url shortener
Stars: ✭ 448 (-1.1%)
Mutual labels:  mongodb

Mongo PHP Adapter

Build Status Code Coverage Scrutinizer Code Quality

The Mongo PHP Adapter is a userland library designed to act as an adapter between applications relying on ext-mongo and the new driver (ext-mongodb).

It provides the API of ext-mongo built on top of mongo-php-library, thus being compatible with PHP 7.

Goal

This library aims to provide a compatibility layer for applications that rely on libraries using ext-mongo, e.g. Doctrine MongoDB ODM, but want to migrate to PHP 7 on which ext-mongo will not run.

You should not be using this library if you do not rely on a library using ext-mongo. If you are starting a new project, please check out mongodb/mongodb.

Installation

This library requires you to have the mongodb extension installed, and it conflicts with the legacy mongo extension.

The preferred method of installing this library is with Composer by running the following from your project root:

$ composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter

The above command first marks the mongo extension as installed, then requires this adapter. This is to work around a bug in composer, see composer/composer#5030.

Known issues

Return values and exceptions

Some methods may not throw exceptions with the same exception messages as their counterparts in ext-mongo. Do not rely on exception messages being the same.

Methods that return a result array containing a connectionId field will always return 0 as connection ID.

Errors

All errors and warnings triggered by ext-mongo are triggered as E_USER_WARNING and E_USER_ERROR because trigger_error doesn't accept the E_WARNING and E_USER codes. If you rely on these error codes in your error handling routines, please update your code accordingly.

Serialization of objects

Serialization of any Mongo* objects (e.g. MongoGridFSFile, MongoCursor, etc.) will not work properly. The objects can be serialized but are not usable after unserializing them.

Mongo

  • The Mongo class is deprecated and was not implemented in this library. If you are still using it please update your code to use the new classes.

MongoLog

  • The MongoLog class does not log anything because the underlying driver does not offer a method to retrieve this data.

MongoClient

  • The connect and close methods are not implemented because the underlying driver connects lazily and does not offer methods for connecting disconnecting.
  • The getConnections method is not implemented because the underlying driver does not offer a method to retrieve this data.
  • The killCursor method is not yet implemented.

MongoDB

  • The authenticate method is not supported. To connect to a database with authentication, please supply the credentials using the connection string.
  • The $cmd collection cannot be used due to an issue in the underlying driver. To run commands, use the command method instead of querying the virtual $cmd collection.

MongoCollection

  • The insert, batchInsert, and save methods take the first argument by reference. While the original API does not explicitely specify by-reference arguments it does add an ID field to the objects and documents given.
  • The parallelCollectionScan method is not yet implemented.

MongoCursor

  • The info method does not reliably fill all fields in the cursor information. This includes the numReturned and server keys once the cursor has started iterating. The numReturned field will always show the same value as the at field. The server field is lacking authentication information.
  • The setFlag method is not yet implemented.
  • The timeout method will not change any query options. Client-side timeouts are no longer supported by the new driver. Use the maxTimeMS setting as a replacement.

MongoCommandCursor

  • The createFromDocument method is not yet implemented.
  • The info method does not reliably fill all fields in the cursor information. This includes the at, numReturned, firstBatchAt and firstBatchNumReturned fields. The at and numReturned fields always return 0 for compatibility to MongoCursor. The firstBatchAt and firstBatchNumReturned fields will contain the same value, which is the internal position of the iterator.

Development

If you are working on patches to this driver, you can run the unit tests by following these steps from the root of the repo directory:

$ composer install
$ vendor/phpunit/phpunit/phpunit --verbose

It assumes that the the localhost is running a mongod server. Here is a sample command to start mongod for these tests:

$ mongod --smallfiles --fork --logpath /var/log/mongod.log --setParameter enableTestCommands=1

The tests also assume PHP 5.6+ and the ext-mongodb extension being available.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].