function FixturesBase::tmpDir

Generates a path to a temporary location, but do not create the directory.

Parameters

string $prefix: A prefix for the temporary directory name.

Return value

string Path to temporary directory

1 call to FixturesBase::tmpDir()
FixturesBase::mkTmpDir in core/tests/Drupal/Tests/Composer/Plugin/FixturesBase.php
Creates a temporary directory.
1 method overrides FixturesBase::tmpDir()
Fixtures::tmpDir in core/tests/Drupal/Tests/Composer/Plugin/Unpack/Fixtures.php
Generates a path to a temporary location, but do not create the directory.

File

core/tests/Drupal/Tests/Composer/Plugin/FixturesBase.php, line 148

Class

FixturesBase
Base class for fixtures to test composer plugins.

Namespace

Drupal\Tests\Composer\Plugin

Code

public function tmpDir(string $prefix) : string {
    $prefix .= static::persistentPrefix();
    $tmpDir = sys_get_temp_dir() . '/scaffold-' . $prefix . uniqid(md5($prefix . microtime()), TRUE);
    $this->tmpDirs[] = $tmpDir;
    return $tmpDir;
}

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