Changeset 2389


Ignore:
Timestamp:
11/26/11 04:10:12 (3 years ago)
Author:
lowjoel
Message:

Remove the dependency on the Database since we can make do with static information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/website/scripts/BuildPublish.php

    r2386 r2389  
    1515 
    1616require_once('Credentials.php'); 
    17 require_once('Database.php'); 
    18 require_once('Build.php'); 
     17require_once('BuildBranch.php'); 
     18require_once('BuildUtil.php'); 
    1919 
    2020$file = fopen($argv[3], 'rb'); 
     
    4040    $installerPath = sprintf('/builds/%s/%s', $branch->ID, $fileName); 
    4141 
    42     //Then upload the installer to the URL. 
     42    //Upload the installer to the URL. 
    4343    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     
    6847} 
    6948catch (Exception $e) 
Note: See TracChangeset for help on using the changeset viewer.