[Validator] Made GraphWalker::validateReference() method public
This commit is contained in:
parent
5ed4d91bb8
commit
55a97ec78e
@ -133,7 +133,7 @@ class GraphWalker
|
||||
}
|
||||
}
|
||||
|
||||
protected function walkReference($value, $group, $propertyPath, $traverse)
|
||||
public function walkReference($value, $group, $propertyPath, $traverse)
|
||||
{
|
||||
if (null !== $value) {
|
||||
if (!is_object($value) && !is_array($value)) {
|
||||
|
35
src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php
Normal file
35
src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Components\Validator\Mapping\Cache;
|
||||
|
||||
use Symfony\Components\Validator\Mapping\ClassMetadata;
|
||||
|
||||
class ApcCache implements CacheInterface
|
||||
{
|
||||
public function has($class)
|
||||
{
|
||||
apc_delete($this->computeCacheKey($class));
|
||||
apc_fetch($this->computeCacheKey($class), $exists);
|
||||
|
||||
return $exists;
|
||||
}
|
||||
|
||||
public function read($class)
|
||||
{
|
||||
if (!$this->has($class)) {
|
||||
// TODO exception
|
||||
}
|
||||
|
||||
return apc_fetch($this->computeCacheKey($class));
|
||||
}
|
||||
|
||||
public function write(ClassMetadata $metadata)
|
||||
{
|
||||
apc_store($this->computeCacheKey($metadata->getClassName()), $metadata);
|
||||
}
|
||||
|
||||
protected function computeCacheKey($class)
|
||||
{
|
||||
return 'Symfony\Components\Validator:'.$class;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user