Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom installation path for composer packages

Hi I am trying to setup a project using composer. I am able to install CakePHP but I am getting a hard time installing cakephp/debug_kit on a custom direcoty. I am trying to install it on "vendor/cakephp/cakephp/app/Plugin/DebugKit/" because CakePHP require its plugins to be installed on the Plugin directory of its "app" folder.

I already setup my composer.json according this site but still the plugin get installed on "vendor/cakephp/debug_kit"

Here is my composer.json maybe there is something wrong with my code. I am just a newbie in using composer.json.

{
    "name" : "notmii/pse",
    "repositories" :
    [{
        "type": "package",
        "package":
        {
            "name" : "cakephp/cakephp",
            "version" : "2.3.5",
            "source" :
            {
                "type" : "git",
                "url" : "git://github.com/cakephp/cakephp.git",
                "reference" : "2.3.5"
            },
            "bin" : ["lib/Cake/Console/cake"]
        }
    },
    {
        "type": "package",
        "package":
        {
            "name" : "cakephp/debug_kit",
            "version" : "2.2.0",
            "source" :
            {
                "type" : "git",
                "url" : "https://github.com/cakephp/debug_kit.git",
                "reference" : "2.2.0"
            }
        }
    }],

    "extra":
    {
        "installer-paths":
        {
            "vendor/cakephp/cakephp/app/Plugin/DebugKit/": ["cakephp/debug_kit"]
        }
    },

    "require" :
    {
        "php": ">=5.3",
        "cakephp/cakephp" : ">=2.3.5",
        "cakephp/debug_kit": "2.2.*"
    }
}
like image 448
notmii Avatar asked Dec 27 '22 04:12

notmii


2 Answers

Change your extra block to:

"extra":
{
    "installer-paths":
    {
        "app/Plugin/DebugKit": ["cakephp/debug_kit"]
    }
},

This worked for me.

like image 127
Kris Avatar answered Jan 05 '23 18:01

Kris


If you want to add all plugins to app/Plugin instead of defining custom path for each plugin, update your extra block like this:

"extra": {
    "installer-paths": {
        "app/Plugin/{$name}/": ["type:cakephp-plugin"]
    }
}
like image 38
trank Avatar answered Jan 05 '23 18:01

trank