<?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>Tue, 24 Aug 2010 15:59:19 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>mysqlind_qc: Client Side Caching for MySQL extensions for PHP</title><link>http://blogs.vinuthomas.com/2010/06/29/mysqlind_qc-client-side-caching-for-mysql-extensions-for-php/</link> <comments>http://blogs.vinuthomas.com/2010/06/29/mysqlind_qc-client-side-caching-for-mysql-extensions-for-php/#comments</comments> <pubDate>Tue, 29 Jun 2010 07:50:02 +0000</pubDate> <dc:creator>vinu</dc:creator> <category><![CDATA[Databases]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[extension]]></category> <category><![CDATA[mysql]]></category><guid isPermaLink="false">http://blogs.vinuthomas.com/?p=4954</guid> <description><![CDATA[Here's something in the making, a PHP extension which caches MySQL queries irrespective of the extension being used. It's a plugin for mysqlind, the native MySQL driver for PHP called  mysqlind_qc. This currently requires PHP 5.3.3-dev which is still in development.]]></description> <content:encoded><![CDATA[<p><a href="http://blogcdn.vinuthomas.com/wp-content/uploads/2010/06/mysql_logo.png" rel="lightbox[4954]"><img class="size-full wp-image-542 alignright" title="MySQL " src="http://blogcdn.vinuthomas.com/wp-content/uploads/2010/06/mysql_logo.png" alt="" width="200" height="103" /></a></p><p>Here&#8217;s something in the making, a PHP extension which caches MySQL queries irrespective of the extension being used. It&#8217;s a plugin for <a href="http://dev.mysql.com/downloads/connector/php-mysqlnd/">mysqlnd</a>, the native MySQL driver for PHP called  mysqlnd_qc. This currently requires PHP 5.3.3-dev which is still in development.</p><p>The extension allows caching buffered queries through mysql_query and mysqli_query. It allows cache-invalidation though TTL or a user defined callback. This extension is still in the protoype stage right now and will evolve as the project progresses.</p><p>The Query Cache is implemented as a PHP extension. It is written in C and operates &#8220;under the hood&#8221; of PHP. During the start up of the PHP interpreter it gets registered as a mysqlnd plugin to replaces selected mysqlnd methods.</p><blockquote><p>At PHP run time it proxies queries send from mysqlnd/PHP to the MySQL server. If a query string starts with the SQL hint (/*qc=on*/) to enable caching of it and the query is not cached (Cache miss), the query cache plugin will record the raw wire protocol data send from MySQL to PHP to answer the query. The query cache records the wire protocol data in its cache medium and replays it, if still valid, on a cache hit.</p><p>Note that the query cache does not hold decoded result sets consisting of zvals (C struct representing a PHP variable). It stores the raw wire data of the MySQL client server protocol. In case of a cache hits, mysqlnd still needs to decode the cached raw wire data into PHP variables before passing the result to the user space. This approach has one major advantage: simplicity.</p></blockquote><p>You can get more information and installation instructions over at the <a href="http://forge.mysql.com/wiki/MySQLnd_Query_Cache_Plugin_for_PHP">MySQLND Query Cache Project page at Mysql Forge</a>.</p><p>Check out this slide which gives you more information about this extension:</p><div id="__ss_4525028" style="width: 425px;"><strong><a title="Built-in query caching for all PHP MySQL extensions/APIs" href="http://www.slideshare.net/nixnutz/buildin-query-caching-for-all-php-mysql-extensionsapis">Built-in query caching for all PHP MySQL extensions/APIs</a></strong><object id="__sse4525028" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mysqlndquerycacheprototype-100617062420-phpapp01&amp;stripped_title=buildin-query-caching-for-all-php-mysql-extensionsapis" /><param name="name" value="__sse4525028" /><param name="allowfullscreen" value="true" /><embed id="__sse4525028" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mysqlndquerycacheprototype-100617062420-phpapp01&amp;stripped_title=buildin-query-caching-for-all-php-mysql-extensionsapis" name="__sse4525028" allowscriptaccess="always" allowfullscreen="true"></embed></object></p><div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/nixnutz">Ulf Wendel</a>.</div></div><div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_c.png?x-id=97f0e5db-2fe9-4768-a02e-773c38987487" alt="Enhanced by 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/06/29/mysqlind_qc-client-side-caching-for-mysql-extensions-for-php/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Free Ebook on the Zend Framework</title><link>http://blogs.vinuthomas.com/2010/06/21/free-ebook-on-the-zend-framework/</link> <comments>http://blogs.vinuthomas.com/2010/06/21/free-ebook-on-the-zend-framework/#comments</comments> <pubDate>Mon, 21 Jun 2010 08:02:28 +0000</pubDate> <dc:creator>vinu</dc:creator> <category><![CDATA[PHP]]></category><guid isPermaLink="false">http://blogs.vinuthomas.com/?p=4929</guid> <description><![CDATA[Here&#8217;s a very good e-book on the Zend Framework called Zend Framework: Surviving The Deep End by Pádraic Brady. You can access this book from it&#8217;s site at www.survivethedeepend.com. It&#8217;s not yet available in print or download, but the author does mention that there&#8217;s a print book coming out in the near future. Here&#8217;s a [...]]]></description> <content:encoded><![CDATA[<p><a href="http://blogcdn.vinuthomas.com/wp-content/uploads/2010/06/zend_framework_logo.png" rel="lightbox[4929]"><img class="size-full wp-image-576 alignright" title="zend_framework_logo" src="http://blogcdn.vinuthomas.com/wp-content/uploads/2010/06/zend_framework_logo.png" alt="" width="246" height="136" /></a>Here&#8217;s a very good e-book on the Zend Framework called Zend Framework: Surviving The Deep End by Pádraic Brady. You can access this book from it&#8217;s site at <a href="http://www.survivethedeepend.com/">www.survivethedeepend.com</a>. It&#8217;s not yet available in print or download, but the author does mention that there&#8217;s a print book coming out in the near future.<br /> Here&#8217;s a top level Table of contents of the subjects covered in this book:</p><dl><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/introduction">1.  Introduction</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/the.architecture.of.zend.framework.applications">2.  The Architecture of Zend Framework Applications</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/the.model">3.  The Model</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/installing.the.zend.framework">4.  Installing The Zend Framework</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/a.not.so.simple.hello.world.tutorial">5.  A Not So Simple Hello World Tutorial</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/standardise.the.bootstrap.class.with.zend.application">6.  Standardise The Bootstrap Class With Zend_Application</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/handling.application.errors.gracefully">7.  Handling Application Errors Gracefully</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/developing.a.blogging.application">8.  Developing A Blogging Application</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/implementing.the.domain.model.entries.and.authors">9.  Implementing The Domain Model: Entries and Authors</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/setting.the.design.with.zend.view.zend.layout.html.5.and.yahoo.user.interface.library">10.  Setting The Design With Zend_View, Zend_Layout, HTML 5 and Yahoo!   User Interface Library</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/creating.a.local.domain.using.apache.virtual.hosts">A.  Creating A Local Domain Using Apache Virtual Hosts</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/performance.optimisation.for.zend.framework.applications">B.  Performance Optimisation For Zend Framework Applications</a></dt><dt> <a href="http://www.survivethedeepend.com/zendframeworkbook/en/1.0/apc">C.  Copyright Information</a></dt><dt></dt><dt></dt><dt>If you&#8217;re already working on the Zend Framework, take a look at the section on Performance optimizations for apps built on the Zend Framework, which has some useful tips.</dt></dl> ]]></content:encoded> <wfw:commentRss>http://blogs.vinuthomas.com/2010/06/21/free-ebook-on-the-zend-framework/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Create RESTful Webservices in minutes with FRAPI</title><link>http://blogs.vinuthomas.com/2010/05/27/create-restful-webservices-in-minutes-with-frapi/</link> <comments>http://blogs.vinuthomas.com/2010/05/27/create-restful-webservices-in-minutes-with-frapi/#comments</comments> <pubDate>Thu, 27 May 2010 10:02:44 +0000</pubDate> <dc:creator>vinu</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[api]]></category> <category><![CDATA[Framework]]></category> <category><![CDATA[PEAR]]></category> <category><![CDATA[webservice]]></category><guid isPermaLink="false">http://blogs.vinuthomas.com/?p=4178</guid> <description><![CDATA[Planning on starting a project with REST webservices? You&#8217;ve gotta check out this new framework called FRAPI. This API framework built in PHP eases development of REST webservices, by allowing you to add actions, responses and even create users and assign API keys to them for accessing the services you create. Here&#8217;s a video showing [...]]]></description> <content:encoded><![CDATA[<p>Planning on starting a project with REST webservices? You&#8217;ve gotta check out this new framework called FRAPI. This API framework built in PHP eases development of REST webservices, by allowing you to add actions, responses and even create users and assign API keys to them for accessing the services you create. Here&#8217;s a video showing an overview of FRAPI and how simple it is to deploy and manage webservices.</p><p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/vJVQi7ZFSaQ&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/vJVQi7ZFSaQ&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p><p>This project is still quite new and <a href="http://wiki.github.com/frapi/frapi/">their documentation</a> is down to the bare minimum. They do have the required documentation for you you&#8217;ll need to get your hands dirty with FRAPI. First you&#8217;ll have to <a href="http://wiki.github.com/frapi/frapi/downloading-frapi">download the sources</a> and <a href="http://wiki.github.com/frapi/frapi/setting-up-frapi">set it up on</a> your own. One you&#8217;ve downloaded the files and setup the directory permissions, you&#8217;ll also have to make the <a href="http://wiki.github.com/frapi/frapi/running-on-apache">Apache Virtual host settings</a> to get FRAPI to start working.</p><p>FRAPI has the following requirements for it to run:</p><ul><li>PHP 5.2.2 or later</li><li>APC: Required for caching of actions, errors, etc.</li><li>HTTP: (http://pecl.php.net/pecl_http</li><li>PEAR: (http://pear.php.net)</li><li>PEAR::HTTP_Request2: This could be replaced by pecl_http however it is used in the bundled <a href="http://github.com/till/armchair">ArmChair</a> package which is used to access CouchDB (http://pear.php.net/HTTP_Request2)</li></ul><p>Some of the advantages I see after playing around with FRAPI is that it auto-generates the code skeleton for you to work on so you just have to go fill in the blanks to create your service. You also don&#8217;t have to worry about transfoming the your data into different formats, FRAPI supports JSON, XML, PHP, and plain text natively. This enables you to make your webservices cross-platform and even power mobile apps. You also don&#8217;t have to tweak around with code which handles http requests and responses while creating your webservices.</p><p>For more information on this project, head over to their site  <a href="http://getfrapi.com/">getfrapi.com</a> or their project page on <a href="http://github.com/frapi/frapi">github</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/628efc64-c484-4134-a602-29ae5d98f6ea/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_b.png?x-id=628efc64-c484-4134-a602-29ae5d98f6ea" 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/05/27/create-restful-webservices-in-minutes-with-frapi/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Check your server load before you process</title><link>http://blogs.vinuthomas.com/2010/05/18/check-your-server-load-before-you-process/</link> <comments>http://blogs.vinuthomas.com/2010/05/18/check-your-server-load-before-you-process/#comments</comments> <pubDate>Tue, 18 May 2010 12:30:36 +0000</pubDate> <dc:creator>vinu</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[function]]></category> <category><![CDATA[performance]]></category><guid isPermaLink="false">http://blogs.vinuthomas.com/?p=4142</guid> <description><![CDATA[Most of us just write applications to be deployed on a webserver without thinking about what to do when the server becomes overloaded. What happens in most cases is that the application would go trying to run itself on every request, and on a heavily loaded system, it just goes on the aggravate the problem, [...]]]></description> <content:encoded><![CDATA[<p><a href="http://blogcdn.vinuthomas.com/wp-content/uploads/2010/05/load.png" rel="lightbox[4142]"><img class="alignright size-medium wp-image-4162" src="http://blogcdn.vinuthomas.com/wp-content/uploads/2010/05/load-300x198.png" alt="" width="300" height="198" /></a>Most of us just write applications to be deployed on a webserver without thinking about what to do when the server becomes overloaded. What happens in most cases is that the application would go trying to run itself on every request, and on a heavily loaded system, it just goes on the aggravate the problem, making increasing the load on the server, till finally the server becomes unreachable.</p><p>What if you could actually check the server load in your PHP application? Would you think about checking the server load before doing some heavy computational task or database accesses? There&#8217;s function in PHP which will allow you to check the load averages on a server.</p><p>The <a href="http://.php.net/manual/en/function.sys-getloadavg.php">sys_getloadavg()</a> in PHP gives you the <a href="http://en.wikipedia.org/wiki/Load_%28computing%29">load averages</a> for your server. You can use this to check the load on your server before processing a request.</p><pre class="brush: php;">
$serverload = sys_getloadavg();
print_r($serverload);
</pre><p>The code above gives the output:</p><pre class="brush: php;">Array
(
    [0] =&gt; 1.07
    [1] =&gt; 0.89
    [2] =&gt; 1
)
</pre><p>The output from the code shows the system load averages where [0] is the load averages for the past 1 minute, [1] is for the past 5 minutes and [2] is for the past 15 minutes.</p><p>On an ideal server, the load averages on the server shouldn&#8217;t go above 3. A load average of more than 15 would mean that the server is already running much lower than normal, and you may not want to add more load to this.</p><p>You can use this output to decide whether to serve a process intensive page depending on the server load. Here&#8217;s a pseudo-code on how you&#8217;d do something like this:</p><pre class="brush: php;">$serverload = sys_getloadavg();
if ($serverload[0]&lt;10)
  {
    // process loads of data now
    some_big_process();
  } else
     {   // Send a 503 header stating that the server is overloaded.
         header('HTTP/1.1 503 Too busy, try again later');
         die('The server is busy at present and cannot process your request.');
      }
</pre><p>You can also run the application in such a way that you can wait till the load on the server decreases to run your process. This is useful if you are running a cron for processing data:</p><pre class="brush: php;">set_time_limit(0);
//set time limit to 0, so PHP's max execution time doesn't interfere with the processing script
$serverload = sys_getloadavg();
//Check load and see if it's low enough to start processing
while ($serverload[0]&gt;5)
{  //Wait for 1 minute to check load again
    sleep(60);
}
// out of the loop - so let's do some processing now!
some_big_process();
</pre><p>To ensure that the script doesn&#8217;t run endlessly on a permanently overloaded server, time check in the while loop to auto-end the script it the server load remains high for a certain amount of time.</p><p><strong>More reading:</strong><br /> <a href="http://en.wikipedia.org/wiki/Load_%28computing%29">Load &amp; Load Averages on Wikipedia</a><br /> <a href="http://in3.php.net/manual/en/function.sys-getloadavg.php">PHP function &#8211; sys_getloadavg</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/1542a605-53f8-4411-b201-f1860ea0a54a/"><img alt="" /></a></div> ]]></content:encoded> <wfw:commentRss>http://blogs.vinuthomas.com/2010/05/18/check-your-server-load-before-you-process/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Bangalore PHP Meetup April &#8217;10</title><link>http://blogs.vinuthomas.com/2010/04/16/bangalore-php-meetup-april-10/</link> <comments>http://blogs.vinuthomas.com/2010/04/16/bangalore-php-meetup-april-10/#comments</comments> <pubDate>Thu, 15 Apr 2010 20:06:43 +0000</pubDate> <dc:creator>vinu</dc:creator> <category><![CDATA[General Stuff]]></category> <category><![CDATA[PHP]]></category><guid isPermaLink="false">http://blogs.vinuthomas.com/?p=4123</guid> <description><![CDATA[Just a quick heads up in case you missed out on the announcement. The Bangalore PHP Meetup&#8217;s happening this month on the 24th. For a change, I&#8217;m not involved much in the organization of this event. Indus Khaithan took care of the venue arragements and Harsha MV&#8217;s taken up co-ordinating with the potential speakers and [...]]]></description> <content:encoded><![CDATA[<p><a href="http://www.meetup.com/Bangalore-PHP-Users/calendar/13135127/"><img class="alignright size-medium wp-image-4125" title="Meetup Logo" src="http://blogcdn.vinuthomas.com/wp-content/uploads/2010/04/meetup_logo_1-300x222.png" alt="" width="240" height="178" /></a>Just a quick heads up in case you missed out on the announcement. The Bangalore PHP Meetup&#8217;s happening this month on the 24th. For a change, I&#8217;m not involved much in the organization of this event. <a href="http://khaitan.org/">Indus Khaithan</a> took care of the venue arragements and<a href="http://harshamv.com/"> Harsha MV&#8217;s</a> taken up co-ordinating with the potential speakers and finalizing the talk list. Thanks a ton guys for taking taking the initiative.</p><p>Harsha&#8217;s put up a tenative list of talks for this month&#8217;s event:</p><ul><li>Developing Facebook Application using PHP by Sriram Kumar</li><li>Job Queues by Abhinav Lal</li><li>Zend ACL Component - <a href="http://projects.binaryvibes.co.in/projects/show/bare" target="_blank">Bare_Acl</a> by Sudheer Satyanarayana</li></ul><p>Here&#8217;s the link to this month&#8217;s meetup event &#8211; <a href="http://www.meetup.com/Bangalore-PHP-Users/calendar/13135127/">www.meetup.com/Bangalore-PHP-Users/calendar/13135127</a>. We&#8217;ll keep that page updated with the latest details about the event. If you are planning on coming for this, join our Meetup group and RSVP &#8216;YES&#8217; to the event.</p><p>As always &#8211; Please forward that link to your friends who you think would be interested in our group as well.</p> ]]></content:encoded> <wfw:commentRss>http://blogs.vinuthomas.com/2010/04/16/bangalore-php-meetup-april-10/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <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 [...]]]></description> <content:encoded><![CDATA[<p><img class="alignright size-full wp-image-4000" title="Zend - The PHP company - Logo" src="http://blogcdn.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&#8242;s co-creator and two leading PHP developers show you how to make the most of PHP 5&#8242;s industrial-strength enhancements in any project—no matter how large or complex. Their unique insights and realistic examples illuminate PHP 5&#8242;s [...]]]></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://blogcdn.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&#8242;s co-creator and two leading PHP developers show you how to make the most of PHP 5&#8242;s industrial-strength enhancements in any project—no matter how large or complex. Their unique insights and realistic examples illuminate PHP 5&#8242;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&#8242;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 [...]]]></description> <content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2890" src="http://blogcdn.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://blogcdn.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 [...]]]></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://blogcdn.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://blogcdn.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>2</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 [...]]]></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="http://blogcdn.vinuthomas.com/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://blogcdn.vinuthomas.com/wp-content/uploads/2009/09/interop.jpg" rel="lightbox[1573]"><img class="alignright size-medium wp-image-1575" title="interop" src="http://blogcdn.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://blogcdn.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://blogcdn.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&#8242;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://blogcdn.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://blogcdn.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://blogcdn.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://blogcdn.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://blogcdn.vinuthomas.com/wp-content/uploads/2009/07/php6unicode.jpg" rel="lightbox[1228]"><img src="http://blogcdn.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://blogcdn.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://blogcdn.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> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 15/20 queries in 0.008 seconds using disk
Content Delivery Network via blogcdn.vinuthomas.com

Served from: blogs.vinuthomas.com @ 2010-09-03 21:42:26 -->