Mercurial > hg > isophonics-drupal-site
comparison vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
110 $this->saveCacheFile($path, $annot); | 110 $this->saveCacheFile($path, $annot); |
111 return $this->loadedAnnotations[$key] = $annot; | 111 return $this->loadedAnnotations[$key] = $annot; |
112 } | 112 } |
113 | 113 |
114 if ($this->debug | 114 if ($this->debug |
115 && (false !== $filename = $class->getFilename()) | 115 && (false !== $filename = $class->getFileName()) |
116 && filemtime($path) < filemtime($filename)) { | 116 && filemtime($path) < filemtime($filename)) { |
117 @unlink($path); | 117 @unlink($path); |
118 | 118 |
119 $annot = $this->reader->getClassAnnotations($class); | 119 $annot = $this->reader->getClassAnnotations($class); |
120 $this->saveCacheFile($path, $annot); | 120 $this->saveCacheFile($path, $annot); |
212 | 212 |
213 if (false === $tempfile) { | 213 if (false === $tempfile) { |
214 throw new \RuntimeException(sprintf('Unable to create tempfile in directory: %s', $this->dir)); | 214 throw new \RuntimeException(sprintf('Unable to create tempfile in directory: %s', $this->dir)); |
215 } | 215 } |
216 | 216 |
217 @chmod($tempfile, 0666 & (~$this->umask)); | |
218 | |
217 $written = file_put_contents($tempfile, '<?php return unserialize('.var_export(serialize($data), true).');'); | 219 $written = file_put_contents($tempfile, '<?php return unserialize('.var_export(serialize($data), true).');'); |
218 | 220 |
219 if (false === $written) { | 221 if (false === $written) { |
220 throw new \RuntimeException(sprintf('Unable to write cached file to: %s', $tempfile)); | 222 throw new \RuntimeException(sprintf('Unable to write cached file to: %s', $tempfile)); |
221 } | 223 } |