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 |
Autoloader.php
01 <?php
02
03 declare(strict_types=1);
04
05 namespace ProxyManager\Autoloader;
06
07 use ProxyManager\FileLocator\FileLocatorInterface;
08 use ProxyManager\Inflector\ClassNameInflectorInterface;
09
10 /**
11 * {@inheritDoc}
12 *
13 * @author Marco Pivetta <ocramius@gmail.com>
14 * @license MIT
15 */
16 class Autoloader implements AutoloaderInterface
17 {
18 /**
19 * @var \ProxyManager\FileLocator\FileLocatorInterface
20 */
21 protected $fileLocator;
22
23 /**
24 * @var \ProxyManager\Inflector\ClassNameInflectorInterface
25 */
26 protected $classNameInflector;
27
28 /**
29 * @param \ProxyManager\FileLocator\FileLocatorInterface $fileLocator
30 * @param \ProxyManager\Inflector\ClassNameInflectorInterface $classNameInflector
31 */
32 public function __construct(FileLocatorInterface $fileLocator, ClassNameInflectorInterface $classNameInflector)
33 {
34 $this->fileLocator = $fileLocator;
35 $this->classNameInflector = $classNameInflector;
36 }
37
38 /**
39 * {@inheritDoc}
40 */
41 public function __invoke(string $className) : bool
42 {
43 if (class_exists($className, false) || ! $this->classNameInflector->isProxyClassName($className)) {
44 return false;
45 }
46
47 $file = $this->fileLocator->getProxyFileName($className);
48
49 if (! file_exists($file)) {
50 return false;
51 }
52
53 /* @noinspection PhpIncludeInspection */
54 /* @noinspection UsingInclusionOnceReturnValueInspection */
55 return (bool) require_once $file;
56 }
57 }
58