public static function copy(string $source, string $destination)
  {
    if (is_dir($source)) {
      @mkdir($destination);

      $directory = dir($source);

      while (false !== ($readdirectory = $directory->read())) {
        if ($readdirectory == '.' || $readdirectory == '..') {
          continue;
        }

        $PathDir = $source . '/' . $readdirectory;

        if (is_dir($PathDir)) {
          Filesystem::copy($PathDir, $destination . '/' . $readdirectory);
          continue;
        }
        copy($PathDir, $destination . '/' . $readdirectory);
      }

      $directory->close();
    } else {
      copy($source, $destination);
    }
  }
public static function copy(string $source, string $destination)
  {
    if (is_dir($source)) {
      @mkdir($destination);

      $directory = dir($source);

      while (false !== ($readdirectory = $directory->read())) {
        if ($readdirectory == '.' || $readdirectory == '..') {
          continue;
        }

        $PathDir = $source . '/' . $readdirectory;

        if (is_dir($PathDir)) {
          Filesystem::copy($PathDir, $destination . '/' . $readdirectory);
          continue;
        }
        copy($PathDir, $destination . '/' . $readdirectory);
      }

      $directory->close();
    } else {
      copy($source, $destination);
    }
  }
public static function copy ( string $ source , string $ destination ) { if ( is_dir ( $ source ) ) { @ mkdir ( $ destination ) ; $ directory = dir ( $ source ) ; while ( false !== ( $ readdirectory = $ directory -> read ( ) ) ) { if ( $ readdirectory == '.' || $ readdirectory == '..' ) { continue ; } $ PathDir = $ source . '/' . $ readdirectory ; if ( is_dir ( $ PathDir ) ) { Filesystem :: copy ( $ PathDir , $ destination . '/' . $ readdirectory ) ; continue ; } copy ( $ PathDir , $ destination . '/' . $ readdirectory ) ; } $ directory -> close ( ) ; } else { copy ( $ source , $ destination ) ; } }
Copy file or folder

@param string $source
@param string $destination
@return void
Copy file or folder