file_directory_temp

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 file_directory_temp()

Determine the default temporary directory.

Rückgabewert

A string containing a temp directory.

Verwandte Themen

▾ 11 functions call file_directory_temp()

FileDirectoryTest::testFileDirectoryTemp in modules/simpletest/tests/file.test
Check file_directory_path() and file_directory_temp().
FileValidatorTest::testFileValidateImageResolution in modules/simpletest/tests/file.test
This ensures the resolution of a specific file is within bounds. The image will be resized if it's too large.
file_check_directory in includes/file.inc
Check that the directory exists and is writable.
file_create_path in includes/file.inc
Make sure the destination is a complete path and resides in the file system directory, if it is not prepend the file system directory.
file_save_upload in includes/file.inc
Saves a file upload to a new location.
file_unmanaged_save_data in includes/file.inc
Save a string to the specified destination without calling any hooks or making any changes to the database.
LocaleExportFunctionalTest::testExportTranslation in modules/locale/locale.test
Test exportation of translations.
LocaleImportFunctionalTest::testStandalonePoFile in modules/locale/locale.test
Test importation of standalone .po files.
SessionTestCase::sessionReset in modules/simpletest/tests/session.test
Reset the cookie file so that it refers to the specified user.
system_file_system_settings in modules/system/system.admin.inc
Form builder; Configure the site file handling.
upload_form_alter in modules/upload/upload.module

Code

includes/file.inc, line 1455

<?php
function file_directory_temp() {
  $temporary_directory = variable_get('file_directory_temp');

  if (is_null($temporary_directory)) {
    $directories = array();

    // Has PHP been set with an upload_tmp_dir?
    if (ini_get('upload_tmp_dir')) {
      $directories[] = ini_get('upload_tmp_dir');
    }

    // Operating system specific dirs.
    if (substr(PHP_OS, 0, 3) == 'WIN') {
      $directories[] = 'c:/windows/temp';
      $directories[] = 'c:/winnt/temp';
    }
    else {
      $directories[] = '/tmp';
    }

    foreach ($directories as $directory) {
      if (!$temporary_directory && is_dir($directory)) {
        $temporary_directory = $directory;
      }
    }

    // if a directory has been found, use it, otherwise default to 'files/tmp'
    $temporary_directory = $temporary_directory ? $temporary_directory : file_directory_path() . '/tmp';
    variable_set('file_directory_temp', $temporary_directory);
  }

  return $temporary_directory;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen