- Patch #843162 by pwolanin, Scott Falconer, Berdir, jhodgdon, a.mikheychik, mtift: creating vocabularies with machine-names 'List' or 'Add' breaks links in taxonomy overview admin area.
parent
b9bcbf8c63
commit
7ed2dbe959
|
@ -730,26 +730,6 @@ function update_manager_install_form_submit($form, &$form_state) {
|
|||
* and verify archive files.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return the directory where update archive files should be extracted.
|
||||
*
|
||||
* If the directory does not already exist, attempt to create it.
|
||||
*
|
||||
* @return
|
||||
* The full path to the temporary directory where update file archives
|
||||
* should be extracted.
|
||||
*/
|
||||
function _update_manager_extract_directory() {
|
||||
$directory = &drupal_static(__FUNCTION__, '');
|
||||
if (empty($directory)) {
|
||||
$directory = 'temporary://update-extraction';
|
||||
if (!file_exists($directory)) {
|
||||
mkdir($directory);
|
||||
}
|
||||
}
|
||||
return $directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a downloaded archive file.
|
||||
*
|
||||
|
@ -829,13 +809,9 @@ function update_manager_file_get($url) {
|
|||
}
|
||||
|
||||
// Check the cache and download the file if needed.
|
||||
$cache_directory = 'temporary://update-cache';
|
||||
$cache_directory = _update_manager_cache_directory();
|
||||
$local = $cache_directory . '/' . basename($parsed_url['path']);
|
||||
|
||||
if (!file_exists($cache_directory)) {
|
||||
mkdir($cache_directory);
|
||||
}
|
||||
|
||||
if (!file_exists($local) || update_delete_file_if_stale($local)) {
|
||||
return system_retrieve_file($url, $local, FALSE, FILE_EXISTS_REPLACE);
|
||||
}
|
||||
|
|
|
@ -856,14 +856,71 @@ function update_flush_caches() {
|
|||
* @} End of "defgroup update_status_cache".
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return a short unique identifier for this Drupal installation.
|
||||
*
|
||||
* @return
|
||||
* An eight character string uniquely identifying this Drupal installation.
|
||||
*/
|
||||
function _update_manager_unique_identifier() {
|
||||
$id = &drupal_static(__FUNCTION__, '');
|
||||
if (empty($id)) {
|
||||
$id = substr(hash('sha256', drupal_get_hash_salt()), 0, 8);
|
||||
}
|
||||
return $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the directory where update archive files should be extracted.
|
||||
*
|
||||
* @param $create
|
||||
* If TRUE, attempt to create the directory if it does not already exist.
|
||||
*
|
||||
* @return
|
||||
* The full path to the temporary directory where update file archives
|
||||
* should be extracted.
|
||||
*/
|
||||
function _update_manager_extract_directory($create = TRUE) {
|
||||
$directory = &drupal_static(__FUNCTION__, '');
|
||||
if (empty($directory)) {
|
||||
$directory = 'temporary://update-extraction-' . _update_manager_unique_identifier();
|
||||
if ($create && !file_exists($directory)) {
|
||||
mkdir($directory);
|
||||
}
|
||||
}
|
||||
return $directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the directory where update archive files should be cached.
|
||||
*
|
||||
* @param $create
|
||||
* If TRUE, attempt to create the directory if it does not already exist.
|
||||
*
|
||||
* @return
|
||||
* The full path to the temporary directory where update file archives
|
||||
* should be cached.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the temporary files and directories based on file age from disk.
|
||||
*/
|
||||
function update_clear_update_disk_cache() {
|
||||
// List of update module cache directories.
|
||||
// List of update module cache directories. Do not create the directories if
|
||||
// they do not exist.
|
||||
$directories = array(
|
||||
'temporary://update-cache',
|
||||
'temporary://update-extraction',
|
||||
_update_manager_cache_directory(FALSE),
|
||||
_update_manager_extract_directory(FALSE),
|
||||
);
|
||||
|
||||
// Search for files and directories in base folder only without recursion.
|
||||
|
|
Loading…
Reference in New Issue