Download the PHP package microweber-deps/composer-shared-package-plugin without Composer

On this page you can find all versions of the php package microweber-deps/composer-shared-package-plugin. 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-shared-package-plugin

Composer - Shared Package Plugin

Code Climate Scrutinizer Code Quality Build Status Test Coverage

This composer plugin allows you to share your selected packages between your projects by creating symlinks.
All shared packages will be in the same dedicated directory for all of your projects (ordered by versions) and a symlink directory container will be created on your projects (vendor-shared by default).

This plugin will improve your work process to avoid to work into the vendor folder or to avoid to force you to push your package to work/test it with another project.

How it works

A shared package is flagged by two ways :

If this composer plugin is required in the root project composer.json : the package will be downloaded in the dedicated dependencies directory that you provided and a symlink will be created in the project vendor-shared directory (by default).

This plugin allows you to work with many versions at the same time for a package by creating a sub-directory named by the version of your package (dev-master, dev-develop, 1.0.x-dev, etc).

A packages.json file is created in the dependencies sources directory to know which projects use a package version and be able to ask you if you want to delete the version directory during the Composer uninstall process, if no project seems to use it.

Installation

Step 1 : edit your root composer.json

Add, to your root project composer.json, this require (in dev only) :

Note: this plugin works fine in production mode, but it has been created for development purpose.

Step 2 : set your dependencies vendor path

Your dependencies vendor path is the path where all your shared packages will be downloaded. This path should be at the same level (or above) of all your projects.
If you IDE doesn't handle symlinks, you may use this directory to work on your development packages. Otherwise, you'll be able to work directly on your symlinks with modern IDE (PHP Storm, SublimeText, ...).

Add, to your root project composer.json, this extra configuration :

Note: you can pass a relative path (foo/bar) or absolute path (starts with "/" : /foo/bar).
If your path is relative, your symlink directory base path will be relative too.

Note for VM users: you can manually override the symlink directory base path with the configuration symlink-base-path if your host machine dependencies directory path is not the same as your guest machine, see all available configurations page for more information.

Step 3 : select your shared packages

Add, in your own package composer.json, which one you want to share between your projects :

Note: as you can see, you can pass a wild card * to the package name. So, in this example, all packages that starts with bar/ will be shared. Note²: you can set a package name to * to share all packages.

Step 4 : (re)install your dependencies

If you already have installed your project dependencies, you have to fully delete your vendor/ directory and your composer.lock file.
Run the composer install command.

You should see a new vendor-shared folder with all shared packages symlinks.

Step 5 : play with require-dev :

You can avoid to have two project composer.json by setting your require dependencies on a stable version (~x.x.x) and work on dev environement with a your working in progress version by setting, in your require-dev with your development version, like this :

Thanks to that, you will be able to work with development version in dev environement and have stable version in production.

Note: the alias * as 1.0 may avoid a Composer version solver error, because this behavior is not handled by default.
Note²: Composer has not been created to work with development version/branch, so when you run a composer install, the current package branch HEAD commit will flagged in your composer.lock.
So, the next time you'll run this command on dev environement, and if you already have a composer.lock file, Composer will checkout the flagged commit and not the new HEAD (if you made new commit) of your branch : your shared packages won't be up to date. To avoid this behavior, please read "How to use - Update only your own packages".

Structure generation example

Here, a complete example. Our own shared package is called acme/foo-bar.

With this composer.json, the structure will look like :

How to use (and known issues)

This plugin implement a new behavior which is not handled by Composer, so there are a few known issues. Here, the way to fix them :

All available configurations

See the all available configurations documentation.

Reporting an issue or a feature request

Feel free to open an issue, fork this project or suggest an awesome new feature in the issue tracker.

ChangeLog

3.1.0

3.0.0 :

2.0.0 :

1.2.0 :

1.1.0 :

Credit

L'Étudiant

This plugin project is maintained by L'Etudiant.
The Composer project is maintained by Nils Adermann & Jordi Boggiano, see https://github.com/composer/composer#authors for more information.

License

This plugin is licensed under MIT license, see the LICENSE file for more information.
You can also read the Composer license for more information.


All versions of composer-shared-package-plugin with dependencies

PHP Build Version
Package Version
Requires composer/composer Version ^1.10
composer-plugin-api Version ^1.1
phpunit/phpunit Version ^9.3
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 microweber-deps/composer-shared-package-plugin contains the following files

Loading the files please wait ....