Will generate a new file in the given path from name.
@param String $path
@param String $name
@param bool $hashName
@return File
508540
public function newFileFromName($path, $name, $hashName = false){
        $info = pathinfo($name);
        $ext = isset($info['extension'])? ".{$info['extension']}":"";
        $name = $info['filename'];
        $n = $hashName?md5($name):$name;
        $file = new FileImpl("$path/$n$ext");
        $i = 0;
        while($file->exists()){
            $i++;
            $n = $hashName?md5($name.$i):"$name ($i)";
            $file = new FileImpl("$path/$n$ext");
        }
        return $file;

    }
164036
public function getFromPath($name = false, $path = false)
    {
        if ($path && $name) {
            $this->img       = $path . '/' . $name;
            $this->handle    = new Upload($this->img);
            $this->_new_name = $this->s3->sanitizeFilename(uniqid("", true) . $this->handle->file_src_name);
        }
    }
200025
public function createFile(string $path): File {
    $localFile = $this->instantiateFile($path);
    $localFile->create();
    return $localFile;
  }
758227
protected function getDestenationFile($name, $path)
    {
        if (!empty($path)) {
            $path = Helpers::getPathWithSlash(ucfirst($path));
        }

        return app_path(Config::getModelsPath($path . $name . '.php'));
    }
928062
public function rename($hash, $name) {
		if ($this->commandDisabled('rename')) {
			return $this->setError(elFinder::ERROR_PERM_DENIED);
		}
		
		if (!$this->nameAccepted($name)) {
			return $this->setError(elFinder::ERROR_INVALID_NAME, $name);
		}
		
		if (!($file = $this->file($hash))) {
			return $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
		}
		
		if ($name == $file['name']) {
			return $file;
		}
		
		if (!empty($file['locked'])) {
			return $this->setError(elFinder::ERROR_LOCKED, $file['name']);
		}
		
		$path = $this->decode($hash);
		$dir  = $this->dirnameCE($path);
		$stat = $this->stat($this->joinPathCE($dir, $name));
		if ($stat) {
			return $this->setError(elFinder::ERROR_EXISTS, $name);
		}
		
		if (!$this->allowCreate($dir, $name, ($file['mime'] === 'directory'))) {
			return $this->setError(elFinder::ERROR_PERM_DENIED);
		}

		$this->rmTmb($file); // remove old name tmbs, we cannot do this after dir move


		if ($path = $this->convEncOut($this->_move($this->convEncIn($path), $this->convEncIn($dir), $this->convEncIn($name)))) {
			$this->clearcache();
			return $this->stat($path);
		}
		return false;
	}
1357578
public function ext($name, $path)
    {
        if(null === $path)
        {
            $path = File::path(dirname(Imi::getNamespacePath(App::getNamespace())), 'ide-helper');
        }
        foreach($name as $extName)
        {
            echo 'Generating ', $extName, '...', PHP_EOL;
            $extensionReflection = new ExtensionReflection($extName);
            $extensionReflection->save(File::path($path, $extName));
        }
        echo 'Complete!', PHP_EOL;
    }
1172045
public function create($name, $path, $table = null, $create = false)
    {
        $path = $this->getPath($name, $path);

        // First we will get the stub file for the migration, which serves as a type
        // of template for the migration. Once we have those we will populate the
        // various place-holders, save the file, and run the post create event.
        $stub = $this->getStub($table, $create);

        $this->files->put($path, $this->populateStub($name, $stub, $table));

        $this->firePostCreateHooks();

        return $path;
    }
250986
protected function _mkdir($path, $name) {
		$path = $path.DIRECTORY_SEPARATOR.$name;

		if (@mkdir($path)) {
			@chmod($path, $this->options['dirMode']);
			return $path;
		}

		return false;
	}
625904
public function uploadFile(string $file, string $path, string $name)
    {
        // to store the file we have to make sure the directory exists
        foreach ($this->extractDirectories($path) as $dir) {
            // if change to directory fails
            // create the dir and change into it afterwards
            try {
                $this->chDir($dir);
            } catch (\Exception $e) {
                $this->mkDir($dir);
                $this->chDir($dir);
            }
        }
        if (!$this->put($name, $file, FTP_BINARY)) {
            $error   = error_get_last();
            $message = $error['message'];
            throw new RuntimeException(sprintf('error uploading file: %s - %s', $file, $message));
        }
    }
1202564
public function getFile($path) {
		$dirPath = realpath($this->path);
		
		if ($dirPath === false) {
			throw new InvalidPath('Path "' . $this->path . '" doesn\'t exists or inaccsessible', null, null, $this->path);
		}
		
		return new File($dirPath . DIRECTORY_SEPARATOR . $path);
	}
898141
public function generate($path, $name)
    {
        $token = md5(uniqid($this->dic['user']['id'], true));

        $record = ORM::for_table('files_downloads')->create();
        $record->path = $path;
        $record->name = $name;
        $record->token = $token;
        $record->created_at = $this->dic['datetimenow'];
        $record->save();
        if (is_object($record)) {
            return $token;
        } else {
            return '';
        }
    }
703876
public function child($name) {
        $file = $this->getChild($name);
        if (is_dir($file)) {
            return new static($file);
        }
        if (is_file($file)) {
            return new File($file);
        }
        return false;
    }
305535
public T addFile(final String name, final List<String> path, final byte[] newHash, final boolean isDirectory) {
        return addFile(name, path, newHash, isDirectory, null);
    }
134542
public static function copy(string $filename, string $path): bool
    {
        return @copy($filename, $path . '/' . self::basename($filename));
    }
647611
public function download($name,$path){
        $ruta = $this->getFullPath().$path.$name;
        if( $this->config['debug'] ) $this->_log('$ruta - '.$ruta);
        if($this->validNameFile($name) && file_exists($ruta) && is_file($ruta) ){
            $response = new Response(file_get_contents($ruta));
            $response->headers->set('Content-Type', 'application/octet-stream');
            $d = $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT,$name);
            $response->headers->set('Content-Disposition', $d);
            $response->send();
        }else{
            exit();
            // return null;
        }
    }
859197
protected function _mkdir($path, $name) {
		
		$newkey = $this->_normpath($path);
		$newkey = preg_replace("/\/$/", "", $newkey);
		$newkey = "$newkey/$name/";

		try {
			$obj = $this->s3->PutObjectInline(array('Bucket' => $this->options['bucket'], 'Key' => $newkey , 'ContentLength' => 0, 'Data' => ''));
		} catch (Exception $e) {
		
		}
		
		if (isset($obj)) {
			return "$path/$name";
		}
		
		return false;
	}
242422
protected function folder($name, $path): string
    {
        $fullPath = realpath($this->folders[$name] . '/' . $path);

        if (!$fullPath)
        {
            throw new NotFound\Path('Path `' . $name . ':' . $path . '` not found!');
        }

        return $fullPath;
    }