Changeset View
Changeset View
Standalone View
Standalone View
core/units/helpers/file_helper.php
Show First 20 Lines • Show All 311 Lines • ▼ Show 20 Line(s) | |||||
public function copyFolderRecursive($source, $destination) | public function copyFolderRecursive($source, $destination) | ||||
{ | { | ||||
if ( substr($source, -1) == DIRECTORY_SEPARATOR ) { | if ( substr($source, -1) == DIRECTORY_SEPARATOR ) { | ||||
$source = substr($source, 0, -1); | $source = substr($source, 0, -1); | ||||
$destination .= DIRECTORY_SEPARATOR . basename($source); | $destination .= DIRECTORY_SEPARATOR . basename($source); | ||||
} | } | ||||
$iterator = new DirectoryIterator($source); | $iterator = new DirectoryIterator($source); | ||||
/* @var $file_info DirectoryIterator */ | /** @var DirectoryIterator $file_info */ | ||||
$result = $this->CheckFolder($destination); | $result = $this->CheckFolder($destination); | ||||
foreach ($iterator as $file_info) { | foreach ($iterator as $file_info) { | ||||
if ( $file_info->isDot() ) { | if ( $file_info->isDot() ) { | ||||
continue; | continue; | ||||
} | } | ||||
Show All 26 Lines | |||||
public function copyFolder($source, $destination) | public function copyFolder($source, $destination) | ||||
{ | { | ||||
if ( substr($source, -1) == DIRECTORY_SEPARATOR ) { | if ( substr($source, -1) == DIRECTORY_SEPARATOR ) { | ||||
$source = substr($source, 0, -1); | $source = substr($source, 0, -1); | ||||
$destination .= DIRECTORY_SEPARATOR . basename($source); | $destination .= DIRECTORY_SEPARATOR . basename($source); | ||||
} | } | ||||
$iterator = new DirectoryIterator($source); | $iterator = new DirectoryIterator($source); | ||||
/* @var $file_info DirectoryIterator */ | /** @var DirectoryIterator $file_info */ | ||||
$result = $this->CheckFolder($destination); | $result = $this->CheckFolder($destination); | ||||
foreach ($iterator as $file_info) { | foreach ($iterator as $file_info) { | ||||
if ( $file_info->isDot() || !$file_info->isFile() ) { | if ( $file_info->isDot() || !$file_info->isFile() ) { | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |