diff --git a/core/includes/file.inc b/core/includes/file.inc index bef4d253e4..c246fe402f 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -15,7 +15,6 @@ use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\PrivateStream; -use Drupal\Core\StreamWrapper\PublicStream; use Drupal\Core\StreamWrapper\StreamWrapperManager; /** @@ -1138,30 +1137,16 @@ function drupal_tempnam($directory, $prefix) { * * @return mixed|null * A string containing the path to the temporary directory. + * + * @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use + * \Drupal\Core\File\FileSystemInterface::getTempDirectory() instead. + * + * @see \Drupal\Core\File\FileSystemInterface::getTempDirectory() + * @see https://www.drupal.org/node/3039255 */ function file_directory_temp() { - $temporary_directory = \Drupal::config('system.file')->get('path.temporary'); - if (empty($temporary_directory)) { - // Needs set up. - $config = \Drupal::configFactory()->getEditable('system.file'); - $temporary_directory = ComponentFileSystem::getOsTemporaryDirectory(); - - if (empty($temporary_directory)) { - // If no directory has been found default to 'files/tmp'. - $temporary_directory = PublicStream::basePath() . '/tmp'; - - // Windows accepts paths with either slash (/) or backslash (\), but will - // not accept a path which contains both a slash and a backslash. Since - // the 'file_public_path' variable may have either format, we sanitize - // everything to use slash which is supported on all platforms. - $temporary_directory = str_replace('\\', '/', $temporary_directory); - } - // Save the path of the discovered directory. Do not check config schema on - // save. - $config->set('path.temporary', (string) $temporary_directory)->save(TRUE); - } - - return $temporary_directory; + @trigger_error('file_directory_temp() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystemInterface::getTempDirectory() instead. See https://www.drupal.org/node/3039255', E_USER_DEPRECATED); + return \Drupal::service('file_system')->getTempDirectory(); } /** diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index b3b462e19e..c75da59c7a 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -27,7 +27,6 @@ use Drupal\Core\Site\Settings; use Drupal\Core\StringTranslation\Translator\FileTranslation; use Drupal\Core\StackMiddleware\ReverseProxyMiddleware; -use Drupal\Core\StreamWrapper\PublicStream; use Drupal\Core\Extension\ExtensionDiscovery; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Url; @@ -1100,21 +1099,6 @@ function install_base_system(&$install_state) { // Install system.module. drupal_install_system($install_state); - // Prevent the installer from using the system temporary directory after the - // system module has been installed. - if (drupal_valid_test_ua()) { - // While the temporary directory could be preset/enforced in settings.php - // like the public files directory, some tests expect it to be configurable - // in the UI. If declared in settings.php, they would no longer be - // configurable. The temporary directory needs to match what is set in each - // test types ::prepareEnvironment() step. - $temporary_directory = dirname(PublicStream::basePath()) . '/temp'; - \Drupal::service('file_system')->prepareDirectory($temporary_directory, FileSystemInterface::MODIFY_PERMISSIONS | FileSystemInterface::CREATE_DIRECTORY); - \Drupal::configFactory()->getEditable('system.file') - ->set('path.temporary', $temporary_directory) - ->save(); - } - // Call file_ensure_htaccess() to ensure that all of Drupal's standard // directories (e.g., the public files directory and config directory) have // appropriate .htaccess files. These directories will have already been diff --git a/core/lib/Drupal/Core/File/FileSystem.php b/core/lib/Drupal/Core/File/FileSystem.php index 54bbe419ee..2e9544f481 100644 --- a/core/lib/Drupal/Core/File/FileSystem.php +++ b/core/lib/Drupal/Core/File/FileSystem.php @@ -2,6 +2,7 @@ namespace Drupal\Core\File; +use Drupal\Component\FileSystem\FileSystem as FileSystemComponent; use Drupal\Component\Utility\Unicode; use Drupal\Core\File\Exception\DirectoryNotReadyException; use Drupal\Core\File\Exception\FileException; @@ -11,6 +12,7 @@ use Drupal\Core\File\Exception\NotRegularDirectoryException; use Drupal\Core\File\Exception\NotRegularFileException; use Drupal\Core\Site\Settings; +use Drupal\Core\StreamWrapper\PublicStream; use Drupal\Core\StreamWrapper\StreamWrapperManager; use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface; use Psr\Log\LoggerInterface; @@ -626,6 +628,44 @@ public function createFilename($basename, $directory) { return $destination; } + /** + * {@inheritdoc} + */ + public function getTempDirectory() { + // Use settings. + $temporary_directory = $this->settings->get('file_temp_path'); + if (!empty($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. + $temporary_directory = FileSystemComponent::getOsTemporaryDirectory(); + + if (empty($temporary_directory)) { + // If no directory has been found default to 'files/tmp'. + $temporary_directory = PublicStream::basePath() . '/tmp'; + + // Windows accepts paths with either slash (/) or backslash (\), but + // will not accept a path which contains both a slash and a backslash. + // Since the 'file_public_path' variable may have either format, we + // sanitize everything to use slash which is supported on all platforms. + $temporary_directory = str_replace('\\', '/', $temporary_directory); + } + return $temporary_directory; + } + /** * {@inheritdoc} */ diff --git a/core/lib/Drupal/Core/File/FileSystemInterface.php b/core/lib/Drupal/Core/File/FileSystemInterface.php index 8bcad1db37..48e833847c 100644 --- a/core/lib/Drupal/Core/File/FileSystemInterface.php +++ b/core/lib/Drupal/Core/File/FileSystemInterface.php @@ -472,6 +472,18 @@ public function createFilename($basename, $directory); */ public function getDestinationFilename($destination, $replace); + /** + * Gets the path of the configured temporary directory. + * + * If the path is not set, it will fall back to the OS-specific default if + * set, otherwise a directory under the public files directory. It will then + * set this as the configured directory. + * + * @return string + * A string containing the path to the temporary directory. + */ + public function getTempDirectory(); + /** * Finds all files that match a given mask in a given directory. * diff --git a/core/lib/Drupal/Core/StreamWrapper/TemporaryStream.php b/core/lib/Drupal/Core/StreamWrapper/TemporaryStream.php index 5e1e56b9f5..bce46e03c5 100644 --- a/core/lib/Drupal/Core/StreamWrapper/TemporaryStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/TemporaryStream.php @@ -37,7 +37,7 @@ public function getDescription() { * {@inheritdoc} */ public function getDirectoryPath() { - return file_directory_temp(); + return \Drupal::service('file_system')->getTempDirectory(); } /** diff --git a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php index de4f9ab2cf..9c200679bc 100644 --- a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php +++ b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php @@ -91,6 +91,10 @@ protected function prepareSettings() { 'value' => $this->privateFilesDirectory, 'required' => TRUE, ]; + $settings['settings']['file_temp_path'] = (object) [ + 'value' => $this->tempFilesDirectory, + 'required' => TRUE, + ]; // Save the original site directory path, so that extensions in the // site-specific directory can still be discovered in the test site // environment. diff --git a/core/modules/config/src/Controller/ConfigController.php b/core/modules/config/src/Controller/ConfigController.php index ea65096c3f..a4dc4ca079 100644 --- a/core/modules/config/src/Controller/ConfigController.php +++ b/core/modules/config/src/Controller/ConfigController.php @@ -121,13 +121,13 @@ public function __construct(StorageInterface $target_storage, StorageInterface $ */ public function downloadExport() { try { - $this->fileSystem->delete(file_directory_temp() . '/config.tar.gz'); + $this->fileSystem->delete($this->fileSystem->getTempDirectory() . '/config.tar.gz'); } catch (FileException $e) { // Ignore failed deletes. } - $archiver = new ArchiveTar(file_directory_temp() . '/config.tar.gz', 'gz'); + $archiver = new ArchiveTar($this->fileSystem->getTempDirectory() . '/config.tar.gz', 'gz'); // Add all contents of the export storage to the archive. foreach ($this->exportStorage->listAll() as $name) { $archiver->addString("$name.yml", Yaml::encode($this->exportStorage->read($name))); diff --git a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php index e3720d6d08..4e20768ab3 100644 --- a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php +++ b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php @@ -226,7 +226,7 @@ public function testExportImportCollections() { // Export the configuration. $this->drupalPostForm('admin/config/development/configuration/full/export', [], 'Export'); $this->tarball = $this->getSession()->getPage()->getContent(); - $filename = file_directory_temp() . '/' . $this->randomMachineName(); + $filename = \Drupal::service('file_system')->getTempDirectory() . '/' . $this->randomMachineName(); file_put_contents($filename, $this->tarball); // Set up the active storage collections to test import. diff --git a/core/modules/config/tests/src/Functional/ConfigExportUITest.php b/core/modules/config/tests/src/Functional/ConfigExportUITest.php index 4cd23acf56..215b582bf6 100644 --- a/core/modules/config/tests/src/Functional/ConfigExportUITest.php +++ b/core/modules/config/tests/src/Functional/ConfigExportUITest.php @@ -3,6 +3,7 @@ namespace Drupal\Tests\config\Functional; use Drupal\Core\Archiver\Tar; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Serialization\Yaml; use Drupal\Tests\BrowserTestBase; @@ -57,7 +58,10 @@ public function testExport() { $this->assertTrue($header_match, "Header with filename matches the expected format."); // Extract the archive and verify it's not empty. - $file_path = file_directory_temp() . '/config.tar.gz'; + $file_system = \Drupal::service('file_system'); + assert($file_system instanceof FileSystemInterface); + $temp_directory = $file_system->getTempDirectory(); + $file_path = $temp_directory . '/config.tar.gz'; $archiver = new Tar($file_path); $archive_contents = $archiver->listContents(); $this->assert(!empty($archive_contents), 'Downloaded archive file is not empty.'); @@ -75,8 +79,8 @@ public function testExport() { // Ensure the test configuration override is in effect but was not exported. $this->assertIdentical(\Drupal::config('system.maintenance')->get('message'), 'Foo'); - $archiver->extract(file_directory_temp(), ['system.maintenance.yml']); - $file_contents = file_get_contents(file_directory_temp() . '/' . 'system.maintenance.yml'); + $archiver->extract($temp_directory, ['system.maintenance.yml']); + $file_contents = file_get_contents($temp_directory . '/' . 'system.maintenance.yml'); $exported = Yaml::decode($file_contents); $this->assertNotIdentical($exported['message'], 'Foo'); diff --git a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php index a3d4ba5e7c..6986dc1685 100644 --- a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php +++ b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php @@ -101,11 +101,6 @@ public function testFiles() { ->fields(['value' => serialize('files/test')]) ->condition('name', 'file_directory_path') ->execute(); - Database::getConnection('default', 'migrate') - ->update('variable') - ->fields(['value' => serialize(file_directory_temp())]) - ->condition('name', 'file_directory_temp') - ->execute(); $this->executeMigration('d6_file'); diff --git a/core/modules/system/config/install/system.file.yml b/core/modules/system/config/install/system.file.yml index ec8c0533f6..02b376f454 100644 --- a/core/modules/system/config/install/system.file.yml +++ b/core/modules/system/config/install/system.file.yml @@ -1,5 +1,3 @@ allow_insecure_uploads: false default_scheme: 'public' -path: - temporary: '' temporary_maximum_age: 21600 diff --git a/core/modules/system/migrations/d6_system_file.yml b/core/modules/system/migrations/d6_system_file.yml index 3f7145533a..025fd2804c 100644 --- a/core/modules/system/migrations/d6_system_file.yml +++ b/core/modules/system/migrations/d6_system_file.yml @@ -6,11 +6,9 @@ migration_tags: source: plugin: variable variables: - - file_directory_temp - allow_insecure_uploads source_module: system process: - 'path/temporary': file_directory_temp allow_insecure_uploads: plugin: static_map source: allow_insecure_uploads diff --git a/core/modules/system/migrations/d7_system_file.yml b/core/modules/system/migrations/d7_system_file.yml index b9fba89ea6..08aa9b27a9 100644 --- a/core/modules/system/migrations/d7_system_file.yml +++ b/core/modules/system/migrations/d7_system_file.yml @@ -7,7 +7,6 @@ source: plugin: variable variables: - allow_insecure_uploads - - file_temporary_path source_module: system process: allow_insecure_uploads: @@ -16,7 +15,6 @@ process: map: 0: FALSE 1: TRUE - 'path/temporary': file_temporary_path destination: plugin: config config_name: system.file diff --git a/core/modules/system/src/Form/FileSystemForm.php b/core/modules/system/src/Form/FileSystemForm.php index dedf32a69f..d81488b44e 100644 --- a/core/modules/system/src/Form/FileSystemForm.php +++ b/core/modules/system/src/Form/FileSystemForm.php @@ -4,6 +4,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Datetime\DateFormatterInterface; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\StreamWrapper\PrivateStream; use Drupal\Core\StreamWrapper\PublicStream; @@ -33,6 +34,13 @@ class FileSystemForm extends ConfigFormBase { */ protected $streamWrapperManager; + /** + * The file system. + * + * @var \Drupal\Core\File\FileSystemInterface + */ + protected $fileSystem; + /** * Constructs a FileSystemForm object. * @@ -42,11 +50,18 @@ class FileSystemForm extends ConfigFormBase { * The date formatter service. * @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager * The stream wrapper manager. + * @param \Drupal\Core\File\FileSystemInterface $file_system + * The file system. */ - public function __construct(ConfigFactoryInterface $config_factory, DateFormatterInterface $date_formatter, StreamWrapperManagerInterface $stream_wrapper_manager) { + public function __construct(ConfigFactoryInterface $config_factory, DateFormatterInterface $date_formatter, StreamWrapperManagerInterface $stream_wrapper_manager, FileSystemInterface $file_system = NULL) { parent::__construct($config_factory); $this->dateFormatter = $date_formatter; $this->streamWrapperManager = $stream_wrapper_manager; + if (!$file_system) { + @trigger_error('Calling FileSystemForm::__construct() without the $file_system argument is deprecated in drupal:8.8.0. The $file_system argument will be required in drupal:9.0.0. See https://www.drupal.org/node/3039255', E_USER_DEPRECATED); + $file_system = \Drupal::service('file_system'); + } + $this->fileSystem = $file_system; } /** @@ -56,7 +71,8 @@ public static function create(ContainerInterface $container) { return new static( $container->get('config.factory'), $container->get('date.formatter'), - $container->get('stream_wrapper_manager') + $container->get('stream_wrapper_manager'), + $container->get('file_system') ); } @@ -101,12 +117,10 @@ public function buildForm(array $form, FormStateInterface $form_state) { ]; $form['file_temporary_path'] = [ - '#type' => 'textfield', + '#type' => 'item', '#title' => t('Temporary directory'), - '#default_value' => $config->get('path.temporary'), - '#maxlength' => 255, - '#description' => t('A local file system path where temporary files will be stored. This directory should not be accessible over the web.'), - '#after_build' => ['system_check_directory'], + '#markup' => $this->fileSystem->getTempDirectory(), + '#description' => t('A local file system path where temporary files will be stored. This directory should not be accessible over the web. This must be changed in settings.php.'), ]; // Any visible, writeable wrapper can potentially be used for the files // directory, including a remote file system that integrates with a CDN. @@ -141,7 +155,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $config = $this->config('system.file') - ->set('path.temporary', $form_state->getValue('file_temporary_path')) ->set('temporary_maximum_age', $form_state->getValue('temporary_maximum_age')); if ($form_state->hasValue('file_default_scheme')) { diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 4723a73958..018d5d003e 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -529,6 +529,38 @@ function system_requirements($phase) { } } + // Test that path.temporary config is not set. + if ($phase == 'runtime') { + if (!Settings::get('file_temp_path')) { + $filesystem_config = \Drupal::config('system.file'); + if ($temp_path = $filesystem_config->get('path.temporary')) { + $requirements['temp_directory'] = [ + 'title' => t('Temporary Directory'), + 'severity' => REQUIREMENT_WARNING, + 'value' => 'Deprecated configuration', + 'description' => [ + [ + '#markup' => t('You are using deprecated configuration for the temporary files path.'), + '#suffix' => ' ', + ], + ], + ]; + if ($temp_path === FileSystem::getOsTemporaryDirectory()) { + $requirements['temp_directory']['description'][] = [ + '#markup' => t('Your temporary directory configuration matches the OS default and can be safely removed.'), + '#suffix' => ' ', + ]; + } + else { + $requirements['temp_directory']['description'][] = [ + '#markup' => t('Remove the configuration and add the following to settings.php. $settings["file_temp_path"] = "%temp_path"', ['%temp_path' => $temp_path]), + '#suffix' => ' ', + ]; + } + } + } + } + // Report cron status. if ($phase == 'runtime') { $cron_config = \Drupal::config('system.cron'); @@ -596,7 +628,7 @@ function system_requirements($phase) { // By default no private files directory is configured. For private files // to be secure the admin needs to provide a path outside the webroot. PrivateStream::basePath(), - file_directory_temp(), + \Drupal::service('file_system')->getTempDirectory(), ]; } @@ -617,8 +649,8 @@ function system_requirements($phase) { if ($file_private_path = Settings::get('file_private_path')) { $directories[] = $file_private_path; } - if (!empty($GLOBALS['config']['system.file']['path']['temporary'])) { - $directories[] = $GLOBALS['config']['system.file']['path']['temporary']; + if (Settings::get('file_temp_path')) { + $directories[] = Settings::get('file_temp_path'); } else { // If the temporary directory is not overridden use an appropriate @@ -2312,3 +2344,16 @@ function system_update_8702() { } \Drupal::entityTypeManager()->useCaches(TRUE); } + +/** + * Remove 'path.temporary' config if redundant. + */ +function system_update_8801() { + // If settings is already being used, or the config is set to the OS default, + // clear the config value. + $config = Drupal::configFactory()->getEditable('system.file'); + if (Settings::get('file_temp_path') || $config->get('path.temporary') === FileSystem::getOsTemporaryDirectory()) { + $config->clear('path.temporary') + ->save(TRUE); + } +} diff --git a/core/modules/system/tests/src/Functional/File/ConfigTest.php b/core/modules/system/tests/src/Functional/File/ConfigTest.php index caf691591a..9d0761fd16 100644 --- a/core/modules/system/tests/src/Functional/File/ConfigTest.php +++ b/core/modules/system/tests/src/Functional/File/ConfigTest.php @@ -27,7 +27,6 @@ public function testFileConfigurationPage() { // upon form submission. $file_path = $this->publicFilesDirectory; $fields = [ - 'file_temporary_path' => $file_path . '/file_config_page_test/temporary', 'file_default_scheme' => 'private', ]; diff --git a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php index 33c963de3c..f1c62a481a 100644 --- a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php +++ b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php @@ -47,9 +47,6 @@ class MigrateSystemConfigurationTest extends MigrateDrupal6TestBase { 'allow_insecure_uploads' => TRUE, // default_scheme is not handled by the migration. 'default_scheme' => 'public', - 'path' => [ - 'temporary' => 'files/temp', - ], // temporary_maximum_age is not handled by the migration. 'temporary_maximum_age' => 21600, ], diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php index 0216e2dd31..8fef991b4f 100644 --- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php +++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php @@ -45,9 +45,6 @@ class MigrateSystemConfigurationTest extends MigrateDrupal7TestBase { 'allow_insecure_uploads' => TRUE, // default_scheme is not handled by the migration. 'default_scheme' => 'public', - 'path' => [ - 'temporary' => '/tmp', - ], // temporary_maximum_age is not handled by the migration. 'temporary_maximum_age' => 21600, ], diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php index 06a0ef676b..d7bad28513 100644 --- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php @@ -190,6 +190,10 @@ protected function setUp() { $sync_directory = Settings::get('config_sync_directory'); \Drupal::service('file_system')->prepareDirectory($sync_directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS); + // Ensure the default temp directory exist and is writable. The configured + // temp directory may be removed during update. + \Drupal::service('file_system')->prepareDirectory($this->tempFilesDirectory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS); + // Set the container. parent::rebuildAll() would normally do this, but this // not safe to do here, because the database has not been updated yet. $this->container = \Drupal::getContainer(); diff --git a/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php b/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php index f57a5c3e42..796e87b4d6 100644 --- a/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php @@ -2,6 +2,7 @@ namespace Drupal\KernelTests\Core\File; +use Drupal\Component\FileSystem\FileSystem; use Drupal\Component\Render\FormattableMarkup; use Drupal\Component\PhpStorage\FileStorage; use Drupal\Core\File\Exception\FileException; @@ -167,15 +168,12 @@ public function testFileDestination() { } /** - * Ensure that the file_directory_temp() function always returns a value. + * Ensure that the getTempDirectory() method always returns a value. */ public function testFileDirectoryTemp() { - // Start with an empty variable to ensure we have a clean slate. - $config = $this->config('system.file'); - $config->set('path.temporary', '')->save(); - $tmp_directory = file_directory_temp(); - $this->assertEqual(empty($tmp_directory), FALSE, 'file_directory_temp() returned a non-empty value.'); - $this->assertEqual($config->get('path.temporary'), $tmp_directory); + $tmp_directory = \Drupal::service('file_system')->getTempDirectory(); + $this->assertNotEmpty($tmp_directory); + $this->assertEquals($tmp_directory, FileSystem::getOsTemporaryDirectory()); } /** diff --git a/core/tests/Drupal/KernelTests/Core/File/FileSystemDeprecationTest.php b/core/tests/Drupal/KernelTests/Core/File/FileSystemDeprecationTest.php index c081e035f2..84975e180a 100644 --- a/core/tests/Drupal/KernelTests/Core/File/FileSystemDeprecationTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/FileSystemDeprecationTest.php @@ -46,7 +46,7 @@ public function testDeprecatedFileMoveUploadedFile() { * @expectedDeprecation file_unmanaged_copy() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::copy(). See https://www.drupal.org/node/3006851. */ public function testDeprecatedUnmanagedFileCopy() { - $source = file_directory_temp() . '/example.txt'; + $source = \Drupal::service('file_system')->getTempDirectory() . '/example.txt'; file_put_contents($source, 'example'); $filename = file_unmanaged_copy($source); $this->assertEquals('public://example.txt', $filename); @@ -67,6 +67,7 @@ public function testDeprecatedUnmanagedFileDeleteRecursive() { } /** + * @expectedDeprecation file_directory_temp() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystemInterface::getTempDirectory() instead. See https://www.drupal.org/node/3039255 * @expectedDeprecation file_unmanaged_move() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::move(). See https://www.drupal.org/node/3006851. */ public function testDeprecatedUnmanagedFileMove() { diff --git a/core/tests/Drupal/KernelTests/Core/File/FileSystemRequirementsTest.php b/core/tests/Drupal/KernelTests/Core/File/FileSystemRequirementsTest.php new file mode 100644 index 0000000000..159e93882f --- /dev/null +++ b/core/tests/Drupal/KernelTests/Core/File/FileSystemRequirementsTest.php @@ -0,0 +1,79 @@ +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. + */ + public function testSettingsExist() { + $this->setSetting('file_temp_path', $this->randomMachineName()); + $requirements = $this->checkSystemRequirements(); + $this->assertArrayNotHasKey('temp_directory', $requirements); + } + + /** + * Checks system runtime requirements. + * + * @return array + * An array of system requirements. + */ + protected function checkSystemRequirements() { + module_load_install('system'); + return system_requirements('runtime'); + } + +} diff --git a/core/tests/Drupal/KernelTests/Core/File/FileSystemTempDirectoryTest.php b/core/tests/Drupal/KernelTests/Core/File/FileSystemTempDirectoryTest.php new file mode 100644 index 0000000000..e106906b5a --- /dev/null +++ b/core/tests/Drupal/KernelTests/Core/File/FileSystemTempDirectoryTest.php @@ -0,0 +1,81 @@ +container->get('stream_wrapper_manager'); + $logger = $this->container->get('logger.channel.file'); + $settings = $this->container->get('settings'); + $this->fileSystem = new FileSystem($stream_wrapper_manager, $settings, $logger); + } + + /** + * Tests 'file_temp_path' setting. + * + * @covers ::getTempDirectory + */ + public function testGetTempDirectorySettings() { + $tempDir = '/var/tmp/' . $this->randomMachineName(); + $this->setSetting('file_temp_path', $tempDir); + $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. + * + * @covers ::getTempDirectory + */ + public function testGetTempDirectoryOsDefault() { + $tempDir = FileSystemComponent::getOsTemporaryDirectory(); + $dir = $this->fileSystem->getTempDirectory(); + $this->assertEquals($tempDir, $dir); + } + +} diff --git a/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php index bfa63cb0f0..2a0cd9bfd4 100644 --- a/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php @@ -3,6 +3,7 @@ namespace Drupal\KernelTests\Core\File; use Drupal\Core\DrupalKernel; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\PublicStream; use Symfony\Component\HttpFoundation\Request; @@ -91,7 +92,9 @@ public function testUriFunctions() { // Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath(). $this->assertEqual(file_build_uri('foo/bar.txt'), 'public://foo/bar.txt', 'Expected scheme was added.'); $this->assertEqual($stream_wrapper_manager->getViaScheme('public')->getDirectoryPath(), PublicStream::basePath(), 'Expected default directory path was returned.'); - $this->assertEqual($stream_wrapper_manager->getViaScheme('temporary')->getDirectoryPath(), $config->get('path.temporary'), 'Expected temporary directory path was returned.'); + $file_system = \Drupal::service('file_system'); + assert($file_system instanceof FileSystemInterface); + $this->assertEqual($stream_wrapper_manager->getViaScheme('temporary')->getDirectoryPath(), $file_system->getTempDirectory(), 'Expected temporary directory path was returned.'); $config->set('default_scheme', 'private')->save(); $this->assertEqual(file_build_uri('foo/bar.txt'), 'private://foo/bar.txt', 'Got a valid URI from foo/bar.txt.'); diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php index a6bac86682..02afacda64 100644 --- a/core/tests/Drupal/KernelTests/KernelTestBase.php +++ b/core/tests/Drupal/KernelTests/KernelTestBase.php @@ -1037,7 +1037,7 @@ public function __get($name) { return Settings::get('file_private_path'); case 'temp_files_directory': - return file_directory_temp(); + return \Drupal::service('file_system')->getTempDirectory(); case 'translation_files_directory': return Settings::get('file_public_path', \Drupal::service('site.path') . '/translations'); diff --git a/core/tests/fixtures/config_install/multilingual.tar.gz b/core/tests/fixtures/config_install/multilingual.tar.gz index 36a08ae69a..e4961cc7de 100644 --- a/core/tests/fixtures/config_install/multilingual.tar.gz +++ b/core/tests/fixtures/config_install/multilingual.tar.gz @@ -1,51 +1,47 @@ -[}r8fSp:'Qѷ%˒7IfYuD"i.&ȁy~Hj-gLWeˈRhδ Hrc/M"S$ -_M0p$1(1vFg/ץDOT"0C5\`pNt f-[ >,=R^}J>5^?!!'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ư[ 8)=&#M /Sϸt9Px' "arO!2<\/)n`>5XO3Vz-=i $ǵG*I#=SAc"X^(U%U͋1:?n3GM]2G^ +! BI"#Gc[ +2p wz1~&{N|ե_6J(ާd$-q/?2gtv#e j_<_7R|/܏%qx&b}6{Ly<&pldBbx؜ӕ;wOvmTbA )^U/뺮!IEY<ͶѨ֜thXEҠ_|e<4KV7$ǻ; b0Y$;> ++ bx;P./m&'^7u1zàߒYb?I R^7xJ$dT0u>/+&Reе!\N[X{ݩ߸-]\MzTWysVn<{WP'?f +M'sާD]/o72oX!}e`oSv/ئ d:}ǭ_m1_nba $龃q9J s/R%AXQxڐ0Xi4ŷBCQyjitvKzǀ 0` 0`_ \ No newline at end of file diff --git a/core/tests/fixtures/config_install/testing_config_install.tar.gz b/core/tests/fixtures/config_install/testing_config_install.tar.gz index f4f067063c..8e2ecd3d44 100644 --- a/core/tests/fixtures/config_install/testing_config_install.tar.gz +++ b/core/tests/fixtures/config_install/testing_config_install.tar.gz @@ -1,40 +1,53 @@ -p[}{sJONg"N~8N^Ƙ熢$@ൽg m$m>4>sZmTJR2U&WjB@6mTDQq9W/$h/G(҂HbNփ("O@za|p=y E_D8UUpH0i%9F., 5WG9ÿ#\GBGrth& -/r9u sHr9 A+9U\vB5I8Bㅢ~\#FV$+#s^ G~^tS"١Z+9<+HnGCu#aAx1Cp^ ws"˺hhIpJˋ A~\΂*syrnC\ U < .sS30U hJڠ7P= -, f@+@L q;?͇}{_1`=p@S"e>"C ?%_ӑN$AH,ZP 97SIwگd;/MojeQz.pfj#f*2aĽ+~[u-٩${*W%"{O]k-/XVW/H k~U@d 8|-jd -N"_`"g$҆$KyN@h -U/߀oz0K>,{S(Q9%ƜN]Ϲw -cKo^}SF;K"w;pMߴz]. zކ'id?4?/r49Dd)@^h8%8=&"yNOfoBܗu\ScN=m}5@58V,%֣wp7My[C <3LPIeCH@4UCzPZVZkRFJmܞh['_iUl;魯w$^*Pt]sQE*w :Q!:c/_d P̳[f)e)}wo<_l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ō,Lơk:K- +Lrikla8n_2/žRZT|ᦶ`'X(r687,u>;cw:G.aRN<&7L3\j:,δٙ3dod?H q̙yv07 +הkE4e!.!wfUW;? ߾+#?a韓cq2S7({M-+֍zU~Z +$UEcГ`ZGr4ޝi? #;LglERbr譨p@Df=]Vhp vT8ʪ}{vb o{W=kI27ϓ7#N?g$ax?/ǎ9`(fgGCH"Q<0FѲbYu?K+ke,*VZj7t|I|&DeDR:}%^acdzbG'2H1P`eRe RcJF|d Rd U6;3sn(2.McDlGOVal07*?i ⟜O_# IY (PP +¬)Xz#kθVS9_Rj +\&27 +FnqD K ?9Ȏ-2UZCI"/#G?dH1X&'\ρK8{A{f_8DkT"?0d2|n؊UCf~ˉnϼ/  )ңPETMmR?S9g"k!ERGiM +%@@Hh!)( i@6.Ơ1s1lKOjrMt o::H4i.~O^高s^E1OI_h U:I]t'Nh'z_moPQ!:גt-';kvw+& ʾqKtTy/Gߒg eǬmf؏ڥe@\Q~1bCܼwT"^P$jɍsw3r lj-yyoD)DJG*do]e+Na'XLSnKz%zO39fhJRЬrc0|WveIW!5VQ u˔&Y%؏+ĐĦ C,'pFH\mh>&oޑ-%D+ř*c%@tTp\p,B;įtwPoyMN~*c@ZJW=cU9T[{n~hiyɝgo__duuM@>v uqWJ>:~kWۗew +518:) r)bCD~(0]O+ps TY$d Z IPDZ,#'زI+,l4߫7rEE_*_a!Lg +&p]1L[zeP ln鸶?7Qӭ}QMz o#V+_ws??R%:-gXDvDclllAĢq<}u0CztA/żM@A_4SZlRR4]X1)nݺ~on̻xx:;i6#VԄ4̖.CŁ;*jM YDtœtE>7 LroMm*K셊t” +8*XN=&񏴾JF>L-B&#HOMz3䜗ݕ.N!\,6N̳ 1aET+4l?-Pzqh ȭ#`|}7V@_3 +(P@ +(P@`h \ No newline at end of file diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index e882dd138d..75411f05cd 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -522,6 +522,19 @@ */ # $settings['file_private_path'] = ''; +/** + * Temporary file path: + * + * A local file system path where temporary files will be stored. This directory + * must be absolute, outside of the Drupal installation directory and not + * accessible over the web. + * + * If this is not set, the default for the operating system will be used. + * + * @see \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory() + */ +# $settings['file_temp_path'] = '/tmp'; + /** * Session write interval: * @@ -604,7 +617,6 @@ * configuration values in settings.php will not fire any of the configuration * change events. */ -# $config['system.file']['path']['temporary'] = '/tmp'; # $config['system.site']['name'] = 'My Drupal site'; # $config['system.theme']['default'] = 'stark'; # $config['user.settings']['anonymous'] = 'Visitor';