<?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, 22 May 2012 12:03:37 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Inject dependencies via PhpDoc]]></title>
      <guid>http://www.phpdeveloper.org/news/17796</guid>
      <link>http://www.phpdeveloper.org/news/17796</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a new post to his blog looking at <a href="http://gonzalo123.wordpress.com/2012/04/09/inject-dependencies-via-phpdoc/">a method for injecting dependencies</a> into your application's code based on comments in the PHPDocumentor-formatted comments of your methods.
</p>
<blockquote>
Last month I attended to <a href="http://www.codemotion.es/">Codemotion</a> conference. I was listening to a talk about Java and I saw the "@inject" decorator. I must admit I switched off my mind from the conference and I started to take notes in my notebook. The idea is to implement something similar in PHP. It's a pity we don't have real decorators in PHP. I really <a href="http://gonzalo123.wordpress.com/2009/12/09/things-i-miss-in-php-function-decorators/">miss</a> them. We need to use <a href="http://gonzalo123.wordpress.com/2011/02/01/function-decorators-in-php-with-phpdoc-and-annotations/">PhpDoc</a>. It's not the same than real decorators in other programming languages. That's my prototype. Let's go.
</blockquote>
<p>
All of the code you'll need to recreate his solution is included - a sample "User" class that needs a valid PDO object in a private "db" property, a "DocInject" class that parses the comments and, using a new feature of PHP 5.4 (traits), injects the needed functionality into the "User" class and creates/assigns the object.
</p>
<p>
You can see just the full code in <a href="https://gist.github.com/2343376">these</a> <a href="https://gist.github.com/2343390">two</a> gists on Github.
</p>]]></description>
      <pubDate>Tue, 10 Apr 2012 10:23:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rafael Dohms' Blog: Book Review: The Art of Readable Code]]></title>
      <guid>http://www.phpdeveloper.org/news/17604</guid>
      <link>http://www.phpdeveloper.org/news/17604</link>
      <description><![CDATA[<p>
<i>Rafael Dohms</i> has posted <a href="http://blog.doh.ms/2012/02/27/book-review-art-of-readable-code/">a new review of a book</a> that focuses on helping you create better, more readable code - "The Art of Readable Code" (<i>Dustin Boswell</i>, <i>Trevor Foucher</i>, O'Reilly). This is isn't about "pretty code" as much as it is manageable, easy to follow structures and logic flows.
</p>
<blockquote>
"The Art of Readable Code" was written by Dustin Bowell and Trevor Foucher and basically focuses on concepts and suggestions to make you code not just readable, but comprehendible by other developers, or as the author's suggest, yourself in six months. Code readability is a topic that I truly believe the PHP community does not focus enough on and i really wanted a look at this book to see what kind of ideas it had and what I could do my best to bring to the attention of other developers.
</blockquote>
<p>
The book is language-agnostic and provides ideas that developers should keep in mind when doing their development - clear variable names, making comments that make sense, refactoring tips and hints for implementing your ideas in code. He recommends the book to any developer (in any language) to help them make code that will stand the test of time and be easier to manage/understand in the future.
</p>]]></description>
      <pubDate>Wed, 29 Feb 2012 10:41:12 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Building a Domain Model - An Introduction to Persistence Agnosticism]]></title>
      <guid>http://www.phpdeveloper.org/news/17591</guid>
      <link>http://www.phpdeveloper.org/news/17591</link>
      <description><![CDATA[<p>
On PHPMaster.com there's <a href="http://phpmaster.com/building-a-domain-model/">a recent tutorial</a> introducing the concept of a "domain model" and showing how to create them in PHP (manually, not inside of any ORM or database solution).
</p>
<blockquote>
First off, creating a rich Domain Model, where multiple domain objects with well-defined constraints and rules interact, can be a daunting task. Second, not only is it necessary to define from top to bottom the model itself, but it's also necessary to implement from scratch or reuse a mapping layer in order to move data back and forward between the persistence layer and the model in question. 
</blockquote>
<p>
They include an example of a set of domain models tat relate to one another - a blog setup with posts, comments and users. They show how to create the AbstractEntity to handle a bit of the magic behind the scenes, an example "Post" and "Comment" models and how they can be put to work creating some posts and appending comments. A little bit of markup is included to output the results.
</p>]]></description>
      <pubDate>Mon, 27 Feb 2012 12:58:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Introduction to PhpDoc]]></title>
      <guid>http://www.phpdeveloper.org/news/17370</guid>
      <link>http://www.phpdeveloper.org/news/17370</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new post from <i>Moshe Teutsch</i> about <a href="http://phpmaster.com/introduction-to-phpdoc/">working with docblock comments</a> in PHP scripts and how to use the <a href="http://phpdoc.org">phpDocumentor</a> tool to generate the documentation from them.
</p>
<blockquote>
If you've ever tried to read code written by someone other than yourself (who hasn't?), you know it can be a daunting task. [...] PhpDoc, short for PhpDocumentor, is a powerful tool that allows you to easily document your code via specially formatted comments. [...] By using PhpDoc, you can make it easy for others (and yourself) to understand your code - weeks, months, and even years after you've written it.
</blockquote>
<p>
He introduces the concept of "docblocks" and includes several examples of how to comment things like packages, files, classes and functions/methods. Finally, he wraps up the post with an example of using the "phpdoc" command to run phpDocumentor and build the docs. In the comments, another tool is also suggested - <a href="http://docblox-project.org/">DocBlox</a>, a project that still parses the same docbloc syntax but does it in a much more memory efficient way (and is an actively maintained project).
</p>]]></description>
      <pubDate>Tue, 10 Jan 2012 10:07:26 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Karsten Deubert's Blog: Zend_MVC, Controller Plugins and Annotations]]></title>
      <guid>http://www.phpdeveloper.org/news/17178</guid>
      <link>http://www.phpdeveloper.org/news/17178</link>
      <description><![CDATA[<p>
<i>Karsten Deubert</i> has a recent post to his blog looking at <a href="http://www.logaholic.de/2011/11/25/zend_mvc-controller-plugins-and-annotations/">annotations in Zend Framework applications</a> to enhance functionality already in the framework.
</p>
<blockquote>
Recently I had the idea to influence Controller Actions with annotations but discarded it with thoughts like "In PHP I will have to use reflection and some black magic to get this working which will have insane performance hits for my applications"... until I set everything up to see that it costs just 1-2ms in average per request without any form of caching.
</blockquote>
<p>
He includes a few bits of code to show a simple annotation example (setting a layout) and the controller plugin that performs the translation. In his case, it's hard-coded to look for the "@layout" annotation in the docblock comment, but it'd be relatively trivial to extend it to a more full-featured version.
</p>]]></description>
      <pubDate>Mon, 28 Nov 2011 12:02:50 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Using DocBlox]]></title>
      <guid>http://www.phpdeveloper.org/news/16672</guid>
      <link>http://www.phpdeveloper.org/news/16672</link>
      <description><![CDATA[<p>
On his blog today <i>Matthew Weier O'Phinney</i> has <a href="http://weierophinney.net/matthew/archives/265-Using-DocBlox.html">a new post</a> looking at an alternative to some of the other PHPDoc-based documentation tools, <a href="http://docblox-project.org/">DocBlox</a>, a tool written in PHP.
</p>
<blockquote>
Until a few years ago, there were basically two tools you could use to generate API documentation in PHP: <a href="http://phpdocumentor.org/">phpDocumentor</a> and <a href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</a>. [...] phpDocumentor is practically unsupported at this time (though a small group of developers is working on a new version), and Doxygen has never had PHP as its primary concern. As such, a number of new projects are starting to emerge as replacements. 
</blockquote>
<p>
He introduces <a href="http://docblox-project.org/">DocBlox</a> as one of these alternatives and points out where you can get the latest version (from one of many sources including <a href="http://github.com/mvriel/docblox">github</a>, <a href="http://pear.docblox-project.org/">PEAR</a> or by just grabbing <a href="https://github.com/mvriel/Docblox/zipball/v0.12.2">a release</a>. He includes instructions on how to run the tool on your code, use it to identify missing docblock comments and how to use the class diagrams feature that gives a more visual sense of how things fit together. He also mentions changing the title of the output, using different templates and how it uses a local SQLite database to cache the parsed information about your code (making it simpler and faster to do updates in the future).
</p>]]></description>
      <pubDate>Thu, 04 Aug 2011 08:08:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Integrate Facebook Comments Code with Wordpress or PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16512</guid>
      <link>http://www.phpdeveloper.org/news/16512</link>
      <description><![CDATA[<p>
On DevShed today there's a new tutorial showing you how to <a href="http://www.devshed.com/c/a/PHP/How-to-Add-Facebook-Comment-Boxes-with-PHP/">integrate Facebook commenting</a> with your PHP application via the Facebook Connect API.
</p>
<blockquote>
Facebook comments are a great way to optimize your site for social media and add a level of user-engagement to you site. Quality website comments can increase your website's credibility, as well as its traffic. This tutorial will teach you how to use Facebook's API Connect to integrate comment boxes on your website in a few simple steps, utilizing a little PHP and some elbow grease.
</blockquote>
<p>
You'll need to <a href="http://www.facebook.com/developers/createapp.php">set up an application</a> for your PHP app to make the connection. This will give you the unique keys for your application that'll be used in setting up the commenting. By including a Facebook javascript file, all you'll need to do is output a special "fb" HTML tag with the right attributes and a meta tag or two to configure it with your application's keys.
</p>]]></description>
      <pubDate>Thu, 23 Jun 2011 12:16:19 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Reflection over PHPDoc with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16143</guid>
      <link>http://www.phpdeveloper.org/news/16143</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a new post to his blog today talking about a regular expression-laden script he's some up with to <a href="http://gonzalo123.wordpress.com/2011/04/04/reflection-over-phpdoc-with-php/">reflect over a PHP file</a> and pull out the document's comments (PHPDoc-style).
</p>
<blockquote>
I want to parse PHPDoc code. Let me explain a little bit what I want to do. Imagine a dummy function documented with PHPDoc. [...] PHP has a great reflection API, but as at least in the current PHP version (as far as I know) we only can get the PHPDoc as a string, without parse it. I need to get the parameters and the type of them with reflection. [...] But the type is different. 
</blockquote>
<p>
His script (based loosely on a bit of a component from the <a href="http://framework.zend.com">Zend Framework</a>) parses the file and its comments and grabs the variable types from the PHPDoc blocks on each method and associates them.
</p>
<p>
If you're looking for a more mature solution than just this script, take a look at <a href="https://github.com/mvriel/Docblox">Docblox</a>, a PHP 5.3 documentation generator.
</p>]]></description>
      <pubDate>Mon, 04 Apr 2011 12:51:15 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mike van Riel's Blog: Introducing: DocBlox]]></title>
      <guid>http://www.phpdeveloper.org/news/15847</guid>
      <link>http://www.phpdeveloper.org/news/15847</link>
      <description><![CDATA[<p>
Frustrated with some of the limitations the <a href="http://phpoc.org">phpDocumentor</a> tool has - mostly dealing with the memory issues - <i>Mike van Riel</i> has <a href="http://blog.naenius.com/2011/02/introducing-docblox/">introduced how own tool</a> that works similar but takes better advantage of advancements in PHP to keep things bit more manageable - <a href="https://github.com/mvriel/Docblox">Docblox</a>.
</p>
<blockquote>
Right before or during the Dutch PHP Conference 2010 the issue had arisen again and this time I was determined on solving it. In the end I chose to build a new Documentation Generation Application (may I coin DGA?) for PHP [...] With [a list of key] requirements written down in a small TODO file I started designing the new project (which at the time was still nameless) After spending some hours designing, coding, prototyping, designing, coding and testing is now the time to reveal the fruits of my labour: DocBlox
</blockquote>
<p>
Currently the project is in a pre-release state but is quickly headed to a 1.0 release. The current codebase is completely able to parse files and output the results to HTML files. PDF support is planned for the future. You can find the current feature list <a href="https://github.com/mvriel/Docblox/wiki/Features">here</a> and can download/clone the latest source from it's <a href="https://github.com/mvriel/Docblox">github repository</a>.
</p>]]></description>
      <pubDate>Wed, 02 Feb 2011 13:48:14 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Francesco Montefoschi's Blog: PHPADD: abandoned docblocks detector]]></title>
      <guid>http://www.phpdeveloper.org/news/15578</guid>
      <link>http://www.phpdeveloper.org/news/15578</link>
      <description><![CDATA[<p>
<i>Francesco Montefoschi</i> has a <a href="http://blog.webmatters.it/2010/12/phpadd-abandoned-docblocks-detector/">recent post to his blog</a> looking at a tool you could use to ensure the quality of your code comments - <a href="https://github.com/fmntf/phpadd">PHPADD</a>, the abandoned docblock detector.
</p>
<blockquote>
PHPADD can analyze a directory with PHP source code and detect (for each file, for each class, for each method) if the parameters in the function declaration are compatible with the parameters found in the docblock, reporting the outdated ones. This can be easily integrated in your build script and the result can be published in build result. Using Hudson, you just need HTML Publisher plugin.
</blockquote>
<p>
The include the (super simple) installation instructions for pulling it in via the PEAR installer and running it on your codebase. There's even some <a href="http://acme.webmatters.it/misc/phpadd-output.html">sample output</a> included. If you're interested in the source, check out (or fork) <a href="https://github.com/fmntf/phpadd">the latest code on github</a>.
</p>]]></description>
      <pubDate>Tue, 14 Dec 2010 13:34:34 -0600</pubDate>
    </item>
  </channel>
</rss>

