Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Adding composer.json #20

Closed
mcallisto opened this issue Jun 10, 2013 · 10 comments
Closed

Adding composer.json #20

mcallisto opened this issue Jun 10, 2013 · 10 comments

Comments

@mcallisto
Copy link
Contributor

It would be great if this plugin (and its dependencies) could be installed via composer.

@burzum
Copy link
Owner

burzum commented Jun 12, 2013

ok!

@burzum
Copy link
Owner

burzum commented Jun 13, 2013

Let me know if I'm missing something, first time I set this up for a cakephp plugin 7f33e2a

@mcallisto
Copy link
Contributor Author

@burzum thank you very much, really nice of you.

I loaded it with the following app/composer.json in my project and the update was completed

{
    "config": {
        "vendor-dir": "Vendor"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/burzum/FileStorage.git"
        }    
    ],
    "require": {
        "burzum/FileStorage": "dev-develop"
    }
}

Note that doing so the Gaufrette library is in app/Vendor/knplabs/gaufrette this means adding in app/Config/bootstrap.php the following lines

Configure::write(
    'FileStorage.GaufretteLib',
    APP . 'Vendor' . DS . 'knplabs' . DS . 'gaufrette' . DS . 'src' . DS
);

@mcallisto mcallisto reopened this Jun 13, 2013
@mcallisto
Copy link
Contributor Author

First problem: with the app/composer.json posted in my previous (above) comment, the plugin is created in Plugin/Filestorage (with lower case s) instead of Plugin/FileStorage (with upper case s).

As a comparison I am using also https://github.com/cakephp/debug_kit and this is correctly created in Plugin/DebugKit.

So I wonder if:

  • there is a solution (not found it yet) in the json syntax for this, allowing to change the name of the root folder of the plugin
  • or the name of the Git repository must be changed

@burzum
Copy link
Owner

burzum commented Jun 20, 2013

This is an issue of the composer CakePHP installer -> https://github.com/composer/installers/blob/master/src/Composer/Installers/CakePHPInstaller.php

It does not handle CamelCasedWords correctly.

I've fixed it https://github.com/burzum/installers/commit/87e0ea2e85b47a90c4cba1556a8b76f199e120d8 and created a pull request composer/installers#89

As a workaround please try this:

"extra": {
    "installer-paths": {
        "Plugin/FileStorage": ["vendor/package"]
    }
}

See http://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md

@mcallisto
Copy link
Contributor Author

Thank you, running composer update, due to your accepted pull request, now installs the plugin with the correct name.

If you agree, these could be the possible next steps:

  1. Adding an app/composer.json to https://github.com/cakedc/imagine
  2. Having this dependency suggested (not required) in this app/composer.json

@mcallisto
Copy link
Contributor Author

As a first step, I proposed this pull request https://github.com/mcallisto/Imagine/commit/5d9f732c3fadad049a113a0a8ffab7bac5476d01

@burzum
Copy link
Owner

burzum commented Jun 24, 2013

Merged it.

@mcallisto
Copy link
Contributor Author

Sorry, it contained a typo, my mistake, see https://github.com/mcallisto/Imagine/commit/f78c08988bd1bfa2dfdda86d5a0e86e54b8d208c

@burzum
Copy link
Owner

burzum commented Jun 25, 2013

Thanks for the PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants