How to: use github for download yii, create new app, and store our modules or extensions.

You are viewing revision #2 of this wiki article.
This is the latest version of this article.
You may want to see the changes made in this revision.

« previous (#1)

Yesterday I've written a module for myself. Just an experiment. When I was feeling satisfied, I've created a repository on github, and pushed my code. My module and yii are on github. So I'll show you a "new" way to start our yii projects.

  • download yii and checkout the right yii version
  • download our modules or extensions

Download yii and checkout 1.1.10 version

Yii is on github. So we can download it. We can start to create a folder project like "amazyiing". And clone yii project.

$ cd /var/www
$ mkdir amazyiing
$ cd amazyiing
$ git clone git@github.com:yiisoft/yii
$ git checkout 1.1.10

Now git will download yii. We just need a console. We do not need to download a zip file. We do not need to extract. We just need to clone and checkout from bash.

Create our project and download our module

Now I want to create my new project:

$ ./yii/framework/yiic webapp /var/www/amazyiing

Also, I want to download all my needed modules:

$ cd /var/www/amazyiing/protected/modules
$ git clone git@github.com:<my-user-name>/<my-repo-name>
$ git clone git@github.com:<my-user-name>/<my-repo-name>
$ git clone git@github.com:<my-user-name>/<my-repo-name>
$ git clone git@github.com:<my-user-name>/<my-repo-name>

Also, I want to download all my needed extensions:

$ cd /var/www/amazyiing/protected/extensions
$ git clone git@github.com:<my-user-name>/<my-repo-name>
$ git clone git@github.com:<my-user-name>/<my-repo-name>
$ git clone git@github.com:<my-user-name>/<my-repo-name>
$ git clone git@github.com:<my-user-name>/<my-repo-name>

Conclusions

So, if we want, we can share our extensions and modules on github. And people can install them just by cloning them. Remember to use tag so, ... you can checkout the right version of extensions.

If we have distributed applications, we can also just use

$ git pull origin master

to update our extension. Also, we can delete module or extensions and just clone them.