<?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>Sun, 26 May 2013 00:14:16 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Pixelstech.com: Should we use Abstract class or Interface?]]></title>
      <guid>http://www.phpdeveloper.org/news/19478</guid>
      <link>http://www.phpdeveloper.org/news/19478</link>
      <description><![CDATA[<p>
On the Pixelstech.com site today there's a new post that talks about the <a href="http://www.pixelstech.net/article/1366044255_Should_we_use_Abstract_class_or_Interface_">differences between abstract classes and interfaces</a> and when's the best time to use either (or both).
</p>
<blockquote>
When we write programs, we may often get into a situation where we don't know whether we should use Abstract class or Interface when we want to define an abstract object. These two are very similar and they are interchangeable. On Stackoverflow, this question is asked many times, it's related to many programming languages. Also in the official documentation of PHP regarding the Abstract class and Interface, people are arguing about this. To understand this question, we need to understand their differences and use scenarios.
</blockquote>
<p>
They provide examples of abstract class and interface usage with one of the main differences being that you can define functionality in abstract classes. There's also examples showing classes that extend the abstract class while implementing the interface at the same time, helping to define the object structure to an even finer level.
</p>
Link: http://www.pixelstech.net/article/1366044255_Should_we_use_Abstract_class_or_Interface_]]></description>
      <pubDate>Thu, 18 Apr 2013 09:22:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Phil Bennett: Do We Need a Framework For That? Or Hurry Up PHP-FIG]]></title>
      <guid>http://www.phpdeveloper.org/news/19442</guid>
      <link>http://www.phpdeveloper.org/news/19442</link>
      <description><![CDATA[<p>
In <a href="http://happyaccidents.me/blog/do-we-need-a-framework-for-that">this recent post</a> to his site, <i>Phil Bennett</i> shares some thoughts about the PHP-FIG, the standards they're proposing and how the shares interfaces might help reduce dependencies in framework-based applications.
</p>
<blockquote>
[Frameworks] come in several different flavours that all have huge advantages, but also a few disadvantages. Over engineered (because their popularity demands that they be), updated too often, not updated enough. If you decide for example to update your application from using Zend Framework 1 to using Zend Framework 2, this will more than likely require, at least in part, a re-write of your code. This makes scalability difficult.
</blockquote>
<p>
He talks some about the PSRs that the PHP-FIG group has proposed including the PSR-3 logging interface structure. He points out that, by having this same structure, it makes injecting dependencies easy while still leaving the actual functionality open to interpretation. He also suggests that maybe a framework isn't the right choice for all applications and that possibly using a collection of libraries, tied together by the PSR standards, could be a better answer.
</p>
Link: http://happyaccidents.me/blog/do-we-need-a-framework-for-that]]></description>
      <pubDate>Wed, 10 Apr 2013 13:38:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen: Objects in the model layer: Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/19398</guid>
      <link>http://www.phpdeveloper.org/news/19398</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> <a href="http://akrabat.com/development/objects-in-the-model-layer/">previously posted</a> about some of his practices around the different types of objects in the model layer of his Zend Framework 2 applications. In <a href="http://akrabat.com/php/objects-in-the-model-layer-part-2/">this latest post</a> he follows up and shares some example code for the different types.
</p>
<blockquote>
I previously talked about the terms I use for <a href="http://akrabat.com/development/objects-in-the-model-layer/">objects in the model layer</a> and now it's time to put some code on those bones. Note that,as always, all code here is example code and not production-ready.
</blockquote>
<p>
He includes sample classes related to his "books" examples - a "book" entity (with title, author, id and ISBN), a mapper object to load/save/delete the entity and a service object that provides an interface for the entity to the rest of the application.
</p>]]></description>
      <pubDate>Tue, 02 Apr 2013 11:55:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Maarten Balliauw: Working with Windows Azure SQL Database in PhpStorm]]></title>
      <guid>http://www.phpdeveloper.org/news/19231</guid>
      <link>http://www.phpdeveloper.org/news/19231</link>
      <description><![CDATA[<p>
<i>Maarten Balliauw</i> has a new post to his site showing how you can work with a Azure SQL database <a href="http://blog.maartenballiauw.be/post/2013/02/25/Working-with-Windows-Azure-SQL-Database-in-PhpStorm.aspx">directly from the UI</a> of the popular PHP IDE, <a href="http://www.jetbrains.com/phpstorm/">phpStorm</a>.
</p>
<blockquote>
PhpStorm provides us the possibility to connect to Windows Azure SQL Database right from within the IDE. In this post, we'll explore several options that are available for working with Windows Azure SQL Database: Setting up a database connection, creating a table, inserting and updating data, using the database console, generating a database diagram and database refactoring.
</blockquote>
<p>
He includes the instructions and several screenshots showing each step of the above mentioned steps. The database diagram gives you a good overall view of your database structure and allows you to show a visualization of how the tables relate to each other. Note that, though this particular example shows it connecting to an Azure SQL database, the same setup can be used with lots of popular RDBMS out there.
</p>]]></description>
      <pubDate>Mon, 25 Feb 2013 09:13:20 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Implementing PSR-3 with log4php]]></title>
      <guid>http://www.phpdeveloper.org/news/19039</guid>
      <link>http://www.phpdeveloper.org/news/19039</link>
      <description><![CDATA[<p>
With the <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md">PSR-3</a> logging interface recently accepted by the PHP-FIG, <i>Jamie Munro</i> has written up a post for PHPMaster.com that shows how to <a href="http://phpmaster.com/implementing-psr-3-with-log4php/">implement the interface with log4php</a>, the <a href="http://logging.apache.org/log4php/">Apache logging tool</a>.
</p>
<blockquote>
With the recent passage of PSR-3, a standard for a common interface for logging libraries, it seems appropriate to discuss the implementation with my favorite logging library. log4php is an open source Apache project that is a very versatile logging framework. Through log4php's configuration files, logging has a variety of output locations, so it's possible to send specific log levels to different output locations. 
</blockquote>
<p>
He includes the Composer requirements for the interface and shares the code for a wrapper class that implements the Logger interface and defines methods for each of the logging levels (alert, notice, debug, etc). Also in the post is an example XML configuration for log4php and how to load it into your class instance.
</p>]]></description>
      <pubDate>Tue, 15 Jan 2013 12:53:17 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: PSR-3 Accepted - Logger Interface]]></title>
      <guid>http://www.phpdeveloper.org/news/19037</guid>
      <link>http://www.phpdeveloper.org/news/19037</link>
      <description><![CDATA[<p>
The PHP-FIG  (Framework Interoperability Group) has recently <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md">accepted the PSR-3 definition</a> for a standardized Logger interface structure that can be used for interoperability between frameworks (and other tools).
</p>
<blockquote>
The main goal is to allow libraries to receive a PsrLogLoggerInterface object and write logs to it in a simple and universal way. Frameworks and CMSs that have custom needs MAY extend the interface for their own purpose, but SHOULD remain compatible with this document. This ensures that the third-party libraries an application uses can write to the centralized application logs.
</blockquote>
<p>
The <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md">implementation of this structure</a> into your application makes it easier should you decide to swap out logging tools or want to create your own that can be used across several different frameworks. This is the third PSR to be accepted by the group, following <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md">PSR-1</a> and <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md">PSR-2</a> more related to coding standards.
</p>]]></description>
      <pubDate>Tue, 15 Jan 2013 10:55:01 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stuart Herbert: Personal Thoughts On The PSR-3 Log Proposal]]></title>
      <guid>http://www.phpdeveloper.org/news/18971</guid>
      <link>http://www.phpdeveloper.org/news/18971</link>
      <description><![CDATA[<p>
In his latest post, <i>Stuart Herbert</i> has <a href="http://blog.stuartherbert.com/php/2012/12/29/personal-thoughts-on-the-psr-3-log-proposal/">shared some thoughts</a> about the recently proposed PSR-3 proposal for a unified logging interface for PHP projects.
</p>
<blockquote>
PSR-3 is a proposed standard (<a href="https://groups.google.com/forum/?fromgroups=#!topic/php-fig/d0yPC7jWPAE">voting</a> has finished, it should appear as an accepted standard when the PSR folks recover from too much Christmas turkey) describing a common logging interface for PHP frameworks. It's based on a small subsection of <a href="http://tools.ietf.org/html/rfc5424">RFC 5424</a>, which describes the Syslog standard, which is a very sensible choice. Sysadmins think in terms of Syslog levels, and they utterly hate dealing with loggers that don't map cleanly onto Syslog.
</blockquote>
<p>
He briefly introduces the PSR and the format of the logger with some of the main methods it should implement and what they do. He talk gets into some of his critiques about the proposal, namely the method naming, the exception handling parameter and the proposed LogLevel constants.
</p>]]></description>
      <pubDate>Mon, 31 Dec 2012 10:46:13 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Paul Jones: A Response To "On php-fig and Shared Interfaces"]]></title>
      <guid>http://www.phpdeveloper.org/news/18944</guid>
      <link>http://www.phpdeveloper.org/news/18944</link>
      <description><![CDATA[<p>
<i>Paul Jones</i> has <a href="http://paul-m-jones.com/archives/4226">written up a response</a> to <i>Matthew Weier O'Phinney</i>'s <a href="http://phpdeveloper.org/news/18933">recent post</a> on shared interfaces and the PHP-FIG. In it he talks about the PHP-FIG group itself and specific references back to the original post.
</p>
<p>
He mentions the ideas of "new thinking" and the limitations that standardized interfaces might try to impose on an application:
</p>
<blockquote>
One is able to imagine reasons why having shared interfaces of the kind described above is in opposition to, or at best orthogonal to, better development practices and greater innovation across PHP land. Even so, I assert that shared interfaces as described, while maybe preventing an imaginable ideal in theory, instead promote an actual good in practice.
</blockquote>
<p>
<i>Matthew Weier O'Phinney</i> <a href="http://mwop.net/blog/2012-12-20-on-shared-interfaces.html#comment-744905017">responded</a> with some of his own comments and correcting some of the misinterpretation of his original comments.
</p>]]></description>
      <pubDate>Mon, 24 Dec 2012 12:54:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney: On php-fig and Shared Interfaces]]></title>
      <guid>http://www.phpdeveloper.org/news/18933</guid>
      <link>http://www.phpdeveloper.org/news/18933</link>
      <description><![CDATA[<p>
In his most recent post <i>Matthew Weier O'Phinney</i> (lead on the Zend Framework project) takes a look at the PHP Interoperability Group (php-fig) and some recent discussions that have come up about <a href="http://mwop.net/blog/2012-12-20-on-shared-interfaces.html">shared interfaces</a> for things like logging and caching.
</p>
<blockquote>
A little over a year ago, there was a new push by a number of folks wanting to do more. Paul Jones did a remarkable job of spearheading the next <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md">two</a> <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md">standards</a>, which centered around coding style. [...] And this is when we started seeing proposals surface for shared interfaces, first around caching, and now around logging (though the latter is the first up for vote).
</blockquote>
<p>
He talks a bit about shared interfaces - what they are and what kind of problem they aim to solve - and how he's not sure he "buys into them". He notes that "sharing is good, developing solutions is better" and stresses making it easier to operate with each other and not worry so much about standardized interfaces.
</p>
<p>
He's found a few problems with the concepts behind them like the Not Invented Here (NIH) idea they promote and that there's not really just a single solution to these kinds of problems ("space for multiple implementations"). He suggests an alternative to the idea of these shared interfaces - <a href="http://en.wikipedia.org/wiki/Bridge_pattern">bridges</a>/<a href="http://en.wikipedia.org/wiki/Adapter_pattern">adapters</a>. He illustrates this idea with some code showing the implementation of a "CacheInterface" and a "FrameworkACache" adapter that wraps the functionality of a "CacheItem" class that might be internal to your application already.
</p>]]></description>
      <pubDate>Fri, 21 Dec 2012 11:45:37 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[IBM developerWorks: Create REST applications with the Slim micro-framework]]></title>
      <guid>http://www.phpdeveloper.org/news/18903</guid>
      <link>http://www.phpdeveloper.org/news/18903</link>
      <description><![CDATA[<p>
On the IBM developerWorks site there's a new tutorial posted walking you through the process of creating a <a href="http://www.ibm.com/developerworks/xml/library/x-slim-rest/index.html">REST application with Slim</a>, a popular microframework for PHP.
</p>
<blockquote>
In this article, I introduce you to Slim, a PHP micro-framework that's designed for rapid development of web applications and APIs. Don't be fooled by the name: Slim comes with a sophisticated URL router and support for page templates, flash messages, encrypted cookies, and middleware. It's also extremely easy to understand and use, and it comes with great documentation and an enthusiastic developer community.
</blockquote>
<p>
They start off by defining REST in terms of its usual four "verbs" - GET, POST, PUT and DELETE - and the conventions of the types of actions for each. Once you get the framework installed (via <a href="http://getcomposer.org">Composer</a>) they help you create a sample database with an "articles" table and some sample data your service will work with. They go through each of the "verbs" and include code showing how to respond to the requests for each, including some exceptions for when things go wrong. There's also a bit about adding authentication "middleware" to the process - a hook to validate a user key as a part of the routing process. They finish things off by showing how to support multiple response formats and like XML and JSON based on the requested media type.
</p>]]></description>
      <pubDate>Mon, 17 Dec 2012 12:56:24 -0600</pubDate>
    </item>
  </channel>
</rss>
