Yii Framework Forum: Yii2 + Git + Composer Best Practices - Yii Framework Forum

Jump to content

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

Yii2 + Git + Composer Best Practices

#1 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 752
  • Joined: 02-February 09

Posted 30 March 2014 - 06:05 AM

So I am looking forward to first taste of Yii2 and also composer and I was wondering what is the best practice to manage composer and git alongside in a code base. As far as I can see composer-installed third party extensions appear as git submodules (if they are pulled from github). In addition, I would like my custom code to be in git. So my question is what is the git deployment best practices in this case? Should I run composer update on the production server every time I deploy? Should I deploy the composer.lock file so that I can ensure the same extension version all over the place?

Thanks for sharing your thoughts!
0

#2 User is offline   Renka 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 06-April 12

Posted 31 March 2014 - 10:59 AM

deploy composer.lock and run composer install on production. This way you will get versions that are defined in lock file.

Use composer update only in dev/testing.
0

#3 User is offline   Nagy Tibor 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 19-December 14

Posted 23 January 2015 - 08:52 AM

Does it mean, that the vendor directory can be excluded from git?
0

#4 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 572
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 24 January 2015 - 02:10 PM

@Nagy Read this https://getcomposer....or-directory.md
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
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