Latest PECL Releases:
MongoDB Cursors with PHP
Tuesday, May 22nd 2012, 09:15 BST
Recently I was asked to improve the MongoCursor::batchSize documentation. This began an indepth investigation in how the PHP driver for MongoDB handles pulling data that's been queried from the MongoDB server. Here are my findings.
A MongoCursor is created as soon as you run the find() method on a MongoCollection object, like in:
$m = new Mongo();
$collection = $m-demoDb-demoCollection;
$cursor = $collection-find();
Like every product, Natural Load Testing needs to send some mail, having written and re-written a bunch of different blocks of mail code over the years, I wanted to come up with something that would work now, and continue to serve us well into the future.
Send multipart/mime mail, so the emails can look a€omore officiala€ť than plain text for the average customer. Users reading mail in plain text still get something nice.
Easy to send a custom email with a block or two of text in...
Sean Coates has posted a reminder for PHP developers (and really anyone executing command-line scripts) to use "env" instead of hard-coding the path to the PHP interpreter.These [support] scripts often run PHP in Gimme Bar land, and we make extensive use of the shebang syntax that uses common Unix practice of putting #!/path/to/interpreter at the beginning of our command-line code. Clearly, this is nothing special -lots of people do exactly this same thing with PHP scripts. One thing I have noticed,...
I think it took me (or us) a couple attempts to get this right - let me introduce you to Zf_Crud, a CRUD controller for the Zend Framework.
What's CRUD?CRUD is an acronym and stands for:
A general purpose for CRUD are administrative interfaces - view records, create them, update them or delete them. Think of phpMyAdmin as a very general purpose CRUD interface. One you need some SQL-fu for.
In my experience, such interfaces are most likely or often the very last item on a...
In this quick post to his blog, Mike Purcell mentions the deprecation of the "assertType" assertion and includes some code you can add to correct the issue in your tests.We recently upgraded phpunit from a very old version to the current 3.6.x version (at time of writing). During the upgrade I noticed that assertType is no longer supported in many of our tests which were testing if something was a string, an array, or an object. So I had to write a quick script to update assertType to assertInternalType...
We use quite a few technologies to build our products, but Gimme Bar is still primarily a PHP app.
To support these apps, we have a number of command-line scripts that handle maintenance tasks, cron jobs, data migration jobs, data processing workers, etc.These scripts often run PHP in Gimme Bar land, and we make extensive use of the shebang syntax that uses common Unix practice of putting #!/path/to/interpreter at the beginning of our command-line code. Clearly, this is nothing special-lots of people do...
PHPMaster.com has posted the latest tutorial in their series covering RESTful APIS - part four of "REST - Can you do More than Spell it?" In this latest part of the series, they focus on something very key to RESTful services, the HTTP spec (and headers).We're getting close to the end now, and the only thing remaining is to discuss a little more about the protocol you'll most likely use in any RESTful application that you write. Because HTTP is so often used with REST, that's the protocol I'd like to...
Latest PEAR Releases:
JsDay directly started with a mindblowing talk by Mark Boas (The slides can be found...
I've recently built a product in Node JS, and it was a very positive experience (more on that in another blog post). I'm now looking around at what I need to do to package it all up for customers and entrepreneurs - hosting, developer meetups, that sort of thing. I'm looking for the wider ecosystem that customers can tap into. I'm a bit surprised at what I found during my research, and I thought I'd share it in case anyone else can add to it.
Why Hosting Matters
Let's not beat about the bush here. As a...
Job postings for the past week:Job Posting: Wikimedia Foundation Seeks Senior Software Developer (San Francisco, CA)
In this recent post to Reddit.com, the question of application security is asked - the poster wants recommendations on how he should keep his app safe from would-be attackers:I can code fairly well in PHP these days, but my security isn't so hot. Is there a tutorial or plugin you guys can recommend as to how I should be protecting my php pages/inputs? I want to avoid common attacks like XSS, inputs with NULL or DROP TABLE etc?Responses on the post include recommendations related to:
Using the Chorizo...
Klaus Silveira has submitted a project he's been working on to make browsing through git repositories a bit simpler with a local tool - gitlist.GitList is an elegant and modern web interface for interacting with multiple git repositories. It allows you to browse repositories using your favorite browser, viewing files under different revisions, commit history, diffs. It also generates RSS feeds for each repository, allowing you to stay up-to-date with the latest changes anytime, anywhere. GitList was...
On the Nerdery blog today there's a new post about the recent Minnesota PHP User Group's latest meeting where the topics were "When SQL Meets Developers" and "Message Queues & Distributed Job Processing".In their May meeting, the Minnesota PHP User Group heard two talks on "When SQL Meets Documents" [above] and "Message Queues & Distributed Job Processing" [below]. MNPHP meets once a month at The Nerdery's office in Bloomington.Both of the presentations were recorded - you can find the videos over on...
Popular posts from PHPDeveloper.org for the past week:Tom Barrett's Blog: WordPress is more than a CMS, it is a PHP Framework
Community News: Drafts of PSR-1 (and prelim PSR-2)
NetTuts.com: Aspect-Oriented Programming in PHP
Developer.com: Creating a Custom ACL in PHP
Jeremy Cook's Blog: Implementing IteratorAggregate and Iterator
Anson Cheung's Blog: Create nodes in eZ Publish using PHP
Gonzalo Ayuso's Blog: Building a simple SQL wrapper with PHP
Fabien Potencier's Blog: Sami: Yet another PHP API...
The Symfony Project is running a community survey for developers using the framework. It asks some generic questions including "how long have you been working with Symfony?" and "how did you get to know Symfony?"Symfony 2.0 has been released for quite a long time now, and so we would like to conduct a quick survey to get a better understanding of the Symfony community. I'm going to use some of the aggregated results for my Symfony Live keynote, and all the aggregated results will be published on this...
The Atlanta PHP User Group has announced their latest meeting for June 2012 - an introduction to the Larvel framework from Ben Edmunds.Are you ashamed to admit you're a PHP developer? Have you been using the same old, boring PHP framework for years? Tired of your PHP applications turning into enormous beasts? Maybe you've heard about Laravel but haven't made the effort to dive into it? In this presentation, we'll walk through what makes Laravel an elegant, fun, and exciting framework to make PHP...