idlesign/ist-yii-cfile — pull request #8 by Agent47DarkSoul (2012-04-07 15:27:09+00:00)
Title: Some remodelling of code.

I have modified various methods and made them static. Also there is no need to create CFile instance using new. This modified version allows CFile::set($path) to create a CFile instance. Also I have made some changes to allow using CFileHelper without Yii. One of the core change is CFileHelper::get() returns a CFile instance rather than CFileHelper instance. This allows us to implement public and protected methods like set(), addLog(), formatNumber() as static as they dont $this. To allow this feature, I created wrapper methods for addLog, formatNumber and getPathFromAlias.

Also I have added a CFileTest which currently tests for 6 public methods.

I am thinking about dividing the File and Folder functionalities in different classes like CFile and CFolder inheriting from CResource which is an abstract class containing common functionalities.

So basically CApplication->CResource->CFile and CFolder.

BTW, I am a under-grad student, so if I made any mistake or there is any problem, please feel free to critique the code. All inputs will be appreciated.