2017 © Pedro Peláez
 

library phar-install

image

dxw/phar-install

  • Thursday, April 26, 2018
  • by tomdxw
  • Repository
  • 1 Watchers
  • 2 Stars
  • 7,458 Installations
  • Shell
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 5 Versions
  • 7 % Grown

The README.md

phar-install

Tool to bundle up contents of vendor/ into vendor.phar file., (*1)

This may be useful if you want to put your project in a web-readable directory but you don't want to trawl through all the files in vendor/ to make sure none of them could allow an attacker to do something they shouldn't be able to do., (*2)

Usage

Add the following to composer.json:, (*3)

  "scripts": {
    "post-update-cmd": "vendor/bin/phar-install"
  },

Add phar-install:, (*4)

composer require --dev dxw/phar-install

vendor.phar will be rebuilt automatically every time composer update or composer require is run., (*5)

Now just replace require(__DIR__.'/vendor/autoload.php'); with require(__DIR__.'/vendor.phar');., (*6)

Get composer's autoloader

You can also get access to the autoloader object if needed. The phar file will return the autoloader. With this functionality you can add on your own project's namespaced files into the autoloader., (*7)

$autoload = require_once __DIR__ . '/vendor.phar';
$autoload->add('MyNamespace', __DIR__ . '/src');

Copyright dxw 2015 - see COPYING.md, (*8)

The Versions

26/04 2018
08/03 2018

dev-fix/readme

dev-fix/readme https://github.com/dxw/phar-install

  Sources   Download

MIT

22/10 2015

dev-feature/readme

dev-feature/readme https://github.com/dxw/phar-install

  Sources   Download

MIT