PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 31, 2022

[FIXED] Putting composer.json in the root of a CakePHP installation

 January 31, 2022     cakephp, composer-php, php     No comments   

Issue

My current website installation looks like this:

.htaccess app/composer.phar app/composer.json app/Config app/Controller app/Model app/Plugin app/Test app/tmp app/Vendor (CakePHP and most other composer packages get installed here) app/webroot

I would quite like the composer files to be in the root of the structure. I know I can change vendor-dir in composer.json to app/Vendor however the issue I am having is that some of my required packages are of the cakephp-plugin so they automatically get installed to the Plugin folder - this is working fine for the above folder structure. But if I move composer.json to the root, I am unsure how to make them go to app/Plugin without defining the path for each package in composer.json to override where composer would want to install to. What is the correct way to do this?


Solution

It looks like you just need to add this to your composer.json. I haven't tested it.

{
    "extra": {
        "installer-paths": {
            "app/Plugin/{$name}/": ["type:cakephp-plugin"]
        }
    }
}

More info: https://github.com/composer/installers#custom-install-paths



Answered By - kevinsearle
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing