Yii 1.1: how to use github (un)official extension repo in your Yii project

8 followers

Using a git submodule command in your yii project

I'm developing a web project for a company using Yii framework. We are using a git vcs in our development process. We like to use Yii extensions. But only if they are good.

We are chossing an extension very carefully. If we don't like its code or something else, we don't use it. And last time someone noticed, that we are using only extensions from (un)official github yii extensions repo . But we still need a solution how to use that repositoires independently from our project ?

git submodule add https://github.com/yiiext/with-related-behavior ./protected/extensions/[extension name]

This command will add an extension repository under our project extension folder. And any other extension from github (un)official yii extension repo you can add to your project git repo easy. Then when another coder cloned your repo his extension folders will be empty. He needs to type

git submodule update --init --recursive

And then extensions will appear in his repo too.

very nice feature. You can read more about it on Progit

Total 4 comments

#5399 report it
schmunk at 2011/10/09 01:32pm
git submodule foreach git pull

May be also a useful command.

#5278 report it
CeBe at 2011/09/29 05:36pm
not best way

The way you add the extension is not recommendable. you should use a subdirectory under /protected/extensions and far better also to add it under yiiext:

git submodule add https://github.com/yiiext/with-related-behavior ./protected/extensions/yiiext/with-related-behavior

I will create best practise pages under yiiext wiki on github soon.

#5276 report it
samdark at 2011/09/29 10:09am
yiiext isn't official

yiiext isn't official repository. The difference is that we're working as a team on it and we have a bit stricter rules for these.

#5275 report it
Stamm at 2011/09/29 05:05am
Git init in one command

Hello, RusAlex.

This is very usable for updating third party extensions.

You may init all submodule in one command:

git submodule update --init --recursive

Leave a comment

Please to leave your comment.

Write new article
  • Written by: RusAlex
  • Category: Tips
  • Yii Version: 1.1
  • Votes: +4
  • Viewed: 6,963 times
  • Created on: Sep 29, 2011
  • Last updated: Oct 2, 2011
  • Tags: github git extensions