New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory repository type and local stability #3658

Closed
yguedidi opened this Issue Jan 20, 2015 · 5 comments

Comments

Projects
None yet
6 participants
@yguedidi

yguedidi commented Jan 20, 2015

First of all, thank you for composer!

But currently it's a pain to work localy on packages that depend on each other. You must run composer update each time a dependency of a package you work on is updated.

That's why I propose to have a repository type directory, with a path option. And they have only the local stability. If the directory exists locally, then composer create a symlink to that directory in vendors.

Exemple 1:

Here the repo must be defined in ~/.composer/config.json, but this allow the contributor to put it where he want on his machine (usage between windows and linux)

// ~/.composer/config.json
{
    "repositories": [
        {
            "type": "directory",
            "path": "/path/to/my/local/repo"
        }
    ]
}
// /myrepo/composer.json
{
    "require": "myother/repo@local"
}

An error is throwed when the local repository is not available.

Exemple 2:

Here the required repo must be at the same level of the current one, in a repo2 directory.

// /myrepo/composer.json
{
    "repositories": [
        {
            "type": "directory",
            "path": "../repo2"
        }
    ],
    "require": "myother/repo@local"
}

I hope I'm understandable... Any thoughts?

@alcohol

This comment has been minimized.

Member

alcohol commented Jan 21, 2015

Composer already supports (local) directories as repository sources. These however are used as actual repositories.

Your issue is a common one and could easily be resolved by simply creating symlinks yourself for example.

See also related issues: #601, #1299, #2171, #3254 (and probably more)

@torches

This comment has been minimized.

torches commented Feb 2, 2015

@yguedidi I agree, this is a pain, on one hand composer allows for rapid development with what it provides, but if you want to continue that rapid development, while working in a packaged module structure (keeping your in house modules split out) it becomes a cumbersome effort.
There should be an easy way to define the local path to your code without overriding the autoloader inside your front controller, or using symlinks.
I think a drop in file as suggested above that would allow you to specify the local static path of your module namespace makes perfect sense.
A good option for some is to have an "app" which has all of your modules included and their namespaces defined, but this is only practical for some projects.

+1 on this feature.

@jreinke

This comment has been minimized.

jreinke commented Apr 2, 2015

Just gave a solution for this on another related issue: #1299 (comment)

@Seldaek

This comment has been minimized.

Member

Seldaek commented Oct 28, 2015

The path repo helps with this so closing, could be we have a better solution eventually but right now that's it https://getcomposer.org/doc/05-repositories.md#path

@Seldaek Seldaek closed this Oct 28, 2015

@mreschke

This comment has been minimized.

mreschke commented Nov 24, 2015

Yes the https://getcomposer.org/doc/05-repositories.md#path solution works almost 100%...except for the version issues it has. See #4635

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment