add some php docs, and minor changes