Ignore:
Timestamp:
2/8/2010 4:51:14 AM (2 years ago)
Author:
lowjoel
Message:

Added support to include the current version of the builds so that proper version numbers can be embedded into the database instead of just the coarse revision numbers.

File:
1 edited

Legend:

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

    r1647 r1760  
    148148        $result = array(); 
    149149        $builds = array('Eraser5' => 'Eraser 5', 'Eraser6' => 'Eraser 6.0', 'Eraser6.2' => 'Eraser 6.2'); 
     150        $versions = array('Eraser5' => '5.8.9', 'Eraser6' => '6.0.6', 'Eraser6.2' => '6.1.0'); 
    150151        foreach ($builds as $branchName => $buildName) 
    151152        { 
     
    167168                { 
    168169                    $result[$buildName][] = Build::GetBuildFromID( 
    169                         Build::InsertBuild($branchName, $revisionID, 
     170                        Build::InsertBuild($branchName, $versions[$branchName], $revisionID, 
    170171                            Build::GetPath($branchName) . '/' . $revision)); 
    171172                } 
     
    213214    } 
    214215     
    215     private static function InsertBuild($branch, $revision, $buildPath) 
     216    private static function InsertBuild($branch, $version, $revision, $buildPath) 
    216217    { 
    217218        //Find the binary that users will get to download. 
     
    256257        mysql_query(sprintf('INSERT INTO downloads (Name, Released, `Type`, Version, PublisherID, Architecture, Filesize, Link) 
    257258                VALUES ( 
    258                     \'%1$s r%2$d\', \'%4$s\' , \'build\', \'r%2$d\', 1, \'any\', %3$d, \'?%5$s\' 
     259                    \'%1$s %2$s.%3$d\', \'%5$s\' , \'build\', \'%2$s.%3$d\', 1, \'any\', %4$d, \'?%6$s\' 
    259260                )', 
    260             mysql_real_escape_string($branch), intval($revision), $installerSize, 
    261             PhpToMySqlTimestamp(filemtime($buildPath)), mysql_real_escape_string($installerPath))) 
     261            mysql_real_escape_string($branch), mysql_real_escape_string($version), intval($revision), 
     262            $installerSize, PhpToMySqlTimestamp(filemtime($buildPath)), 
     263            mysql_real_escape_string($installerPath))) 
    262264                or die(mysql_error()); 
    263265        mysql_query(sprintf('INSERT INTO builds (DownloadID, Branch, Revision) 
Note: See TracChangeset for help on using the changeset viewer.