News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Christian Weiske's Blog:
Working with .phar files
August 26, 2011 @ 09:07:41

Christian Weiske has a new post to his blog looking at a feature of PHP that's very useful yet doesn't seem to be widely used - phar archives. His post introduces you to phar and includes the good and the bad about their use.

It is possible to pack an entire PHP web application up in one single file and run it without unpacking it. This files usually have a .phar extension, which is an acronym for PHp ARchive, loosely based on jar (Java ARchive). [...] With PHP 5.3.0, the Phar extension is an official part of PHP. Shipping your applications as Phar thus is safe since 5.2 has reached its EOL already.

He mentions some of the pros (like one file, no unpacking needed) and cons (like no method for incremental updates, changing individual files inside the package is hard) of using them. He also talks about some of the tools you can use to create your own packages including PHP's own support, phar-util and Phing's phar task. He includes a few "things to consider" when making your packages and gives examples from the SemanticShuttle package to illustrate. Thrown in at the end are some benchmarks that show the difference between static file serving (with and without PHP) and the same sort of statistics with Phar packages included in the mix.

0 comments voice your opinion now!
phar archive tutorial introduction pros cons benchmark


blog comments powered by Disqus

Similar Posts

WebReference.com: The Building Blocks: Data Types, Literals, Variables, and Constants - Part 2

DZone.com: Sencha Touch 2 Models - Loading And Saving Model Data Using a Proxy, PHP Example

VT\'s Tech Blog: A Few XML & PHP Tutorials

PHP-GTK Community Site: Accessing geo-nick with Zend Framework (Zend_XmlRpc_Client)

NetTuts.com: Relational Databases for Dummies


Community Events





Don't see your event here?
Let us know!


interview laravel list wordpress developer series api configure release install library code application threedevsandamaybe podcast bugfix community language symfony introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework