<?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>Thu, 09 Feb 2012 20:14:31 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Bending XML to Your Will]]></title>
      <guid>http://www.phpdeveloper.org/news/17453</guid>
      <link>http://www.phpdeveloper.org/news/17453</link>
      <description><![CDATA[<p>
PHPMaster.com has a new tutorial posted today about <a href="http://phpmaster.com/bending-xml-to-your-will/">"bending XML to your will"</a> - working with XML data using the <a href="http://us.php.net/manual/en/ref.xml.php">XML Parser</a> and <a href="http://php.net/simplexml">SimpleXML</a> functionality already included with PHP.
</p>
<blockquote>
If you've ever worked with the Twitter or Facebook APIs, looked at RSS feeds from a website, or made use of some type of RPC calls, you've undoubtedly experienced working with XML. [...] Knowing how to process XML data is a crucial programming skill today, and thankfully, PHP offers multiple ways to read, filter, and even generate XML. In this article I'll explain what exactly XML is, in case you haven't had any experience with it yet, and then dive into a few ways you can use PHP to bend XML to your will.
</blockquote>
<p>
He introduces the concepts and syntax behind XML first for those not accustomed and quickly moves into the tools to parse it. First he looks at the <a href="http://us.php.net/manual/en/ref.xml.php">XML Parser</a>, an event-based parser, and <a href="http://php.net/simplexml">SimpleXML</a>, an easy way to access the contents of a well-formed XML document. Snippets of code are provided for each to show you how to put them into practice.
</p>]]></description>
      <pubDate>Thu, 26 Jan 2012 11:04:44 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Philip Norton's Blog: Simple PHP Code To Get last.fm Last Played Tracks]]></title>
      <guid>http://www.phpdeveloper.org/news/17199</guid>
      <link>http://www.phpdeveloper.org/news/17199</link>
      <description><![CDATA[<p>
If you're a <a href="http://last.fm">last.fm</a> user and have been curious about how to get the latest list of your "last played" selections, <i>Philip Norton</i> has <a href="http://www.hashbangcode.com/blog/simple-php-code-get-lastfm-last-played-tracks-605.html">just the code you'll need</a>.
</p>
<blockquote>
The other day I was approached by a friend (Julie Cheung) and asked if I could create some code that would display a list of last played tracks from last.fm. Julie isn't a PHP developer and so the code I gave her had to be easily understandable so that she could edit it herself if needed. The following code is what I came up with.
</blockquote>
<p>
The code pulls from the defined user's "recenttracks" feed and parses it (via a <a href="http://php.net/simplexml_load_string">simplexml_load_string</a> call) into an object that's looped through and outputted. Data that comes back from the feed includes artist anme, name of the track, a URL to more information about it and an image of the album cover. He also includes an updated version that caches the data for three minutes so it's not always relying on the last.fm servers to be there.
</p>]]></description>
      <pubDate>Thu, 01 Dec 2011 13:41:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint.com: How to Create an XML to JSON Proxy Server in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17016</guid>
      <link>http://www.phpdeveloper.org/news/17016</link>
      <description><![CDATA[<p>
On SitePoint.com today there's a new post from <i>Craig Buckler</i> showing you how to create a <a href="http://www.sitepoint.com/php-xml-to-json-proxy/">simple XML to JSON proxy server</a> in PHP with a SimpleXML object at its heart.
</p>
<blockquote>
Unless you're new to this web development lark, you'll know the 'X' in 'AJAX' stands for XML - eXtensible Markup Language. But you're probably not using XML. If you are, you'd probably prefer not to. All the cool kids are using JSON or JSON-P: it has a smaller payload, is easier to use and faster to process. [...] Fortunately, there are a couple of solutions which allow you to retain the benefits of XML data interchange but provide the ease of JSON in JavaScript. In this article, we're going to create an XML to JSON proxy server in PHP.
</blockquote>
<p>
Of course, this will only work with well-formatted XML documents, but it's a quick little hack that pulls in the XML data with a <a href="http://php.net/curl">curl</a> request and parses it via SimpleXML and uses <a href="http://php.net/json_encode">json_encode</a> to push it back out as JSON.
</p>
]]></description>
      <pubDate>Wed, 19 Oct 2011 13:07:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Script-Tutorials.com: Autocomplete with PHP, jQuery, MySQL and XML]]></title>
      <guid>http://www.phpdeveloper.org/news/16981</guid>
      <link>http://www.phpdeveloper.org/news/16981</link>
      <description><![CDATA[<p>
In <a href="http://www.script-tutorials.com/autocomplete-with-php-jquery-mysql-and-xml/">this new tutorial</a> from Script-Tutorials.com they show you how to combine PHP, <a href="http://jquery.com">jQuery</a>, <a href="http://mysql.com">MySQL</a> and XML to create an auto-complete box with drop-down suggestions.
</p>
<blockquote>
Today I have new article for PHP. I will tell you about implementation autocomplete for your sites. Data can be located in different sources - directly in the JS code, in the database, and even in the XML file.
</blockquote>
<p>
All of the code and markup you'll need is included - the HTML for the page containing the field, CSS to style it, the Javascript (jQuery) to make the field work and the SQL/PHP/XML for the backend. You can check out a live demo of the script in action <a href="http://www.script-tutorials.com/demos/160/index.html">here</a> or <a href="http://www.script-tutorials.com/demos/160/source.zip">download the source</a> in a single package and get started.
</p>]]></description>
      <pubDate>Wed, 12 Oct 2011 08:54:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jakub Zalas' Blog: Managing object creation in PHP with the Symfony2 Dependency Injection component]]></title>
      <guid>http://www.phpdeveloper.org/news/16832</guid>
      <link>http://www.phpdeveloper.org/news/16832</link>
      <description><![CDATA[<p>
On his blog today <i>Jakub Zalas</i> has posted a tutorial he's written up about <a href="http://www.zalas.eu/managing-object-creation-in-php-with-the-symfony2-dependency-injection-component">using dependency injection in PHP</a> with the Symfony2 dependency injection component (DIC).
</p>
<blockquote>
Symfony's <a href="https://github.com/symfony/DependencyInjection">DependencyInjection component</a> is a PHP implementation of a Service Container, or as others like to call it, a Dependency Injection Container (DIC). The component also provides useful tools for handling service definitions, like XML loaders or dumpers. If you want to learn more about the dependency injection or the dependency injection container, read an excellent series of articles on the subject by Fabien Potencier: <a href="http://fabien.potencier.org/article/11/what-is-dependency-injection">What is Dependency Injection?</a>
</blockquote>
<p>
He walks you through the entire process - installing the needed libraries (the DIC, a config and class loader component and Buzz, a lightweight HTTP client). Code is included to show object creation the "usual way" and then creating the same types of objects in a dependency injection environment. Also included is a sample XML document describing the services for the container. He finishes the post with a <a href="http://www.zalas.eu/uploads/wp/2011/08/services.png">GraphvizDumper-generated image</a> for the container.
</p>]]></description>
      <pubDate>Thu, 08 Sep 2011 09:24:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Building a Multilingual PHP Website]]></title>
      <guid>http://www.phpdeveloper.org/news/16802</guid>
      <link>http://www.phpdeveloper.org/news/16802</link>
      <description><![CDATA[<p>
On PHPBuilder.com today there's a new post from <i>Vojislav Janjic</i> with three methods (sans-framework) that you can use to <a href="http://www.phpbuilder.com/columns/MultilingualPHPSite/index.php3">create a multilingual website</a> - some a bit easier to maintain than others.
</p>
<blockquote>
Fast internet growth has brought many opportunities in the global market. Businesses can reach their customers across many countries, and information sharing is not limited to a local area or country anymore. This is why there is an increasing tendency for multilingual websites. By having a website in multiple languages, you can target local markets more easily. Also, it is more convenient to use a website in your native language.
</blockquote>
<p>
His three methods are all relatively simple, but they all have their good and bad points - making separate HTML/views for each language, creating XML files with different versions of the content or storing the translations in a MySQL database. He gives quick code snippets showing how to implement each of them, some basing the language on a cookie value, others on a GET variable passed to the page.
</p>]]></description>
      <pubDate>Thu, 01 Sep 2011 09:02:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[David Stockton's Blog: Zend JSON - An Introduction]]></title>
      <guid>http://www.phpdeveloper.org/news/16763</guid>
      <link>http://www.phpdeveloper.org/news/16763</link>
      <description><![CDATA[<p>
<i>David Stockton</i> has a new post to his ZendTutorials.com site today introducing you to an increasingly more handy Zend Framework component that can make your messaging needs easier. The new tutorial <a href="http://zendtutorials.com/tutorial/zend-json-an-introduction/">introduces you to Zend_Json</a>, a component for generating and parsing JSON messages.
</p>
<blockquote>
In the past few years, JSON, or JavaScript Object Notation has seemed to overtake XML and other data encoding methods on the web. [...]  I've also seen numerous examples of developers who create their own sort of JSON encoder rather than either using json_encode or using Zend_Json. What inevitably comes back to bite them is when the data they are encoding contains a special character like quotes, colons, curly brackets, etc.
</blockquote>
<p>
He demonstrates how the Zend_Json component helps to alleviate some of the worries with built-in features that handle everything from basic encoding/decoding, printing out results in a "pretty" way and a handy way to include executable Javascript (once it's evaled on the other side) in your payload. He finishes the tutorial off with a mention of a very handy method that will please those already having to work with XML - the fromXML() method that automagically converts the data over to JSON for you.
</p>]]></description>
      <pubDate>Wed, 24 Aug 2011 08:17:12 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Converting DocBook4 to DocBook5]]></title>
      <guid>http://www.phpdeveloper.org/news/16611</guid>
      <link>http://www.phpdeveloper.org/news/16611</link>
      <description><![CDATA[<p>
In <a href="http://weierophinney.net/matthew/archives/264-Converting-DocBook4-to-DocBook5.html">this new post</a> to his blog <i>Matthew Weier O'Phinney</i> looks at the steps he took to convert over the documentation for the Zend Framework 2 from the DocBook 4 formatting over to DocBook 5. Included in the post is some of the (PHP and bash) code he used to make the switch.
</p>
<blockquote>
Within the <a href="https://github.com/zendframework/zf2">Zend Framework 2 repository</a>, I recently performed a conversion from <A href="http://docbook.org/">DocBook</a> 4 to 5. [...] Interestingly, for DocBook5 being available in beta since 2005 and an official standard since 2009, there is very little material on migrating from DocBook 4 to 5.
</blockquote>
<p>
Right from the start he came across a few problems with the included conversion process that're a part of the "db4-update.xsl" definitions. 
 He has a list of eight steps he had to perform on the current DocBook 4 formatted documentation to make the conversion work smoothly including:
</p>
<ul>
<li>Identify files containing entity declarations, and skip them.
<li>Run the XML file through the db4-upgrade.xsl stylesheet and restore XML entities from the previously placed markers
<li>Fix programlisting elements (replaces entities with original text and wraps in CDATA).
</ul>
<p>
He details these steps in a few different sections talking about handling the entities, creating some helper scripts and how to put the two code parts together in a single bash script that can be run on the entire documentation set. If you're just looking for the code, you can find it <a href="https://github.com/weierophinney/docbook5-migration">on his github account</a>.
</p>]]></description>
      <pubDate>Wed, 20 Jul 2011 09:55:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Idiot-Proof Deployment with Phing]]></title>
      <guid>http://www.phpdeveloper.org/news/16338</guid>
      <link>http://www.phpdeveloper.org/news/16338</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a new post to her blog providing what she calls an <a href="http://www.lornajane.net/posts/2011/Idiot-Proof-Deployment-with-Phing">idiot-proof guide to deployment with Phing</a>, the popular PHP-based deployment tool based on Apache's Ant.
</p>
<blockquote>
When I launched my own product recently (<a href="http://bitestats.com/">BiteStats</a>, a thing to automatically email you a summary of your analytics stats every month), I knew that I would need a really robust way of deploying code. I've been doing a few different things for a few years, and I've often implemented these tools with or for other organisations, but I don't have much code in production in my own right, weirdly. I decided <a href="http://phing.info/">Phing</a> was the way to go, got it installed, and worked out what to do next.
</blockquote>
<p>
Her guide starts with a simple build.xml and builds it out with several tasks and targets including her main "deploy" target that grabs the next tag from her mercurial repository, packages it up for deployment. She explains things step by step so you won't miss anything too, since there's a lot going on.
</p>]]></description>
      <pubDate>Fri, 13 May 2011 11:38:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Enrico Zimuel's Blog: XML to JSON in PHP: an odyssey]]></title>
      <guid>http://www.phpdeveloper.org/news/16289</guid>
      <link>http://www.phpdeveloper.org/news/16289</link>
      <description><![CDATA[<p>
<i>Enrico Zimuel</i> as a new post to his blog today talking about his exploration of <a href="http://framework.zend.com/issues/browse/ZF-3257">a Zend Framework bug</a> related to the JSON handling of the Zend_Json component. The issue was related to the conversion of XML to JSON but it only happened in specific instances.
</p>
<blockquote>
As you can see the bar value, of the a element [in the example code], is not represented in JSON. This issue comes also with other XML documents, and in general when an XML node has a single character data child, any attributes are lost.
</blockquote>
<p>
In tracking down the issue, he followed a lead through a possible SimpleXML issue and, with some further testing, found a simple, non-Zend Framework script to behave the same way. It dropped the "bar" value of the example XML from the object's return value. To get around this bug, he created a new conversion algorithm that redefined the _processXML method in Zend_Json to work with the Zend_Json_Expr functionality to parse things more correctly. If you can't wait for the next release to get it into your codebase, you can <a href="http://www.zimuel.it/blog/2011/05/xml-to-json-in-php-an-odyssey/">grab the code from his post</a>.
</p>]]></description>
      <pubDate>Tue, 03 May 2011 12:05:09 -0500</pubDate>
    </item>
  </channel>
</rss>

