Orientação automática da imagem
@param  string $src Imagem de origem
@param  string $dst Imagem de destino
@return bool        Retorna true ou false
971999
public function autoOrient(string $src, string $dst)
    {
        if (!$dst) {
            $dst=$src;
        }
        return $this
        ->image($src)
        ->autoOrient()
        ->toFile($dst);
    }
123977
public function fileMove($src, $dst, $overwrite = false)
    {
        $src = $this->alias->resolve($src);
        $dst = $this->alias->resolve($dst);

        if (rtrim($dst, '\\/') !== $dst) {
            $dst .= basename($src);
        }

        if (!$overwrite && is_file($dst)) {
            throw new RuntimeException(['move `:src` to `:dst` failed: file exists already', 'src' => $src, 'dst' => $dst]);
        }

        if (!is_dir($dir = dirname($dst))) {
            $this->_dirCreate($dir);
        }

        if (!rename($src, $dst)) {
            throw new RuntimeException(['move `:src` to `:dst` failed: :last_error_message', 'src' => $src, 'dst' => $dst]);
        }
    }
755797
public function htmlImage($src, array $attributes = array()) {
        $attributes['src'] = $src;
        $html = '<img' . $this->_htmlAttribs($attributes) . '>';
        return $html;
    }
1021224
public function get($src, $dest){
		if ( $src = $this->checkFilePath($src) &&
            ftp_get($this->cn, $dest, $src, FTP_BINARY) ){
      return true;
		}
		return false;
	}
602898
public function paste($volume, $src, $dst, $rmSrc = false) {
		$err = $rmSrc ? elFinder::ERROR_MOVE : elFinder::ERROR_COPY;
		
		if ($this->commandDisabled('paste')) {
			return $this->setError($err, '#'.$src, elFinder::ERROR_PERM_DENIED);
		}

		if (($file = $volume->file($src, $rmSrc)) == false) {
			return $this->setError($err, '#'.$src, elFinder::ERROR_FILE_NOT_FOUND);
		}

		$name = $file['name'];
		$errpath = $volume->path($src);
		
		if (($dir = $this->dir($dst)) == false) {
			return $this->setError($err, $errpath, elFinder::ERROR_TRGDIR_NOT_FOUND, '#'.$dst);
		}
		
		if (!$dir['write'] || !$file['read']) {
			return $this->setError($err, $errpath, elFinder::ERROR_PERM_DENIED);
		}

		$destination = $this->decode($dst);

		if (($test = $volume->closest($src, $rmSrc ? 'locked' : 'read', $rmSrc))) {
			return $rmSrc
				? $this->setError($err, $errpath, elFinder::ERROR_LOCKED, $volume->path($test))
				: $this->setError($err, $errpath, elFinder::ERROR_PERM_DENIED);
		}

		$test = $this->joinPathCE($destination, $name);
		$stat = $this->stat($test);
		$this->clearcache();
		if ($stat) {
			if ($this->options['copyOverwrite']) {
				// do not replace file with dir or dir with file
				if (!$this->isSameType($file['mime'], $stat['mime'])) {
					return $this->setError(elFinder::ERROR_NOT_REPLACE, $this->path($test));
				}
				// existed file is not writable
				if (!$stat['write']) {
					return $this->setError($err, $errpath, elFinder::ERROR_PERM_DENIED);
				}
				// existed file locked or has locked child
				if (($locked = $this->closestByAttr($test, 'locked', true))) {
					return $this->setError(elFinder::ERROR_LOCKED, $this->path($locked));
				}
				// target is entity file of alias
				if ($volume == $this && ($test == @$file['target'] || $test == $this->decode($src))) {
					return $this->setError(elFinder::ERROR_REPLACE, $errpath);
				}
				// remove existed file
				if (!$this->remove($test)) {
					return $this->setError(elFinder::ERROR_REPLACE, $this->path($test));
				}
			} else {
				$name = $this->uniqueName($destination, $name, ' ', false);
			}
		}
		
		// copy/move inside current volume
		if ($volume == $this) {
			$source = $this->decode($src);
			// do not copy into itself
			if ($this->inpathCE($destination, $source)) {
				return $this->setError(elFinder::ERROR_COPY_INTO_ITSELF, $errpath);
			}
			$method = $rmSrc ? 'move' : 'copy';
			return ($path = $this->$method($source, $destination, $name)) ? $this->stat($path) : false;
		}
		
		// copy/move from another volume
		if (!$this->options['copyTo'] || !$volume->copyFromAllowed()) {
			return $this->setError(elFinder::ERROR_COPY, $errpath, elFinder::ERROR_PERM_DENIED);
		}
		
		if (($path = $this->copyFrom($volume, $src, $destination, $name)) == false) {
			return false;
		}
		
		if ($rmSrc) {
			if ($volume->rm($src)) {
				$this->removed[] = $file;
			} else {
				return $this->setError(elFinder::ERROR_MOVE, $errpath, elFinder::ERROR_RM_SRC);
			}
		}
		return $this->stat($path);
	}
960963
protected function copyDir($src, $dst) {
		$r = true;
		$dir = opendir($src);
		\Asgard\File\FileSystem::mkdir($dst);
		while(false !== ($file = readdir($dir))) {
			if(($file != '.') && ($file != '..'))
				$r = $r && $this->copy($src.'/'.$file, $dst.'/'.$file);
		}
		closedir($dir);

		if($r !== false)
			return $dst;
		return false;
	}
1151390
public static function unzipAssets($src, $dst) {

        if (false === is_dir($dst)) {
            throw new InvalidArgumentException(sprintf("\"%s\" is not a directory", $dst));
        }

        $result = [];

        foreach (static::listAssets($src) as $current) {

            $zip = new ZipArchive();

            if (true === $zip->open($current)) {
                $result[$current] = $zip->extractTo(realpath($dst));
                $zip->close();
            }
        }

        return $result;
    }
880543
public function copy($src, $dst) {
		if(is_dir($src))
			return $this->copyDir($src, $dst);
		else {
			if(file_exists($dst)) {
				$dst = \Asgard\File\FileSystem::getNewFilename($odst = $dst);
				$this->output->writeln('<warning>The file '.$odst.' had to be renamed into '.$dst.'.</warning>');
			}

			\Asgard\File\FileSystem::mkdir(dirname($dst));
			$r = copy($src, $dst);

			if($r !== false)
				return $dst;
			return false;
		}
	}
533015
public function publishMigrations($src, $dstDir, $migrate) {
		$r = true;
		foreach(glob($src.'/*') as $file) {
			if(basename($file) === 'migrations.json')
				continue;
			$dst = $dstDir.'/'.basename($file);
			$this->copy($file, $dst);
		}

		if(!$r) {
			$this->output->writeln('<warning>The migrations could not be added because some files had to be renamed. Please add them manually.</warning>');
			return false;
		}
		else {
			$mm = new \Asgard\Migration\MigrationManager($dstDir, $this->db, $this->schema, $this->container);
			$tracking = new \Asgard\Migration\Tracker($src, $this->db);
			foreach(array_keys($tracking->getList()) as $migration) {
				$mm->getTracker()->add($migration);
				if($migrate)
					$mm->migrate($migration);
			}
			return true;
		}
	}
438163
public function copy($dst, $mode=null) {
		$dst = \Asgard\File\FileSystem::copy($this->src, $dst, $mode);
		if($dst) {
			$copy = clone $this;
			$copy->setSrc($dst);
			return $copy;
		}
		return false;
	}
516554
public function imageCopyResampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
    {
        if($this->copyStrategy == self::RESIZE) {
            $this->log("Copy by resize");
            imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
        } else {
            $this->log("Copy by resample");
            imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
        }
    }
700072
protected function preserveAlpha($dest, $src)
    {
        $transparent = @imagecolortransparent($src);
        if (-1 != $transparent) {
            $color = @imagecolorsforindex($src, $transparent);
            $allocated = @imagecolorallocatealpha(
                            $dest
                            , $color['red']
                            , $color['green']
                            , $color['blue']
                            , $color['alpha']
            );
            @imagecolortransparent($dest, $allocated);
            @imagefill($dest, 0, 0, $allocated);
        }
    }
623667
protected function copyFileWithDirsCreating($src, $dest)
    {
        $dirPathOfDestFile = dirname($dest);

        if (! File::exists($dirPathOfDestFile)) {
            File::makeDirectory($dirPathOfDestFile, 0755, true);
        }

        if (! File::exists($dest)) {
            File::copy($src, $dest);
        }
    }
1313436
public function createImage($src, $alt = null)
    {
        $this->childNodes->push(new Image($src, $alt));

        return $this->childNodes->last();
    }
992647
private function recursiveCopy($src, $dst)
    {
        @mkdir($dst, 0755);

        $iterator = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator($src, \RecursiveDirectoryIterator::SKIP_DOTS),
            \RecursiveIteratorIterator::SELF_FIRST
        );

        foreach ($iterator as $file) {
            if ($file->isDir()) {
                @mkdir($dst.'/'.$iterator->getSubPathName());
            } else {
                $success = copy($file, $dst.'/'.$iterator->getSubPathName());
                if ($success) {
                    if (! $this->silent) {
                        echo 'copied: '.$dst.'/'.$iterator->getSubPathName().PHP_EOL;
                    }
                }
            }
        }
    }
1136207
public static function copy($src, $dst, $context = null)
    {
        return self::resourceExists($src) ? copy($src, $dst, $context) : false;
    }
704196
public function addMapping(string $src, string $dest): void
	{
		$this->mapper[$src] = $dest;
	}