<?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, 23 May 2012 03:56:41 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Project: Patchwork-Doc - JSON Formatted Output of PHP variables]]></title>
      <guid>http://www.phpdeveloper.org/news/16960</guid>
      <link>http://www.phpdeveloper.org/news/16960</link>
      <description><![CDATA[<p>
<i>Nicolas Grekas</i> has submitted about a new tool he's developed to "represent faithfully any PHP variable as complex as it is" - <a href="https://github.com/nicolas-grekas/Patchwork-Doc/blob/master/Dumping-PHP-Data-en.md">Patchwork-Doc</a> (related to his <a href="https://github.com/nicolas-grekas/Patchwork">Patchwork</a> PHP framework).
</p>
<blockquote>
The JSON format on which it rests guarantees maximum interoperability while ensuring good readability. The implementation done in the JsonDumper class operates all potentialities of the representation while providing maximum latitude to the developer to exploit its ability as desired, both in term of exposure of internal class mechanism for specialization and in terms of custom use, thanks to the callbacks that allow to intercept the JSON line by line and to adjust the dumping of objects or resources according to their type.
</blockquote>
<p>
It isn't required to use the framework to use this tool, however. You can see an example of the output format in <a href="https://github.com/nicolas-grekas/Patchwork-Doc/blob/master/Dumping-PHP-Data-en.md">this example</a> on the project's github page, complete with a guide to some of the advantages and disadvantages of some of the current, more common methods of output. Several types are included in the example including simple string/integer values, objects, classes, stream resources and the results of variable casting.
</p>]]></description>
      <pubDate>Thu, 06 Oct 2011 12:16:58 -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[Marcus Bointon's Blog: PHP Base-62 Encoding]]></title>
      <guid>http://www.phpdeveloper.org/news/16706</guid>
      <link>http://www.phpdeveloper.org/news/16706</link>
      <description><![CDATA[<p>
In a recent post <i>Marcus Bointon</i> looks at a hashing method that's not one as commonly used by developers as the usual <a href="http://php.net/base64_encode">base64</a> - <a href="http://marcus.bointon.com/archives/92-PHP-Base-62-encoding.html">base-62 encoding</a> that plays a bit nicer with things like URLs and emails due to the character set it allows.
</p>
<blockquote>
There's a really horrible bug (though they won't call it that!) in Apache's mod_rewrite that means that urlencoded inputs in rewrites get unescaped in their transformation to output patterns. The bug actually remains unfixed, though a workaround first appeared in Apache 2.2.12. [...] Base-62 is interesting as it can be made safe for use in URLs, DNS, email addresses and pathnames, unlike any available encoding of base-64, as it only includes [0-9A-Za-z].
</blockquote>
<p>
He originally wrote his own parser, but notes that now the <a href="http://li.php.net/manual/en/book.bc.php">BCMath</a> and <a href="http://li.php.net/manual/en/book.gmp.php">gmp</a> extensions make it much simpler, just a call to <a href="http://www.php.net/gmp_strval">gmp_strval</a> with <a href="http://www.php.net/gmp_init">gmp_init</a>. This method works, but it's still not quite all he wanted so he <a href="https://gist.github.com/1139429">created his own encoder</a> to do the job.
</p>]]></description>
      <pubDate>Thu, 11 Aug 2011 11:28:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: PHP Returning Numeric Values in JSON]]></title>
      <guid>http://www.phpdeveloper.org/news/16577</guid>
      <link>http://www.phpdeveloper.org/news/16577</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a <a href="http://www.lornajane.net/posts/2011/PHP-Returning-Numeric-Values-in-JSON">quick reminder</a> about an issue in the new <a href="http://joind.in/">joind.in</a> API version - everything was being returned as strings, even integers.
</p>
<blockquote>
A few weeks later (my inbox is a black hole and it takes a while to process these things) I fell over a throwaway comment to an undocumented constant JSON_NUMERIC_CHECK, and I added the constant name to my todo list. In the time it took for me to actually get around to googling for this, some wonderful person updated the PHP manual page (this is why I love PHP) to include it as a documented option, and someone else had added a user contributed note about using it.
</blockquote>
<p>
This option, JSON_NUMERIC_CHECK, tells the <a href="http://php.net/json_encode">json_encode</a> function to property consider numbers in its encoding process. It applies globally, so if there's an instance where you don't want something assigned as a number, you might need to go with another, more flexible JSON encoding option. You can find information about this and other possible options json_encode can take on <a href="http://us.php.net/json_encode">its manual page</a>.
</p>
]]></description>
      <pubDate>Tue, 12 Jul 2011 08:41:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schluter's Blog: Jason, let me help you!]]></title>
      <guid>http://www.phpdeveloper.org/news/14604</guid>
      <link>http://www.phpdeveloper.org/news/14604</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Johannes Schluter</i> looks at <A href="http://schlueters.de/blog/archives/135-Jason,-let-me-help-you!.html">a helpful new inclusion</a> into the latest versions of the PHP trunk - a new JSON serialization interface included in the core.
</p>
<blockquote>
For many PHP objects the JSON-representation of the data is a bit more complex.for instance what about private properties or maybe you want to calculate some inner values? - In PHP 5.3 you were on your own. but thanks to Sara there's hope in sight: the new interface JsonSerializable. Classes implementing this interface have to provide a method jsonSerialize()  which will be called by json_encode() and has to return a JSON-compatible representation of the data by doing whatever you want. 
</blockquote>
<p>
He gives two examples of this new feature in action - a simple one that just spits out some basic JSON as a result of the output of a class and the other that's a bit more technical, involving multiple class isntances, a stdClass and a normal array.
</p>]]></description>
      <pubDate>Fri, 04 Jun 2010 10:02:15 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Evert Pot's Blog: Javscript's escape and encodeURI vs. PHP $_POST]]></title>
      <guid>http://www.phpdeveloper.org/news/13799</guid>
      <link>http://www.phpdeveloper.org/news/13799</link>
      <description><![CDATA[<p>
<i>Evert Pot</i> came across <a href="http://www.rooftopsolutions.nl/article/261?">something strange</a> in an application he was working with - the incorrect decoding of data coming back from an Ajax call POSTed back into the app.
</p>
<blockquote>
Basically, data is coming into our PHP application through a Javascript's XMLHttpRequest (ajax). [...] Normally everything in the $_POST and $_GET arrays is already decoded, so when you're dealing with these arrays you don't really have to think about this. This time however, I was dealing with some non-latin unicode characters and for some reason they were never decoded and ended up in the database as raw url-encoded strings.
</blockquote>
<p>
The issue was caused by the fact that the non-latin characters were handled differently on the byte level and that, because of the choice PHP makes on which of the unicode characters to use for spaces, he found that there were two options for handling strings - escape() and encodeURI().
</p>]]></description>
      <pubDate>Thu, 07 Jan 2010 14:10:46 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Pablo Viquez's Blog: JSON, ISO 8859-1 and UTF-8 - Part]]></title>
      <guid>http://www.phpdeveloper.org/news/12906</guid>
      <link>http://www.phpdeveloper.org/news/12906</link>
      <description><![CDATA[<p>
After spotting some null values in a few of his form fields following an Ajax request, <i>Pablo Viquez</i> decided to track down his issue:
</p>
<blockquote>
While I was looking at some AJAX calls, I started to have a problem, for some reason, when I tried to query a JSON service I did using JQuery, the result was null for some fields. Going a little deeper, I notice that the records from the DB were OK, and the JavaScript was OK to, so what was the problem? The JSON Encode!
</blockquote>
<p>
His issue stemmed from the character encoding of the string being passed into <a href="http://php.net/json_encode">json_encode</a> (in this case, UTF-8) was coming from a PHP script saved in a page encoded as ISO-8859-1. You can <a href="http://www.pabloviquez.com/demo_files/Encoding-JSON.zip">download the files</a> he's come up with to illustrate the point.
</p>]]></description>
      <pubDate>Mon, 20 Jul 2009 12:42:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lukas Smith's Blog: One thumb up and two down (Zend_Http_Client)]]></title>
      <guid>http://www.phpdeveloper.org/news/10418</guid>
      <link>http://www.phpdeveloper.org/news/10418</link>
      <description><![CDATA[<p>
Coming back from some <a href="http://www.phpdeveloper.org/news/10381">previous comments</a> about the Zend_Http_Client in the Zend Framework, <i>Lukas Smith</i> admits that a <a href="http://framework.zend.com/manual/en/zend.http.client.adapters.html#zend.http.client.adapters.proxy">certain feature</a> has come in handy with their development, but another bug has come up that has gotten under his skin - a problem with the component's cookie handling.
</p>
<blockquote>
We ran into a really hard to find <a href="http://framework.zend.com/issues/browse/ZF-1850">bug in the cookie handling</a> of Zend_Http_Client, which has been filed as a bug back in August 2007 against version 1.0.1 (today we are at 1.5.2). More over this is a bug that other similar packages have <a href="http://pear.php.net/bugs/bug.php?id=1080">gotten over in 2004</a>.
</blockquote>
<p>
He had to use <a href="http://www.wireshark.org/">wireshark</a> to finally track down the culprit - a call to urlencode on the contents of the cookie before sending it. He also includes some code to overcome a problem he had with UTF-16 in one of his feeds (a custom function that takes in and returns a string translated correctly).
</p>]]></description>
      <pubDate>Mon, 16 Jun 2008 09:32:24 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Christopher Kunz's Blog: PHPShield, SourceGuardian and Inovica Ltd.]]></title>
      <guid>http://www.phpdeveloper.org/news/10025</guid>
      <link>http://www.phpdeveloper.org/news/10025</link>
      <description><![CDATA[<p>
<i>Christopher Kunz</i> has <a href="http://www.christopher-kunz.de/archives/158-PHPShield,-SourceGuardian-and-Inovica-Ltd..html">shared about</a> a resource he came across that offers complete PHP encoding for a much lower price than some of the other services - <a href="http://ww.phpshield.com">phpshield.com</a>. It seems a little too good to be true, though:
</p>
<blockquote>
However, the phpShield.com home page did not offer the slightest clue who actually is behind that product. [...] It's common practice to whitelabel your solutions and sell them under different brands with different feature sets to different target audiences. However, we always clearly state who is behind the whitelabelled solution.
</blockquote>
<p>
A little more digging shows an interesting relationship between the company that sells SourceGuardian and the company behind this PHPShield (Inovica). He sees the deception counting against the company and has just "struck one off the list" from his search for encoding methods.
</p>]]></description>
      <pubDate>Wed, 23 Apr 2008 12:58:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Davey Shafik's Blog: Mini-Review: Zend Guard vs IonCube PHP Encoder]]></title>
      <guid>http://www.phpdeveloper.org/news/9832</guid>
      <link>http://www.phpdeveloper.org/news/9832</link>
      <description><![CDATA[<p>
<i>Davey Shafik</i> has done a <a href="http://pixelated-dreams.com/archives/348-Mini-Review-Zend-Guard-vs-IonCube-PHP-Encoder.html">mini-review</a> comparing the <a href="http://www.zend.com/en/products/guard/">Zend Guard</a> software with a similar offering from IonCube, <a href="http://www.ioncube.com/sa_encoder.php">IonCube Encoder</a> to help protect your PHP applications.
</p>
<blockquote>
For the last several years, we have been successfully using the IonCube PHP encoder. It works well, providing us with as secure a solution as we could wish for, for our code. [...] Due to the amount of head pounding involved in finding this issue [where IonCube was removing a valid logic branch], I started to consider using <a href="http://www.zend.com/en/products/guard/">Zend Guard</a> instead, figuring that Zend has far more resources and more experience in this arena, we might see less issues.
</blockquote>
<p>
He <a href="http://pixelated-dreams.com/archives/348-Mini-Review-Zend-Guard-vs-IonCube-PHP-Encoder.html">details</a> their upgrade process including comments on the included GUI and how it "just works" (once it's set up)
</p>]]></description>
      <pubDate>Thu, 20 Mar 2008 12:53:11 -0500</pubDate>
    </item>
  </channel>
</rss>

