Skip to content

Commit

Permalink
Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/modulebuilder/index.php
  • Loading branch information
eldy committed Jan 15, 2020
2 parents 14d59f4 + 0442105 commit c8ff847
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions htdocs/core/lib/files.lib.php
Expand Up @@ -2082,9 +2082,10 @@ function dol_uncompress($inputfile, $outputdir)
* @param string $outputfile Target file name (output directory must exists and be writable)
* @param string $mode 'zip'
* @param string $excludefiles A regex pattern. For example: '/\.log$|\/temp\//'
* @param string $rootdirinzip Add a root dir level in zip file
* @return int <0 if KO, >0 if OK
*/
function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '')
function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '', $rootdirinzip = '')
{
$foundhandler=0;

Expand Down Expand Up @@ -2145,7 +2146,8 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles =
{
// Get real and relative path for current file
$filePath = $file->getRealPath();
$relativePath = substr($filePath, strlen($inputdir) + 1);
$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($filePath, strlen($inputdir) + 1);

if (empty($excludefiles) || ! preg_match($excludefiles, $filePath))
{
// Add current file to archive
Expand Down
2 changes: 1 addition & 1 deletion htdocs/modulebuilder/index.php
Expand Up @@ -1307,7 +1307,7 @@
if ($dirofmodule)
{
if (!dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule);
$result = dol_compress_dir($dir, $outputfilezip, 'zip');
$result = dol_compress_dir($dir, $outputfilezip, 'zip', '', $modulelowercase);
}
else
{
Expand Down

0 comments on commit c8ff847

Please sign in to comment.