Пример #1
0
 /**
  * ftpCopyFiles
  * 
  * @param string $from
  * @param string $to
  * @param int    $chmodf
  * @param int    $chmodd
  * @param bool   $overwrite
  */
 public function ftpCopyFiles($from = '', $to = '', $chmodf = 0644, $chmodd = 0755, $overwrite = false)
 {
     foreach (self::$_instance->iterator($from) as $f) {
         if (self::$_instance->is_dir($from . '/' . $f)) {
             self::$_instance->mkdir($to . '/' . $f, $chmodd);
             $this->ftpCopyFiles($from . '/' . $f, $to . '/' . $f, $chmodf, $chmodd, $overwrite);
         } else {
             if ($overwrite || !self::$_instance->file_exists($to . '/' . $f)) {
                 self::$_instance->file_put_contents($to . '/' . $f, self::$_instance->file_get_contents($from . '/' . $f));
                 $this->rechmod($to . '/' . $f, $chmodf);
             }
         }
     }
 }