News Feed
Jobs Feed
Sections




News Archive
feed this:

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

Phil Sturgeon:
Benchmarking Codswallop NodeJS v PHP
November 12, 2013 @ 09:21:29

Phil Sturgeonhas posted about some Node.js vs PHP benchmarks that someone linked him to concerning web scraping. The article suggests that Node.js "owns" PHP when it comes to this but, as Phil finds out, there's a bit more to the story than that.

Sometimes people link me to articles and ask for my opinions. This one was a real doozy. Oh goody, a framework versus language post. Let's try and chew through this probable linkbait [where] we're benchmarking NodeJS v PHP. Weird, but I'll go along with it. Well, now we're testing cheerio v PhpQuery which is a bit different, but fine, let's go along with it.

Through a little discovery, Phil noticed phpQuery using file_get_contents, a blocking method for fetching the remote pages to scrape. Node.js instead uses a non-blocking method, meaning multiple files can be fetched at the same time. In answer to this blocking vs non-blocking, he decided to run benchamrks against a few cases - Node.js/Cherrio, PHP/phpQuery and his own, more correct comparison to the Node option - PHP/ReactPHP/phpQuery. He's shared his results, showing a major difference between the straight phpQuery and the React-based version.

It seems likely to me that people just assume PHP can't do this stuff, because by default most people arse around PHP with things like MAMP, or on their shitty web-host where is is hard to install things and as such get used to writing PHP without utilizing many extensions. It is probably exactly this which makes people think PHP just can't do something, when it easily can.
0 comments voice your opinion now!
nodejs reactphp webpage scraping benchmark compare

Link: http://philsturgeon.co.uk/blog/2013/11/benchmarking-codswallop-nodejs-v-php

VilkomenJuist.nl:
Laravel 4 and NodeJs/Redis pub/sub realtime notifications
October 23, 2013 @ 11:48:36

On VilkomenJuist.nl there's a recent post showing you how to create a real-time notification system with PHP using Laravel, NodeJs and Redis.

Currently I am building an application where we can fill in live scores and I needed something to update all my visitors whenever a score has been updated by one of the admins. Whenever an admin updates the score via the Laravel 4 backend I fire an event and publish it to Redis. I've setup a simple NodeJS server which listens to Redis for incoming changes. NodeJS will redirect the message to all Socket.IO clients.

The post has all of the code and configuration you'll need to reproduce the setup. This includes the Laravel Redis config, code for the event handler and the Node server listening for the socket connection.

0 comments voice your opinion now!
redis realtime notification nodejs socketio laravel tutorial configuration

Link: http://www.volkomenjuist.nl/blog/2013/10/20/laravel-4-and-nodejsredis-pubsub-realtime-notifications/

NetTuts.com:
Travis-CI What, Why, How
September 19, 2013 @ 11:10:31

If you've ever wanted to put together automated builds for your project but didn't want to have to worry about all the setup and systems involved, Travis-CI might fit your needs. To help get you started NetTuts.com has posted this introduction to the (free) service and its features.

Travis CI makes working in a team for a software project easier with automated builds. These builds are triggered automatically when each developer checks in their code to the repository. In this article, we will go through how we can integrate Travis CI easily with our project, which is hosted on Github. With automation, notification and testing in place, we can focus on our coding and creating, while Travis CI does the hard work of continuous integration!

They focus on its use in a Node-based project, but Travis-CI is language agnostic, so the ideas still apply to PHP-based apps too. They introduce you to the Travis interface and show you how to hook it into your Github account. They also point out another handy feature of Travis - executing on pull requests to see if the results would break anything if merged. Plenty of screenshots are included in the post showing you different states of passing and failing builds. They also include a bit about showing the build status image in your project's README Markdown file.

0 comments voice your opinion now!
travisci continuous integration introduction nodejs

Link: http://net.tutsplus.com/tutorials/tools-and-tips/travis-ci-what-why-how/

Web and PHP:
July 2013 Issue - "PHP, meet Node.js"
July 03, 2013 @ 09:42:54

The Web and PHP Magazine has released its latest issue - the July 2013 edition of their magazine, "PHP, meet Node.js". This new issue has several different articles in it (not just ones about Node and PHP) like:

You can pick up this issue for free by heading over to the Web and PHP site and hitting the "download" link at the bottom.

0 comments voice your opinion now!
webandphp magazine july2013 nodejs article release

Link: http://webandphp.com/July2013

PHPMaster.com:
A First Look at React
March 26, 2013 @ 10:01:33

On PHPMaster.com there's a new tutorial that introduces you to React, the PHP-based event-driven non-blocking socket tool that's similar to some of the functionality Node.js provides. The article is a very basic introduction but can help get your feet wet with the tool.

For the past couple of years, Node.js has been drawing increasing amounts of attention as a promising web technology. While it has some strengths, like being event driven, some people just want to stick to PHP. For over a year now, however, there has been a similar project for PHP named React. React is mostly coded by Igor Wiedler, who is also a prominent contributor to the Silex framework. While reading through the React examples, it really does look similar to Node.js.

Included in the post are the instructions on how to get the latest version of React (via Composer) and the code to create a sample server that just writes out a string with a counter for the number of requests made. There's also an example of a "keystroke logger" for all data that's coming across the connection. The author (Igor) notes, however, that he wouldn't recommend using React in production, though, as its target is mostly those working with "cutting-edge technologies" rather than more stable applications.

0 comments voice your opinion now!
react tutorial introduction nodejs socket server example


Francois Zaninotto:
Node.js for PHP Developers Series
January 23, 2013 @ 09:21:48

If you're a PHP developer and have ever wanted to branch out into learning another language, Node.js is a popular choice right now. To help you ease into some of the concepts that Node development involves, Francois Zaninotto has come up with his "Node.js for PHP Developers" series of posts (4 of them now, one previously mentioned here):

in each article he provides code examples showing "the Node way" versus "the PHP way" to do various things. It's a great little series and can definitely kickstart your Node.js knowledge.

0 comments voice your opinion now!
nodejs developer tutorial series examples code


Brian Moon's Blog:
Stop comparing stuff you don't understand
June 26, 2012 @ 09:09:19

In his latest post Brian Moon responds to another "PHP versus..." article from this site comparing it to Node.js and how it's less of a valid comparison and more of an "apples to oranges" comparison.

I normally don't do this. When I see someone write a blog post I don't agree with, I often just dismiss it and go on. But, this particular one caught my attention. It was titled PHP vs Node.js: Yet Another Versus.

He points out some of the problems with some of the arguments, specifically with some of the points made about Gearman, memcache, the PHP.net site and the creation of daemons in PHP.

Listen, I write code in PHP and JavaScript all day. I also use some Ruby, Lua and even dabble in C. I am not a language snob. Use what works for you. I do however take exception when people write about things they clearly have no idea about.
0 comments voice your opinion now!
compare opinion respond nodejs understanding


Gonzalo Ayuso's Blog:
Database connection pooling with PHP and React (node.php)
May 21, 2012 @ 10:19:44

In this latest post Gonzalo Ayuso his recent experiences with <1 href="http://nodephp.org/">React (Node.js in PHP) and an example of how he worked up a script to pool database connections.

Last saturday I meet a new hype: "React" also known as "node.php". Basically it's the same idea than node.js but built with PHP instead of javascript. [...] Basically I want to create a database connection pooling. It's one of the things that I miss in PHP. I wrote a post here some time ago with this idea with one exotic experiment building one connection pooling using gearman. Today the idea is the same but now with React.

He includes the sample script, also including the line to add to your composer.json file to install React and the SQL to create the sample tables. The script makes a PDO connection and assigns it to the pool, an instance of his "CPool" class. If you want to try it out, you can find the code over on github.

0 comments voice your opinion now!
react nodejs nodephp database connection pool


Jani Hartikainen's Blog:
5 ways how PHP is better than Node.js
April 25, 2012 @ 09:13:50

In what's sure to be a "flame bait" kind of post, Jani Hartikainen has posted five reasons PHP is better than Node.js - some simple one-liners and others a bit more complicated.

All hail Node.js! Boo PHP! Except there are various things where PHP is better than Node…

His five reasons are:

  • Easier to find hosting
  • It's easier to get started with PHP
  • If your PHP code breaks, it doesn't bring your whole server down
  • PHP processes are short lived
  • Bigger standard library

There's a few comments on the post already, one noting that some of the points could be turned around to make PHP fall more on the "bad" side.

0 comments voice your opinion now!
nodejs opinion better language reasons compare


Anthony Wlodarski's Blog:
Node.js and Zend Auth with Sessions stored in the database
March 07, 2012 @ 09:50:46

Anthony Wlodarski has posted a quick example of how he shared the sessions from Zend_Auth in his Zend Framework application over with a Node.js server/application.

Recently on a project I had to make changes to a underlying portion of the sites architecture to move sessions in Zend Framework from file storage to database storage. However this affected a piece of the architecture. Node.js, which manages all our real time interaction, looked at sessions at the file level. This was quite a easy transition for the function as it was abstracted away in a function call so the theory was to just replace the function "guts" with a new component.

The post shows the code he came from (which pulled in the PHP session file and extracted the session data manually) over to a new database-based version that selects from the SESSIONS table and pulls out the data. It's based on the table having an "id" column and the Zend_Auth namespace it uses.

0 comments voice your opinion now!
nodejs zendauth sessions platform read tutorial database



Community Events











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


release database hhvm composer symfony2 facebook language framework component podcast install introduction package hack security unittest project application performance example

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