mnsami / composer-custom-directory-installer

A composer plugin, to install differenty types of composer packages in custom directories outside the default composer default installation path which is in the vendor folder.
https://packagist.org/packages/mnsami/composer-custom-directory-installer
MIT License
138 stars 27 forks source link

Can not seem to get working (probably a problem with my composer.json) #11

Closed chopfitzroy closed 8 years ago

chopfitzroy commented 9 years ago

Here is my composer.json:

{
  "name": "Frontier-CMS",
  "description": "The best Frontend Engineer package around",
  "require": {
    "mnsami/composer-custom-directory-installer": "*",
    "frontier-app/cockpit": "*"
  },
  "extra":{
    "installer-paths":{
      "./admin/": ["frontier-app/cockpit"]
    }
  }
}

When I run composer install it just installs everything to the vendor/ folder.

mnsami commented 9 years ago

hey @CrashyBang ... first sorry for the inconvenience.

I think because you defined your composer.json for your frontier-app/cockpit as a project and not as a library or package.

let me run some tests and get back to you soon.

chopfitzroy commented 9 years ago

Thanks man :) thats really cool I am happy to change anything to make this work :+1:

fnagel commented 9 years ago

Same issues here :-/

royduin commented 8 years ago

An idea to support project types to? For example in combination with https://github.com/aheinze/cockpit/blob/master/composer.json.

mnsami commented 8 years ago

hello

First of all, sorry for the late reply, I had my wedding vacations for 1 month and came back busy with lots of project.

Relating this issue, I have already this issue open with the same request #7 .

My idea with this plugin, is to override the a functionality, with preserving the composer default functionality and behavior, and as a result of this the composer ProjectInstaller requires that a package of type project must be installed in a clean directory.

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

and needs the path of the installation beforehand which is something not achievable when constructing the ProjectPlugin to load the custom ProjectInstaller.

royduin commented 8 years ago

Np, gefeliciteerd! (congrats in Dutch). Then we've to find another way.

mnsami commented 8 years ago

Thanks !

I would recommend changing the package type to something that is composer defined, as per the composer documentation https://getcomposer.org/doc/04-schema.md#type

The type of the package. It defaults to library.

Package types are used for custom installation logic. If you have a package that needs some special logic, you can define a custom type. This could be a symfony-bundle, a wordpress-plugin or a typo3-module. These types will all be specific to certain projects, and they will need to provide an installer capable of installing packages of that type.

which is something that makes sense to me.

what is your opinion?

@fnagel @CrashyBang @royduin

royduin commented 8 years ago

I totally agree with you, I think Cockpit CMS should change it's type as suggested here: https://github.com/aheinze/cockpit/issues/261, but the author isn't responding so we're looking for other options. The suggestions made here are possibilities but those aren't that clean.

mnsami commented 8 years ago

And to be honest, I don't want to handle special handling for a very custom specific project.

The main goal here, is not to create another composer installer to support different projects, the main goal is to extend the functionality of composer.

So, do you mind if I close the ticket?

royduin commented 8 years ago

Sure no problem, but it's opened by @CrashyBang.

mnsami commented 8 years ago

True, I'll wait for @CrashyBang to reply first, but he was satisfied by the solution I told him as his problem was something different.

Anyways, I'll wait for him.

mnsami commented 8 years ago

Reporter is not responding, I'm closing the ticket until further notice.

chopfitzroy commented 8 years ago

Hey @mnsami sorry have been al over the show lately, yes your initial suggestion worked well for me, sorry for not getting back sooner!

Cheers.