Stripping Comments from Prod Framework

Hi guys, is there a way to easily strip out all comments (and un-ncesessary spaces and linebreaks for that matter) out of the production version of the framework. The reason I want to do this is that the framework is quite heavily documented in the comments, which is good, but that’s not so good when PHP is parsing the files even with opcode caching where it would only happen once (although in my case I would be using without opcode caching). I know there’s yiilite, but I would prefer to just strip un-necessary stuff out of the entire framework if I could.

I am pretty new here, too, but I believe you can do that easily by editing index.php in the root directory of your project and changing line #4 from this:




$yii=dirname(__FILE__).'/path/to/yii/framework/yii.php';



to this:




$yii=dirname(__FILE__).'/path/to/yii/framework/yiilite.php';



Sorry, I overlooked the last sentence of your question when I replied. There’s no easy way I know of to do that.

http://bytes.com/topic/php/answers/595003-useful-remove-comments-spaces-source-code

@jayrulez:

Interesting, didn’t know PHP has a feature for that. Even though i also doubt that you’ll see any effect. I like that quote: