atoulme | 425b6c8 | 2008-11-24 14:00:27 +0000 | [diff] [blame] | 1 | <?php |
| 2 | /******************************************************************************* |
| 3 | * Copyright (c) 2007-2008 Eclipse Foundation and others. |
| 4 | * All rights reserved. This program and the accompanying materials |
| 5 | * are made available under the terms of the Eclipse Public License v1.0 |
| 6 | * which accompanies this distribution, and is available at |
| 7 | * http://www.eclipse.org/legal/epl-v10.html |
| 8 | * |
| 9 | * Contributors: |
| 10 | * Antoine Toulme, Intalio Inc. bug 248845: Refactoring generate1.php into different files with a functional approach |
| 11 | *******************************************************************************/ |
| 12 | |
| 13 | class ReleaseTrain { |
| 14 | |
| 15 | public $id = ''; |
| 16 | public $version = ''; |
atoulme | cab9de9 | 2008-11-24 15:04:02 +0000 | [diff] [blame] | 17 | public $timestamp = ''; |
atoulme | 425b6c8 | 2008-11-24 14:00:27 +0000 | [diff] [blame] | 18 | |
| 19 | /** |
| 20 | * Default constructor for now. |
| 21 | **/ |
| 22 | function ReleaseTrain($id) { |
| 23 | $this->id = $id; |
| 24 | $this->version = "3.4.0"; |
| 25 | if (strcmp($id, "europa") == 0) { |
| 26 | $this->version = "3.3.0"; |
| 27 | } |
atoulme | cab9de9 | 2008-11-24 15:04:02 +0000 | [diff] [blame] | 28 | $this->timestamp = date("Ymdhis"); |
atoulme | 425b6c8 | 2008-11-24 14:00:27 +0000 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | static function all() { |
| 32 | $trains = array(); |
kitlo | 2c8d8a9 | 2018-04-19 13:25:09 -0400 | [diff] [blame^] | 33 | $train_result = mysqli_query("SELECT DISTINCT train_id FROM release_train_projects"); |
atoulme | 425b6c8 | 2008-11-24 14:00:27 +0000 | [diff] [blame] | 34 | while (($train_row = mysql_fetch_assoc($train_result)) != null) { |
| 35 | $trains[] = new ReleaseTrain($train_row['train_id']); |
| 36 | } |
| 37 | return $trains; |
| 38 | } |
| 39 | |
| 40 | } |