PHP Archive (.phar) Attaching with ZF2

PHP archive aka phar is a stream wrapper which can serve any packaged PHP library efficiently.

To create a phar document for a library (not for web output or for cli executable) is simple as pie like –

$phar = new \Phar('target-location-where-to-save.phar', 
 FilesystemIterator::CURRENT_AS_FILEINFO |
 FilesystemIterator::KEY_AS_FILENAME, 'optionalPharAliasName');

After creating phar document, file can use to attach ZF2 standard autoloader as follows –

 'Zend\Loader\StandardAutoloader' => array(
   'autoregister_zf' => true,
   'namespaces' => array(

This works as simple folder of your file system. Easily distributable, packaged.