Commit 452011df authored by speedprogs_de's avatar speedprogs_de
Browse files

added option to enable zip file generation only for last version of an extension

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/terfe/branches/ter_fe2@53800 735d13b6-9817-0410-8766-e36946ffe9aa
parent 61b988cd
......@@ -91,16 +91,22 @@
$currentDir = getcwd();
chdir(PATH_site);
// Create ZIP file only for last version
$lastVersionOnly = !empty($this->setup['settings.']['onlyLatestVersionZip']);
foreach ($versions as $version) {
// Get media path for the extension
$extKey = $version->getExtension()->getExtKey();
$lastVersion = $version->getExtension()->getLastVersion();
$extensionMediaPath = Tx_TerFe2_Utility_File::getAbsoluteDirectory($this->mediaRootPath . $extKey);
// Create zip file
$zipFile = $this->createZipFile($version, $extensionMediaPath);
if (!empty($zipFile)) {
$version->setZipFileSize(filesize($zipFile));
$version->setHasZipFile(TRUE);
if (!$lastVersionOnly || ($lastVersion === $version)) {
$zipFile = $this->createZipFile($version, $extensionMediaPath);
if (!empty($zipFile)) {
$version->setZipFileSize(filesize($zipFile));
$version->setHasZipFile(TRUE);
}
}
// Create images
......@@ -120,7 +126,7 @@
/**
* Create a zip file for given version
*
*
* @param Tx_TerFe2_Domain_Model_Version $version Path to t3x file
* @param string $extensionMediaPath Path to media files
* @return string Name of the zip file
......@@ -157,7 +163,7 @@
/**
* Create images for given version
*
*
* @param Tx_TerFe2_Domain_Model_Version $version Path to t3x file
* @param string $extensionMediaPath Path to media files
* @return boolean TRUE if success
......
......@@ -39,6 +39,9 @@ plugin.tx_terfe2 {
# cat=TER Frontend/settings/1110; type=boolean; label=Skip latest version: Skip latest version in version history
skipLatestVersion = 1
# cat=TER Frontend/settings/1120; type=boolean; label=Only latest version zip: Create ZIP file only for latest version
onlyLatestVersionZip = 1
terConnection {
# cat=TER Frontend/settings/2000; type=string; label=TER WSDL URI: WSDL URI to connect TER server
wsdl = http://typo3.org/wsdl/tx_ter_wsdl.php
......
......@@ -16,6 +16,7 @@ plugin.tx_terfe2 {
defaultPointCount = {$plugin.tx_terfe2.settings.defaultPointCount}
versionHistoryCount = {$plugin.tx_terfe2.settings.versionHistoryCount}
skipLatestVersion = {$plugin.tx_terfe2.settings.skipLatestVersion}
onlyLatestVersionZip = {$plugin.tx_terfe2.settings.onlyLatestVersionZip}
terConnection {
wsdl = {$plugin.tx_terfe2.settings.terConnection.wsdl}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment