News Feed
Sections




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

DZone.com:
Phar PHP libraries included with a single file
September 23, 2011 @ 11:30:40

On DZone.com today Giorgio Sironi has a new post looking at an interesting, if seldom used, feature of recent PHP releases - packaging applications with phar archives.

Phar is a php extensions that provides the means for distributing code as a single archive, that does not have to be extracted to a folder before usage. The concept is similar to JVM Jars: each archive becomes a virtual directory where files can be accessed. However, the virtual folder is not limited to class loading, but you can open and read internal files as if it were decompresse into a directory.

He includes a brief "hello world" example of packaging up a script into a phar archive and executing it via PHP. He also shows how easy it is to create an archive from current code, making an archive containing the latest Doctrine 2 release for simple inclusion. Phars also allow compression and hashing but has issues with resource management and access external files.

0 comments voice your opinion now!
phar archive file compress doctrine2 tutorial


blog comments powered by Disqus

Similar Posts

Evan Coury's Blog: Using Zend\Dbs TableGateway & HydratingResultSet to return rows as custom enties

SitePoint PHP Blog: Mock your Test Dependencies with Mockery

Procurios Blog: Syntactic Sugar for MySQLi Results using SPL Iterators

Rob Allen's Blog: Tutorial Notes - Zend_Auth in French & Using Oracle

DevShed: Displaying User Comments in a Code Igniter Blog Application


Community Events





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


community bugfix podcast series opinion install laravel api deployment release tips framework list voicesoftheelephpant symfony package introduction language interview library

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