Should you put Yii framework files under version control

I have split my app as recommended in the docs were the framework and protected are not in wwwroot. They both one folder back.

I have added all of this to Git.

My question is if putting Yii core framework files into version control is a good idea. I think it is because that way I can control my Yii version per a site and it could be useful with managing upgrades. I can also see there maybe being an argument for not adding the framework files to a projects repo.

Anybody got any thoughts on this?

I think it depends. in most cases we do not put framework under version controll, but there were few projects where we had to change some framework files (I know we shouldn’t do this, but there were no other option - for example current stable version had a bug with quoting tables for Oracle). In such cases we put framework under version controll to track such changes.

I think it also depends on your control of your production environment. I think if you going to be launching in a shared environment where you don’t have control and might be forced to put the framework in your wwwroot. I know you can try ignore some paths to exclude the framework, but that also seems like more effort than its worth.

I am thinking of changing my development environment to have yii installed in its own location separate to my projects. This way I can have multiple versions of Yii installed but only one of each version regardless of what my projects are using and then only have my actual project files in version control.

EG:

/src/yii/1.1.9/

/src/yii/1.1.10/

/src/yii/2.x/

You can put it under control, since yii framework is added to public github repository recently. The problem can be if you are using same yii framework copy for multiple projects, in case that you depend on some code in yii framework, that is changed(very small possibility).