setFile and open can use stream resource as file parameter
improve php doc and fix coding style