You are here

public function PurgersService::createId in Purge 8.3

Create a unique instance ID for new purger instances.

Every purger has a unique instance identifier set by the purgers service, whether it is multi-instantiable or not. This helper creates a unique, random string, 10 characters long.

Return value

string The unique instance ID.

Overrides PurgersServiceInterface::createId

See also

\Drupal\purge\Plugin\Purge\Purger\PurgerInterface::getId()

File

src/Plugin/Purge/Purger/PurgersService.php, line 208

Class

PurgersService
Provides the service that distributes access to one or more purgers.

Namespace

Drupal\purge\Plugin\Purge\Purger

Code

public function createId() {
  return substr(sha1(microtime()), 0, 10);
}