added php library and docs for it