<?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 07:31:05 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Michael Nitschinger: Benchmarking Cache Transcoders in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19117</guid>
      <link>http://www.phpdeveloper.org/news/19117</link>
      <description><![CDATA[<p>
<i>Michael Nitschinger</i> has written up a new post comparing a few different methods for serializing or translating objects to <a href="http://nitschinger.at/Benchmarking-Cache-Transcoders-in-PHP">store them in a cache</a>. In it, he compares the PHP serializer, the <a href="http://pecl.php.net/package/igbinary">igbinary</a> extension and translation to JSON.
</p>
<blockquote>
Storing PHP objects (or simpler data types like arrays) in caches always requires some kind of transformation. You need a way of encoding/decoding data so that it can be stored and loaded properly. In most languages, this process is known as object <a href="http://en.wikipedia.org/wiki/Serialization">serialization</a>. PHP provides a mechanism for this out of the box, but in this article we'll also look at <a href="http://pecl.php.net/package/igbinary">igbinary</a> as a drop-in replacement for the default serializer. We also compare the results to object transcoding based on <a href="http://json.org/">JSON</a>, which is not really an object serialization mechanism but commonly used as a data chache structure which has its own benefits and drawbacks.
</blockquote>
<p>
He goes through each of the three technologies and includes a snippet of code showing how they'd work in object translation. He also talks about things like the size of the result and the performance of each when the results are looped over. Based on the results of some of his "microbenchmarking" of each of the methods, <a href="http://pecl.php.net/package/igbinary">igbinary</a> came out on top, even faster than PHP's own <a href="http://php.net/serialize">serialize</a>/<a href="http://php.net/unserialize">unserialize</a>.
</p>]]></description>
      <pubDate>Thu, 31 Jan 2013 11:31:01 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: In My Language, Please! - Translating WordPress Themes and Plugins]]></title>
      <guid>http://www.phpdeveloper.org/news/17852</guid>
      <link>http://www.phpdeveloper.org/news/17852</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new tutorial showing how to <a href="http://phpmaster.com/in-my-language-please/">use the localization support</a> that comes with WordPress to make using different language definitions much simpler.
</p>
<blockquote>
WordPress itself is translated to many languages and people can use it in their preferred language. But this is not the case with themes, plugins, and other front-end customizations. [...] The purpose of this article is to show you how to translate properly any theme or plugin by using internationalization and localization methods. In brief, internationalization (i18n) deals with making sure strings of text are wrapped in specific function calls. 
</blockquote>
<p>
He starts by introducing the PHP functions (and configuration) you'll need to get the localization support up and running in your plugin, including a few examples of how to translate a string. Also included into the post is an introduction to using the <a href="http://www.poedit.net/">Poedit</a> software to create the different translation files.
</p>]]></description>
      <pubDate>Mon, 23 Apr 2012 12:27:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Using iterator_to_array() in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17602</guid>
      <link>http://www.phpdeveloper.org/news/17602</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a new post to her blog today showing off a lesser-known but very useful function included in PHP - the <a href="http://www.lornajane.net/posts/2012/using-iterator_to_array-in-php">iterator_to_array</a> function, used to translate things that implement Traversable into arrays.
</p>
<blockquote>
Someone watching over my shoulder recently had never seen the ubiquitously-useful <a href="http://uk3.php.net/manual/en/function.iterator-to-array.php">iterator_to_array()</a> before. [...] Mostly I find this useful when I'm working with collections of data as these often present themselves as an object that you can foreach() over, but you can't dump it directly. If the object in question implements the <a href="http://uk3.php.net/manual/en/class.traversable.php">Traversable</a> interface, you can instead pass it into iterator_to_array to get the data as an array.
</blockquote>
<p>
She includes a brief snippet of code showing it in use - transforming the results from a MongoDB cursor object back into an array.
</p>]]></description>
      <pubDate>Wed, 29 Feb 2012 08:55:52 -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[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[Derick Rethans' Blog: Translating Twitter, part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/16419</guid>
      <link>http://www.phpdeveloper.org/news/16419</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has posted the second part of his look at <a href="http://derickrethans.nl/translating-twitter-part2.html">translating twitter</a> as a part of his PHP-GTK Twitter client <a href="http://derickrethans.nl/projects.html#haunt">Haunt</a>. Because of the deprecation route Google chose for its translation API, he needed a change to another service - the <a href="http://www.microsoft.com/web/post/using-the-free-bing-translation-apis">Bing Translation API</a>.
</p>
<blockquote>
A while ago I wrote in <a href="http://derickrethans.nl/translating-twitter.html">an article</a> about translating tweets in my client <a href="http://derickrethans.nl/projects.html#haunt">Haunt</a>. For the translating itself I was using the Google Translate API, which has sadly be <a href="http://googlecode.blogspot.com/2011/05/spring-cleaning-for-some-of-our-apis.html">deprecated</a>. Evil after all I suppose. I've now rewritten my translation code to use the <a href="http://www.microsoft.com/web/post/using-the-free-bing-translation-apis">Bing Translation APIs</a> instead. You need to register an API key (see <a href="http://www.bing.com/developers/appids.aspx%29">http://www.bing.com/developers/appids.aspx</a>) to be able to use the APIs. The APIs that I am using are fairly simple though.
</blockquote>
<p>
Also included in <a href="http://derickrethans.nl/translating-twitter-part2.html">the post</a> is some sample code showing how to make the request to this new API and the results from the requests.
</p>]]></description>
      <pubDate>Thu, 02 Jun 2011 11:28:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPRiot.com: Translating Text Using the Google Translate API and PHP, JSON and cURL]]></title>
      <guid>http://www.phpdeveloper.org/news/16304</guid>
      <link>http://www.phpdeveloper.org/news/16304</link>
      <description><![CDATA[<p>
On PHPRiot.com there's a new tutorial showing you how to <a href="http://www.phpriot.com/articles/google-translate-api">use the Google Translate service</a> to translate the text of your website into any language they support. They interface with it using a cURL connection and JSON messaging.
</p>
<blockquote>
Google Translate is a service from Google that you can use to translate text or HTML from one language to another. One of the great features of this service is that they now offer an API to let you programmatically translate text. In this article I will show you how to interact with the Google Translate API. Initially, the Google Translate API was available only via JavaScript. This has now changed, as version 2 offers a REST interface which returns translations in JSON format.
</blockquote>
<p>
They talk about the input parameters you can give the service, the enforcement of query limits and how to handle the results that are returned. The response message is, by default, in JSON so a simple call to <a href="http://www.phpriot.com/manual/php/function.json-decode">json_decode</a> should be all that's needed. They've also included a sample class you can drop in and use for your translation needs (as well as sample usage code).
</p>]]></description>
      <pubDate>Fri, 06 May 2011 08:45:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Creating Multi-Language Web Applications with Zend_Translate]]></title>
      <guid>http://www.phpdeveloper.org/news/15887</guid>
      <link>http://www.phpdeveloper.org/news/15887</link>
      <description><![CDATA[<p>
On the Zend Developer Zone today there's <a href="http://devzone.zend.com/article/12995-Creating-Multi-Language-Web-Applications-with-Zend_Translate">a new tutorial</a> they've posted looking at adding multi-language support to your applications with the help of the Zend_Translate component of the <a href="http://framework.zend.com">Zend Framework</a>. It makes it simple to swap between sets of language data without much effort on your part.
</p>
<blockquote>
If you're a Web developer building an application for global consumption, it's important for you to build in a framework for multi-language support right from the start. Fortunately, there are a number of ready-made components that can help with this task. This article will introduce you to one such component, Zend_Translate, and demonstrate how you can use it to add multi-language support to your PHP application.
</blockquote>
<p>
There's no "magic bullet" here that'll do the translation for you, but he shows you how to set up the data for the different languages, either in PHP arrays or in translation files, that the Zend_Translate component knows how to use. He also mentions the component's ability to scan a directory tree for language files an detect the language based on a naming convention. He also mentions the "gettext" tool that you can use to generate language files based on a standard GNU format that can be used cross-language with several different tools.
</p>
<p>
There's lots of other handy bits in <a href="http://devzone.zend.com/article/12995-Creating-Multi-Language-Web-Applications-with-Zend_Translate">the tutorial</a> so I suggest reading if you're thinking about any kind of translation for your site.
</p>]]></description>
      <pubDate>Thu, 10 Feb 2011 12:03:29 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Translations of my Zend Framework Tutorial for ZF 1.10 & 1.11]]></title>
      <guid>http://www.phpdeveloper.org/news/15791</guid>
      <link>http://www.phpdeveloper.org/news/15791</link>
      <description><![CDATA[<p>
In a quick new post to his blog <i>Rob Allen</i> points out <a href="http://akrabat.com/tutorial/translations-of-my-zend-framework-tutorial-for-zf-1-10-1-11/">two new translations </a> that have been made of his introductory Zend Framework tutorial (found <a href="http://akrabat.com/zend-framework-tutorial">here</a>).
</p>
<blockquote>
Recently, a couple of people have very generously donated their time to translate my Zend Framework Tutorial into their native language to help their fellow countrymen.
</blockquote>
<p>
These two new translations are into <a href="http://www.phpnews.it/corsi/corso-zend-framework/">Italian</a> from <i>Mario Santagiuliana</i> and <a href="http://akrabat.com/wp-content/uploads/Pierwsze-kroki-z-Zend-Framework.pdf">into Polish</a> by <i>Radoslaw Benkel</i>. <i>Rob</i>'s tutorial helps you <a href="http://akrabat.com/zend-framework-tutorial/">get up to speed</a> with the Zend Framework by creating a sample application for working with albums and their properties. The English <a href="http://akrabat.com/wp-content/uploads/Getting-Started-with-Zend-Framework.pdf">version is here</a>.
</p>]]></description>
      <pubDate>Mon, 24 Jan 2011 08:42:28 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Translating Twitter]]></title>
      <guid>http://www.phpdeveloper.org/news/15685</guid>
      <link>http://www.phpdeveloper.org/news/15685</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Derick Rethans</i> shows how to implement something very handy for those wanting to read all of the posts in their twitter stream, regardless of the language. Using Google web services, he's put together a <a href="http://derickrethans.nl/translating-twitter.html">twitter translation</a> for his twitter client <a href="http://derickrethans.nl/projects.html#haunt">Haunt</a>.
</p>
<blockquote>
As the author of <a href="http://twitter.com/xdebug">Xdebug</a> I am interested in finding out what people think of it, and whether they have problems or compliments. I've set-up a <a href="http://twitter.com/">twitter</a> account for Xdebug, <a href="http://twitter.com/xdebug">@xdebug</a>, and my twitter client <A href="http://derickrethans.nl/projects.html#haunt">Haunt</a> also shows me all tweets with the <a href="http://twitter.com/#%21/search/xdebug">search term xdebug</a>. However, sometimes I get tweets in a language I can't read.
</blockquote>
<p>
Since there's no language information associated with tweets, <i>Derick</i> used Google's <a href="http://code.google.com/apis/language/translate/v1/using_rest_langdetect.html">Language Detect</a> web service to get the language code for the text. Another quick call to the <a href="http://code.google.com/apis/language/translate/v1/using_rest_translate.html">Translate</a> service and a suable translation is returned. You can see how it looks in <a href="http://derickrethans.nl/images/content/haunt.gif">his screenshot</a>. You can find the code for it <a href="http://svn.xdebug.org/cgi-bin/viewvc.cgi/twitter/trunk/twitter.php?annotate=34&root=openmoko#l209">here</a>.
</p>]]></description>
      <pubDate>Wed, 05 Jan 2011 10:05:46 -0600</pubDate>
    </item>
  </channel>
</rss>
