Skip to content
Snippets Groups Projects
Commit 8d6d9148 authored by catch's avatar catch
Browse files

Issue #3093564 by Dinesh18, longwave, Vinodhini.E, Berdir, kim.pepper: Remove...

Issue #3093564 by Dinesh18, longwave, Vinodhini.E, Berdir, kim.pepper: Remove all @deprecated code in core File system
parent 721422b8
No related branches found
No related tags found
No related merge requests found
...@@ -288,22 +288,6 @@ public function tempnam($directory, $prefix) { ...@@ -288,22 +288,6 @@ public function tempnam($directory, $prefix) {
} }
} }
/**
* {@inheritdoc}
*/
public function uriScheme($uri) {
@trigger_error('FileSystem::uriScheme() is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Use \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::getScheme() instead. See https://www.drupal.org/node/3035273', E_USER_DEPRECATED);
return StreamWrapperManager::getScheme($uri);
}
/**
* {@inheritdoc}
*/
public function validScheme($scheme) {
@trigger_error('FileSystem::validScheme() is deprecated in drupal:8.8.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::isValidScheme() instead. See https://www.drupal.org/node/3035273', E_USER_DEPRECATED);
return $this->streamWrapperManager->isValidScheme($scheme);
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
...@@ -635,18 +619,6 @@ public function getTempDirectory() { ...@@ -635,18 +619,6 @@ public function getTempDirectory() {
return $temporary_directory; return $temporary_directory;
} }
// Fallback to config for Backwards compatibility.
// This service is lazy-loaded and not injected, as the file_system service
// is used in the install phase before config_factory service exists. It
// will be removed before Drupal 9.0.0.
if (\Drupal::hasContainer()) {
$temporary_directory = \Drupal::config('system.file')->get('path.temporary');
if (!empty($temporary_directory)) {
@trigger_error("The 'system.file' config 'path.temporary' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Set 'file_temp_path' in settings.php instead. See https://www.drupal.org/node/3039255", E_USER_DEPRECATED);
return $temporary_directory;
}
}
// Fallback to OS default. // Fallback to OS default.
$temporary_directory = FileSystemComponent::getOsTemporaryDirectory(); $temporary_directory = FileSystemComponent::getOsTemporaryDirectory();
......
...@@ -232,46 +232,6 @@ public function rmdir($uri, $context = NULL); ...@@ -232,46 +232,6 @@ public function rmdir($uri, $context = NULL);
*/ */
public function tempnam($directory, $prefix); public function tempnam($directory, $prefix);
/**
* Returns the scheme of a URI (e.g. a stream).
*
* @param string $uri
* A stream, referenced as "scheme://target" or "data:target".
*
* @return string|bool
* A string containing the name of the scheme, or FALSE if none. For
* example, the URI "public://example.txt" would return "public".
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::getScheme()
* instead.
*
* @see https://www.drupal.org/node/3035273
*/
public function uriScheme($uri);
/**
* Checks that the scheme of a stream URI is valid.
*
* Confirms that there is a registered stream handler for the provided scheme
* and that it is callable. This is useful if you want to confirm a valid
* scheme without creating a new instance of the registered handler.
*
* @param string $scheme
* A URI scheme, a stream is referenced as "scheme://target".
*
* @return bool
* Returns TRUE if the string is the name of a validated stream, or FALSE if
* the scheme does not have a registered handler.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
* Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::isValidScheme()
* instead.
*
* @see https://www.drupal.org/node/3035273
*/
public function validScheme($scheme);
/** /**
* Copies a file to a new location without invoking the file API. * Copies a file to a new location without invoking the file API.
* *
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace Drupal\KernelTests\Core\File; namespace Drupal\KernelTests\Core\File;
use Drupal\Component\FileSystem\FileSystem;
use Drupal\KernelTests\KernelTestBase; use Drupal\KernelTests\KernelTestBase;
/** /**
...@@ -31,31 +30,6 @@ protected function setUp() { ...@@ -31,31 +30,6 @@ protected function setUp() {
$this->setInstallProfile('standard'); $this->setInstallProfile('standard');
} }
/**
* Tests requirements warnings.
*
* @expectedDeprecation The 'system.file' config 'path.temporary' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Set 'file_temp_path' in settings.php instead. See https://www.drupal.org/node/3039255
*/
public function testFileSystemRequirements() {
$this->config('system.file')
->set('path.temporary', $this->randomMachineName())
->save(TRUE);
$requirements = $this->checkSystemRequirements();
$this->assertEquals('Deprecated configuration', (string) $requirements['temp_directory']['value']);
$this->assertEquals('You are using deprecated configuration for the temporary files path.', (string) $requirements['temp_directory']['description'][0]['#markup']);
$this->assertStringStartsWith('Remove the configuration and add the following', (string) $requirements['temp_directory']['description'][1]['#markup']);
$this->config('system.file')
->set('path.temporary', FileSystem::getOsTemporaryDirectory())
->save(TRUE);
$requirements = $this->checkSystemRequirements();
$this->assertEquals('Deprecated configuration', (string) $requirements['temp_directory']['value']);
$this->assertEquals('You are using deprecated configuration for the temporary files path.', (string) $requirements['temp_directory']['description'][0]['#markup']);
$this->assertEquals('Your temporary directory configuration matches the OS default and can be safely removed.', (string) $requirements['temp_directory']['description'][1]['#markup']);
}
/** /**
* Tests if settings are set, there are not warnings. * Tests if settings are set, there are not warnings.
*/ */
......
...@@ -50,23 +50,6 @@ public function testGetTempDirectorySettings() { ...@@ -50,23 +50,6 @@ public function testGetTempDirectorySettings() {
$this->assertEquals($tempDir, $this->fileSystem->getTempDirectory()); $this->assertEquals($tempDir, $this->fileSystem->getTempDirectory());
} }
/**
* Tests 'path.temporary' config deprecation.
*
* @group legacy
* @covers ::getTempDirectory
* @expectedDeprecation The 'system.file' config 'path.temporary' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Set 'file_temp_path' in settings.php instead. See https://www.drupal.org/node/3039255
*/
public function testGetTempDirectoryDeprecation() {
$tempDir = '/var/tmp/' . $this->randomMachineName();
$this->config('system.file')
->set('path.temporary', $tempDir)
->save(TRUE);
$dir = $this->fileSystem->getTempDirectory();
$this->assertEquals($tempDir, $dir);
}
/** /**
* Tests os default fallback. * Tests os default fallback.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment