} else { echo "Schema NICHT vorhanden<br>"; //Load SQL dump file and replace "schema_name" placeholder with desired schema name $sql_dump = file_get_contents('sql/db-schema.sql'); //echo $sql_dump; $sql_dump2 = str_replace('schema_name', $_REQUEST['schema'], $sql_dump); //echo $sql_dump2; pg_query($db_conn, $sql_dump2); //Check for additional migration files (e.g. 20150731_mig.sql) $migration_files = scandir('sql'); foreach ($migration_files as $migration_file) { if (strpos($migration_file, '_mig')) { echo 'mig file ' . $migration_file . ' found'; //Load SQL migration file and replace "schema_name" placeholder with desired schema name pg_query($db_conn, str_replace('schema_name', $_REQUEST['schema'], file_get_contents('sql/' . $migration_file))); } } } //if Argo Export using ISO19136 Schema, fill stereotypes table if ($_REQUEST['argo'] == 1) { $xmi2db->fillArgoStereotypes(); $xmi2db->fillArgoDatatypes(); } //perfom the queries echo "<pre>"; print_r($xmi2db->getQueries()); echo "</pre>"; ?> </body> </html>