0) { foreach (range(1, pg_num_rows($result)) as $i){ $row=pg_fetch_row($result, $i-1, PGSQL_ASSOC); $sql.="drop table ".$row['table_name'].";"; $sql.="delete from geometry_columns where f_table_name='".$row['table_name']."';"; $sql.="delete from \"datasetsMetadata\" where \"tableName\"='".$row['table_name']."';"; //DEREGISTER DATASET in GEOSERVER //------------------------------------------------------------- //Register the new data type using geoserver configuration tool $client = new HttpClient($geoserverInternalHost, $geoserverInternalPort); $client->setDebug(false); //Authenticate in Geoserver $client->post($geoserverPath.'admin/loginSubmit.do', array ( 'username' =>$geoserver_user, 'password' =>$geoserver_pwd, 'submit' => 'Submit' )); $headers = $client->getHeaders(); $foo= explode(";",$headers['set-cookie']); $foo= explode("=",$foo[0]); $sessionArray = array('JSESSIONID' => $foo[1]); $client->setCookies($sessionArray); //delete the Feature Type $client->post($geoserverPath.'config/data/typeSelectSubmit.do', array ( 'selectedFeatureTypeName' => 'temp_datasets:'.$row['table_name'], 'buttonAction' => 'Delete' )); //Click Apply $client->post($geoserverPath.'admin/saveToGeoServer.do', array ('submit' => 'Apply')); //Click Save $client->post($geoserverPath.'admin/saveToXML.do', array ('submit' => 'Save')); //------------------------------------------------------------------ } } $sql.="VACUUM FULL;"; //we remove all tables $result = pg_query($dbcon, $sql); echo($sql); ?>