[248845] Refactoring generate1.php into different files with a functional approach
fixing remaining issues.
diff --git a/classes/export/generate_feature.php b/classes/export/generate_feature.php
index d2caf76..cecf5ec 100644
--- a/classes/export/generate_feature.php
+++ b/classes/export/generate_feature.php
@@ -23,7 +23,7 @@
 $dbc = new DBConnection();
 $dbh = $dbc->connect();
 
-$work_dir = "/home/babel-working/";
+$work_dir = "/tmp/babel-working/";
 if (!($ini = @parse_ini_file(BABEL_BASE_DIR . "classes/base.conf"))) {
 	errorLog("Failed to find/read database conf file - aborting.");
 	exitTo("error.php?errNo=101300","error: 101300 - database conf can not be found");
@@ -38,13 +38,15 @@
 
 exec("rm -rf $work_context_dir*");
 exec("mkdir -p $output_dir");
+exec("mkdir -p $features_dir");
 
 foreach(ReleaseTrain::all() as $train) {
+	exec("mkdir -p $features_dir/$train->id");
 	$output_dir_for_train = "$output_dir/$train->id/";
 	foreach(Language::all() as $lang) {
 		$feature = new Feature($lang, $train, $tmp_dir, $output_dir_for_train);
 		$feature->generateAll();
-		$featureZip = $feature->zip($features_dir);
-		echo "Feature created here: $featureZip";
+		$featureZip = $feature->zip("$features_dir/$train->id");
+		echo "Feature created here: $featureZip\n";
 	}
 }