Cavity-QED-based quantum phase gate