public function set($entryIdentifier, $data, array $tags = [], $lifetime = null)
{
if (!is_string($data)) {
throw new InvalidDataException('The specified data is of type "' . gettype($data) . '" but a string is expected.', 1334756734);
}
if ($entryIdentifier !== basename($entryIdentifier)) {
throw new \InvalidArgumentException('The specified entry identifier must not contain a path segment.', 1334756735);
}
if ($entryIdentifier === '') {
throw new \InvalidArgumentException('The specified entry identifier must not be empty.', 1334756736);
}
$cacheEntryPathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
$result = $this->writeCacheFile($cacheEntryPathAndFilename, $data);
if ($result !== false) {
if ($this->cacheEntryFileExtension === '.php') {
OpcodeCacheHelper::clearAllActive($cacheEntryPathAndFilename);
}
return;
}
$this->throwExceptionIfPathExceedsMaximumLength($cacheEntryPathAndFilename);
throw new Exception('The cache file "' . $cacheEntryPathAndFilename . '" could not be written.', 1334756737);
}