Segundo o github do projeto, esse é o caminho correto da instalação via composer.
Because this plugin has the type cakephp-plugin set in it's own composer.json, composer knows to install it inside your /Plugins directory, rather than in the usual vendors file. It is recommended that you add /Plugins/Upload to your .gitignore file.
A documentação do projeto diz que o plugin tem um arquivo composer com a configuração type: cakephp-plugin
, o que é verdade olhando o repositório do projeto.
Segundo a documentação do composer, esse realmente é o comportamento dessa configuração.
This is an example for a CakePHP plugin. The only important parts to set in your composer.json file are "type": "cakephp-plugin" which describes what your package is and "require": { "composer/installers": "~1.0" } which tells composer to load the custom installers.
{
"name": "you/ftp",
"type": "cakephp-plugin",
"require": {
"composer/installers": "~1.0"
}
}
This would install your package to the Plugin/Ftp/ folder of a CakePHP app when a user runs php composer.phar install.
Acredito que o CakePHP deva funcionar dessa forma, embora eu nunca tenha usado.
Segundo a documentação do CakePHP
Autoloading Plugin Classes
When using bake for creating a plugin or when installing a plugin using Composer, you don’t typically need to make any changes to your application in order to make CakePHP recognize the classes that live inside it.
In any other cases you may need to modify your application’s composer.json file to contain the following information:
"psr-4": {
(...)
"MyPlugin\\": "./plugins/MyPlugin/src",
"MyPlugin\\Test\\": "./plugins/MyPlugin/tests"
}
Additionally you will need to tell Composer to refresh its autoloading cache:
$ php composer.phar dumpautoload
If you are unable to use Composer for any reason, you can also use a fallback >autoloading for your plugin:
Plugin::load('ContactManager', ['autoload' => true]);
Caso você realmente necessite trocar o path da onde o composer instala os plugins do CakePHP, seria só adicionar a configuração a seguir no seu arquivo composer.json
A package type can have a custom installation path with a type: prefix.
{
"extra": {
"installer-paths": {
"your/custom/path/{$name}/": ["type:cakephp-plugin"]
}
}
}
Ou você pode mudar o caminho de instalação de um único pacote
If you are consuming a package that uses the composer/installers you can override the install path with the following extra in your composer.json:
{
"extra": {
"installer-paths": {
"your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
}
}
}