Skip to content

Commit

Permalink
Remove xdelta3 logic
Browse files Browse the repository at this point in the history
But provide support for deltas, if any ZIP is present inside builds/delta path
  • Loading branch information
julianxhokaxhiu committed Jan 21, 2017
1 parent 6e7823b commit b6c7598
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/Helpers/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,15 @@ public function getDelta($targetToken){
$deltaFile = $this->incremental . '-' . $targetToken->incremental . '.zip';
$deltaFilePath = Flight::cfg()->get('realBasePath') . '/builds/delta/' . $deltaFile;

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

if ( !file_exists( $deltaFilePath ) ) {
exec( 'xdelta3 -e -s ' . $this->filePath . ' ' . $targetToken->filePath . ' ' . $deltaFilePath );
}

$ret = array(
'filename' => $deltaFile,
'timestamp' => filemtime( $deltaFilePath ),
'md5' => $this->getMD5( $deltaFilePath ),
'url' => $this->_getUrl( $deltaFile, Flight::cfg()->get('deltasPath') ),
'api_level' => $this->apiLevel,
'incremental' => $targetToken->incremental
);
}
if ( file_exists( $deltaFilePath ) )
$ret = array(
'filename' => $deltaFile,
'timestamp' => filemtime( $deltaFilePath ),
'md5' => $this->getMD5( $deltaFilePath ),
'url' => $this->_getUrl( $deltaFile, Flight::cfg()->get('deltasPath') ),
'api_level' => $this->apiLevel,
'incremental' => $targetToken->incremental
);

return $ret;
}
Expand Down

0 comments on commit b6c7598

Please sign in to comment.