Skip to content
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

Problems with composer-custom-directory-installer #7

Closed
pablor opened this issue Sep 4, 2014 · 4 comments
Closed

Problems with composer-custom-directory-installer #7

pablor opened this issue Sep 4, 2014 · 4 comments

Comments

@pablor
Copy link

pablor commented Sep 4, 2014

Hi @mnsami,
Fisrt of all thanks for your work!
I'm trying to use your installer and I have some problems. With that composer.json everything works OK:

{
    "name": "test/testign",
    "description": "Tetsting",
    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:mnsami/composer-custom-directory-installer.git"
        }
    ],
    "require": {
        "php": ">=5.3",
        "mnsami/composer-custom-directory-installer": "1.0.*",
        "monolog/monolog": "*"
    },
    "extra": {
        "installer-paths": {
            "./monolog/": ["monolog/monolog"]
        }
    },
    "minimum-stability": "dev"
}

The monolog library was placed in the ./monolog directory as expected. But, if I use my own repo, it doesn't place the pablor/test-library inside the ./monolog directory.

{
    "name": "test/testign",
    "description": "Testing",
    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:mnsami/composer-custom-directory-installer.git"
        },
        {
            "type": "vcs",
            "url": "https://github.com/pablor/test-library"
        }
    ],
    "require": {
        "php": ">=5.3",
        "mnsami/composer-custom-directory-installer": "1.0.*",
        "pablor/test-library": "*",
        "monolog/monolog": "*"
    },
    "extra": {
        "installer-paths": {
            "./monolog/": ["pablor/test-library"]
        }
    },
    "minimum-stability": "dev"
}

Any idea about waht I'm doing wrong?
Thanks!

@pablor
Copy link
Author

pablor commented Sep 5, 2014

Some updates :)
If I execute composer twice, then it works more of less. My repo is copied to /monlog directory and also it remains in /vendor directory. The final directory structure is something like that:

|- composer.json
|- composer.lock
|- monolog
|  |- test-library (my repo files)
|- vendor
|  |- composer
|  |- mnsami
|  |- monolog
|  |- pablor
|  |- psr
|  |- autoload.php

It's very strange that it works only in the second composer update...

@mnsami
Copy link
Owner

mnsami commented Oct 4, 2014

hello @pablor

sorry it took me time to answer you. But I took your composer.json content and ran composer install on it, I had no problems finding your repo content inside the monolog folder. In other words, the content of your repo was downloaded successfully in the right directory.

may be something happened during the composer install?

can you try again and tell me?

thanks

@idct-tech
Copy link

hi @pablor,

you are most likely using an old composer as I had the same before doing composer.phar self-update

kind regards,
Bartosz

@mnsami
Copy link
Owner

mnsami commented Feb 1, 2016

Hi @pablor

After doing some investigations, you package is of type project and composer ProjectInstaller handles anything with type project to be installed in the root of clean directory.

Check https://github.com/composer/composer/blob/master/src/Composer/Installer/ProjectInstaller.php#L61

The best thing you can do, is change the type of your composer package to something that the composer installers can handle.

The idea with my plugin here, is to provide customization for the composer installers without altering how composer function or doing some dirty hacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants