diff --git a/src/Symfony/Component/DependencyInjection/Config/AutowireServiceResource.php b/src/Symfony/Component/DependencyInjection/Config/AutowireServiceResource.php index 370af81c322d9..36449d8d3042a 100644 --- a/src/Symfony/Component/DependencyInjection/Config/AutowireServiceResource.php +++ b/src/Symfony/Component/DependencyInjection/Config/AutowireServiceResource.php @@ -12,6 +12,7 @@ namespace Symfony\Component\DependencyInjection\Config; use Symfony\Component\Config\Resource\SelfCheckingResourceInterface; +use Symfony\Component\DependencyInjection\Compiler\AutowirePass; class AutowireServiceResource implements SelfCheckingResourceInterface, \Serializable { @@ -32,7 +33,19 @@ public function isFresh($timestamp) return false; } - return @filemtime($this->filePath) <= $timestamp; + // has the file *not* been modified? Definitely fresh + if (@filemtime($this->filePath) <= $timestamp) { + return true; + } + + try { + $reflectionClass = new \ReflectionClass($this->class); + } catch (\ReflectionException $e) { + // the class does not exist anymore! + return false; + } + + return (array) $this === (array) AutowirePass::createResourceForClass($reflectionClass); } public function __toString()