Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.9] Remove Rackspace support for Filesystem #28442

Merged
merged 2 commits into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions src/Illuminate/Filesystem/FilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use InvalidArgumentException;
use Illuminate\Support\Carbon;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Collection;
use League\Flysystem\AdapterInterface;
Expand All @@ -17,7 +16,6 @@
use League\Flysystem\AwsS3v3\AwsS3Adapter;
use League\Flysystem\Cached\CachedAdapter;
use League\Flysystem\FileNotFoundException;
use League\Flysystem\Rackspace\RackspaceAdapter;
use League\Flysystem\Adapter\Local as LocalAdapter;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Illuminate\Contracts\Filesystem\Cloud as CloudFilesystemContract;
Expand Down Expand Up @@ -400,8 +398,6 @@ public function url($path)
return $this->driver->getUrl($path);
} elseif ($adapter instanceof AwsS3Adapter) {
return $this->getAwsUrl($adapter, $path);
} elseif ($adapter instanceof RackspaceAdapter) {
return $this->getRackspaceUrl($adapter, $path);
} elseif ($adapter instanceof LocalAdapter) {
return $this->getLocalUrl($path);
} else {
Expand Down Expand Up @@ -456,18 +452,6 @@ protected function getAwsUrl($adapter, $path)
);
}

/**
* Get the URL for the file at the given path.
*
* @param \League\Flysystem\Rackspace\RackspaceAdapter $adapter
* @param string $path
* @return string
*/
protected function getRackspaceUrl($adapter, $path)
{
return (string) $adapter->getContainer()->getObject($path)->getPublicUrl();
}

/**
* Get the URL for the file at the given path.
*
Expand Down Expand Up @@ -519,8 +503,6 @@ public function temporaryUrl($path, $expiration, array $options = [])
return $adapter->getTemporaryUrl($path, $expiration, $options);
} elseif ($adapter instanceof AwsS3Adapter) {
return $this->getAwsTemporaryUrl($adapter, $path, $expiration, $options);
} elseif ($adapter instanceof RackspaceAdapter) {
return $this->getRackspaceTemporaryUrl($adapter, $path, $expiration, $options);
} else {
throw new RuntimeException('This driver does not support creating temporary URLs.');
}
Expand Down Expand Up @@ -549,24 +531,6 @@ public function getAwsTemporaryUrl($adapter, $path, $expiration, $options)
)->getUri();
}

/**
* Get a temporary URL for the file at the given path.
*
* @param \League\Flysystem\Rackspace\RackspaceAdapter $adapter
* @param string $path
* @param \DateTimeInterface $expiration
* @param array $options
* @return string
*/
public function getRackspaceTemporaryUrl($adapter, $path, $expiration, $options)
{
return $adapter->getContainer()->getObject($path)->getTemporaryUrl(
Carbon::now()->diffInSeconds($expiration),
$options['method'] ?? 'GET',
$options['forcePublicUrl'] ?? true
);
}

/**
* Concatenate a path to a URL.
*
Expand Down
37 changes: 0 additions & 37 deletions src/Illuminate/Filesystem/FilesystemManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Closure;
use Aws\S3\S3Client;
use OpenCloud\Rackspace;
use Illuminate\Support\Arr;
use InvalidArgumentException;
use League\Flysystem\AdapterInterface;
Expand All @@ -13,7 +12,6 @@
use League\Flysystem\Cached\CachedAdapter;
use League\Flysystem\Filesystem as Flysystem;
use League\Flysystem\Adapter\Ftp as FtpAdapter;
use League\Flysystem\Rackspace\RackspaceAdapter;
use League\Flysystem\Adapter\Local as LocalAdapter;
use League\Flysystem\AwsS3v3\AwsS3Adapter as S3Adapter;
use League\Flysystem\Cached\Storage\Memory as MemoryStore;
Expand Down Expand Up @@ -226,41 +224,6 @@ protected function formatS3Config(array $config)
return $config;
}

/**
* Create an instance of the Rackspace driver.
*
* @param array $config
* @return \Illuminate\Contracts\Filesystem\Cloud
*/
public function createRackspaceDriver(array $config)
{
$client = new Rackspace($config['endpoint'], [
'username' => $config['username'], 'apiKey' => $config['key'],
], $config['options'] ?? []);

$root = $config['root'] ?? null;

return $this->adapt($this->createFlysystem(
new RackspaceAdapter($this->getRackspaceContainer($client, $config), $root), $config
));
}

/**
* Get the Rackspace Cloud Files container.
*
* @param \OpenCloud\Rackspace $client
* @param array $config
* @return \OpenCloud\ObjectStore\Resource\Container
*/
protected function getRackspaceContainer(Rackspace $client, array $config)
{
$urlType = $config['url_type'] ?? null;

$store = $client->objectStoreService('cloudFiles', $config['region'], $urlType);

return $store->getContainer($config['container']);
}

/**
* Create a Flysystem instance with the given adapter.
*
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Filesystem/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.0).",
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).",
"league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).",
"league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (^1.0).",
"league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0)."
},
"config": {
Expand Down