Yii Framework Forum: Help With Composer For Yii2 - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help With Composer For Yii2

#1 User is offline   Jonny 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 184
  • Joined: 26-December 11

Posted 22 November 2013 - 11:39 PM

Hi

I solved this so you may want to skip to the update part

Never used Composer, so giving it a bash. I have a new directory called "Yii2" it is inside my htdocs folder on XAMPP.

I have composer.phar (Downloaded from composer) inside my Yii2 folder too. I have tried to use the link from the docs for the advanced app.

php composer.phar create-project --stability=dev yiisoft/yii2-app-advanced yii-advanced

I get a runtime error saying
[RuntimeException] Failed to clone, git was not found, check that it is installed and in your PATH env. 'git' is not recognized as an internal or external command, operable program or batch file.


What have I done wrong? I've never used composer so any help would be appreciated when trying to fix this.

Update

I copied the composer.json file from Git:

{
        "name": "yiisoft/yii2-app-advanced",
        "description": "Yii 2 Advanced Application Template",
        "keywords": ["yii", "framework", "advanced", "application template"],
        "homepage": "http://www.yiiframework.com/",
        "type": "project",
        "license": "BSD-3-Clause",
        "support": {
                "issues": "https://github.com/yiisoft/yii2/issues?state=open",
                "forum": "http://www.yiiframework.com/forum/",
                "wiki": "http://www.yiiframework.com/wiki/",
                "irc": "irc://irc.freenode.net/yii",
                "source": "https://github.com/yiisoft/yii2"
        },
        "minimum-stability": "dev",
        "require": {
                "php": ">=5.4.0",
                "yiisoft/yii2": "dev-master",
                "yiisoft/yii2-swiftmailer": "dev-master",
                "yiisoft/yii2-bootstrap": "dev-master",
                "yiisoft/yii2-debug": "dev-master",
                "yiisoft/yii2-gii": "dev-master"
        },
        "scripts": {
                "post-create-project-cmd": [
                        "yii\\composer\\Installer::setPermission"
                ]
        },
        "extra": {
                "writable": [
                        "backend/runtime",
                        "backend/web/assets",

                        "console/runtime",
                        "console/migrations",

                        "frontend/runtime",
                        "frontend/web/assets"
                ]
        }
}


So when i used "php composer.phar install" it downloaded fine. So I now have a vendors folder inside my directory. Is that the whole framework, i.e should probably not be in my project folder and be in the xampp directory? I feel like it is meaning that I need to somehow still create an app?

Is that correct? Apologies if this is simple. I only started using Yii 1 recently and have never used Composer, so it's a bit of a change. So if someone can point me in the right direction that would be great. I have read the current docs, but I still wasn't sure.

Thanks

Jonny
0

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 535
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 23 November 2013 - 12:42 AM

Quote

What have I done wrong? I've never used composer so any help would be appreciated when trying to fix this.


You do not seem to have git installed. You can either install git / make it available in path or adjust the command of composer to not use git:

php composer.phar create-project --stability=dev yiisoft/yii2-app-advanced yii-advanced --prefer-dist

0

#3 User is offline   Jonny 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 184
  • Joined: 26-December 11

Posted 23 November 2013 - 10:33 AM

Thanks Cebe,

I shall look into downloading git or not one of your options.

The vendor folder, it's content and the composer.json and composer.phar I downloaded, should that be in my xampp folder? where I would have put my framework and protected folder if this was a Yii 1 install?
0

#4 User is offline   Jonny 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 184
  • Joined: 26-December 11

Posted 23 November 2013 - 06:15 PM

Ok think I fixed this. I managed to install the basic app using command line. Thanks
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users