<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 18 Jun 2013 18:07:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: A First Look at React]]></title>
      <guid>http://www.phpdeveloper.org/news/19365</guid>
      <link>http://www.phpdeveloper.org/news/19365</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new tutorial that <a href="http://phpmaster.com/a-first-look-at-react/">introduces you to React</a>, 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.
</p>
<blockquote>
For the past couple of years, <a href="http://nodejs.org/">Node.js</a> 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 <a href="http://reactphp.org/">React</a>. React is mostly coded by <a href="https://igor.io/">Igor Wiedler</a>, who is also a prominent contributor to the <a href="https://github.com/fabpot/Silex">Silex framework</a>. While reading through the React examples, it really does look similar to Node.js.
</blockquote>
<p>
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 (<i>Igor</i>) 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.
</p>]]></description>
      <pubDate>Tue, 26 Mar 2013 10:01:33 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Francois Zaninotto: Node.js for PHP Developers Series]]></title>
      <guid>http://www.phpdeveloper.org/news/19077</guid>
      <link>http://www.phpdeveloper.org/news/19077</link>
      <description><![CDATA[<p>
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, <i>Francois Zaninotto</i> has come up with his "Node.js for PHP Developers" series of posts (4 of them now, one previously mentioned <a href="http://phpdeveloper.org/news/17450">here</a>):
</p>
<ul>
<li><a href="http://dotheweb.posterous.com/nodejs-for-php-programmers-1-event-driven-pro">Part One</a> - Event Driven Programming
<li><a href="http://dotheweb.posterous.com/nodejs-for-php-programmers-2-modules-packages">Part Two</a> - Modules, Packages and the Strawberry House
<li><a href="http://dotheweb.posterous.com/nodejs-for-php-programmers-3-exceptions-and-e">Part Three</a> - Exceptions and Errors
<li><a href="http://dotheweb.posterous.com/nodejs-for-php-programmers-4-streams">Part Four</a> - Streams
</ul>
<p>
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.
</p>]]></description>
      <pubDate>Wed, 23 Jan 2013 09:21:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: Stop comparing stuff you don't understand]]></title>
      <guid>http://www.phpdeveloper.org/news/18138</guid>
      <link>http://www.phpdeveloper.org/news/18138</link>
      <description><![CDATA[<p>
In <a href="http://brian.moonspot.net/node-vs-php-is-apples-and-oranges">his latest post</a> <i>Brian Moon</i> responds to another "PHP versus..." article from <a href="http://thomashunter.name/blog/php-vs-nodejs/">this</a> site comparing it to Node.js and how it's less of a valid comparison and more of an "apples to oranges" comparison.
</p>
<blockquote>
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 <a href="http://thomashunter.name/blog/php-vs-nodejs/">PHP vs Node.js: Yet Another Versus</a>. 
</blockquote>
<p>
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.
</p>
<blockquote>
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. 
</blockquote>]]></description>
      <pubDate>Tue, 26 Jun 2012 09:09:19 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Database connection pooling with PHP and React (node.php)]]></title>
      <guid>http://www.phpdeveloper.org/news/17983</guid>
      <link>http://www.phpdeveloper.org/news/17983</link>
      <description><![CDATA[<p>
In <a href="http://gonzalo123.wordpress.com/2012/05/21/database-connection-pooling-with-php-and-react-node-php/">this latest post</a> <i>Gonzalo Ayuso</i> his recent experiences with <1 href="http://nodephp.org/">React</a> (Node.js in PHP) and an example of how he worked up a script to pool database connections.
</p>
<blockquote>
Last saturday I meet a new hype: "<a href="http://nodephp.org/">React</a>" 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 <a href="http://gonzalo123.wordpress.com/2010/11/01/database-connection-pooling-with-php-and-gearman/">connection pooling using gearman</a>. Today the idea is the same but now with React.
</blockquote>
<p>
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 <a href="https://github.com/gonzalo123/CPool">over on github</a>.
</p>]]></description>
      <pubDate>Mon, 21 May 2012 10:19:44 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: 5 ways how PHP is better than Node.js]]></title>
      <guid>http://www.phpdeveloper.org/news/17863</guid>
      <link>http://www.phpdeveloper.org/news/17863</link>
      <description><![CDATA[<p>
In what's sure to be a "flame bait" kind of post, <i>Jani Hartikainen</i> has posted <a href="http://codeutopia.net/blog/2012/04/24/5-ways-how-php-is-better-than-node-js/">five reasons PHP is better than Node.js</a> - some simple one-liners and others a bit more complicated.
</p>
<blockquote>
All hail Node.js! Boo PHP! Except there are various things where PHP is better than Node…
</blockquote>
<p>His five reasons are:</p>
<ul>
<li>Easier to find hosting
<li>It's easier to get started with PHP
<li>If your PHP code breaks, it doesn't bring your whole server down
<li>PHP processes are short lived
<li>Bigger standard library
</ul>
<p>
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.
</p>]]></description>
      <pubDate>Wed, 25 Apr 2012 09:13:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Wlodarski's Blog: Node.js and Zend Auth with Sessions stored in the database]]></title>
      <guid>http://www.phpdeveloper.org/news/17637</guid>
      <link>http://www.phpdeveloper.org/news/17637</link>
      <description><![CDATA[<p>
<i>Anthony Wlodarski</i> has <a href="http://anthonyw.net/2012/03/node-js-and-zend-auth-with-sessions-stored-in-the-database/">posted a quick example</a> of how he shared the sessions from <a href="http://framework.zend.com/manual/en/zend.auth.html">Zend_Auth</a> in his Zend Framework application over with a Node.js server/application.
</p>
<blockquote>
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.
</blockquote>
<p>
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.
</p>]]></description>
      <pubDate>Wed, 07 Mar 2012 09:50:46 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Francois Zaninotto's Blog: Node.js for PHP Programmers #1: Event-Driven Programming... and Pasta]]></title>
      <guid>http://www.phpdeveloper.org/news/17450</guid>
      <link>http://www.phpdeveloper.org/news/17450</link>
      <description><![CDATA[<p>
On his blog today <i>Francois Zaninotto</i> has a post that aims to <a href="http://dotheweb.posterous.com/nodejs-for-php-programmers-1-event-driven-pro">introduce those with a PHP background to how Node.js</a> works. In this first part of his series, he tries to explain the idea of event-driven programming - parallel processing of different parts of an application based on some action taken in the code.
</p>
<blockquote>
For a PHP developer, asynchronicity is the most puzzling aspect of the Node.js runtime. It's simply a new way to write programs. And once you pass the first learning steps, event-driven programming opens a world of possibilities PHP programmers would never dream of. I'll try to explain you how it works, but first, let's talk about pasta.
</blockquote>
<p>
In his "pasta" example, he shows how a typical PHP application would make a "Pan" object, call a "warm" action, "add olive oil", etc. All of this happens in sequence, though and takes 29 "minutes" to complete. To help things along, he implements an "EventLoop" class that handles tracking the timing and includes two methods to execute callbacks and delayed methods. He expands on this example with asynchronous objects and method calls to handle multiple things at once. He relates this to what Node.js offers - a built in event handling system, an included EventLoop object and native blocking I/O operations. 
</p>]]></description>
      <pubDate>Thu, 26 Jan 2012 08:35:41 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Henri Bergius' Blog: DNode: Make PHP And Node.Js Talk To Each Other]]></title>
      <guid>http://www.phpdeveloper.org/news/17060</guid>
      <link>http://www.phpdeveloper.org/news/17060</link>
      <description><![CDATA[<p>
<i>Henri Bergius</i> has a new post to his blog today sharing details about a messaging protocol that can help PHP and Node.js play together nicely - <a href="http://substack.net/posts/85e1bd/DNode-Asynchronous-Remote-Method-Invocation-for-Node-js-and-the-Browser">DNode</a>.
</p>
<blockquote>
Both environments have their strong points. Node.js is very fast and flexible, but PHP has a lot more mature tools and libraries available. So in a lot of projects it is hard to choose between the two. But now you might not have to. <a href="http://substack.net/posts/85e1bd/DNode-Asynchronous-Remote-Method-Invocation-for-Node-js-and-the-Browser">DNode</a> is a remote method invocation protocol originally written for Node.js, as the name probably tells. But as <a href="https://github.com/substack/dnode-protocol#readme">the protocol</a> itself is quite simple, just sending newline-terminated JSON packets over TCP connections, implementations have started popping up in other languages. You can talk DNode in <a href="https://github.com/substack/dnode-ruby">Ruby</a>, <a href="https://github.com/substack/dnode-perl">Perl</a>, <a href="https://github.com/jesusabdullah/dnode-python">Python</a>, <a href="https://github.com/aslakhellesoy/dnode-java">Java</a>, and now <a href="https://github.com/bergie/dnode-php">PHP</a>.
</blockquote>
<p>
He includes a <a href="http://bergie.iki.fi/blog/dnode-make_php_and_node-js_talk_to_each_other/">quick example</a> of both sides of the messaging - a simple server on the Node.js side that looks for a DNode request and using the <a href="https://github.com/bergie/dnode-php">dnode PHP client</a> to connect to it (and return the input number multiplied by 100). He also includes a method that allows for bidirectional communication with a service that converts from Celsius to Fahrenheit.
</p>]]></description>
      <pubDate>Mon, 31 Oct 2011 09:50:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Wlodarskis Blog: Authentication with Node.js and Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/16649</guid>
      <link>http://www.phpdeveloper.org/news/16649</link>
      <description><![CDATA[<p>
<i>Anthony Wlodarski</i> has put together a new post to his blog talking about <a href="http://anthonyw.net/2011/07/authentication-with-node-js-and-zend-framework/">authenticating a Zend Framework app against Node.js</a> with the help of the <a href="http://socket.io/">Socket.io</a> component for handling credentials.
</p>
<blockquote>
Zend Framework which is PHP based and Node.js which is JavaScript based don't have a common connection to pass data in a bi-directional nature. I was tasked with building a bridge of sorts that would utilize existing information from Zend Framework with the latest release of Socket.io's authorization mechanisms. (If you don't do this then arbitrary connections can happen and will be authorized.)
</blockquote>
<p>
He starts with the code (on the Node.js side) to create a simple HTTP server to listen for the requests from the Zend Framework application. He gets into the details of how that all works before moving to the other side - a simple update to the authentication to store a session cookie with the information that is passed, via Socket.io to the waiting Node.js server for handling.
</p>]]></description>
      <pubDate>Thu, 28 Jul 2011 13:41:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Using node.js to store PHP sessions]]></title>
      <guid>http://www.phpdeveloper.org/news/16627</guid>
      <link>http://www.phpdeveloper.org/news/16627</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has an <a href="http://gonzalo123.wordpress.com/2011/07/25/using-node-js-to-store-php-sessions/">interesting new post</a> today looking at how to go cross-technology in your application and store your PHP sessions in a basic Node.js instance.
</p>
<blockquote>
We use <a href="http://www.php.net/manual/en/book.session.php">sessions</a> when we want to preserve certain data across subsequent accesses. PHP allows us to use different handlers when we're using sessions. The default one is filesystem, but we can change it with <A href="http://www.php.net/manual/en/session.configuration.php#ini.session.save-handler">session.save_handler</a> in the php.ini. session.save_handler defines the name of the handler which is used for storing and retrieving data associated with a session. We also can create our own handler to manage sessions. In this post we're going to create a custom handler to store sessions in a node.js service.
</blockquote>
<p>
He includes the full code you'll need (also <a href="https://github.com/gonzalo123/nodePhpSessions">here</a> on github) to make a custom session handling class on the PHP side and some simple unit tests done on the Node.js side to ensure for proper handling and garbage collection.
</p>]]></description>
      <pubDate>Mon, 25 Jul 2011 11:43:45 -0500</pubDate>
    </item>
  </channel>
</rss>
