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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

ComposerResource.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.82 KiB


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\Config\Resource;
13   
14  /**
15   * ComposerResource tracks the PHP version and Composer dependencies.
16   *
17   * @author Nicolas Grekas <p@tchwork.com>
18   */
19  class ComposerResource implements SelfCheckingResourceInterface, \Serializable
20  {
21      private $vendors;
22   
23      private static $runtimeVendors;
24   
25      public function __construct()
26      {
27          self::refresh();
28          $this->vendors = self::$runtimeVendors;
29      }
30   
31      public function getVendors()
32      {
33          return array_keys($this->vendors);
34      }
35   
36      /**
37       * {@inheritdoc}
38       */
39      public function __toString()
40      {
41          return __CLASS__;
42      }
43   
44      /**
45       * {@inheritdoc}
46       */
47      public function isFresh($timestamp)
48      {
49          self::refresh();
50   
51          return array_values(self::$runtimeVendors) === array_values($this->vendors);
52      }
53   
54      /**
55       * @internal
56       */
57      public function serialize()
58      {
59          return serialize($this->vendors);
60      }
61   
62      /**
63       * @internal
64       */
65      public function unserialize($serialized)
66      {
67          $this->vendors = unserialize($serialized);
68      }
69   
70      private static function refresh()
71      {
72          self::$runtimeVendors = [];
73   
74          foreach (get_declared_classes() as $class) {
75              if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
76                  $r = new \ReflectionClass($class);
77                  $v = \dirname(\dirname($r->getFileName()));
78                  if (file_exists($v.'/composer/installed.json')) {
79                      self::$runtimeVendors[$v] = @filemtime($v.'/composer/installed.json');
80                  }
81              }
82          }
83      }
84  }
85