function _update_manager_cache_directory

Same name in other branches
  1. 7.x modules/update/update.module \_update_manager_cache_directory()
  2. 9 core/modules/update/update.module \_update_manager_cache_directory()
  3. 10 core/modules/update/update.module \_update_manager_cache_directory()
  4. 11.x core/modules/update/update.module \_update_manager_cache_directory()

Returns the directory where update archive files should be cached.

Parameters

$create: (optional) Whether to attempt to create the directory if it does not already exist. Defaults to TRUE.

Return value

The full path to the temporary directory where update file archives should be cached.

4 calls to _update_manager_cache_directory()
FileTransferAuthorizeFormTest::setUp in core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php
UpdateCoreTest::testClearDiskCache in core/modules/update/tests/src/Functional/UpdateCoreTest.php
Checks that clearing the disk cache works.
update_clear_update_disk_cache in core/modules/update/update.module
Clears the temporary files and directories based on file age from disk.
update_manager_file_get in core/modules/update/update.manager.inc
Copies a file from the specified URL to the temporary directory for updates.

File

core/modules/update/update.module, line 788

Code

function _update_manager_cache_directory($create = TRUE) {
    $directory =& drupal_static(__FUNCTION__, '');
    if (empty($directory)) {
        $directory = 'temporary://update-cache-' . _update_manager_unique_identifier();
        if ($create && !file_exists($directory)) {
            mkdir($directory);
        }
    }
    return $directory;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.