3

I'm trying to add FirePHP to my Zend Framework 2 project using composer, but I get errors.
My OS is a Windows 7.
I tried following ways to make it working:

I added following code to composer.json file:

"repositories": [{
    "type": "vcs",
    "url": "https://github.com/RobLoach/firephp-core"
}],
"require": {
    "firephp/firephp-core": "dev-master" // Tried also: "firephp/firephp-core": "*"
}

Here is a error I got:

[RuntimeException]
Failed to clone http://github.com/RobLoach/firephp-core.git, git was not found, check that it is installed and in your PATH env.

I tried add to composer.json following code, which I found in firephp pull request. :

"require": {
    "firephp/firephp-core": "*"
}

But it gives me same error I have posted above. Composer is totally new for me. I couldn't find any helpful tutorial for it, so I'm not sure how does it work yet, but I'm doing my best to get familiar with it.
I hope someone can tell me what I'm doing wrong.
Thanks.

EDIT: I got it working thanks to @Seldaek help, but it removed my Zend library folder.
Here is log from cmd:

E:\xampp\htdocs\ZendSkeleton>php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing firephp/firephp-core (dev-master f60753a)
    Cloning f60753a8dd7817e4da6bc73e0e717387a9a0866a

  - Removing zendframework/zendframework (2.0.5)
Writing lock file
Generating autoload files

Is there any way to stop removing Zend folder?

Here is my full composer.json file:

{
    "name": "zendframework/skeleton-application",
    "description": "Skeleton Application for ZF2",
    "license": "BSD-3-Clause",
    "keywords": [
        "framework",
        "zf2"
    ],
    "homepage": "http://framework.zend.com/",
    "require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": "2.*"
    },
    "require": {
        "firephp/firephp-core": "dev-master"
    },
    "config": {
        "bin-dir": "E:/xampp/htdocs/ZendSkeleton/"
    }
}
oz123
  • 27,559
  • 27
  • 125
  • 187
user1409508
  • 623
  • 1
  • 12
  • 38

1 Answers1

5

The problem is the package only has a dev-master version available, and those are by default installed with git. If you don't have git available in your PATH you can run composer with --prefer-dist which will force it to install from zip archives instead of via git. Something like composer update --prefer-dist should work out.

The better fix though would be to make sure that the git executable is accessible in your PATH environment variable. If you have no idea what I'm asking, maybe another option is to run composer from the "Git Bash" shell instead of cmd.exe.

Seldaek
  • 40,986
  • 9
  • 97
  • 77
  • Thanks for response, I reinstalled msysgit and it start working, but it removes my Zend lib folder, do you have any idea why? I edited my first post with more details – user1409508 Mar 26 '13 at 11:20
  • You override the require block in your composer.json, you defined it twice so the second one clears out the first and zendframework is not required anymore. You can just add the firephp/firephp-core line to the first require block and remove the second one. – Seldaek Mar 26 '13 at 12:45
  • @user1409508 also regarding the bin-dir, you can use "." to install them in the current dir, instead of putting the complete path which means the composer config won't work on another machine than yours. – Seldaek Mar 26 '13 at 12:46