Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Derick Rethans:
New MongoDB Drivers for PHP and HHVM: Cursor Behaviour
Mar 08, 2016 @ 11:52:14

Derick Rethans has posted the next part of his series looking at the new an improved MongoDB drivers for PHP in this post to his site. This time he focuses on the updates to cursor behavior from the previous versions.

We released a new version of the MongoDB driver for PHP (the mongodb extension) near the end of last year. In a previous blog post, I covered the back story of the how and why we undertook this effort. And in another post, I spoke about the architecture of the new driver. In this episode I will discuss changes in cursor behaviour.

I recently found the following comment added to the driver's documentation, on PHP.net, which read: "I noticed that ->sort is missing from the cursor. Seems like the old driver has more functionality."

The new driver certainly allows for sorting of results of queries, but no longer by calling the sort() method on the cursor object. This is because cursors are now created differently than in the old mongo extension.

He starts by talking about how the legacy driver handled its cursor functionality and when it actually performed the data lookup (hint: not until used). In the newer drivers the cursor request is made when the object is created. Because of this change, actions like "sort" and "skip" have to be sent as options on the query instead.

tagged: mongodb drivers hhvm cursor behavior difference version

Link: https://derickrethans.nl/new-drivers-part3-cursor.html

Derick Rethans:
New MongoDB Drivers for PHP and HHVM: Architecture
Jan 12, 2016 @ 09:37:59

Derick Rethans continues his look at the latest version of the MongoDB drivers for both PHP and HHVM with this look at their architecture and how it's different from previous versions.

We recently released a new version of the MongoDB driver for PHP (the mongodb extension). This release is the result of nearly a year and a half of work to re-engineer and rewrite the original MongoDB driver (mongo). In the previous blog post, I covered the back story of the how and why we undertook this effort. In this new blog post, I will talk about the architecture of the new driver.

He uses the goals stated at the end of his previous post and covers:

  • Support for Other PHP Engines like HHVM
  • [How/Why] The Driver Should Be Bare Bones
  • No Reinvention of the Wheel
  • Provide an Easy to Use API
  • Backwards Compatibility

From there he then gives an overview (complete with a handy graphic) of the overall MongoDB PHP ecosystem and where the extensions fit in the plan.

tagged: mongodb derickrethans drivers hhvm architecture series part2

Link: http://derickrethans.nl/new-drivers-part2.html

MongoDB Blog:
Call for Feedback: The New PHP and HHVM Drivers
Mar 12, 2015 @ 11:33:23

The MongoDB blog has a new post asking for feedback on what the user community thinks of their approach to supporting MongoDB functionality in PHP 5.x, HHVM and even out to PHP7.

Since the PHP driver first appeared on the scene, MongoDB has gone through many changes. [...] Beyond MongoDB's features, our ecosystem has also changed. [...] During the spring of 2014, we worked with a team of students from Facebook's Open Academy program to prototype an HHVM driver modeled after the 1.x API.

[...] Although the final result was not feature complete, the project was a valuable learning experience. The C driver proved quite up to the task, and HNI, which allows an HHVM extension to be written with a combination of PHP and C++, highlighted critical areas of the driver for which we'd want to use C. This all leads up to the question of how best to support PHP 5.x, HHVM, and PHP 7.0 with our next-generation driver.

They've shared the overview of the new driver structure including three layers: the system level functionality, the extensions themselves and a MongoDB userland library. They walk through the thinking on each of the pieces of the puzzle and how they all couple together to make for a more robust, flexible system that's also easy to use.

tagged: mongodb drivers extension mongo userland library architecture opinion feedback

Link: http://www.mongodb.com/blog/post/call-feedback-new-php-and-hhvm-drivers

Lukas Smith's Blog:
Next MDB2 releases are around the corner
Jul 18, 2006 @ 05:50:27

Lukas Smith notes in this new blog post that the next releases for his MDB2 package should be just around to corner.

He's been working on several issues:

  • fixing issues with MySQL drivers
  • updating transaction support to add SAVEPOINTS
  • integrating a debug callback mechanism

The only two bug reports I am currently hoping to get resolved before the next release are: a MySQL issue getting the last ID and a problem with an internal datatype.

Keep an eye out for his next release.

tagged: mdb2 database abstraction layer transaction drivers debug callback mdb2 database abstraction layer transaction drivers debug callback

Link:

Lukas Smith's Blog:
Next MDB2 releases are around the corner
Jul 18, 2006 @ 05:50:27

Lukas Smith notes in this new blog post that the next releases for his MDB2 package should be just around to corner.

He's been working on several issues:

  • fixing issues with MySQL drivers
  • updating transaction support to add SAVEPOINTS
  • integrating a debug callback mechanism

The only two bug reports I am currently hoping to get resolved before the next release are: a MySQL issue getting the last ID and a problem with an internal datatype.

Keep an eye out for his next release.

tagged: mdb2 database abstraction layer transaction drivers debug callback mdb2 database abstraction layer transaction drivers debug callback

Link: