Frage

I'm trying to address this issue now for a long time but still could not figure out what's my mistake.

I've got two repositories I want to combine. The Application and the Framework Core.

// Application
 - composer.json
 - public/
 - CCF/
   - core/ <- here the core package should go 
   - vendor/ <- here it goes instead

Now basically I want to create a composer package that install's into CCF/core/ instead of CCF/vendor/clancats/core/etc..

So I created a custom installer at:

vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php

class ClanCatsFrameworkInstaller extends BaseInstaller
{
    protected $locations = array(
        'core'      => 'CCF/core/',
        'orbit'     => 'CCF/orbit/{$name}/',
    );
}

The composer.json of the core

{
    "name": "clancats/core",
    "description": "The ClanCatsFramework Core repository",
    "type": "clancatsframework-core",
    "license": "MIT",
    "require": {
        "php": ">=5.3",
        "composer/installers": "~1.0"
    }
}

composer.json of the application that should implement the core at CCF/core

{

    "type": "project",  
    "require": {
        "php": ">=5.3",
        "clancats/core": "dev-master"
    },
    "config": {
        "vendor-dir": "CCF/vendor"
    },
}

But after all that composer still installs the core package at /vendor/clancats/etc..

So my question is what is my mistake that composer won't install the core package to CCF/core/?

  • Added composer/installers to the requires.
  • I created a custom installer which defines the path to the core
  • Set the type of the core package to my custom one.

Another question that is spinning around my head, is my pattern wrong? I mean did i misunderstand how to use composer?

Github:

Thanks for your help guys :)

War es hilfreich?

Lösung

So for everyone who runs into the same problem:

My mistake was that i didn't require the composer/installers in the main repository.

The composer installers have to be required in both repositories.

So in this case:

{
    "type": "project",  
    "require": {
        "php": ">=5.3",
        "clancats/core": "dev-master",
        "composer/installers": "~1.0"
    },
    "config": {
        "vendor-dir": "CCF/vendor"
    },
}

solves the problem.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top