Exemple #1
0
 /**
  *
  * Copies $srcDir into $dstDirectory across multiple mount points
  *
  * @param $srcDir : expects sanitized absolute directory
  * @param $dstDirectory : expects sanitized absolute directory, if it doesn't exists, create it!
  * @param array $options : [recursive (true/false) default true, timeout (seconds) default 60, overwriteModus : XAPP_XFILE_OVERWRITE_NONE | XAPP_XFILE_OVERWRITE_ALL | XAPP_XFILE_OVERWRITE_IF_SIZE_DIFFERS
  * @param array|string $inclusionMask : null means all, if its a string : it must compatible to a scandir query, if its a string its a regular expression
  * @param array|string $exclusionMask : null means all, otherwise it must compatible to a scandir query,if its a string its a regular expression
  * @param $error : a pointer to an array reference, please track all errors and don't abort! Check __copyOrMoveFile below how to write the error messages right!
  * @param $success : track all copied items here
  */
 public function copyDirectory($srcDir, $dstDirectory, $options = array(), $inclusionMask = array(), $exclusionMask = array(), &$error, &$success)
 {
     if ($srcDir == "/" || $dstDirectory == "/") {
         $error[] = XAPP_TEXT_FORMATTED("CAN_NOT_COPY_MOUNT_POINTS");
     } else {
         $srcDir = $this->toRealPath($srcDir);
         $dstDirectory = $this->toRealPath($dstDirectory);
         XApp_File_Utils::copyDirectoryEx($srcDir, $dstDirectory, $options, $inclusionMask, $exclusionMask, $error, $success);
     }
 }