Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
AutowireServiceResource.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\DependencyInjection\Config;
13
14 @trigger_error('The '.__NAMESPACE__.'\AutowireServiceResource class is deprecated since Symfony 3.3 and will be removed in 4.0. Use ContainerBuilder::getReflectionClass() instead.', \E_USER_DEPRECATED);
15
16 use Symfony\Component\Config\Resource\SelfCheckingResourceInterface;
17 use Symfony\Component\DependencyInjection\Compiler\AutowirePass;
18
19 /**
20 * @deprecated since version 3.3, to be removed in 4.0. Use ContainerBuilder::getReflectionClass() instead.
21 */
22 class AutowireServiceResource implements SelfCheckingResourceInterface, \Serializable
23 {
24 private $class;
25 private $filePath;
26 private $autowiringMetadata = [];
27
28 public function __construct($class, $path, array $autowiringMetadata)
29 {
30 $this->class = $class;
31 $this->filePath = $path;
32 $this->autowiringMetadata = $autowiringMetadata;
33 }
34
35 public function isFresh($timestamp)
36 {
37 if (!file_exists($this->filePath)) {
38 return false;
39 }
40
41 // has the file *not* been modified? Definitely fresh
42 if (@filemtime($this->filePath) <= $timestamp) {
43 return true;
44 }
45
46 try {
47 $reflectionClass = new \ReflectionClass($this->class);
48 } catch (\ReflectionException $e) {
49 // the class does not exist anymore!
50 return false;
51 }
52
53 return (array) $this === (array) AutowirePass::createResourceForClass($reflectionClass);
54 }
55
56 public function __toString()
57 {
58 return 'service.autowire.'.$this->class;
59 }
60
61 /**
62 * @internal
63 */
64 public function serialize()
65 {
66 return serialize([$this->class, $this->filePath, $this->autowiringMetadata]);
67 }
68
69 /**
70 * @internal
71 */
72 public function unserialize($serialized)
73 {
74 if (\PHP_VERSION_ID >= 70000) {
75 list($this->class, $this->filePath, $this->autowiringMetadata) = unserialize($serialized, ['allowed_classes' => false]);
76 } else {
77 list($this->class, $this->filePath, $this->autowiringMetadata) = unserialize($serialized);
78 }
79 }
80
81 /**
82 * @deprecated Implemented for compatibility with Symfony 2.8
83 */
84 public function getResource()
85 {
86 return $this->filePath;
87 }
88 }
89