Get full file location on server including homedir.

@param BucketInterface $bucket
@param string          $name

@return string
182023
protected function getPath(BucketInterface $bucket, string $name): string
    {
        if (empty($this->options['home'])) {
            return $this->files->normalizePath($bucket->getOption('directory') . $name);
        }

        return $this->files->normalizePath(
            $this->options['home'] . '/' . $bucket->getOption('directory') . $name
        );
    }
714856
protected function getMigrationFullName($name)
    {
        $folder = '';

        if (Config::organizeMigrations()) {
            $folder = $this->getTableName();
        }

        return $this->getMigrationPath($folder) . DIRECTORY_SEPARATOR . $name . '.php';
    }
886842
private static function asFullPath($name, $includesFiles = false)
    {
        $appendage = ($name ? '/' . ltrim($name, '/') : null);

        return static::$root . $appendage;
        //return Platform::getStoragePath( $name, true, $includesFiles );
    }
139711
private function getContent($name)
    {
        $filename = $this->getCacheFileName($name);
        if (!is_file($filename)) {
            return false;
        }

        if ($this->options['thread_safe']) {
            $fd = fopen($filename, 'r+');
            flock($fd, LOCK_SH);
            $fc = fread($fd, filesize($filename));
            fclose($fd);

            return $fc;
        } else {
            return file_get_contents($filename);
        }
    }
320830
public function getFromInput($name = false)
    {
        if ($name) {
            $this->img       = $_FILES[$name];
            $this->handle    = new Upload($this->img);
            $this->_new_name = $this->s3->sanitizeFilename(uniqid("", true) . $this->handle->file_src_name);
        }
    }
232664
private function createHeaders(BucketInterface $bucket, string $name, StreamInterface $stream): array
    {
        if (empty($mimetype = mimetype_from_filename($name))) {
            $mimetype = self::DEFAULT_MIMETYPE;
        };

        //Possible to add custom headers into the bucket
        $headers = $bucket->getOption('headers', []);

        if (!empty($maxAge = $bucket->getOption('maxAge', 0))) {
            //Shortcut
            $headers['Cache-control'] = 'max-age=' . $bucket->getOption('maxAge', 0) . ', public';
            $headers['Expires'] = gmdate(
                'D, d M Y H:i:s T',
                time() + $bucket->getOption('maxAge', 0)
            );
        }

        $stream->rewind();

        return $headers + [
                'Content-MD5'  => base64_encode(md5($stream->getContents(), true)),
                'Content-Type' => $mimetype
            ];
    }
1178136
public static function getFile($tmp = true, $name = null)
    {
        return ($tmp ? realpath(sys_get_temp_dir()) : '').'/'.(null === $name ? uniqid() : $name);
    }
193450
protected function getStub($name, $type)
    {
        if (stripos($name, '.php') === false) {
            $name = $name . '.php';
        }

        return $this->filesystem->get($this->getStubsPath($type) . '/' . $name);
    }
758227
protected function getDestenationFile($name, $path)
    {
        if (!empty($path)) {
            $path = Helpers::getPathWithSlash(ucfirst($path));
        }

        return app_path(Config::getModelsPath($path . $name . '.php'));
    }
876305
public static function getBucketLocation($bucket)
	{
		$rest = new S3Request('GET', $bucket, '', self::$endpoint);
		$rest->setParameter('location', null);
		$rest = $rest->getResponse();
		if ($rest->error === false && $rest->code !== 200)
			$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
		if ($rest->error !== false)
		{
			self::__triggerError(sprintf("S3::getBucketLocation({$bucket}): [%s] %s",
			$rest->error['code'], $rest->error['message']), __FILE__, __LINE__);
			return false;
		}
		return (isset($rest->body[0]) && (string)$rest->body[0] !== '') ? (string)$rest->body[0] : 'US';
	}
1123889
protected function rmdir($name = '')
    {
        $result = true;
        $name = preg_replace(array('!\.{1,2}/!', '!^/!', '!/$!'), '', $name);
        $name = $this->dirData.$name;
        if (is_dir($name))
        {
            $files = glob($name.'/{.*,*}', GLOB_BRACE);
            for ($i = 0; $i < count($files); $i++)
            {
                if (substr($files[$i], -2) == '/.' || substr($files[$i], -3) == '/..') continue;
                if (is_dir($files[$i])) $result = $this->rmdir(substr($files[$i], strlen($this->dirData)));
                elseif (is_file($files[$i])) $result = filedelete($files[$i]);
                if (!$result) break;
            }
            if ($result) $result = rmdir($name);
        }
        return $result;
    }
653868
public function getLoadedFile(string $name)
    {
        $properties                     = $this->getProperties();
        $loadedFiles                    = $properties['loadedFiles'];
        $names                          = array_column($loadedFiles, 'name');
        if (in_array($name, $names)) {
            $key = array_search($name, array_column($loadedFiles, 'name'));
            return $loadedFiles[$key];
        }
        return false;
    }
1101627
private function getRealSiteName($name)
    {
        if (! is_null($name)) {
            return $name;
        }

        if (is_string($link = $this->getLinkNameByCurrentDir())) {
            return $link;
        }

        return basename(getcwd());
    }
285397
public function get(string $name): ?UploadedFileInterface
    {
        if (!isset($this->uploadedFiles[$name])) {
            return null;
        }

        return $this->uploadedFiles[$name];
    }
430631
public function getStream(BucketInterface $bucket, string $name): StreamInterface
    {
        $file = $this->gridFS($bucket)->findOne(['filename' => $name]);
        if (empty($file)) {
            throw new ServerException(
                "Unable to create stream for '{$name}', object does not exists"
            );
        }

        //We have to use temporary file now due to issues with seeking (should be fixed soon)
        $resource = fopen('php://memory', 'rw');

        //Copying from non seekable to seekable stream
        stream_copy_to_stream($this->gridFS($bucket)->openDownloadStream($file->_id), $resource);

        //Working thought the memory, WILL FAIL on very huge files
        rewind($resource);

        //Ugly :/
        return stream_for($resource);
    }
810047
private static function _getCacheName($name)
    {
        if (empty(self::$cache_path)) {
            self::$cache_path = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR;
        }
        self::$cache_path = rtrim(self::$cache_path, '/\\') . DIRECTORY_SEPARATOR;
        file_exists(self::$cache_path) || mkdir(self::$cache_path, 0755, true);
        return self::$cache_path . $name;
    }
588997
private Bucket getCachedBucket(final String name) {
        Bucket cachedBucket = bucketCache.get(name);

        if(cachedBucket != null) {
            if (cachedBucket.isClosed()) {
                LOGGER.debug("Not returning cached bucket \"{}\", because it is closed.", name);
                bucketCache.remove(name);
            } else {
                LOGGER.debug("Returning still open, cached bucket \"{}\"", name);
                return cachedBucket;
            }
        }

        return null;
    }