Changeset 2389 for trunk/website/scripts/BuildPublish.php
- Timestamp:
- 11/26/2011 4:10:12 AM (18 months ago)
- File:
-
- 1 edited
-
trunk/website/scripts/BuildPublish.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/website/scripts/BuildPublish.php
r2386 r2389 15 15 16 16 require_once('Credentials.php'); 17 require_once(' Database.php');18 require_once('Build .php');17 require_once('BuildBranch.php'); 18 require_once('BuildUtil.php'); 19 19 20 20 $file = fopen($argv[3], 'rb'); … … 40 40 $installerPath = sprintf('/builds/%s/%s', $branch->ID, $fileName); 41 41 42 // Then upload the installer to the URL.42 //Upload the installer to the URL. 43 43 Upload(SHELL_WEB_ROOT . $installerPath, $file, $sftp_username, $sftp_password); 44 45 //Insert the build to the database. 46 printf('Inserting build into database... '); 47 Build::CreateBuild($branch->ID, intval($argv[2]), filesize($argv[3]), HTTP_WEB_ROOT . $installerPath); 48 printf("Inserted.\n"); 49 50 //Remove old builds 51 printf('Removing old builds from database...' . "\n"); 52 53 $pdo = new Database(); 54 $statement = $pdo->prepare('UPDATE downloads SET Superseded=1 WHERE DownloadID=?'); 55 56 $builds = Build::GetActive($branch->ID); 57 for ($i = 0, $j = count($builds) - 3; $i < $j; ++$i) 58 { 59 printf("\n\t" . 'Removing build %s' . "\n\t\t", $builds[$i]->Name); 60 61 //Delete the copy on the SourceForge web server. 62 Delete(SHELL_WEB_ROOT . parse_url($builds[$i]->Link, PHP_URL_PATH), $sftp_username, 63 $sftp_password); 64 65 //Remove from the database 66 $statement->execute(array($builds[$i]->ID)); 67 } 44 45 //Then update our website builds information 46 68 47 } 69 48 catch (Exception $e)
Note: See TracChangeset
for help on using the changeset viewer.
