Download the PHP package macfja/composer-phar-bin without Composer

On this page you can find all versions of the php package macfja/composer-phar-bin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package composer-phar-bin

Composer Phar Bin plugin

The plugin replace development dependencies by their Phar.

Why ?

I encounter several times a dependency lock on dev tool (code quality, documentation generation, etc.), and most of the time those tool have a Phar binary.

To manage those Phar, solution already exist, like Phive, but it's an another tool to install, another set of commands to run.

So, I create this Composer plugin to integrate Phive into Composer in the less visible way.

How it's works ?

When run composer install, composer update, or composer require, the plugin will check if any of your require-dev packages exist in the Phive repository. If found then Phive will link the Phar in your composer binaries so scripts will continue to work and the dependency will be ignore (so its sub-dependencies).

Installation

Simply run: composer require macfja/composer-phar-bin, and then a composer install.
Or globally: composer global require macfja/composer-phar-bin.

Any later composer install, composer update, or composer require will trigger the dependencies replacement.

How prevent a package to be replace ?

If for some reason need a package known by Phive to not be replace by its Phar, you can add in you (root) composer.json a list of package to don't replace.

In the extra section add composer-phar-bin object that contains an array named exclude of Composer packages.

Example

In the following example, phpunit/phpunit will be downloaded and managed by Composer, but phan/phan will be replace by its Phar.

Limitation

The plugin only work after been installed. That seem obvious but there are cases which are tedious to understand because of this.

Dependencies conflicts on new a environment

Let's imagine that you use the plugin and you have virtually some conflict. Everything work fine, the plugin replace conflicting libraries with their Phar.

Someone want to install the project, but Composer complaint about some packages ("Your requirements could not be resolved to an installable set of packages.").

The reason is probably because you don't commit your composer.lock file, so Composer is trying to solve all dependencies, and as our plugin is not yet installed and loaded, it can't do its magic.

How to solve this ?

You have several solutions to solve this:

Missing phars on fresh install

You download a project with a composer.lock, run composer install.

Everything seem ok, but when you first run a composer script, Composer complain about missing file.

The issue here is that the Composer read the composer.lock file, and so only install your dependencies, excluding the ones that are manage by our plugin. But as the plugin is not loaded (because not yet installed) it doesn't install phar.

How to solve this ?

You have two options:

Contributing

You can contribute to the library. To do so, you have Github issues to:

You also have PR to:

Local installation

First clone the project (either this repository, or your fork), next run:

Validate your code

When you done writing your code run the following command check if the quality meet defined rule and to format it:

License

The MIT License (MIT). Please see License File for more information.


All versions of composer-phar-bin with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
ext-simplexml Version *
composer-plugin-api Version ^1.0
symfony/process Version >= 3
webmozart/path-util Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package macfja/composer-phar-bin contains the following files

Loading the files please wait ....