Question

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/"
    }
}
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top