获取文件的临时访问Url

@param  string $path
@param  \DateTimeInterface $expiration
@param  array $options
@return string
8342
public function temporaryUrl($path, $expiration, array $options = [])
    {
        $adapter = $this->driver->getAdapter();

        if ($adapter instanceof CachedAdapter) {
            $adapter = $adapter->getAdapter();
        }

        if (method_exists($adapter, 'getTemporaryUrl')) {
            return $adapter->getTemporaryUrl($path, $expiration, $options);
        } elseif ($adapter instanceof AwsS3Adapter) {
            return $this->getAwsTemporaryUrl($adapter, $path, $expiration, $options);
        } else {
            throw new RuntimeException('This driver does not support creating temporary URLs.');
        }
    }
294965
public function from_path(string $path, $type = 'page'): ?string
  {
    $parent = null;
    if ( $root = $this->opt->from_code($type, self::$option_root_id) ){
      $parts = explode('/', $path);
      $parent = $root;
      foreach ( $parts as $i => $p ){
        $is_not_last = $i < (\count($parts) - 1);
        if ( !empty($p) ){
          $prev_parent = $parent;
          // Adds a slash for each bit of the path except the last one
          $parent = $this->opt->from_code($p.($is_not_last ? '/' : ''), $prev_parent);
          // If not found looking for a subpermission
          if ( !$parent && $is_not_last ){
            $parent = $this->opt->from_code($p, $prev_parent);
          }
        }
      }
    }
    return $parent ?: null;
  }
1231427
public function getSecureURL($expires = 60) {
		if($this->owner instanceof \Image_Cached || $this->owner instanceof \CdnImage_Cached) {
			return;
		}

		/** @var \FileContent $pointer */
		$pointer = $this->owner->obj('CDNFile');

		if($pointer->exists()) {
			$reader = $this->reader();
			if ($reader && $this->owner->canView() && method_exists($reader, 'getSecureURL')) {
				return $reader->getSecureURL($expires);
			}
		}
	}
1253840
public function writeDefinition($path = '', $options = [])
    {

        if (empty($path)) {
            $path = realpath($this->rootPath . $this->DEFAULT_API_JSON_PATH);
            if (empty($path)) {
                $path = $this->rootPath . $this->DEFAULT_API_JSON_PATH;
            }
        }
        if (file_exists($path)) {
            rename($path, $path . '.bak');
        }

        $data = $this->data;
        $filterParams = ['data' => $this->data, 'definition' => $this->data, 'source' =>
            $this->sourceData];
        $data = $this->applyFilter('APIDefinitionFinalJson', $data, $filterParams);

        $json = json_encode($data, JSON_PRETTY_PRINT | JSON_ERROR_NONE | JSON_UNESCAPED_SLASHES);

        // $options['skipDocs'] = true;
        $pathWihtoutExtension = preg_replace('/\.[^.]+?$/', '', $path);

        if (empty($options['skipPhpDoc'] ?? $options['skipDocs'] ?? false)) {
            $this->writeMarkdownDocs($options['mdDocPath'] ?? ($pathWihtoutExtension . '.md'));
        }

        if (empty($options['skipMDDoc'] ?? ($options['skipDocs'] ?? false))) {
            $this->writePHPDocMethod($options['phpDocPath'] ?? ($pathWihtoutExtension . '.php'));
        }

        return file_put_contents($path, $json);
    }
1208438
public function getTemporaryUrl(DateTimeInterface $expiration, array $options = []): string
    {
        return $this
            ->filesystemManager
            ->disk($this->media->disk)
            ->temporaryUrl($this->getPath(), $expiration, $options);
    }
198257
public function get($path, array $options = array())
    {
        $client = $this->createGuzzleClient($this->accessToken);

        $options = $this->applyDefaultClientQuery($client, $options);

        return json_decode($client->get($path, $options)->getBody(), true);
    }
1302826
public function getTemporaryUrl($path, $expiration, $options)
    {
        $location = $this->applyPathPrefix($path);
        $temporaryUrl = $this->ossClient->signUrl($this->bucket, $location, $expiration, OssClient::OSS_HTTP_GET, $options);
        return $temporaryUrl;
    }
936293
protected function _getCurrentUrlAndOptions($path, array $options, $type, $external)
    {
        if (strpos($path, '//') !== false) {
            $url      = $path;
            $external = true;
            unset($options['fullBase']);
        } else {
            $url = $this->Url->{$type}($path, $options);
            $options = array_diff_key($options, ['fullBase' => null, 'pathPrefix' => null]);
        }

        return [$url, $options, $external];
    }
518969
public function getSignedDownloadUrl($path, $expires = 3600, $host_name = '', $use_ssl = false)
    {
        $object = $this->applyPathPrefix($path);
        $url = $this->client->signUrl($this->bucket, $object, $expires);

        if (! empty($host_name) || $use_ssl) {
            $parse_url = parse_url($url);
            if (! empty($host_name)) {
                $parse_url['host'] = $this->bucket.'.'.$host_name;
            }
            if ($use_ssl) {
                $parse_url['scheme'] = 'https';
            }

            $url = (isset($parse_url['scheme']) ? $parse_url['scheme'].'://' : '')
                   .(
                   isset($parse_url['user']) ?
                       $parse_url['user'].(isset($parse_url['pass']) ? ':'.$parse_url['pass'] : '').'@'
                       : ''
                   )
                   .(isset($parse_url['host']) ? $parse_url['host'] : '')
                   .(isset($parse_url['port']) ? ':'.$parse_url['port'] : '')
                   .(isset($parse_url['path']) ? $parse_url['path'] : '')
                   .(isset($parse_url['query']) ? '?'.$parse_url['query'] : '');
        }

        return $url;
    }
841516
public function handles_acl($path, array $options = [])
    {
        $url = $this->app->make('url');
        if ($url->isValidUrl($path)) {
            return $path;
        }
        @list($component, $action) = explode('/', $path);
        if (is_null($component) or is_null($action)) {
            return $this->handles($path, $options);
        }
//        $resourceMap = app('antares.resource.repository')->findOneByAttributes(['component' => $component, 'action' => $action]);
//        if (is_null($resourceMap)) {
//            return $this->handles($path, $options);
//        }
//        $resource  = $resourceMap->resource;
//        $component = str_replace('::', '/', $component);
//        if (!app('antares.acl')->make($component)->can($resource)) {
//            return '';
//        }

        return $this->handles($path, $options);
    }
47105
public function putPolicyQuery($expires, $options=array())
    {
        $req = $this->putPolicyRequest($options);
        return $req->query_sign($expires);
    }
614455
protected function getImageUrl(ImagePathInterface $path) {
	    $url = $path->getPath();
	    if ($this->getOption('use_prefix', false)) {
	        $url = rtrim($path->getPrefix(), '/') . '/' . $url;
	    }
	    if ($this->getOption('root_url')) {
	        $url = rtrim($this->getOption('root_url'), '/') . '/' . $url;
	    }
	    return filter_var($url, FILTER_SANITIZE_URL);
	}
78005
protected function signUrl(UrlImmutable $url, $expiration, $signature)
    {
        $query = $url->getQuery();

        $query->modify([
            $this->expiresParameter   => $expiration,
            $this->signatureParameter => $signature,
        ]);

        $urlSigner = $url->setQuery($query);

        return $urlSigner;
    }
1212619
protected function getUrl(ServerRequestInterface $request, array $options)
    {
        $url = $options['url'];
        if ($options['queryParam'] !== null && $request->getMethod() === 'GET') {
            $query = urlencode($options['queryParam']) . '=' . urlencode($request->getRequestTarget());
            if (strpos($url, '?') !== false) {
                $query = '&' . $query;
            } else {
                $query = '?' . $query;
            }

            $url .= $query;
        }

        return $url;
    }
627959
public static function get($path, $options = array()) {
    $requestOptions = array(
      "path" => $path,
      "method" => "GET"
    );

    if (!empty($options["sign"])) {
      $requestOptions["sign"] = $options["sign"];
    }

    return self::request($requestOptions);
  }
1128307
public static function put($path, $options = array()) {
    $requestOptions = array(
      "path" => $path,
      "method" => "PUT",
      "body" => $options["body"]
    );

    if (!empty($options["sign"])) {
      $requestOptions["sign"] = $options["sign"];
    }

    return self::request($requestOptions);
  }
600001
public function handles($path, array $options = [])
    {
        if (str_contains($path, '.') and ! is_api_request() and ! starts_with($path, 'http') && strpos($path, '.') < 20) {
            try {
                return route($path, $options);
            } catch (Exception $ex) {
                return '';
            }
        }
        $url = $this->app->make('url');
        if ($url->isValidUrl($path)) {
            return $path;
        }
        $area = array_get($options, 'area', true);
        if (array_key_exists('area', $options)) {
            unset($options['area']);
        }
        list($package, $route) = $this->locate($path, $options);

        $element = ($area) ? $this->route($package) : $this->route(null);
        if ($area) {
            $element->setAreaPrefix($element);
        }

        $locate = $element->to($route);
        empty($locate) && $locate = '/';
        $this->sandbox($locate, $url, $options);
        return $url->to($locate);
    }