This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php

31 lines
593 B
PHP
Raw Normal View History

<?php
namespace Symfony\Component\Validator\Mapping\Cache;
use Symfony\Component\Validator\Mapping\ClassMetadata;
class ApcCache implements CacheInterface
{
2011-03-29 22:06:30 +01:00
private $prefix;
public function __construct($prefix)
{
$this->prefix = $prefix;
}
public function has($class)
{
2011-04-06 12:12:29 +01:00
return apc_exists($this->prefix.$class);
}
public function read($class)
{
2011-03-29 22:06:30 +01:00
return apc_fetch($this->prefix.$class);
}
public function write(ClassMetadata $metadata)
{
2011-03-29 22:06:30 +01:00
apc_store($this->prefix.$metadata->getClassName(), $metadata);
}
}