Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moodle plugins types not working correctly #214

Closed
danielneis opened this issue Jan 27, 2015 · 5 comments
Closed

Moodle plugins types not working correctly #214

danielneis opened this issue Jan 27, 2015 · 5 comments

Comments

@danielneis
Copy link

Hello,

i am having some problems with installing Moodle Plugins with the composer-installers.
As noted here (https://github.com/danielneis/moodle-block_attendance/blob/master/composer.json), moodle should be supported by installer, although this page (https://composer.github.io/installers/) does not list Moodle as an option.

I am trying to add a package, to the "blocks" folder, but it is being added to vendor instead, as the type was not recognized.

I am using the following composer.json (https://github.com/danielneis/moodle-block_attendance/blob/master/composer.json) for the package:

{
    "name": "danmarsden/moodle-block_attendance",
    "type": "moodle-block",
    "require": {
        "composer/installers": "~1.0"
    },
    "extra": {
        "installer-name": "attendance"
    }
}

And here is the composer.json I am using on moodle root folder (the require-dev was already there and also the first repository):

{
    "repositories" : [
        {
            "type": "vcs",
            "url": "https://github.com/moodlehq/moodle-behat-extension"
        },
        {
            "type":"package",
            "package":{
                "version":"dev-master",
                "name":"danmarsden/moodle-block_attendance",
                "source":{
                    "url":"https://github.com/danielneis/moodle-block_attendance.git",
                    "type":"git",
                    "reference":"master"
                },
                "dist":{
                    "url":"https://github.com/danielneis/moodle-block_attendance/archive/master.zip",
                    "type":"zip"
                }
            }
        }
    ],
    "require": {
        "danmarsden/moodle-block_attendance":"dev-master"
    },
    "require-dev": {
        "phpunit/phpunit": "3.7.*",
        "phpunit/dbUnit": "1.2.*",
        "moodlehq/behat-extension": "1.28.7"
    }
}

It clones the correct repository from github but it is done on vendors/ directory instead of blocks/ as it should.

Am I missing something?

Kind regards,
Daniel

@shama
Copy link
Contributor

shama commented Jan 27, 2015

@Mihailoff or @forloops would you mind helping out here?

@forloops
Copy link
Contributor

@danielneis, you forgot the most important part, you need to require composer/installers in your require section. At the minimum in your moodle root, you need:

{
    "repositories" : [
        { "type": "vcs", "url":  "git@github.com:danielneis/moodle-block_attendance.git" }
    ],
    "require" : {
        "composer/installers" : "dev-master",
        "danmarsden/moodle-block_attendance" : "dev-master"
    }
} 

@danielneis
Copy link
Author

thank you @forloops ! I was sure i was forgetting something, i may have tried "composer-installers" instead of the correct ""composer/installers" and haven't seen.

thank you very much! =D

@shama
Copy link
Contributor

shama commented Jan 27, 2015

Thanks @forloops!

@forloops
Copy link
Contributor

my pleasure :)

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

No branches or pull requests

3 participants