Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Generate a unique ID
<?php uniqid(string $prefix = "", bool $more_entropy = false): string
<?php public function resetTag($name)
{
$this->store->forever($this->tagKey($name), $id = str_replace('.', '', uniqid('', true)));
return $id;
}
<?php public function testGenerateTableWithAutoincrement(): void
{
$columnName = strtoupper('id' . uniqid());
$tableName = strtoupper('table' . uniqid());
$table = new Table($tableName);
$column = $table->addColumn($columnName, 'integer');
<?php public function testGenerateTableWithAutoincrement(): void
{
$columnName = strtoupper('id' . uniqid());
$tableName = strtoupper('table' . uniqid());
$table = new Table($tableName);
$column = $table->addColumn($columnName, 'integer');
$column->setAutoincrement(true);
<?php public function __construct()
{
parent::__construct(uniqid(), null);
}
public function makeCurlRequest(string $verb, string $fullUrl, array $headers = [], array $arguments = []): Response
<?php }
if (!$suffix) {
$suffix = $config->get('autoloader-suffix') ?: md5(uniqid('', true));
}
}
<?php }
if ($this->apcu) {
$apcuPrefix = var_export(($this->apcuPrefix !== null ? $this->apcuPrefix : substr(base64_encode(md5(uniqid('', true), true)), 0, -3)), true);
$file .= <<<APCU
\$loader->setApcuPrefix($apcuPrefix);
<?php $this->io->writeError('Writing '.$this->root . $file.' into cache', true, IOInterface::DEBUG);
$tempFileName = $this->root . $file . uniqid('.', true) . '.tmp';
try {
return file_put_contents($tempFileName, $contents) !== false && rename($tempFileName, $this->root . $file);
} catch (\ErrorException $e) {
<?php }
do {
$temporaryDir = $vendorDir.'/composer/'.substr(md5(uniqid('', true)), 0, 8);
} while (is_dir($temporaryDir));
$this->addCleanupPath($package, $temporaryDir);
<?php $sourcePath = realpath('.');
} else {
$sourcePath = sys_get_temp_dir().'/composer_archive'.uniqid();
$filesystem->ensureDirectoryExists($sourcePath);
try {
<?php }
$tempTarget = sys_get_temp_dir().'/composer_archive'.uniqid().'.'.$format;
$filesystem->ensureDirectoryExists(dirname($tempTarget));
$archivePath = $usableArchiver->archive($sourcePath, $tempTarget, $format, $package->getArchiveExcludes(), $ignoreFilters);
<?php $config = new Config();
}
if (!$config->has('home')) {
$tmpDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'cmptest-'.md5(uniqid('', true));
$config->merge(array('config' => array('home' => $tmpDir)));
}
<?php for ($i = 0; $i < 10; ++$i) {
$tmpFile = $dir.'/'.$prefix.uniqid(mt_rand(), true).$suffix;
<?php $root = sys_get_temp_dir();
do {
$unique = $root . DIRECTORY_SEPARATOR . uniqid('composer-test-' . rand(1000, 9000));
if (!file_exists($unique) && Silencer::call('mkdir', $unique, 0777)) {
return realpath($unique);
<?php private function getRandomSocketUri()
{
return "unix://" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(rand(), true) . '.sock';
}
}
<?php private function getRandomSocketUri()
{
return "unix://" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(rand(), true) . '.sock';
}
}