<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VT's Tech Blog &#187; PHP</title>
	<atom:link href="http://blogs.vinuthomas.com/category/programming/php-stuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.vinuthomas.com</link>
	<description>My Tech Discovery Blog on PHP, Ajax, Security and Web 2.0</description>
	<lastBuildDate>Thu, 04 Mar 2010 06:39:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Interesting Zend Webinars for January</title>
		<link>http://blogs.vinuthomas.com/2010/01/13/interesting-zend-webinars-for-january/</link>
		<comments>http://blogs.vinuthomas.com/2010/01/13/interesting-zend-webinars-for-january/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 12:39:30 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[General Stuff]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[webinars]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=3997</guid>
		<description><![CDATA[Here are some webinars from Zend which you may find interesting:
Webinar &#8211; PHP Development Best Practices: The Untold Story of Geekville 
January 19, 2010 &#8211; 9:00 am PST &#8211; your computer via webex
Have you ever wondered how you could advance your PHP development? Have you considered using an Integrated Development Environment (IDE), an Issue Tracker [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-4000" title="Zend - The PHP company - Logo" src="http://blogs.vinuthomas.com/wp-content/uploads/2010/01/Zend_logo.png" alt="" width="215" height="102" />Here are some webinars from Zend which you may find interesting:</p>
<p><a href="http://www.zend.com/en/company/news/event/webinar-php-development-best-practices-the-untold-story-of-geekville"><strong>Webinar &#8211; PHP Development Best Practices: The Untold Story of Geekville </strong></a><br />
January 19, 2010 &#8211; 9:00 am PST &#8211; your computer via webex</p>
<p>Have you ever wondered how you could advance your PHP development? Have you considered using an Integrated Development Environment (IDE), an Issue Tracker or a Version Control tool, but were concerned about how complex it might be? Taking PHP development to the next level may be easier than you think.  Attend this webinar, hosted by Atlassian and Zend <a href="http://www.zend.com/en/company/news/event/webinar-php-development-best-practices-the-untold-story-of-geekville">More Information/Registration</a></p>
<p><a href="http://www.zend.com/en/company/news/event/webinar-troubleshooting-php-issues-best-and-worst-techniques"><strong>Webinar &#8211; Troubleshooting PHP Issues: Best (and Worst) Techniques</strong></a><br />
January 28, 2010 &#8211; 8:00 am PST &#8211; your computer via webex</p>
<p>Understanding what’s causing your PHP application to be slow or just break is often time-consuming, and almost always frustrating. Join this information-packed webinar, delivered by a senior Zend PHP consultant, to learn what techniques PHP professionals use for pinpointing PHP issues in development, testing and production. <a href="http://www.zend.com/en/company/news/event/webinar-troubleshooting-php-issues-best-and-worst-techniques">More Information/Registration</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/b6cac655-0975-4e40-bf3a-b5d96bd3bd2f/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_b.png?x-id=b6cac655-0975-4e40-bf3a-b5d96bd3bd2f" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2010/01/13/interesting-zend-webinars-for-january/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5 Power Programming &#8211; Free Ebook</title>
		<link>http://blogs.vinuthomas.com/2010/01/12/php-5-power-programming-free-ebook/</link>
		<comments>http://blogs.vinuthomas.com/2010/01/12/php-5-power-programming-free-ebook/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 03:30:19 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=3357</guid>
		<description><![CDATA[Here&#8217;s a free PHP Ebook from Bruce Perens&#8217; Open Source Series. More about this book:
In this book, PHP 5&#8217;s co-creator and two leading PHP developers show you how to make the most of PHP 5&#8217;s industrial-strength enhancements in any project—no matter how large or complex. Their unique insights and realistic examples illuminate PHP 5&#8217;s new [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/013147149X?ie=UTF8&amp;tag=vinuthomascom-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=013147149X"><img class="alignright size-full wp-image-3360" src="http://blogs.vinuthomas.com/wp-content/uploads/2010/01/511vMF2erKL._SL160_.jpg" alt="" width="121" height="160" /></a>Here&#8217;s a free PHP Ebook from Bruce Perens&#8217; <a href="http://www.informit.com/promotions/promotion.aspx?promo=135563">Open Source Series</a>. More about this book:</p>
<p>In this book, PHP 5&#8217;s co-creator and two leading PHP developers show you how to make the most of PHP 5&#8217;s industrial-strength enhancements in any project—no matter how large or complex. Their unique insights and realistic examples illuminate PHP 5&#8217;s new object model, powerful design patterns, improved XML Web services support, and much more. Whether you&#8217;re creating web applications, extensions, packages, or shell scripts—or migrating PHP 4 code—here are high-powered solutions you won&#8217;t find anywhere else.</p>
<p>Review PHP&#8217;s syntax and master its object-oriented capabilities—from properties and methods to polymorphism, interfaces, and reflection</p>
<ul>
<li>Master the four most important design patterns for PHP development</li>
<li>Write powerful web applications: handle input, cookies, session extension, and more</li>
<li>Integrate with MySQL, SQLite, and other database engines</li>
<li>Provide efficient error handling that&#8217;s transparent to your users</li>
<li>Leverage PHP 5&#8217;s improved XML support—including parsing, XSLT conversions, and more</li>
<li>Build XML-based web services with XML-RPC and SOAP</li>
<li>Make the most of PEAR: work with the repository, use key packages, and create your own</li>
<li>Upgrade PHP 4 code to PHP 5—compatibility issues, techniques, and practical workarounds</li>
<li>Improve script performance: tips and tools for PHP optimization</li>
<li>Use PHP extensions to handle files/streams, regular expressions, dates/times, and graphics</li>
<li>Create original extensions and shell scripts</li>
</ul>
<p>If you&#8217;re a software developer new to PHP, you&#8217;ll leap quickly into PHP and its new object-oriented capabilities. If you&#8217;re an experienced PHP programmer, you already recognize PHP&#8217;s convenience and simplicity. Now, discover all of its extraordinary power!</p>
<p>Free Ebook download: <a href="http://www.informit.com/content/images/013147149X/downloads/013147149X_book.pdf">Download PHP 5 Power Programming (PDF)</a><br />
If you like this book and would like to order the Print book, <a href="http://www.amazon.com/gp/product/013147149X?ie=UTF8&amp;tag=vinuthomascom-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=013147149X">check out Amazon&#8217;s deals on PHP 5 Power Programming</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2010/01/12/php-5-power-programming-free-ebook/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Practical PHP Testing &#8211; Free Ebook</title>
		<link>http://blogs.vinuthomas.com/2010/01/04/wanted-to-know-how-to-test-php-applications/</link>
		<comments>http://blogs.vinuthomas.com/2010/01/04/wanted-to-know-how-to-test-php-applications/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 04:13:16 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[FAQs  Help  and Tutorials]]></category>
		<category><![CDATA[PHPUnit]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=2889</guid>
		<description><![CDATA[If you&#8217;re new to testing in PHP, and were wondering how to create and run automated tests, here&#8217;s an ebook which will help you get the basics right.
Practical PHP Testing is an ebook which is a compilation of  articles from Giorgio Sironi&#8217;s blog on Practical PHP testing.
This book takes you though the basics of PHPUnit [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2890" src="http://blogs.vinuthomas.com/wp-content/uploads/2010/01/cover.png" alt="" width="320" height="320" />If you&#8217;re new to testing in PHP, and were wondering how to create and run automated tests, here&#8217;s an ebook which will help you get the basics right.</p>
<p>Practical PHP Testing is an ebook which is a compilation of  articles from Giorgio Sironi&#8217;s blog on <a href="http://giorgiosironi.blogspot.com/search/label/php%20testing%20series">Practical PHP testing</a>.</p>
<p>This book takes you though the basics of <a class="zem_slink" title="PHPUnit" rel="homepage" href="http://www.phpunit.de/">PHPUnit</a> &#8211; how to install it and start writing simple tests using PHP Unit. Here are some of what this ebook covers:</p>
<ul>
<li> bonus chapter on <a class="zem_slink" title="Test-driven development" rel="wikipedia" href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a> theory;</li>
<li> a case study on testing a php function;</li>
<li> working code samples, some of whom were originally kept on pastebin.com;</li>
<li> sets of TDD exercises at the end of each chapter;</li>
<li> glossary that substitutes external links to wiki and other posts, to not interrupt your reading with terms lookup.</li>
</ul>
<p>More information and download link is <a href="http://giorgiosironi.blogspot.com/2009/12/practical-php-testing-is-here.html">available here</a>.</p>
<div class="zemanta-pixie" style="margin-top: 10px;height: 15px"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/2be2fa9b-ee56-4c29-85f2-ce0954e60560/"><img class="zemanta-pixie-img" style="border: medium none;float: right" src="http://img.zemanta.com/reblog_e.png?x-id=2be2fa9b-ee56-4c29-85f2-ce0954e60560" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2010/01/04/wanted-to-know-how-to-test-php-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Profiling &#8211; XHProf</title>
		<link>http://blogs.vinuthomas.com/2009/12/30/php-profiling-xhprof/</link>
		<comments>http://blogs.vinuthomas.com/2009/12/30/php-profiling-xhprof/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 05:25:14 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=1681</guid>
		<description><![CDATA[
XHProf is a heriarcical profiler for PHP originally developed by Facebook and then opensourced. The raw data collection component is implemented in C (as a PHP extension). The reporting/UI layer is all in PHP. It is capable of reporting function-level inclusive and exclusive wall times, memory usage, CPU times and number of calls for each [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.crestock.com/image/1696110-binary-code-and-loupe.aspx"><img class="alignright" src="http://blogs.vinuthomas.com/wp-content/uploads/2010/01/1696110-ms.jpg" alt="binary code and magnifying glass" width="224" height="224" /></a><br />
XHProf is a heriarcical profiler for PHP originally developed by Facebook and then opensourced. The raw data collection component is implemented in C (as a PHP extension). The reporting/UI layer is all in PHP. It is capable of reporting function-level inclusive and exclusive wall times, memory usage, CPU times and number of calls for each function. Additionally, it supports ability to compare two runs (hierarchical DIFF reports), or aggregate results from multiple runs.</p>
<p>Here are some of the reports that XHProf provides:</p>
<ul>
<li><strong>Flat profile</strong> (<a href="http://mirror.facebook.net/facebook/xhprof/sample-flat-view.jpg" rel="lightbox[1681]">screenshot</a>)</li>
<li><strong>Hierarchical profile (Parent/Child View)</strong> (<a href="http://mirror.facebook.net/facebook/xhprof/sample-parent-child-view.jpg" rel="lightbox[1681]">screenshot</a>)</li>
<li><strong>Diff Reports : <span style="font-weight: normal">The &#8220;flat&#8221; view (<a href="http://mirror.facebook.net/facebook/xhprof/sample-diff-report-flat-view.jpg" rel="lightbox[1681]">sample screenshot</a>) &amp; &#8220;hierarchical&#8221; (or parent/child) diff view of a function (<a href="http://mirror.facebook.net/facebook/xhprof/sample-diff-report-parent-child-view.jpg" rel="lightbox[1681]">sample screenshot</a>). </span></strong></li>
<li><strong>Callgraph View</strong> (<a href="http://mirror.facebook.net/facebook/xhprof/sample-callgraph-image.jpg" rel="lightbox[1681]">sample screenshot</a>)</li>
<li><strong>Memory Profile : <span style="font-weight: normal">XHProf&#8217;s memory profile mode helps track functions that allocate lots of memory.</span></strong></li>
</ul>
<p>If you are looking for an article which gives you details on how to install this extension in Ubuntu and a quick runthrough of how to use this,  Lorenzo Alberton has an excellent article on this at <a href="http://techportal.ibuildings.com/2009/12/01/profiling-with-xhprof/">Profiling with XHProf</a>.  There&#8217;s also a good background article on XHProf and why Facebook developed this extension over at <a href="http://www.facebook.com/note.php?note_id=62667953919">Facebook</a>.</p>
<p><strong>Links:</strong><br />
<a href="http://mirror.facebook.net/facebook/xhprof/doc.html">XHProf Documentation</a><br />
<a href="http://pecl.php.net/package/xhprof">XHProf on PECL</a><br />
<a href="http://techportal.ibuildings.com/2009/12/01/profiling-with-xhprof/">Profiling with XHProf</a></p>
<p>Image Credit: from <a href="http://www.crestock.com/free-image.aspx">Crestock Photos</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/12/30/php-profiling-xhprof/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compress your serialize output using igbinary</title>
		<link>http://blogs.vinuthomas.com/2009/11/24/compress-your-serialize-output-using-igbinary/</link>
		<comments>http://blogs.vinuthomas.com/2009/11/24/compress-your-serialize-output-using-igbinary/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 12:23:05 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=1652</guid>
		<description><![CDATA[



Zipped folder icon from RF Stock Images



Igbinary is a &#160;replacement for the standard PHP serializer. While the PHP serializer uses a texual format to represent the data in the serialized version, igbinary uses a binary format which is compact. This helps in brining down the storage size of the serialized data. This helps while trying [...]]]></description>
			<content:encoded><![CDATA[<div class="crestock-img" style="margin:1em;display:block">
<div width="200">
<dl class="wp-caption alignright" style="width: 200px; ">
<dt class="wp-caption-dt"><img id="1436041" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/11/1436041-ms.jpg" width="200px" alt="3D computer icon for zipped folder" title="3D computer icon for zipped folder"/></dt>
<dd class="wp-caption-dd crestock-img-attribution" style="font-size:0.8em"><a href="http://www.crestock.com/image/1436041-Zipped-folder-icon.aspx">Zipped folder icon</a> from <a href="http://www.crestock.com">RF Stock Images</a></dd>
</dl>
</div>
</div>
<p>Igbinary is a &nbsp;replacement for the standard PHP serializer. While the PHP serializer uses a texual format to represent the data in the serialized version, igbinary uses a binary format which is compact. This helps in brining down the storage size of the serialized data. This helps while trying to store the data in shared memory or memcache, which uses (limited) RAM to provide faster access to data.</p>
<p>Since I couldn&#8217;t find any pre-built binaries, I compiled the code which I got from their site. I compiled the <a href="http://opensource.dynamoid.com/igbinary-1.0.2.tar.gz">1.02 build</a>. </p>
<p>Here are quick steps to compile this as a PHP extension for your system ( I tried this on Ubuntu, but should work on other distros as well). Uncompress the contents of the file to a directory and head over to the directory and run the following comands one after the other. Make sure there are no errors in each stage.</p>

<div class="wp_codebox"><table><tr id="p16523"><td class="code" id="p1652code3"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&gt;</span>phpize
<span style="color: #000000; font-weight: bold;">&gt;</span>.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #007800;">CFLAGS</span>=<span style="color: #ff0000;">&quot;-O2 -g&quot;</span> <span style="color: #660033;">--enable-igbinary</span>
<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>If all goes well, the file igbinary.so should be present in your default php extension directory. Once you see this file there, head over to your php.ini file and add the following line at the end of it so that the extension is loaded with PHP.</p>
<pre># Load igbinary extension
extension=igbinary.so</pre>
<p>Once you do this, restart your apache server to reload the PHP configurations. When you run phpinfo(),  you should see the following lines in the output:<br />
<img class="aligncenter size-full wp-image-1656" title="igbinary in phpinfo" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/11/igbinary.png" alt="igbinary in phpinfo" width="486" height="142"/></p>
<p>Once you&#8217;ve got that in your output, all you need to do is to substitute  serialize with igbinary_serialize and unserialize with igbinary_unserialize in your code. </p>
<p>To see the differences in the two formats and see if the serialized and the subsequent unserialize I use the following script  with some dummy data to print out the size of the output string of serialize and  igbinary_serialize.</p>

<div class="wp_codebox"><table><tr id="p16524"><td class="code" id="p1652code4"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$arrc</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$arrc</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$arrc</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$arrc</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Testing&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$arrc</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;another data&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$arrc</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;structure&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$arrc</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$arrc</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$arrc</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #990000;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arrc</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;size of Serialize :&quot;</span><span style="color: #339933;">.</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> igbinary_serialize<span style="color: #009900;">&#40;</span><span style="color: #000088;">$arrc</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;size of igbinary :&quot;</span><span style="color: #339933;">.</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$b</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The output of this script came up showing that output from  igbinary_unserialize does indeed use less space than the the output of serialize. Here&#8217;s the output of this script when I ran it:</p>
<pre>size of Serialize :126
size of igbinary :74
</pre>
<p>If you want the igbinary functions to auto replace the default serialize in the PHP session handler, all you need to do is to add the following lines in your php.ini</p>
<pre># Use igbinary as session serializer
session.serialize_handler=igbinary
</pre>
<p>If you have any experience in using this extension on your projects, let us know your thoughts and observations. You can get more information on igbinary from the author&#8217;s site at: <a href="http://opensource.dynamoid.com/">http://opensource.dynamoid.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/11/24/compress-your-serialize-output-using-igbinary/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple Cloud API for Cross-Cloud Implementations</title>
		<link>http://blogs.vinuthomas.com/2009/09/29/simple-cloud-api-for-cross-cloud-implementations/</link>
		<comments>http://blogs.vinuthomas.com/2009/09/29/simple-cloud-api-for-cross-cloud-implementations/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 06:18:29 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Interoperability]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=1588</guid>
		<description><![CDATA[



tree from Stock Photography



Zend has launched the Simple Cloud project which allows PHP developers to write Cloud based apps without having to bother about the different cloud based solutions available. This works like an abstraction layer for various cloud solutions like Amazon, Windows Azure, Rackspace Cloud Hosting and a few more.
Initially this project aims at [...]]]></description>
			<content:encoded><![CDATA[<div class="crestock-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 290px;">
<dt class="wp-caption-dt"><img class=" " title="lonely tree and a cloudy sky - 3d illustration" src="/wp-content/uploads/crestockimages/181364-ms.jpg" alt="lonely tree and a cloudy sky - 3d illustration" width="280" height="210" /></dt>
<dd class="wp-caption-dd crestock-img-attribution" style="font-size: 0.8em;"><a href="http://www.crestock.com/image/181364-tree.aspx">tree</a> from <a href="http://www.crestock.com">Stock Photography</a></dd>
</dl>
</div>
</div>
<p>Zend has launched the Simple Cloud project which allows PHP developers to write Cloud based apps without having to bother about the different cloud based solutions available. This works like an abstraction layer for various cloud solutions like <a href="http://aws.amazon.com/">Amazon</a>, <a href="http://www.microsoft.com/azure/windowsazure.mspx">Windows Azure</a>, <a href="http://www.rackspacecloud.com/">Rackspace Cloud Hosting</a> and a few more.</p>
<p>Initially this project aims at providing standard cross-cloud simple APIs for</p>
<ul>
<li><a href="http://www.simplecloud.org/api/file-storage">File storage</a>- including Windows Azure blobs, Rackspace Cloud Files, Nirvanix Storage Delivery Network and Amazon S3</li>
<li><a href="http://www.simplecloud.org/api/document-storage">Document Storage</a>- including Windows Azure tables and Amazon SimpleDB</li>
<li><a href="http://www.simplecloud.org/api/simple-queue">Simple Queues</a>- including Amazon SQS and Windows Azure queues</li>
</ul>
<p>From Zend&#8217;s press release, &#8220;<em>Zend Cloud will also provide adapters for local services to make offline coding and testing against cloud services as easy as connected development.</em>&#8221;</p>
<p>These APIs will be appearing soon on the Zend Framework as the Zend Cloud component. They will provide the basic functionality across the various cloud hosting services, but if you do need vendor specific functionality in your code, Zend Framework will provide vendor-specific libraries as well. They&#8217;ve already got <a href="http://framework.zend.com/manual/en/zend.service.nirvanix.html">Nirvanix</a>, Amazon <a href="http://framework.zend.com/manual/en/zend.service.amazon.ec2.html">EC2</a>, <a href="http://framework.zend.com/manual/en/zend.service.amazon.s3.html">S3</a> and <a href="http://framework.zend.com/manual/en/zend.service.amazon.sqs.html">SQS</a> covered. Microsoft&#8217;s <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_WindowsAzure+-+Maarten+Balliauw">proposed the WindowsAzure services</a> for Zend Framework. IBM and Rackspace are also working with Zend to get their services covered. With these integrations in motion, they estimate that ZendCloud adapter with these features will be available in the Zend Framework by end of Q4.</p>
<p>An initial Simple Cloud API proposal and reference implementation is available now for community review and participation at <a href="http://www.simplecloud.org/">http://www.simplecloud.org</a>.</p>
<p><strong>Links: </strong></p>
<p>Zend Press Release &#8211; <a href="http://www.zend.com/en/company/news/Press/zend-teams-with-ibm-microsoft-rackspace-and-other-cloud-leaders-on-open-source-initiative-to-drive-cloud-application-development">Zend Teams with IBM, Microsoft, Rackspace and Other Cloud Leaders on Open Source Initiative to Drive Cloud Application Development</a><br />
MSDN Interoperability Blog &#8211; <a href="http://blogs.msdn.com/interoperability/archive/2009/09/22/microsoft-zend-and-others-announce-simple-api-for-cloud-application-services.aspx">Microsoft, Zend and others announce Simple API for Cloud Application Services</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/3dc58758-ae70-483f-91bc-636f4c7089a4/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=3dc58758-ae70-483f-91bc-636f4c7089a4" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/09/29/simple-cloud-api-for-cross-cloud-implementations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fastrack with PHP on Windows</title>
		<link>http://blogs.vinuthomas.com/2009/09/14/fastrack-with-php-on-windows/</link>
		<comments>http://blogs.vinuthomas.com/2009/09/14/fastrack-with-php-on-windows/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 07:40:32 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[Interoperability]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[iis php]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=1573</guid>
		<description><![CDATA[This article is the start of a series of articles on how PHP interoperates with other technologies. When people think of PHP, the first thing people think of is LAMP. But PHP is not limited to the run just under Apache, you can have PHP run under various configurations, including the command line. Here&#8217;s the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.vinuthomas.com/wp-content/uploads/2009/09/interop.jpg" rel="lightbox[1573]"><img class="alignright size-medium wp-image-1575" title="interop" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/09/interop-299x300.jpg" alt="interop" width="299" height="300" /></a>This article is the start of a series of articles on how PHP interoperates with other technologies. When people think of PHP, the first thing people think of is LAMP. But PHP is not limited to the run just under Apache, you can have PHP run under various configurations, including the command line. Here&#8217;s the first article in this series which shows you how to get PHP working in IIS.</p>
<p>A few weeks back I had attended the Virtual Tech Days events, specifically the Interop sessions. I was quite interested in seeing what Microsoft had to offer for  PHP developers. Going through the oveview of the programs, they seem to have come up with quite a few solutions for PHP developers. One of the important integrations for PHP is the ability to run PHP directly from IIS, as a FastCGI app, without having  to install Apache in Windows.<span id="more-1573"></span></p>
<p>To make this task of installing PHP under IIS as easy as possible, Microsoft has provided Microsoft Web Platform Installer, which helps you install PHP and other server modules required to create your Web Platform.  To get started all you have to do is to head over to <a href="http://php.iis.net/">http://php.iis.net/</a> and click on the install blue PHP button there. That launches the Microsoft Web Platform Installer interface which installs PHP along with  the required dependencies required. If you&#8217;re on Windows XP, you&#8217;ll need Service Pack 2 more above and .NET framework 2 on your PC. I was pleasantly surprised with the ease of setting it up. Even though PHP works under IIS 6.0, it&#8217;s recommended that you run PHP under IIS 7.0 since some of the additional modules you&#8217;ll need (like the URL rewriting) are available on IIS 7.0.</p>
<p style="text-align: center;"><a href="http://blogs.vinuthomas.com/wp-content/uploads/2009/09/php-iis-net.png" rel="lightbox[1573]"><img class="size-medium wp-image-1576  aligncenter" title="php.iis.net" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/09/php-iis-net-300x149.png" alt="php.iis.net" width="300" height="149" /></a></p>
<p>The Microsoft Web Platform Installer installer works on Windows XP, Vista and Windows Server 2003 and 2008. Apart from installing the server components on your system,  this installer also gives you quick installation of popular web applications like Wordpress, Moodle LMS and Acquia Drupal to get you kickstarted in creating solutions in PHP on Windows. To learn more about it, check out &#8211; <span><span><span><a href="http://www.microsoft.com/web/Downloads/platform.aspx">http://www.microsoft.com/web/Downloads/platform.aspx</a></span></span></span></p>
<p>At this point most LAMP developers would be asking the question – But how will my existing application port over to the new platfom? Microsoft does provide a few additional modules which priovide the same functionality on IIS:</p>
<p><strong>Rewriting the URL:</strong></p>
<p>If you are looking for a functionality which is similar to Apache&#8217;s mod_rewrite, which allows you to create custom URL, here&#8217;s the answer to your problem. URL Rewriter for IIS 7.0 helps you create such custom URLs through rules on IIS. You can install URL Rewriter for IIS using Microsoft Web Platform Installer as well. For more information and links to documentations on this module head over to:  <span><span><span><a href="http://www.iis.net/extensions/URLRewrite">http://www.iis.net/extensions/URLRewrite</a></span></span></span>.You can also import your existing Apache&#8217;s rewrite rules into IIS  using the URL Rewriter. Here&#8217;s an artice which shows you how: <span><span><span><a href="http://learn.iis.net/page.aspx/470/importing-apache-modrewrite-rules/">http://learn.iis.net/page.aspx/470/importing-apache-modrewrite-rules/</a></span></span></span></p>
<p><strong>.htaccess rules in IIS?</strong></p>
<p>Now how do you get all your .htaccess rules to work on IIS? To do this you&#8217;ll have to translate the rules which you created in .htaccess to IIS 7.0&#8217;s web.config settings. The web.config in IIS 7.0 uses an xml style syntax to define rules so you will have to translate you current .htaccess rules into this syntax. Here&#8217;s an article which helps you learn more on this process with examples to illustrate the transformations between the two formats- <span><span><span><a href="http://learn.iis.net/page.aspx/557/translating-htaccess-content-to-iis-webconfig/">http://learn.iis.net/page.aspx/557/translating-htaccess-content-to-iis-webconfig/</a></span></span></span></p>
<p><strong>PHP Extensions in Windows</strong></p>
<p>Now to get those PHP extensions which you use and love working on Windows. All PECL extensions for PHP (pecl.php.net) should work on Windows if you compile them. If you are looking for pre-compiled versions of these extensions for Windows, pecl4win.com used to host them earlier, but that seems to be down as of now. You can get some of the (unofficially) compiled PHP exenstions at: <span><span><span><a href="http://downloads.php.net/pierre/">http://downloads.php.net/pierre/</a></span></span></span></p>
<p>To install an PHP extension, you&#8217;ll need to download the dll file for the extension. Then find the path to your extension directory in your php.ini. The path to the extensions should come in the line starting with <strong>extension_dir. </strong><span>If this is not set in your php.ini, you can create a new entry by adding this line in your php.ini &#8211; </span></p>
<pre>extension_dir = c:/php/extensions/</pre>
<p><span>Now you can copy the PHP  extension dll&#8217;s you downloaded to this folder. To enable the extension you have to add the a line in php.ini in the following format: </span><strong>extension = abcde.dll</strong><span>,</span> w<span>here <em>abcde.dll</em> is the file name of the dll you downloaded to the PHP extension directory. Restart your webserver and check in your phpinfo() to see if your extension has been loaded.</span></p>
<p><strong>Improve your PHP Application&#8217;s Performance on IIS: </strong></p>
<p>Once you&#8217;ve got your application working on IIS, here&#8217;s how to supercharge it. To boost the performance of PHP on your installation, you should check out the Windows Cache Extension for PHP. One of the ways this extension helps your improve the performance of your PHP application is by keeping the complied PHP bytecodes in memory for faster access and resuing this for subsequent accesses to the same scripts. Caching the opcodes in memory also helps reduce i/o overheads required to fetch the php scripts when they are accessed. To learn more about Windows Cache Extension for PHP and the link to the Microsoft Web Platform Installer installer for this module head over to : <span><span><span><a href="http://www.iis.net/extensions/WinCacheForPHP">http://www.iis.net/extensions/WinCacheForPHP</a></span></span></span></p>
<p>All these tools and modules does ease the work of developers who need to deploy their applicatons in Windows without much effort. Overall, Microsoft has come a long way in getting PHP applications working on the Windows platform.</p>
<p>One you&#8217;ve got PHP working in Windows, you can start using the other Microsoft technologies like Silverlight for PHP and the PHP SDK for Azure. More on these topics in the upcoming series.</p>
<p><strong>Image Credits:</strong><br />
Lighthouse Image from:<a rel="cc:attributionURL" href="http://www.flickr.com/photos/derohlsen/">http://www.flickr.com/photos/derohlsen/</a> Licensed under <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/">CC BY-NC-ND 2.0</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/08164938-da19-4635-84d9-18be23a96afb/"><img class="zemanta-pixie-img" style="border: medium none ; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=08164938-da19-4635-84d9-18be23a96afb" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/09/14/fastrack-with-php-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP worst practises</title>
		<link>http://blogs.vinuthomas.com/2009/08/21/php-worst-practises/</link>
		<comments>http://blogs.vinuthomas.com/2009/08/21/php-worst-practises/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 06:42:09 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=1561</guid>
		<description><![CDATA[You&#8217;ve read a lot of PHP best practises articles and topics all over the internet and try your best at following them during your development. How about the worst practises in PHP development? There&#8217;s a nice article on the PHPDev Blog which tells you about a few practises (which I&#8217;m sure most of us haven [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.vinuthomas.com/wp-content/uploads/2009/08/php.gif" rel="lightbox[1561]"><img class="alignright size-full wp-image-309" title="PHP Logo" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/08/php.gif" alt="PHP Logo" width="120" height="67" /></a>You&#8217;ve read a lot of PHP best practises articles and topics all over the internet and try your best at following them during your development. How about the worst practises in PHP development? There&#8217;s a nice article on the <a href="http://blog.phpdeveloper.org/?p=173">PHPDev Blog</a> which tells you about a few practises (which I&#8217;m sure most of us haven fallen a prey to during our careers) which should be avoided at all costs.</p>
<p>Some of the practices include in the article are &#8220;I don&#8217;t need no documentation&#8221; syndrome and &#8220;My code is the way to go&#8221; when other better alternates are out there. Why don&#8217;t you head out and read the full article there?</p>
<p><a href="http://blog.phpdeveloper.org/?p=173">PHP Worst Practices</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/08/21/php-worst-practises/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework 1.9.1 released</title>
		<link>http://blogs.vinuthomas.com/2009/08/14/zend-framework-1-9-1-released/</link>
		<comments>http://blogs.vinuthomas.com/2009/08/14/zend-framework-1-9-1-released/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 06:17:12 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=1555</guid>
		<description><![CDATA[Alexander Veremyev, a Zend Framework team member has announced the latest release of the Zend Framework 1.9.1.  This is the first maintenance release in the 1.9 series and has bug fixes for  over 30 issues. You can view the full changelog for this release over at: http://framework.zend.com/changelog/1.9.1
You can download Zend Framework 1.9.1 at: http://framework.zend.com/download/latest
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.vinuthomas.com/wp-content/uploads/2009/08/zend_framework_logo.png" rel="lightbox[1555]"><img class="alignright size-full wp-image-576" title="zend_framework_logo" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/08/zend_framework_logo.png" alt="zend_framework_logo" width="246" height="136" /></a>Alexander Veremyev, a Zend Framework team member has announced the latest release of the Zend Framework 1.9.1.  This is the first maintenance release in the 1.9 series and has bug fixes for  over 30 issues. You can view the full changelog for this release over at: <a href="http://framework.zend.com/changelog/1.9.1">http://framework.zend.com/changelog/1.9.1</a></p>
<p>You can download Zend Framework 1.9.1 at:<a href="http://framework.zend.com/download/latest"> http://framework.zend.com/download/latest</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/08/14/zend-framework-1-9-1-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Are you ready for PHP 6?</title>
		<link>http://blogs.vinuthomas.com/2009/07/22/are-you-ready-for-php-6/</link>
		<comments>http://blogs.vinuthomas.com/2009/07/22/are-you-ready-for-php-6/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 14:23:21 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=1228</guid>
		<description><![CDATA[Here&#8217;s an article from Linux Magazine showing you how to install a development snapshot version of the latest PHP 6 build on your system. They also go on to give an overview on what&#8217;s new in PHP 6&#160; and some of the code you&#8217;ll have to change in your current source to get it working [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.vinuthomas.com/wp-content/uploads/2009/07/php6unicode.jpg" rel="lightbox[1228]"><img src="http://blogs.vinuthomas.com/wp-content/uploads/2009/07/php6unicode.jpg" alt="php6unicode" width="240" height="180" class="alignright size-full wp-image-1231" /></a>Here&#8217;s an article from Linux Magazine showing you how to install a development snapshot version of the latest PHP 6 build on your system. They also go on to give an overview on what&#8217;s new in PHP 6&nbsp; and some of the code you&#8217;ll have to change in your current source to get it working on PHP 6.</p>
<p>The good thing about PHP 6 is that by default all strings are treated as Unicode characters, unlike the earlier versions where a lot of the default functions in PHP used to break up unicode characters and essentially junked the data. UTF-8 is now&nbsp; the default encoding for many of the PHP 6 functions, so you don&#8217;t have to worry about your unicode data getting junked. In PHP 6 you have to watch out when you&#8217;re handling binary data, you&#8217;ll have to explicitly typecast your binary data or risk getting it junked because PHP 6 thinks of it as unicode <img src='http://blogs.vinuthomas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre>$binStr = (binary)$rawdata;</pre>
<p>You can also declare the encoding of your PHP script by the following command:</p>
<pre></pre>
<p>Even your OO code where you were following the pre PHP 5.3 object models will not work here, since object model compatibility is removed. So your classes should be like this:</p>
<pre> class newClass {
   private $variable;
   public function myMethod {
    }
 }</pre>
<p>instead of the old notation in 4.3 which used to look like this:</p>
<pre> class newClass {
   var $variable;
    function myMethod {
    }
 }</pre>
<p>Read more on this topic at <a href="http://www.linux-mag.com/cache/7433/1.html">Linux Magazine: Get Ready for PHP 6</a></p>
<p>Image Credits: <a href="http://www.flickr.com/photos/48637138@N00/2067605262">Narno</a> via Flickr</p>
<div style="margin-top: 10px;height: 15px" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/8a8edb3f-17b1-4407-9fb3-c275a93e76cf/" title="Reblog this post [with Zemanta]"><img /></a><span class="zem-script more-related pretty-attribution"></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/07/22/are-you-ready-for-php-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.3 &amp; Internationalization</title>
		<link>http://blogs.vinuthomas.com/2009/07/14/php-5-3-internationalization/</link>
		<comments>http://blogs.vinuthomas.com/2009/07/14/php-5-3-internationalization/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 03:17:22 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[i18n]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=1097</guid>
		<description><![CDATA[Stas Malyshev has written a good article over at Zend Developer Zone about the new intl &#8211; Internalization extension in PHP 5.3. Internationalization has been a major problem with web developers when developing sites which have to support multiple languages. The new extension eases the developer&#8217;s work drastically. Stas mentions in the article that the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/File:Unicode_sample.png" rel="lightbox[1097]"><img class="alignright size-medium wp-image-1099" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/07/Unicode_sample-299x83.png" alt="Unicode_sample" width="299" height="83" /></a>Stas Malyshev has written a good article over at Zend Developer Zone about the new intl &#8211; Internalization extension in PHP 5.3. Internationalization has been a major problem with web developers when developing sites which have to support multiple languages. The new extension eases the developer&#8217;s work drastically. Stas mentions in the article that the following modules have been implemented in the Intl extension:</p>
<ul>
<li><a href="http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3#Locale">Locale</a> — deals with breaking locale data into components, assembling a locale string from components and displaying the names of countries, languages etc in a specified locale.</li>
<li><a href="http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3#Collator">Collator</a> — a means of comparing and sorting strings according to local rules.</li>
<li><a href="http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3#Number_formatter">Number formatter</a> — allows you to format numbers in a variety of ways, and to parse textual representations of numbers.</li>
<li><a href="http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3#Date_formatter">Date formatter</a> — allows you to format dates and to parse textual representations of dates.</li>
<li><a href="http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3#Message_formatter">Message formatter</a> — allows you to compose messages from parameterized strings while formatting the data inside according to local rules and allowing choices dependent on the actual parameter value.</li>
<li><a href="http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3#Normalizer">Normalizer</a> — a means of bringing a Unicode string to a standard, unambiguous representation.</li>
<li><a href="http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3#Grapheme">Grapheme</a> module &#8211; handles parsing a string into a set of graphemes.</li>
<li><a href="http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3#IDN">IDN</a> &#8211; handles internationalized domain names format</li>
</ul>
<p><a href="http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3">Read Stas&#8217; article</a> to learn how to use the new features this extension provides to make your website Internationalization ready.</p>
<p>If you&#8217;re using PHP5.2, you&#8217;re in luck since there is a PECL package which should run on PHP 5.2.4 and newer over at: <a href="http://pecl.php.net/package/intl">http://pecl.php.net/package/intl</a></p>
<p style="text-align: left">Link: <a href="http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3">http://devzone.zend.com/article/4799-Internationalization-in-PHP-5.3</a></p>
<p style="text-align: right">Image via <a href="http://en.wikipedia.org/wiki/Image:Unicode_sample.png" rel="lightbox[1097]">Wikipedia</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/03cfba03-1afa-4269-964c-92607a667b4b/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=03cfba03-1afa-4269-964c-92607a667b4b" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/07/14/php-5-3-internationalization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saving Data into Excel the Easy Way using PHP</title>
		<link>http://blogs.vinuthomas.com/2009/07/01/saving-data-into-excel-the-easy-way-using-php/</link>
		<comments>http://blogs.vinuthomas.com/2009/07/01/saving-data-into-excel-the-easy-way-using-php/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 13:10:01 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=871</guid>
		<description><![CDATA[If you&#8217;re looking for an easy way to output your data from a PHP script into a Excel file, you&#8217;ve got to check out this script MS-Excel Stream Handler which I came across at the PHP Classes site. What this script essentially does is to implement a stream handler interface to write Microsoft Excel spreadsheet [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re looking for an easy way to output your data from a PHP script into a Excel file, you&#8217;ve got to check out this script <a href="http://www.phpclasses.org/browse/package/1919.html">MS-Excel Stream Handler</a> which I came across at the <a href="http://www.phpclasses.org">PHP Classes</a> site. What this script essentially does is to implement a stream handler interface to write Microsoft Excel spreadsheet files.</p>
<p>All you have to do to output data into an Excel file is to create an associative array with the data to be exported. For example if you wanted an excel sheet in this format:<br />
<a href="http://blogs.vinuthomas.com/wp-content/uploads/2009/06/sheet.png" rel="lightbox[871]"><img class="alignnone size-medium wp-image-872" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/07/sheet-300x85.png" alt="Excel Stream Writer" height="85" width="300"/></a></p>
<p>all you need to do is to create an array like this:</p>

<div class="wp_codebox"><table><tr id="p8717"><td class="code" id="p871code7"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Serial&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Item&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Cables&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Stock&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;100&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cost per unit&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$2</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Serial&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;2&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Item&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Phones&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Stock&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;40&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cost per unit&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$23</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Serial&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Item&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Keypads&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Stock&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cost per unit&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$4</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Serial&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;4&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Item&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Helmets&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Stock&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;54&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cost per unit&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$42</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now to output this into an Excel file, all you need to do is to use the <a href="http://www.phpclasses.org/browse/file/7601.html">excel.php</a> from Ignatius&#8217;s script and open a xlsfile stream to output the data. Here&#8217;s a script which creates the Excel file from the array above and allows the user to download the file to their system:</p>

<div class="wp_codebox"><table><tr id="p8718"><td class="code" id="p871code8"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require</span> <span style="color: #0000ff;">&quot;excel.php&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//open Excel Stream to output</span>
<span style="color: #000088;">$export_file</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;xlsfile://tmp/example.xls&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$export_file</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;wb&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Serial&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Item&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Cables&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Stock&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;100&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cost per unit&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$2</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Serial&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;2&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Item&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Phones&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Stock&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;40&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cost per unit&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$23</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Serial&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Item&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Keypads&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Stock&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cost per unit&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$4</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Serial&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;4&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Item&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Helmets&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Stock&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;54&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cost per unit&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$42</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//write the array to Excel</span>
<span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #339933;">,</span> <span style="color: #990000;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//set headers to download Excel sheet</span>
<span style="color: #990000;">header</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cache-Control: no-cache, must-revalidate&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Pragma: no-cache&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: application/vnd.ms-excel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Disposition: attachment; filename=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$export_file</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">readfile</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$export_file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This script allows you to quickly export any data which you can form into an array quickly into an Excel sheet. If you&#8217;re looking for an Excel export with advanced features like formatting the cells in the sheet, adding colors or the likes of those, you&#8217;re out of luck with this script.</p>
<p>You can get this script and more information about it from the PHP Classes site:<br />
<a href="http://www.phpclasses.org/browse/package/1919.html">http://www.phpclasses.org/browse/package/1919.html</a></p>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/958041e8-fe63-4305-99a6-cc2a75b946db/" title="Reblog this post [with Zemanta]"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=958041e8-fe63-4305-99a6-cc2a75b946db" alt="Reblog this post [with Zemanta]"/></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/07/01/saving-data-into-excel-the-easy-way-using-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Compiler Internal Slides by Sebastian Bergmann</title>
		<link>http://blogs.vinuthomas.com/2009/05/28/php-compiler-internal-slides-by-sebastian-bergmann/</link>
		<comments>http://blogs.vinuthomas.com/2009/05/28/php-compiler-internal-slides-by-sebastian-bergmann/#comments</comments>
		<pubDate>Thu, 28 May 2009 10:25:10 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Bytecode]]></category>
		<category><![CDATA[compiler]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=823</guid>
		<description><![CDATA[Here&#8217;s an interesting slide from Sebastian Bergmann which explains the magic that happens when you execute your PHP code, and how it gets converted into bytecode. He also goes ahead to show you how to extend the PHP compiler in the presentation.

PHP Compiler Internals
View more Microsoft Word documents from Sebastian Bergmann.


]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an interesting slide from Sebastian Bergmann which explains the magic that happens when you execute your PHP code, and how it gets converted into <a class="zem_slink" href="http://en.wikipedia.org/wiki/Bytecode" title="Bytecode" rel="wikipedia">bytecode</a>. He also goes ahead to show you how to extend the PHP compiler in the presentation.</p>
<p><img style="visibility: hidden; width: 0px; height: 0px;" src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEyNDM1MDUzMjMzNjYmcHQ9MTI*MzUwNTc4NjIwMCZwPTEwMTkxJmQ9c3NfZW1iZWQmZz*yJnQ9Jm89ZDZhODkyMjZiYmVjNDYzYmEzN2ZlMTVjYTNkOTFhYWYmb2Y9MA==.gif" border="0" height="0" width="0"/>
<div style="width: 425px; text-align: left;" id="__ss_1495702"><a style="margin: 12px 0pt 3px; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; display: block; text-decoration: underline;" href="http://www.slideshare.net/sebastian_bergmann/php-compiler-internals?type=powerpoint" title="PHP Compiler Internals">PHP Compiler Internals</a><object style="margin: 0px;" height="355" width="425"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=phpcompilerinternals-090527083805-phpapp01&amp;stripped_title=php-compiler-internals"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=phpcompilerinternals-090527083805-phpapp01&amp;stripped_title=php-compiler-internals" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="355" width="425"></embed></param></object>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View more <a style="text-decoration: underline;" href="http://www.slideshare.net/">Microsoft Word documents</a> from <a style="text-decoration: underline;" href="http://www.slideshare.net/sebastian_bergmann">Sebastian Bergmann</a>.</div>
</div>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/0d4c210b-a921-4395-974c-17bfcf5391d9/" title="Reblog this post [with Zemanta]"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=0d4c210b-a921-4395-974c-17bfcf5391d9" alt="Reblog this post [with Zemanta]"/></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/05/28/php-compiler-internal-slides-by-sebastian-bergmann/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Quick Profiler &#8211; Profile your Code</title>
		<link>http://blogs.vinuthomas.com/2009/05/12/php-quick-profiler-profile-your-code/</link>
		<comments>http://blogs.vinuthomas.com/2009/05/12/php-quick-profiler-profile-your-code/#comments</comments>
		<pubDate>Tue, 12 May 2009 14:04:07 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=812</guid>
		<description><![CDATA[
Here&#8217;s a good looking and functional profiler you can plug into your projects. PQP (PHP Quick Profiler) allows you to profile your code and get information about how much time your script took to execute, the amount of memory used, the files which have been included, errors in your code, queries and any other debug [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://blogs.vinuthomas.com/wp-content/uploads/2009/05/phpquickprofiler.png" rel="lightbox[812]"><img class="aligncenter size-medium wp-image-813" title="PHP Quick Pofiler" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/05/phpquickprofiler-300x78.png" alt="PHP Quick Pofiler" width="300" height="78" /></a></p>
<p>Here&#8217;s a good looking and functional profiler you can plug into your projects. PQP (PHP Quick Profiler) allows you to profile your code and get information about how much time your script took to execute, the amount of memory used, the files which have been included, errors in your code, queries and any other debug information you would like to show up.</p>
<p>With minor changes to your code, it&#8217;s easy to get information on the console, memory and file utilizations. Getting information about your queries and load times, you&#8217;ll have to follow the instructions over at:  <a href="http://particletree.com/features/php-quick-profiler/">http://particletree.com/features/php-quick-profiler/</a>.You can also send your exceptions, variable dumps and custom messages sent to the console.</p>
<p>See a demo of PHP Quick Profiler at -<a href="http://particletree.com/examples/pqp/"> http://particletree.com/examples/pqp/</a></p>
<p>Get more information and download PHP Quick Profiler at: <a href="http://particletree.com/features/php-quick-profiler/">http://particletree.com/features/php-quick-profiler/</a></p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://ajaxian.com/archives/firephp-tying-together-firebug-and-php"> FirePHP: Tying together Firebug and PHP </a> (ajaxian.com)</li>
<li class="zemanta-article-ul-li"><a href="http://idojava.blogspot.com/2009/02/php-and-magic-of-xdebug.html">php and the magic of Xdebug</a> (idojava.blogspot.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.phpclasses.org/blog/post/94-Upcoming-PHP-53-features-and-beyond.html"> Manuel Lemos: Upcoming PHP 5.3 features and beyond </a> (phpclasses.org)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/ae1e2d8f-7996-412f-ae8e-1f96fb8a89eb/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=ae1e2d8f-7996-412f-ae8e-1f96fb8a89eb" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/05/12/php-quick-profiler-profile-your-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scienta Zend Framework Debug Bar</title>
		<link>http://blogs.vinuthomas.com/2009/03/31/scienta-zend-framework-debug-bar/</link>
		<comments>http://blogs.vinuthomas.com/2009/03/31/scienta-zend-framework-debug-bar/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 14:38:53 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=796</guid>
		<description><![CDATA[
Scienta ZF Debugbar is a useful tool to add to your sites running on Zend Framework to get server side information of the page being accessed. It&#8217;s quite simple to use &#8211; just download the code, place it in your PHP include path and use the following code in your bootstrap file to get the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://blogs.vinuthomas.com/wp-content/uploads/2009/03/2009-scienta_debugbar.png" rel="lightbox[796]"><img class="size-full wp-image-797 alignnone" title="Scienta Debug Bar" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/03/2009-scienta_debugbar.png" alt="Scienta Debug Bar" width="569" height="21" /></a></p>
<p style="text-align: left;">Scienta ZF Debugbar is a useful tool to add to your sites running on <a class="zem_slink" title="Zend Framework" rel="homepage" href="http://framework.zend.com/">Zend Framework</a> to get server side information of the page being accessed. It&#8217;s quite simple to use &#8211; just <a title="Scienta ZF Debug Bar" href="http://jokke.dk/software/scientadebugbar">download the code</a>, place it in your PHP include path and use the following code in your bootstrap file to get the debug bar to appear at the end of your page:</p>

<div class="wp_codebox"><table><tr id="p79610"><td class="code" id="p796code10"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
   <span style="color: #0000ff;">'database_adapter'</span> <span style="color: #339933;">=&gt;</span>  <span style="color: #000088;">$dbAdapter</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// or array of adapters</span>
   <span style="color: #0000ff;">'memory_usage'</span> <span style="color: #339933;">=&gt;</span>      <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// default value shown</span>
   <span style="color: #0000ff;">'collect_view_vars'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'sort_view_vars'</span> <span style="color: #339933;">=&gt;</span>    <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'show_exceptions'</span> <span style="color: #339933;">=&gt;</span>   <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'handle_errors'</span> <span style="color: #339933;">=&gt;</span>     <span style="color: #009900; font-weight: bold;">FALSE</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$scBar</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Scienta_Controller_Plugin_Debug<span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$frontController</span> <span style="color: #339933;">=</span> Zend_Controller_Front<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$frontController</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">registerPlugin</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$scBar</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p style="text-align: left;">The debug bar also gives you quick access to:</p>
<ul style="text-align: left;">
<li> the variables used in the page</li>
<li>errors generated in that page</li>
<li>Database queries and time taken (if you&#8217;re using the Zend DB libraries)</li>
<li>the time taken to execute the script and more.</li>
</ul>
<p style="text-align: left;">Get more information on this at the project site: <a href="http://jokke.dk/software/scientadebugbar">http://jokke.dk/software/scientadebugbar</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/1b3847a0-9cc8-4728-bf0d-68b8bf9d5d33/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=1b3847a0-9cc8-4728-bf0d-68b8bf9d5d33" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/03/31/scienta-zend-framework-debug-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP functions in Javascript using PHP.JS</title>
		<link>http://blogs.vinuthomas.com/2009/01/08/php-functions-in-javascript-using-phpjs/</link>
		<comments>http://blogs.vinuthomas.com/2009/01/08/php-functions-in-javascript-using-phpjs/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 15:41:33 +0000</pubDate>
		<dc:creator>vinu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[Open source]]></category>

		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=739</guid>
		<description><![CDATA[
PHP programmers usually have to handle HTML &#38; Javascript front-end coding as well and I&#8217;m sure a lot of us have been frustrated with the lack of those easy to use PHP functions in Javascript like those array, encode/decode and string functions. Here&#8217;s a Javascript project which provides you just that.
PHP.JS is an open source [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-full wp-image-740" title="PHP.JS Logo" src="http://blogs.vinuthomas.com/wp-content/uploads/2009/01/logosmall.jpg" alt="PHP.JS Logo" width="120" height="54" /></p>
<p>PHP programmers usually have to handle HTML &amp; Javascript front-end coding as well and I&#8217;m sure a lot of us have been frustrated with the lack of those easy to use PHP functions in Javascript like those array, encode/decode and string functions. Here&#8217;s a Javascript project which provides you just that.</p>
<p>PHP.JS is an open source project started by which aims at providing the standard PHP functions for Javascript development. This eases up programming in Javascript for PHP developers as they can use functions they are familiar with. Currently the project has ported around <a href="http://phpjs.org/functions/index">230+ PHP functions</a>.</p>
<p>To use this library all you need to do is to <a href="http://phpjs.org/packages/index">download</a> the php.js file and include it in your page:</p>

<div class="wp_codebox"><table><tr id="p73913"><td class="code" id="p739code13"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;/pathto/php.js&quot;&gt;&lt;/script&gt;</pre></td></tr></table></div>

<p>Then use use the function as you would in PHP. For example if you want to use the urlencode function in Javascript, just use it like this in Javascript</p>

<div class="wp_codebox"><table><tr id="p73914"><td class="code" id="p739code14"><pre class="javascript" style="font-family:monospace;">urlencode<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://blogs.vinuthomas.com/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This should return &#8216;http%3A%2F%2Fblogs.vinuthomas.com%2F&#8217;. As easy as that !</p>
<p><strong><em>Edit:</em></strong> As Kevin mentioned in the <a href="#comments">comments</a> below, don&#8217;t use the entire php.js file in your projects, just use the function you need. </p>
<p><strong>History of PHP.JS from (<a href="http://phpjs.org">phpjs.org</a>):</strong></p>
<blockquote><p>A developer called Kevin van Zonneveld was once working on a project with a lot of client(JS) / server(PHP) interaction, and he found himself coding PHP functions (like base64_decode &amp; urldecode) in JavaScript to smoothen communication between the two languages.</p>
<p>He stored the stored the functions in a file called php.js which was included in the project. But even when the project was done, it remained fun trying to port PHP functions to JavaScript and so the library grew.</p>
<p>Kevin decided to share the little library online, which triggered the enthusiasm of a lot of PHP developers longing for PHP functionality in JavaScript. The project was open sourced in 2008, and many people contributed their own functions in the comments sections of Kevin&#8217;s blog.</p>
<p>It was decided that the library deserved a bigger home, and a face of its own, and so the PHP.JS core team (which at that time also consisted of Michael White, Felix Geisendörfer, Philip Peterson) developed the phpjs.org website</p></blockquote>
<p>Links:<br />
<a href="http://phpjs.org/">PHP.JS Home Page</a><br />
<a href="http://phpjs.org/functions/index">List of Functions available in PHP.JS</a><br />
<a href="http://phpjs.org/packages/index">Download PHP.JS</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/65d217d5-fcdd-494c-bdb5-84fcf697b711/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=65d217d5-fcdd-494c-bdb5-84fcf697b711" alt="Reblog this post [with Zemanta]" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.vinuthomas.com/2009/01/08/php-functions-in-javascript-using-phpjs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
