Commit 61e4649ab7eb1ff41132f350cc88bcb56ae7e4e1
1 parent
db1c5f1c
Non-Queue bulk downloads fails on all 64bit environments
Jira:KTS-4513 Updated internal Zip Path issue on win 2008 x64 Committed by: Charl Joseph Mert
Showing
1 changed file
with
18 additions
and
10 deletions
lib/util/ktpclzip.inc.php
| @@ -139,20 +139,28 @@ class KTPclZip { | @@ -139,20 +139,28 @@ class KTPclZip { | ||
| 139 | return $sExportCode; | 139 | return $sExportCode; |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | - /* | ||
| 143 | - * Returns the part of the folder to be excluded from the zip content structure | ||
| 144 | - * | 142 | + /* |
| 145 | * @params: $sPath folder to start from. | 143 | * @params: $sPath folder to start from. |
| 146 | * @params: $ds directory separator | 144 | * @params: $ds directory separator |
| 147 | */ | 145 | */ |
| 148 | - function getExcludePath($sPath, $ds = '/') { | 146 | + static function getExcludePath($sPath, $ds = '/') { |
| 149 | //Will grab the part of the full path to exclude from the zip contents | 147 | //Will grab the part of the full path to exclude from the zip contents |
| 150 | - if ($sPath[strlen($sPath)] == $ds) { | ||
| 151 | - //Chopping the last ds to make the keepPath contain an actual folder name | ||
| 152 | - $sPath = substr($sPath, 0, strlen($sPath) - 1); | ||
| 153 | - } | ||
| 154 | - $keepPath = end(explode($ds, $sPath)); | ||
| 155 | - $excludePath = str_replace($keepPath, '', $sPath); | 148 | + |
| 149 | + /* | ||
| 150 | + * For windows the pre drive letter needs to be removed for it to work with the pclzip class | ||
| 151 | + */ | ||
| 152 | + if (stristr(PHP_OS,'WIN')) { | ||
| 153 | + $sPath = end(explode(':', $sPath)); | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + //Chopping the last ds to make the keepPath contain an actual folder name | ||
| 157 | + $aDir = explode($ds, $sPath); | ||
| 158 | + $cutOff = count($aDir); | ||
| 159 | + for ($i = 0; $i < $cutOff; $i++) { | ||
| 160 | + echo $aDir[$i] . "\n"; | ||
| 161 | + $excludePath .= $aDir[$i] . '/'; | ||
| 162 | + } | ||
| 163 | + | ||
| 156 | return $excludePath; | 164 | return $excludePath; |
| 157 | } | 165 | } |
| 158 | 166 |