[248845] Refactoring generate1.php into different files with a functional approach
diff --git a/classes/export/generate_feature.php b/classes/export/generate_feature.php
index 7721aee..d2caf76 100644
--- a/classes/export/generate_feature.php
+++ b/classes/export/generate_feature.php
@@ -39,7 +39,7 @@
 exec("rm -rf $work_context_dir*");
 exec("mkdir -p $output_dir");
 
-foreach($ReleaseTrain::all() as $train) {
+foreach(ReleaseTrain::all() as $train) {
 	$output_dir_for_train = "$output_dir/$train->id/";
 	foreach(Language::all() as $lang) {
 		$feature = new Feature($lang, $train, $tmp_dir, $output_dir_for_train);
diff --git a/classes/system/fragment.class.php b/classes/system/fragment.class.php
index 9fec45c..4d832e0 100644
--- a/classes/system/fragment.class.php
+++ b/classes/system/fragment.class.php
@@ -60,11 +60,11 @@
 		$plugins = array();
 		while (($file_row = mysql_fetch_assoc($file_result)) != null) {
 			$f = new File();
-			$f->file_id = file_row['file_id'];
-			$f->name = file_row['name'];
-			$f->plugin_id = file_row['plugin_id'];
-			$f->project_id = file_row['project_id'];
-			$f->version = file_row['version'];
+			$f->file_id = $file_row['file_id'];
+			$f->name = $file_row['name'];
+			$f->plugin_id = $file_row['plugin_id'];
+			$f->project_id = $file_row['project_id'];
+			$f->version = $file_row['version'];
 			$plugins[$file_row['plugin_id']][] = $file_row;
 		}
 		
diff --git a/classes/system/release_train.class.php b/classes/system/release_train.class.php
index 0dee12a..bab1337 100644
--- a/classes/system/release_train.class.php
+++ b/classes/system/release_train.class.php
@@ -14,7 +14,7 @@
 
 	public $id = '';
 	public $version = '';
-	public $timestamp = date("Ymdhis");
+	public $timestamp = '';
 	
 	/**
 	* Default constructor for now.
@@ -25,6 +25,7 @@
 		if (strcmp($id, "europa") == 0) {
 			$this->version = "3.3.0";
 		}
+		$this->timestamp = date("Ymdhis");
 	}
 	
 	static function all() {