3

Maybe a true stupid question but how can I really test a script with his dependencies before pushing the package to packagist?

I have tried with in myroot/composer.json :

"autoload": {
    "psr-0": {
        "myname/core": "vendor/myname"
    }
}

in my vendor/myname/core/core.php I have something like this :

namespace myname/core;

die('it works');

in my vendor/myname/core/composer.json I have something like this :

{
"name": "myname/core",
"description": "xxx",
"license": "MIT",
"authors": [
    {
        "name": "my name",
        "email": "",
        "homepage": ""
    }
],
"require": {
    "php": ">=5.3.0",
    "monolog/monolog": "1.0.*"
}
}

but it doesn't seem to work, when I try to run:

$ php composer.phar install
=> monolog/monolog is not installed =>

can somebody help me to understand?

kenorb
  • 155,785
  • 88
  • 678
  • 743
injetkilo
  • 300
  • 2
  • 10
  • in which directory are you running `composer install`? – Gediminas May 27 '13 at 10:56
  • > in my vendor/myname/core/composer.json I have something like this That's quite an odd thing to do. composer.json should be place in the root directory. Also what error do you see if composer isn't installing anything? – Danack Jun 01 '13 at 18:19
  • No referring to packagist I have to put a composer.json in my package. I don't have any error when I run php composer.phar update or install I think that there's no way to test if your package install correctly the dependecies... You have to add it to your root composer.json then don't forgot to add it to your composer.json declaration of your package too... Or anybody have an other better workflow solution ? – injetkilo Jun 03 '13 at 13:06

1 Answers1

-1

I think this will help, I have a small blog article that I rewrote today that goes through creating packagist packages.

https://circlical.squarespace.com/blog/2013/6/24/distributing-a-zf2-module-through-packagist-github-and-composer

If you work it this way, I recommend checking it back down and testing inside a real integration -- I usually start like this, and push changes back up to GitHub whenever the changes are thoroughly tested.

Hope this helps.

Saeven
  • 2,280
  • 1
  • 20
  • 33