protected function elFinderVolumeDrupal::_copy in elFinder file manager 7.3
Same name and namespace in other branches
- 8.2 src/Controller/elFinderVolumeDrupal.php \elFinderVolumeDrupal::_copy()
- 6.2 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::_copy()
- 7.2 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::_copy()
Copy file into another file
@author Alexey Sukhotin
Parameters
string $source source file path:
string $targetDir target directory path:
string $name new file name:
Return value
bool
File
- inc/
elfinder.drupalfs.driver.inc, line 116 - elFinder driver for Drupal filesystem.
Class
- elFinderVolumeDrupal
- @file
Code
protected function _copy($source, $targetDir, $name) {
$target = $targetDir . DIRECTORY_SEPARATOR . (!empty($name) ? $name : basename($source));
if (!is_dir($target) && !$this
->CheckExtension($this
->_drupalfileobject($target))) {
return FALSE;
}
if (!$this
->CheckUserQuota()) {
return FALSE;
}
if (file_copy($this
->_drupalfileobject($source), $this
->drupalpathtouri($target))) {
$this
->FileUsageAdd($this
->_drupalfileobject($target));
return TRUE;
}
return FALSE;
}