News Feed
Sections




News Archive
feed this:

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

Derick Rethans:
Parallelizing document retrieval
December 09, 2014 @ 11:59:20

In his latest post Derick Rethans shows how to parallelize document retrieval from a MongoDB database via PHP. This makes it possible to speed up the read operation caused by reading each item one at a time.

MongoDB 2.6 has a new feature that allows you to read all the documents from one collection with multiple cursors in parallel. This is done through a database command called parallelCollectionScan. The idea behind it is that it is faster then reading all the documents in a collection sequentially.

He includes an example snippet that enables the "parallelCollectionScan" handling for a "cities" collection and the resulting output. He shows how to manually create MongoCommandCursors (or let the driver do it for you) and use PHP's own MultipleIterator to process all of the cursors at essentially the same time.

0 comments voice your opinion now!
mongodb driver parallel document retrieval cursor iterator

Link: http://derickrethans.nl/parallelcollectionscan.html

DZone.com:
MongoDB Driver Tips & Tricks PHP
June 04, 2014 @ 10:10:49

On DZone.com there's a new post from Chris Chang that's the third part of the series looking at using various language drivers for working with MongoDB. In this latest article he focuses in on the PHP driver, giving a brief introduction and a few handy tips.

This blog post is the third of a series where we are covering each of the major MongoDB drivers in depth. The driver we'll be covering here is the PHP driver, developed and maintained by the MongoDB, Inc. team (primarily @derickr, @bjori and @jmikola).

He includes a link to some basic examples and shares a "production-ready connect string" with some MongoLab recommended settings. The tips include topics ranging from working with index builds, the lowering of is_master_interval and configuring the connectionTimeoutMS setting for optimum connection handling.

0 comments voice your opinion now!
mongodb driver tips tricks mongolab index master interval connection timeout

Link: http://java.dzone.com/articles/mongodb-driver-tips-tricks-php

SitePoint PHP Blog:
Building a Simple Blog App with MongoDB and PHP
March 14, 2014 @ 09:19:36

On PHPMaster.com there's a recent tutorial posted showing you the creation of a simple blog application with MongoDB + PHP. It's a basic overview, so it's mostly about creates and reads, but it does help get things working.

If you want to create a blog using MongoDB and PHP, this article will teach you. [...] The reason I chose to build a blog application is because it is a basic CRUD application and it is very suitable for easing into PHP and MongoDB web development. We will build a plain user interface using Bootstrap with simple textboxes and buttons. A MongoDB database will store all the content.

He starts off by introducing MongoDB and some of the basic concepts around databases, collections and documents as they relate to it. He then moves into the installation process, getting and configuring a simple MongoDB instance running on localhost. He helps you get the MongoDB PECL driver installed for PHP and includes a bit of code to test the connection. Finally, he gets into the blog example itself and includes the full code to get it up and running.

0 comments voice your opinion now!
tutorial blog application sample introduction mongodb database

Link: http://www.sitepoint.com/building-simple-blog-app-mongodb-php/

SitePoint PHP Blog:
Social Network Style Posting with PHP, MongoDB and jQuery - part 2
November 19, 2013 @ 13:55:17

The SitePoint PHP blog has posted the second part of their series about the creation of a simple comment posting social site based on PHP, MongoDB and jQuery. In this second part they build on the structure from part one and add in posting and "liking".

In the previous part of the series, we explained the database architecture, post stream design and application flow required for developing our post mechanism wherein the user will be able to post a status, like/unlike other people's statuses and comment on them. This part of the series will drive you through the coding required to implement these functionalities. We will use the application flow and database structure as discussed in the last article. Don't forget to download the code from the github repo if you'd like to follow along.

First he shows you how to get new posts added to the database, POSTed to the backend PHP script. He also shows how to insert the contents back into the page and pull out the latest posts. Next up is the like/unlike-ing of the posts, handled by a simple submission to another backend script.

0 comments voice your opinion now!
tutorial mongodb social post jquery

Link: http://www.sitepoint.com/social-network-style-posting-php-mongodb-jquery-part-2/

SitePoint PHP Blog:
Social Network Style Posting with PHP, MongoDB and jQuery - part 1
November 15, 2013 @ 09:09:43

The SitePoint PHP blog has a new tutorial posted today kicking off a series about creating a "social network style posting" application that combines PHP, MongoDB and jQuery that feels similar to a nested commenting system you'd see on most social sites.

Post mechanisms similar to Facebook are nowadays very common within any application. The concept of Post-Like-Comment is familiar to everyone who ever used a social network. In this article, we will learn how to create a similar working model wherein the user will be able to post his status, like posts and comment on them. What's more interesting is that after learning things from this article, going forward you will be able to implement a lot of other features on your own.

In this first part of the series they start you off with the base code and introduce you to how the data is stored. They also walk you through how the "stream" part of the code works and the tracking of the current user. From there, there's a brief look at how to pull out the comments and display them to the page.

0 comments voice your opinion now!
social post tutorial mongodb jquery part1 series

Link: http://www.sitepoint.com/social-network-style-posting-php-mongodb-jquery-part-1/

OpenShift Blog:
Open Source Mapping with PHP and MongoDB
November 06, 2013 @ 13:47:38

On the OpenShift blog Ryan Jarvinen has a new tutorial showing you how to use MongoDB and Silex to create a basic mapping service. It takes advantage of the MongoDB spatial data and query functionality to help locate and map items from the dataset.

Whether your goals are civic-minded or otherwise, PHP can help you craft solutions that are every bit as simple and elegant as what you might expect to see from modern Python, Ruby, or JavaScript frameworks. This particular example is intended to serve as a reusable template for folks who are interested in producing their own mapping applications - substituting in their own collection of map points or other spatial data.

He starts with a look at the datastore - the MongoDB - and the kind of data it will contain. He's shared the dataset (and complete example code too) over on Github and includes the command to import it. He then starts in on the PHP side of things, showing you how to get Silex installed and add in some basic routes and CSS. He then uses the Leaflet.js library to import the data and drop it into an Openstreetmap-based map. The full code and data can be found in this repository over on Github.

0 comments voice your opinion now!
mapping mongodb leafletjs tutorial openstreetmap

Link: https://www.openshift.com/blogs/open-source-mapping-with-php-and-mongodb

Hannes Magnusson:
Query logging and profiling in MongoDB
September 18, 2013 @ 10:25:49

in a previous post Hannes Magnusson introduced the new stream handling notification feature in the MongoDB PHP extension. In his most recent post he elaborates on a subject mentioned in the previous post - query logging and profiling.

In my previous blog post I mentioned that the 1.5.0 release of the MongoDB driver for PHP has improved notification support using the PHP Notification API, and showed off a fairly useless (but fun) progress bar. Now its time for a little bit more practical examples using this system: Query logging and profiling.

He talks about some of the features in his pull request, including the new constants added to help make working with the logging on streams easier. He includes some sample code that handles the logging via an "update" callback function, parsing the log message type and save the related data to a class variable. An instance of this class is then assigned to the "notification" stream and passed in as an additional option when creating the MongoClient connection. He includes an example of querying a basic collection and how to extract the request information from the logging object instance.

0 comments voice your opinion now!
mongodb stream context tutorial log query profile notification api

Link: http://bjori.blogspot.com/2013/09/query-logging-and-profiling-in-mongodb.html

Hannes Magnusson:
PHP Stream Notifications <3 MongoDB
September 17, 2013 @ 09:02:54

In this latest post to his site, Hannes Magnusson looks briefly at an interesting use for PHP's streams functionality - reading data from a MongoDB connection as a streaming resource.

PHP Streams have several pretty nifty features that most people don't really know about; Filters, Wrappers, Context, and Notifications. Documenting these is a bit difficult, and getting the user to discover these features is even more problematic, as these things usually live outside of the normal path (function reference). Maybe I'll blog about these things in the future, but for now I want to talk about the Stream (context) Notifications - or more specifically; Stream Notifications in the MongoDB extension for PHP.

He talks some about what stream notifications are on a basic level and some general use cases for them. From there he moves into the MongoDB world and some changes in the mongodb 1.4 extension over to using streams. He also talks about some of the things coming in the 1.5 version including progress reporting for read/write actions.

0 comments voice your opinion now!
mongodb streams extension nosql notification

Link: http://bjori.blogspot.com/2013/09/php-stream-notifications-mongodb.html

Derick Rethans:
Introduction to Document Databases with MongoDB
September 06, 2013 @ 09:20:08

If you've been wanting to get into document databases (NoSQL stuff) but haven't had a good beginners guide to look at, Derick Rethans has just the post for you. It introduces some of the concepts behind these databases with just a splash of how to use it in PHP.

By now most you will probably have heard of the term NoSQL. It's a vague term that covers a lot of different types of database engines. The main classes of NoSQL databases are key/value stores, column databases, graph databases and document databases. [...] Apache CouchDB and http://mongodb.org/">MongoDB belong to the last category, Document databases. We will be looking extensively at MongoDB in this article.

He starts off with some explanation of basic terminology and quickly gets into some of the strengths of a document-oriented database. He talks about data models and collection interaction as well as an example query translated from ANSI SQL to the MongoDB format. He has a basic installation and configuration guide, both for MongoDB and installing the PHP driver you'll need to make the connection.

0 comments voice your opinion now!
introduction mongodb document database

Link: http://derickrethans.nl/introduction-to-document-databases.html

NetTuts.com:
Building a CodeIgniter Web Application From Scratch - Part 1
August 27, 2013 @ 11:42:02

NetTuts.com has started up a new tutorial series perfect for those wanting to get into PHP frameworks for modern hybrid (PHP backend, Javascript frontend) applications. This is the first part of their series introduces you to the technologies they'll be using and helps you get the basics setup.

In this series we're going to build a web billboard application from scratch, we're going to use CodeIgniter to handle the back-end service and BackboneJS for the web client. In the first two parts of the series we'll create the back-end service and then the client application in the last two.

They walk you through the steps to to set up a MongoDB to handle the data for the backend and configuring CodeIgniter to work with it. He helps you get it set up to handle REST requests from the BackboneJS frontend too (including OPTIONS handling). He shows how to parse the input and handle the output as well as models to connect to the database resources and how to handle sessions.

0 comments voice your opinion now!
codeigniter tutorial series backbonejs mongodb framework

Link: http://net.tutsplus.com/tutorials/php/building-a-codeigniter-web-application-from-scratch-part-1/


Community Events





Don't see your event here?
Let us know!


tool conference community release podcast opinion library composer version introduction series laravel language security voicesoftheelephpant symfony artisanfiles list framework interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework