<?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>Sat, 25 May 2013 22:39:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Andrew Podner: Using Stackato for PHP Applications in a Private PaaS]]></title>
      <guid>http://www.phpdeveloper.org/news/19327</guid>
      <link>http://www.phpdeveloper.org/news/19327</link>
      <description><![CDATA[<p>
In <a href="http://unassumingphp.com/using-stackato-for-php-applications-in-a-private-paas/">this new post</a> to his site <i>Andrew Podner</i> looks at using the <a href="http://www.activestate.com/stackato">Stackato</a> software from ActiveState to provide a Platform-as-a-Service environment on any cloud infrastructure.
</p>
<blockquote>
So, now it is settled, I want to stay inside the corporate firewall, but I want each application isolated from the next, and by the way, there is no budget for any of this.  I posted about three <a href="http://unassumingphp.com/php-apps-and-platform-as-a-service/">PaaS providers</a> a while back, and started thinking that what I really needed was <a href="http://en.wikipedia.org/wiki/Platform_as_a_service">PaaS</a>, but I needed to be able to host the PaaS environment inside a corporate LAN.  Off to search the web. Surprisingly, there were not just a ton of viable results in that search.  Even more surprising...hard to find one with a "download here" button.  No matter how I searched though, one company & product kept popping up: <a href="http://www.activestate.com/stackato">Stackato by ActiveState</a>.  The words "Free Micro Cloud" were a very encouraging sign.  So let's take this thing for a spin and see just how easy it is...
</blockquote>
<p>
He walks you through the installation process - downloading the VMs, setting up the initial configuration and how to use the command line tool to deploy your own applications (several come preconfigured though). He also includes an example configuration (YAML) you can use to configure custom applications and some sample code showing a database connection.
</p>]]></description>
      <pubDate>Mon, 18 Mar 2013 12:17:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: Privates - Harmful or Useful? (Discussion)]]></title>
      <guid>http://www.phpdeveloper.org/news/18878</guid>
      <link>http://www.phpdeveloper.org/news/18878</link>
      <description><![CDATA[<p>
There's been a few articles posted on various blogs in the PHP community recently about the "most correct" usage of the "private" scope in your PHP applications. As with any feature of just about any language out there, there's people on both sides of the fence. Here's the ones that have weighed in so far:
</p>
<ul>
<li><i>Brandon Savage</i>'s <a href="http://www.brandonsavage.net/private-methods-considered-harmful/">initial post</a> (an excerpt from his upcoming "Do This, Not That" book)
<li>A <a href="http://blog.ircmaxell.com/2012/12/response-private-methods-considered.html">response to this</a> from <i>Anthony Ferrara</i>
<li><i>Brandon</I>'s <a href="http://www.brandonsavage.net/in-further-defense-of-avoiding-private-methods/">own response</a> to comments on his previous article
<li><a href="http://www.garfieldtech.com/blog/private-composition-inheritance">This new post</a> from <i>Larry Garfield</i> and some of his experience from the Drupal world
</ul>
<p>
Various topics come up during these posts including static coupling, using interfaces versus inheritance, wrapper classes and developer intent.
</p>]]></description>
      <pubDate>Wed, 12 Dec 2012 09:53:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brandon Savage: Private Methods Considered Harmful ("Do This, Not That" Excerpt)]]></title>
      <guid>http://www.phpdeveloper.org/news/18867</guid>
      <link>http://www.phpdeveloper.org/news/18867</link>
      <description><![CDATA[<p>
A while back <i>Brandon Savage</i> <a href="http://www.brandonsavage.net/introducing-do-this-not-that-for-php-developers/">mentioned a book he was writing</a> ("Do This, Not That") to help PHP developers learn some of the best practices associated with the language. Today he's <a href="http://www.brandonsavage.net/private-methods-considered-harmful/">posted an excerpt</a> from the book for your enjoyment.
</p>
<blockquote>
This great series of highly focused e-books will offer tips, tricks and best practices focused on core areas of PHP development, including databases, security, filtering, regular expressions, configuration and more. Since it will be a series of tightly targeted solutions, developers will be able to pick all, some or just one of the offerings that solves their specific problem(s).
</blockquote>
<p>
<a href="http://www.brandonsavage.net/private-methods-considered-harmful/">This excerpt</a> looks at private method use in your applications and why they could be considered "evil" if not used correctly.
</p>]]></description>
      <pubDate>Mon, 10 Dec 2012 11:26:42 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian G&ouml;ttschkes' Blog: Extending the Testclass for Unittests]]></title>
      <guid>http://www.phpdeveloper.org/news/17898</guid>
      <link>http://www.phpdeveloper.org/news/17898</link>
      <description><![CDATA[<p>
In his <a href="http://phpdeveloper.org/news/17815">previous post</a> <i>Sebastian G&ouml;ttschkes</i> introduced a set of classes you could use for different types of testing in your Symfony2 applications. In his <a href="http://sgoettschkes.blogspot.com/2012/04/extending-testclass-for-unittests.html">most recent post</a> he expands on these examples, giving the UnitTestClass an extra ability.
</p>
<blockquote>
In one of my last articles on <a href="http://sgoettschkes.blogspot.com/2012/04/testclasses-for-symfony2.html">Testclasses for symfony2</a> I explained some of the classes I use for my tests. Since then I found a <a href="http://www.littlehart.net/atthekeyboard/2012/04/19/metatesting-extending-your-testing-tools/">great article on metatesting</a> and want to update my UnitTest class to show some practical examples.
</blockquote>
<p>
His update allows the class to access private properties via a "getAttribute" method that, via PHP's <a href="http://php.net/reflection">Reflection</a>, allows you to pull out the private property's value and a "setAttribute" that lets you inject a value back in. He includes a word of warning, though - if you're using something like this often., you're probably "doing it wrong" and might need to think through your application design a bit more.
</p>
<p>
You can find the source for his classes in <a href="http://sgoettschkes.blogspot.com/2012/04/testclasses-for-symfony2.html">his previous post</a>.
</p>]]></description>
      <pubDate>Wed, 02 May 2012 11:38:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[RubySource.com: Confessions of a Converted PHP Developer: On Visibility and Privates]]></title>
      <guid>http://www.phpdeveloper.org/news/16331</guid>
      <link>http://www.phpdeveloper.org/news/16331</link>
      <description><![CDATA[<p>
From RubySource.com there's a new post from a confessed developer who moved from PHP to Ruby about <a href="http://rubysource.com/php-developer-on-visibility-and-privates/">PHP's private visibility rules</a> and how they compare to Ruby's.
</p>
<blockquote>
Alright class - today I'm here to talk about the differences and similarities that PHP and Ruby have when it comes to object properties, methods, and their visibility - how you create variables inside classes, and how you can interact with them.
</blockquote>
<p>
He compares the private properties in PHP classes to the corresponding handling in Ruby, including the getters and setters to go with them. There's also a look at class visibility settings in Ruby.
</p>]]></description>
      <pubDate>Thu, 12 May 2011 10:49:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Vance Lucas' Blog: Protected vs Private Scope: Arrogance, Fear and Handcuffs]]></title>
      <guid>http://www.phpdeveloper.org/news/16148</guid>
      <link>http://www.phpdeveloper.org/news/16148</link>
      <description><![CDATA[<p>
<i>Vance Lucas</i> has tossed his hat into the ring in the debate about private versus protected scope in PHP projects with <a href="http://www.vancelucas.com/blog/protected-vs-private-scope-arrogance-fear-and-handcuffs/">this new post</a> to his blog.
</p>
<blockquote>
The age old private vs protected debate has been re-ignited in the PHP community recently following the decision of Doctrine2 and Symfony2 to make all class methods private until there is a very clear and proven reason to change them to protected or public. The intention is a good one - to ensure they are providing a clear and stable API through intentional and known extension points that they can better test and support. [...] The problem is that this kind of thinking is a slippery slope that kills the spirit of programming.
</blockquote>
<p>
He suggests that, by limiting the scoping down to private, you're taking away the very thing that gets most people excited about third-party tools - the extensibility. In his opinion, it sends a strong message to other developers that they're "not welcome" to make suggestions or updates to the application/tool. 
</p>]]></description>
      <pubDate>Tue, 05 Apr 2011 10:45:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Insidesigns Blog: Create a scalable private messaging application using PHP5]]></title>
      <guid>http://www.phpdeveloper.org/news/15548</guid>
      <link>http://www.phpdeveloper.org/news/15548</link>
      <description><![CDATA[<p>
From the Insidesigns blog there's <a href="http://blog.insicdesigns.com/2010/12/create-a-scalable-private-messaging-application-using-php5/">a new tutorial</a> showing how you can create a scalable messaging application that works similarly to the instant message platforms users are used to. Their method combines PHP and a MVC approach.
</p>
<blockquote>
Most social networking sites support two types of messages: public and private messages. Private messages are generally sent in a similar fashion to e-mails, and public messages being posted on user's profiles for other users to see. In this article by Michael Peacock, author of the book <a href="https://www.packtpub.com/php-create-powerful-dynamic-social-networking-website/book">PHP 5 Social Networking</a>, we will learn how to allow users to post private messages to each other.
</blockquote>
<p>
They start with the database structure (specifying things like sender, message and the message) and move into the models to connect the scripts to them. Then they progress into the controllers and views for listing messages, reading a message, viewing and deleting a message. Full code is provided in the post, ready for cut and paste.
</p>]]></description>
      <pubDate>Wed, 08 Dec 2010 11:21:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Wojciech Sznapka's Blog: Accessing private object property from other object in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15439</guid>
      <link>http://www.phpdeveloper.org/news/15439</link>
      <description><![CDATA[<p>
<i>Wojciech Sznapka</i> has a new post to his blog showing an interesting OOP programming strick related to <a href="http://blog.sznapka.pl/accessing-private-object-property-from-other-object/">accessing private properties</a> in one object from another if they're derived from the same class.
</p>
<blockquote>
Last time I wrote about <a href="http://blog.sznapka.pl/weirdest-php-construction-ive-ever-seen/">Weirdest PHP construction I've ever seen</a>, now I found another unusual PHP solution. PHP offers 3 visibility modifiers: private, protected and public. Private properties and methods can't be accessed outside the object, as well as from inherited classes. With one exception... They can be accessed by other instances of the same class. You can read more about it in the <a href="http://www.php.net/manual/en/language.oop5.visibility.php#language.oop5.visibility-other-objects">PHP manual</a>.
</blockquote>
<p>
In his code example he shows how to create two objects of the Foo class and, using getters and setters change the value of a private property from the first object on the second object.
</p>]]></description>
      <pubDate>Tue, 16 Nov 2010 12:25:53 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Paul Jones' Blog: Regarding Underscores]]></title>
      <guid>http://www.phpdeveloper.org/news/15314</guid>
      <link>http://www.phpdeveloper.org/news/15314</link>
      <description><![CDATA[<p>
In response to <a href="http://www.phpdeveloper.org/news/15297">a post</a> from <i>Leszek Stachowski</i> about underscores in PHP class development, <i>Paul Jones</i> has <a href="http://paul-m-jones.com/archives/1641">shared his own thoughts</a> on the matter - that he disagrees with <i>Leszek</i> and suggests keeping the underscore prefix for private methods.
</p>
<blockquote>
I think the underscore-prefix for protected and private is a good convention to keep. As with many things about programming, this convention is not for the program, it is for for the programmer. For example, <a href="http://paul-m-jones.com/archives/276">limiting your line length to about 80 characters</a> is a good idea, not for reasons of "tradition", but because of cognitive limitations of human beings who have to read code. Likewise, using the underscore prefix is an immediate and continuous reminder that some portions of the code are not public. Its purpose is as an aid to the programmer. 
</blockquote>
<p>
He suggests that it offers something similar to the thought process behind the magic methods like __get or __set that both work on a private scope. Check some of <a href="http://paul-m-jones.com/archives/1641#comments">the comments</a> for opinions both for and against the idea from other community members.
</p>]]></description>
      <pubDate>Thu, 21 Oct 2010 10:47:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Leszek Stachowski's Blog: php anachronic coding standards]]></title>
      <guid>http://www.phpdeveloper.org/news/15297</guid>
      <link>http://www.phpdeveloper.org/news/15297</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Leszek Stachowski</i> <a href="http://shazarre.wordpress.com/2010/10/18/php-anachronic-coding-standards/">wonders about a coding convention</a> that's still widely used when it comes to private methods in a class - the underscore prefix.
</p>
<blockquote>
The question which comes instantly to my mind is: why? Is there any reason why this convention should be kept when PHP object oriented programming has gone a long way since PHP 4 (when there was no access modifiers and such underscore was the only fast way to distinguish public from, hmm, not public methods and properties) ? Are, for instance (as one of major OOP languages), Java coding standards pushing towards such naming convention? No!
</blockquote>
<p>
He, like many other developers, are pushing to drop this kind of convention as an outdated reminder of the PHP4 days when "private" didn't exist in the language. Scope modifiers have done away with the need for that underscore completely.
</p>]]></description>
      <pubDate>Mon, 18 Oct 2010 13:46:27 -0500</pubDate>
    </item>
  </channel>
</rss>
