Filesystem::copy PHP Method

copy() public static method

public static copy ( $file, $destination )
    public static function copy($file, $destination)
    {
        if (self::exists($file)) {
            $destination = self::path($destination) . '/' . basename($file);
            return copy(self::path($file), $destination);
        }
        return false;
    }

Usage Example

Example #1
0
 /**
  * Aplicar template de um arquivo único.
  *
  * @param $file
  * @param $target
  */
 public function file($file, $target)
 {
     // Verificar se template existe na lista
     if ($this->files->exists($file) != true) {
         error('Template %s não foi encontrado', $file);
     }
     $this->outpath = '';
     $this->filters = [$target];
     // Criar diretório destino
     $path = $this->files->path($target);
     $this->files->force($path);
     // Copiar arquivo
     $this->files->copy($file, $target);
     return $this;
 }
All Usage Examples Of Filesystem::copy