Fixes some stuff, makes php work at up completion, expands it's file upload, cleans up some code.

You probably don't want the diff with the file upload patch but I added it to be sure anyways


greets

Vincent