Skip to content

Commit

Permalink
Fix the Full or Deltas real path and base path.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Xhokaxhiu committed Aug 5, 2014
1 parent d59b831 commit 81cd1e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Helpers/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct($fileName, $physicalPath) {
$this->baseUrl = $baseUrl;
$this->channel = $this->getChannel( str_replace( range( 0 , 9 ), '', $tokens[3] ) );
$this->filename = $fileName;
$this->url = $this->_getUrl();
$this->url = $this->_getUrl( '', Flight::cfg()->get('buildsPath') );
$this->changelogUrl = $this->_getChangelogUrl();
$this->timestamp = filemtime( $this->filePath );
$this->incremental = $this->getBuildPropValue( 'ro.build.version.incremental' );
Expand Down Expand Up @@ -103,7 +103,7 @@ public function getDelta($targetToken){
$ret = false;

$deltaFile = $this->incremental . '-' . $targetToken->incremental . '.zip';
$deltaFilePath = dirname( $this->filePath ) . '/' . $deltaFile;
$deltaFilePath = Flight::cfg()->get('realBasePath') . '/builds/delta/' . $deltaFile;

if ( $this->commandExists('xdelta3') ) {

Expand All @@ -115,7 +115,7 @@ public function getDelta($targetToken){
'filename' => $deltaFile,
'timestamp' => filemtime( $deltaFilePath ),
'md5' => $this->getMD5( $deltaFilePath ),
'url' => $this->_getUrl( $deltaFile ),
'url' => $this->_getUrl( $deltaFile, Flight::cfg()->get('deltasPath') ),
'api_level' => $this->apiLevel,
'incremental' => $targetToken->incremental
);
Expand Down Expand Up @@ -238,9 +238,9 @@ private function getChannel($token){
* @param string $fileName The name of the file
* @return string The absolute URL for the file to be downloaded
*/
private function _getUrl($fileName){
private function _getUrl($fileName = '', $basePath){
if ( empty($fileName) ) $fileName = $this->filename;
return Flight::cfg()->get('buildsPath') . '/' . $fileName;
return $basePath . '/' . $fileName;
}

/**
Expand Down

0 comments on commit 81cd1e1

Please sign in to comment.