Output generate code to external dir to keep current dir clean.

Generate php code and move it to /tmp. Then we will copy file from /tmp
to master branch.