droy | ebd025c | 2009-10-08 20:42:48 +0000 | [diff] [blame] | 1 | <?php |
| 2 | /******************************************************************************* |
Kit Lo | 3c7ce14 | 2013-03-02 18:22:40 -0500 | [diff] [blame] | 3 | * Copyright (c) 2009-2013 Eclipse Foundation, IBM Corporation and others. |
droy | ebd025c | 2009-10-08 20:42:48 +0000 | [diff] [blame] | 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: |
Kit Lo | 3c7ce14 | 2013-03-02 18:22:40 -0500 | [diff] [blame] | 10 | * Eclipse Foundation - Initial API and implementation |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame] | 11 | * Kit Lo (IBM) - Bug 299402, Extract properties files from Eclipse project update sites for translation |
Kit Lo | 3c7ce14 | 2013-03-02 18:22:40 -0500 | [diff] [blame] | 12 | * Kit Lo (IBM) - [402192] Extract project source files from Git repositories for translation |
| 13 | *******************************************************************************/ |
| 14 | |
droy | ebd025c | 2009-10-08 20:42:48 +0000 | [diff] [blame] | 15 | require_once("cb_global.php"); |
| 16 | |
| 17 | $return = array(); |
| 18 | |
| 19 | $project_id = getHTTPParameter("project_id", "POST"); |
| 20 | $version = getHTTPParameter("version", "POST"); |
| 21 | |
| 22 | $query = "SELECT m.project_id, m.version, r.train_id, m.location, m.filename FROM map_files m |
| 23 | LEFT JOIN release_train_projects r ON m.project_id = r.project_id AND m.version = r.version |
| 24 | WHERE m.is_active = 1 |
| 25 | AND m.project_id = " . returnQuotedString(sqlSanitize($project_id, $dbh)) . " |
| 26 | AND m.version = " . returnQuotedString(sqlSanitize($version, $dbh)); |
| 27 | |
kitlo | 2c8d8a9 | 2018-04-19 13:25:09 -0400 | [diff] [blame] | 28 | $res = mysqli_query($dbh, $query); |
kitlo | 1d02709 | 2018-04-19 17:44:07 -0400 | [diff] [blame] | 29 | if (mysqli_affected_rows($dbh) > 0) { |
droy | a3815a5 | 2019-09-25 12:49:18 -0400 | [diff] [blame] | 30 | while ($line = mysqli_fetch_array($res, MYSQLI_ASSOC)) { |
droy | ebd025c | 2009-10-08 20:42:48 +0000 | [diff] [blame] | 31 | echo $line['location'] . "\n"; |
| 32 | } |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame] | 33 | } else { |
Kit Lo | 3c7ce14 | 2013-03-02 18:22:40 -0500 | [diff] [blame] | 34 | echo "No map files or update sites found for $project_id $version"; |
droy | ebd025c | 2009-10-08 20:42:48 +0000 | [diff] [blame] | 35 | } |
Kit Lo | 3c7ce14 | 2013-03-02 18:22:40 -0500 | [diff] [blame] | 36 | ?> |