All Projects → gossi → composer-localdev-plugin

gossi / composer-localdev-plugin

Licence: MIT license
Composer Plugin for local development

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to composer-localdev-plugin

composer-diff
Compares composer.lock changes and generates Markdown report so you can use it in PR description.
Stars: ✭ 51 (+64.52%)
Mutual labels:  packagist, composer, composer-plugin
Awesome Composer
😎 A curated awesome list for Composer, Packagist, Satis, Plugins, Scripts, Composer related resources, tutorials.
Stars: ✭ 738 (+2280.65%)
Mutual labels:  packagist, composer, composer-plugin
composer-velocita
Velocita - Composer plugin for transparent caching
Stars: ✭ 26 (-16.13%)
Mutual labels:  packagist, composer, composer-plugin
Private Composer Installer
Composer install helper outsourcing sensitive keys from the package URL into environment variables
Stars: ✭ 168 (+441.94%)
Mutual labels:  packagist, composer, composer-plugin
Acf Pro Installer
A composer install helper for Advanced Custom Fields PRO
Stars: ✭ 265 (+754.84%)
Mutual labels:  packagist, composer, composer-plugin
Packagist Mirror
Creates Packagist.org mirror site.
Stars: ✭ 32 (+3.23%)
Mutual labels:  packagist, composer
Kontent Delivery Sdk Php
Kentico Kontent Delivery SDK for PHP
Stars: ✭ 41 (+32.26%)
Mutual labels:  packagist, composer
Keygen Php
A fluent PHP random key generator.
Stars: ✭ 93 (+200%)
Mutual labels:  packagist, composer
Security Advisories
A database of PHP security advisories
Stars: ✭ 1,740 (+5512.9%)
Mutual labels:  packagist, composer
Local Php Security Checker
PHP security vulnerabilities checker
Stars: ✭ 482 (+1454.84%)
Mutual labels:  packagist, composer
Satis Server
🐳 Private, self-hosted Composer/Satis repository with unlimited private and open-source packages and support for Git, Mercurial, and Subversion. HTTP API, HTTPs support, webhook handler, scheduled builds, Slack and HipChat integration.
Stars: ✭ 96 (+209.68%)
Mutual labels:  packagist, composer
generator-composer
🐘 Yeoman (http://yeoman.io) generator for a PHP Composer project
Stars: ✭ 16 (-48.39%)
Mutual labels:  packagist, composer
Id Card
身份证号校验及信息获取
Stars: ✭ 14 (-54.84%)
Mutual labels:  packagist, composer
Packagist Mirror
Alibaba Cloud Packagist Mirror
Stars: ✭ 63 (+103.23%)
Mutual labels:  packagist, composer
Composer Mirror
Composer 全量镜像发布于2017年3月,曾不间断运行2年多。这个开源有助于理解 Composer 镜像的工作原理
Stars: ✭ 607 (+1858.06%)
Mutual labels:  packagist, composer
Packeton
📦 Private, self-hosted Packagist/Composer/Satis repository with unlimited private repos.
Stars: ✭ 115 (+270.97%)
Mutual labels:  packagist, composer
Ansible Role Composer
Ansible Role - Composer PHP Dependency Manager
Stars: ✭ 149 (+380.65%)
Mutual labels:  packagist, composer
Hprose Php
Hprose is a cross-language RPC. This project is Hprose 3.0 for PHP
Stars: ✭ 1,952 (+6196.77%)
Mutual labels:  packagist, composer
Satis
Simple static Composer repository generator - For a full private Composer repo use Private Packagist
Stars: ✭ 2,722 (+8680.65%)
Mutual labels:  packagist, composer
Repman
Repman - PHP Repository Manager: packagist proxy and host for private packages
Stars: ✭ 277 (+793.55%)
Mutual labels:  packagist, composer

Composer local Development Plugin

A composer plugin that assists you with local dependencies.

Imagine the following: You are developing two packages, A and B. Package A depends on B. In your normal workflow you would push changes you did in package B to github. .... Then wait.... until changes are pushed to packagist and caches are refreshed. Now you can run composer update in package A to get all the changes you did in package B. That's very ineffective, not only do you need to to push changes most importantly you need to wait for a change that is just a directory away. Here is a solution.

Installation

At best this plugin is installed globally, so go ahead:

$ composer global require 'gossi/composer-localdev-plugin=dev-master'
$ composer global update

Usage

The priority in this plugin lies in the truth that you shouldn't change your packages code, it should just work as expected when pushed to github and others want to consume it. You only describe your local development to composer and the rest is handled by this plugin. Open '~/.composer/config.json' and add the localdev property to the root node:

{
    "config": {
        "localdev": {
            "": ["/path/to/your/packages"],
            "sümfony": "/path/to/sümfony",
			"my/package": "/path/to/my/package"
        }
    }
}

As you can see, you can define three types of folder types:

  1. Global path: The plugin will look for vendor/package packages in these directories. E.g. if you are looking for my/pkg it will look for it in /path/to/your/packages/my/pkg/.
  2. Vendor path: You can give a path for all packages of a certain vendor. E.g. if you are looking for sümfony/finda it will look for it in /path/to/sümfony/finda/.
  3. Package path: Of course explicitly say where a specific package is located. E.g. the lookup for my/package will find it at /path/to/my/package/.

For global and vendor packages you can give multiple paths by defining them as an array (see the difference between global and vendors paths in the example above - both are accepted).

Run update/install

The neat idea is, you don't need to change your workflow at all. If you now run composer install or composer update in one of your packages, those packages that are available locally (described in the global composer config.json) will be symlinked to their original location. You will see something like the notice.

=> Symlinked phootwork/lang from /path/to/phootwork/lang

Pitfalls

At the moment, every package that can be found locally is symlinked no matter what. There must be something to control this, because sometimes you just want your package from packagist in the desired version number. Make your suggestions under Issue #3.

Issues

There are still some issues, that haven't been solved:

  1. Dealing with custom installers: You may have custom installers, that change the installation destination of your package. Normally, the localdev plugin will just wrap them and both work as expected, yet there is a catch. These custom installers (composer plugins as this one) will be installed during the first installation of that required package. They will be unnoticed to the localdev plugin in the first run, so only the custom installer will work. At the moment, you need to run composer update one more time to make them both work (See #1).
  2. "Ignore Discard Changes": I run across this issue, yet I don't remember what caused this one. I just keep it here as an reminder, there is something. If you run across this, please open an issue.

References

Contribute

Contributions are welcome, at best open an issue or add a comment to and existing one get the discussion going.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].