Encoding And Rename Yii Engine


because of my boss policy i must encode the hole project and yii engine folder.

i do that with obfusc and project code hasnt problem but whene i code the yii engine all of json sections disabled and not work.

additional that i must rename the engine name and use the alternative constant like: Test::app() instead of Yii::app().

do you know how can i 1-code the yii engine and 2-rename Yii constant?


Does your boss really want to obfuscate the code from the coders?

You can easily rename the yii engine folder, just tell the bootstrap index.php file where to look and the name of the folder. You can move it out of the document root so it can’t be browsed to. You can also move the protected folder out of webroot too.

Yii::app() is NEVER seen in the browser, and when a new coder comes in and looks at the code, it’ll take them longer to get up to speed.

Is/was your boss a coder, or just management? It sounds like he/she wants security for security’s sake.

thank for reply

he is management and wants not be any name of yii in project.

Yii::app() not seen in browser but its visible in source code.

i rename the whole yii folder "yii" to "test" and file name too.its worked but javascript and jquery codes not work. i found whene i code the yii folder or rename "yii" word all of javascripts fie removed from source code and site loaded without any javascript code.do you know how can fix it?

First thought: What a Winnie!

Anyways, It looks like you will need to modify the Yii base code. There is a file a js/ folder in the framework that refers to the dependencies for jQuery. I have not looked at it in a while, but you might need to change something in there to reference the new location.

You could also google it. I remember something about how to use a cdn version of JQuery involving CMap:: but I really don’t remember how it was done.