<?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>Wed, 22 May 2013 16:41:01 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Rob Allen's Blog: Access view variables in another view model]]></title>
      <guid>http://www.phpdeveloper.org/news/17770</guid>
      <link>http://www.phpdeveloper.org/news/17770</link>
      <description><![CDATA[<p>
In <a href="http://akrabat.com/zend-framework-2/access-view-variables-in-another-view-model/">this new post</a> to his blog <i>Rob Allen</i> shows you how to access the view variables from another ViewModel.
</p>
<blockquote>
Unlike Zend Framework 1, the view layer in Zend Framework 2 separates the variables assigned to each view model. This means that when you are in the layout view script, you don't automatically have access to variables that were assigned the the action's view model and vice versa.
</blockquote>
<p>
He includes snippets of code with an example controller and a sample view that fetches a value from a child ViewModel instance. He also shows how to access layout and configuration values in the view.
</p>]]></description>
      <pubDate>Tue, 03 Apr 2012 12:53:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Re-Cycled Air Blog: PHP Dark Arts: Daemonizing a Process]]></title>
      <guid>http://www.phpdeveloper.org/news/15356</guid>
      <link>http://www.phpdeveloper.org/news/15356</link>
      <description><![CDATA[<p>
On the Re-Cycled Air blog <i>Jack Slingerland</i> has posted another in his "Dark Arts" series looking at some of the lesser used PHP features. This time he focuses in on <a href="http://www.re-cycledair.com/php-dark-arts-daemonizing-a-process">daemonizing a process</a> by forking it off into the background.
</p>
<blockquote>
One of the many things you don't often do with PHP (actually, I'm not sure you do this much with any language) is daemonize a process.  A daemon is program that runs in the background (read more <a href="http://en.wikipedia.org/wiki/Daemon_%28computer_software%29">here</a>).  On Unix systems, processes are usually created by forking the init process and then manipulating the process to your liking.  To create a daemon though, you need to get the init process to adopt your process.  To do that, as soon as you fork the parent process, you kill the parent.  Since you child process is parent-less, the init process generally adopts it.  Once that happens, your process has been daemonized.
</blockquote>
<p>
He uses the <a href="http://php.net/pcntl_fork">pcntl_fork</a> function to spawn off the child process, detach it from a terminal window, create a ".pid" file so the system knows about it and then, of course, have the child script do something.
</p>]]></description>
      <pubDate>Fri, 29 Oct 2010 11:02:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Padraic Brady's Blog: Mysteries Of Asynchronous Processing w/PHP - Pt 3: Spawned Child Processes]]></title>
      <guid>http://www.phpdeveloper.org/news/13319</guid>
      <link>http://www.phpdeveloper.org/news/13319</link>
      <description><![CDATA[<p>
<i>Padraic Brady</i> has posted <a href="http://blog.astrumfutura.com/archives/419-The-Mysteries-Of-Asynchronous-Processing-With-PHP-Part-3-Implementation-With-Spawned-Child-Processes-Using-Simple-Scripts-Or-Zend-Framework.html">part three</a> of his look at asynchronous processing in PHP applications today. The previous two parts <a href="http://www.phpdeveloper.org/news/13293">introduced</a> you to the topic and <a href="http://www.phpdeveloper.org/news/13306">got you ready</a> to work with child processes in a Zend Framework application. This latest part gets into the code showing how to fork the processes and handle communication between them.
</p>
<blockquote>
With the theory heavy portion of the series out of the way, we can begin to explore the various implementation possibilities. In this part, we will examine implementing Asynchronous Processing using a child process, i.e. a separate PHP process we create from our application during a request. We'll analyse this implementation option before introducing the source code so we may understand its advantages and disadvantages.
</blockquote>
<p>
He looks at both the advantages and disadvantages of processing with child processes and suggests a method to get a handle on the processes rather than just spawning new processes - forking. Some basic code examples are included, using the <a href="http://php.net/popen">popen</a> function to open the new child process and a Zend Framework example.
</p>]]></description>
      <pubDate>Thu, 01 Oct 2009 12:35:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Evert Pot's Blog: Lighttpd + PHP fastcgi woes ]]></title>
      <guid>http://www.phpdeveloper.org/news/11000</guid>
      <link>http://www.phpdeveloper.org/news/11000</link>
      <description><![CDATA[<p>
Recently <i>Evert Pot</i> has been <a href="http://www.rooftopsolutions.nl/article/201">having some issues</a> with setting up lighttpd and PHP (fastcgi) for one of his web servers:
</p>
<blockquote>
In trying to get more out of our webservers using a Lighttpd and PHP-FastCGI setup, I've come across some major issues that make it difficult to use. I hope this post will warn people of some of the bugs they might encounter and workaround that might need to be implemented until some of these are fixed.
</blockquote>
<p>
He ran up against two problems - that the parent PHP-CGI process spawns off the configured number of children correctly but with the lighttpd server is killed, they don't get released and that, once you hit full capacity for the PHP backend lighttpd starts serving up 500 errors. 
</p>
<p>
In <a href="http://www.rooftopsolutions.nl/article/201#comments">the comments</a> for the post several others have offered some advice on things that might help (like different config settings and even using XCache to prevent the 500s issue from coming up again).
</p>]]></description>
      <pubDate>Wed, 10 Sep 2008 12:55:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: Understanding Doctrine's NestedSet feature]]></title>
      <guid>http://www.phpdeveloper.org/news/10943</guid>
      <link>http://www.phpdeveloper.org/news/10943</link>
      <description><![CDATA[<p>
On his CodeUtopia blog <i>Jani Hartikainen</i> gives an <a href="http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/">inside look</a> at a feature of Doctrine, nested sets.
</p>
<blockquote>
The Doctrine library comes with a feature called nested set, which makes saving trees in a database easy. However, it's quite easy to accidentally cause a lot of extra unneeded queries if not being careful. Here are some pointers to keep in mind while working with the nested set, and some example queries to make understanding it easier.
</blockquote>
<p>
He gives an example, showing how to get rows from the database - parent and child - and some optimization tips to keep things light. There's also some pros and cons included for doing it either way (the standard fetching or using the more optimized versions).
</p>]]></description>
      <pubDate>Tue, 02 Sep 2008 10:29:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Daniel Cousineau's Blog: Displaying N-Deep Trees (Remember Your Algorithms Course?)]]></title>
      <guid>http://www.phpdeveloper.org/news/10784</guid>
      <link>http://www.phpdeveloper.org/news/10784</link>
      <description><![CDATA[<p>
On his Tower of Power blog <i>Daniel Cousineau</i> has <a href="http://www.toosweettobesour.com/2008/08/05/displaying-n-deep-trees-remember-your-algorithms-course/">written up a look</a> at using a more detailed categorization method than just a parent/child relationship on your data - <a href="http://en.wikipedia.org/wiki/Tree_traversal">Tree Traversals</a>.
</p>
<blockquote>
If the software calls for only 2 levels of categorization (Parent and Child only), a simple nested for loop will suffice. However, software requirements change and you'll soon find yourself up shit creek without a paddle if you need to support 3 or 4 levels of nesting. [...] To those who's training is less formal (most web developers I meet have practical training, not formal), I'll help you out: <a href="http://en.wikipedia.org/wiki/Tree_traversal">Tree Traversals</a> (or if you are completely lost, <a href="http://en.wikipedia.org/wiki/Recursion">Recursion</a>).
</blockquote>
<p>
He creates a recursive function that, when passed in a category set with different types in it, can handle each of them and then calls itself again with the new child data. His sample code creates url out of a set of categories.
</p>]]></description>
      <pubDate>Thu, 07 Aug 2008 12:03:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Defining Public and Protected Methods with Member Visibility in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/10394</guid>
      <link>http://www.phpdeveloper.org/news/10394</link>
      <description><![CDATA[<p>
DevShed continues their series looking at variable scoping in PHP5 classes with <a href="http://www.devshed.com/c/a/PHP/Defining-Public-and-Protected-Methods-with-Member-Visibility-in-PHP-5/">this new look</a> at using the public and protected keywords to "restrict member visibility".
</p>
<blockquote>
Now that you know what will be treated in this fourth chapter of the series, it's time to learn how to declare and implement public and protected methods with PHP 5 classes. Of course, as always I'm going to address this useful topic by using a hands-on approach, which means that there's a bunch of code samples ahead, waiting patiently for you.
</blockquote>
<p>
They talk about calling methods <a href="http://www.devshed.com/c/a/PHP/Defining-Public-and-Protected-Methods-with-Member-Visibility-in-PHP-5/1/">globally</a> first and then move into the keyword restrictions. They show the difference between a public method/variable and a <a href="http://www.devshed.com/c/a/PHP/Defining-Public-and-Protected-Methods-with-Member-Visibility-in-PHP-5/2/">protected</a> one, including how to get at the protected members from a child class.
</p>]]></description>
      <pubDate>Thu, 12 Jun 2008 07:51:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Parsing Child Nodes with the DOM XML extension in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/9928</guid>
      <link>http://www.phpdeveloper.org/news/9928</link>
      <description><![CDATA[<p>
<i>Alejandro Gervasio</i> has finished up his series on DevShed looking at working with the DOM extension in PHP5 with <A href="http://www.devshed.com/c/a/PHP/Parsing-Child-Nodes-with-the-DOM-XML-extension-in-PHP-5/">this new article</a>, a look at parsing child nodes.
</p>
<blockquote>
In this last chapter of the series, I'm going to teach you how to handle the child nodes of an XML document by way of two simple methods, called hasChildNode() and removeChild() respectively. So let's not waste any more time in preliminaries and learn how to use them in a helpful way.
</blockquote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Parsing-Child-Nodes-with-the-DOM-XML-extension-in-PHP-5/1/">review</a> some of the concepts mentioned previously before moving ahead to the use of the <a href="http://www.devshed.com/c/a/PHP/Parsing-Child-Nodes-with-the-DOM-XML-extension-in-PHP-5/2/">hasChildNodes</a> and <a href="http://www.devshed.com/c/a/PHP/Parsing-Child-Nodes-with-the-DOM-XML-extension-in-PHP-5/3/">removeChild</a> methods to check for children and get rid of only certain ones.
</p>]]></description>
      <pubDate>Tue, 08 Apr 2008 09:47:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Arnold Daniels' Blog: A dark corner of PHP: class casting]]></title>
      <guid>http://www.phpdeveloper.org/news/9670</guid>
      <link>http://www.phpdeveloper.org/news/9670</link>
      <description><![CDATA[<p>
In <a href="http://blog.adaniels.nl/articles/a-dark-corner-of-php-class-casting/">this blog entry</a> <i>Arnold Daniels</i> talks about an issue he had in the past (needing a bit more functionality than the <a href="http://pear.php.net/package/DB">PEAR DB library</a> could offer) and how he ended up solving it with what he calls a "dark corner" of PHP - class casting.
</p>
<blockquote>
PHP has a function serialize, which can create a hash from any type of variable, scalars, array, but objects as well. Using the unserialize function, PHP can recreate the variable from the serialized hashed. If we look at how an object is serialized, we see only the properties and the class name are stored.
</blockquote>
<p>
<a href="http://blog.adaniels.nl/articles/a-dark-corner-of-php-class-casting/">His method</a> allows for class manipulation via changes to the serialized class information (like changing the value of the name parameter). His "casttoclass()" function makes changing this value simple.
</p>]]></description>
      <pubDate>Wed, 20 Feb 2008 12:08:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Mike Lively's Blog: Late Static Binding - Changes to parent]]></title>
      <guid>http://www.phpdeveloper.org/news/9112</guid>
      <link>http://www.phpdeveloper.org/news/9112</link>
      <description><![CDATA[<p>
<i>Mike Lively</i> has <a href="http://www.ds-o.com/archives/68-Late-Static-Binding-Changes-to-parent.html">shared some of his thoughts</a> on the late static binding functionality that will be in the upcoming PHP 5.3 - specifically the relationships of parents and children it has.
</p>
<blockquote>
I won't rehash all of the arguments as you can quite easily find out my full thoughts by previous posts and on that mailing list thread. To put it simply I feel that somehow there needs to be a way to call methods in a parent class without losing the ability to reference back to the original called static.
</blockquote>
<p>
He gives an example of what he's talking about (code) and, to help further his cause he's <a href="http://www.ds-o.com/exit.php?url_id=185&entry_id=68">created</a> <a href="http://www.ds-o.com/exit.php?url_id=186&entry_id=68">three</a> <a href="http://www.ds-o.com/exit.php?url_id=187&entry_id=68">patches</a> to make it work how he'd like.
</p>]]></description>
      <pubDate>Mon, 26 Nov 2007 09:37:00 -0600</pubDate>
    </item>
  </channel>
</rss>
