mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-11 16:28:33 +02:00
N°9902 - Can't MTP with 3.3.0-dev
This commit is contained in:
@@ -885,13 +885,16 @@ class SetupUtils
|
||||
/**
|
||||
* Helper to copy a directory to a target directory, skipping .SVN files (for developer's comfort!)
|
||||
* Returns true if successful
|
||||
* @param $sSource
|
||||
* @param $sDest
|
||||
*
|
||||
* @param string $sSource
|
||||
* @param string $sDest
|
||||
* @param bool $bUseSymbolicLinks
|
||||
* @param bool $bCreateDirsIfNeeded
|
||||
*
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function copydir(string $sSource, string $sDest, bool $bUseSymbolicLinks = false): bool
|
||||
public static function copydir(string $sSource, string $sDest, bool $bUseSymbolicLinks = false, bool $bCreateDirsIfNeeded = false): bool
|
||||
{
|
||||
if (is_dir($sSource)) {
|
||||
if (!is_dir($sDest)) {
|
||||
@@ -934,6 +937,12 @@ class SetupUtils
|
||||
return copy($sSource, $sDest);
|
||||
}
|
||||
} else {
|
||||
if ($bCreateDirsIfNeeded) {
|
||||
$bRet = mkdir($sSource, 0777, true);
|
||||
$bRet &= mkdir($sDest, 0777, true);
|
||||
|
||||
return $bRet;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user