Simply use mapscript to modify the contents from the globals.php after roughly line 60:$map = ms_newMapObj($PM_MAP_FILE);
Documentation on PHP MapScript
Use the following to get capabilities on a WMS
http://SERVICE-ENDPOINT/?request=GetCapabilities&service=WMS&version=DESIRED-VERSION