-// Check if osm-file is set and points to a valid file if --all or --import-data is given
-checkInFile($aCMDResult);
+//*******************************************************
+// Making some sanity check:
+// Check if osm-file is set and points to a valid file
+if ($aCMDResult['import-data'] || $aCMDResult['all']) {
+ // to remain in /lib/setup_functions.php function
+ checkInFile($aCMDResult['osm-file']);
+}
+
+// osmosis init is no longer supported
+if ($aCMDResult['osmosis-init']) {
+ $bDidSomething = true;
+ echo "Command 'osmosis-init' no longer available, please use utils/update.php --init-updates.\n";
+}
+
+// ******************************************************
+// instantiate Setup class
+$oSetup = new SetupFunctions($aCMDResult);
+
+// *******************************************************
+// go through complete process if 'all' is selected or start selected functions
+if ($aCMDResult['create-db'] || $aCMDResult['all']) {
+ $bDidSomething = true;
+ $oSetup->createDB();
+}
+
+$oSetup->connect();