teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

autload_real.phpのコードを掲載

2021/05/25 02:01

投稿

takuyaKK
takuyaKK

スコア37

title CHANGED
File without changes
body CHANGED
@@ -7,4 +7,83 @@
7
7
  \Composer\Autoload\ComposerStaticInitbaf0960fd667a299f3f264c39b8ee711::getInitializer($loader);
8
8
  ```
9
9
  と書いても変わらないような気がするのですが、実際にやると上手くautloadできないようです。
10
- どういった原因があるのでしょうか?
10
+ どういった原因があるのでしょうか?
11
+
12
+ ```autload_real.php
13
+ <?php
14
+
15
+ // autoload_real.php @generated by Composer
16
+
17
+ class ComposerAutoloaderInitbaf0960fd667a299f3f264c39b8ee711
18
+ {
19
+ private static $loader;
20
+
21
+ public static function loadClassLoader($class)
22
+ {
23
+ if ('Composer\Autoload\ClassLoader' === $class) {
24
+ require __DIR__ . '/ClassLoader.php';
25
+ }
26
+ }
27
+
28
+ /**
29
+ * @return \Composer\Autoload\ClassLoader
30
+ */
31
+ public static function getLoader()
32
+ {
33
+ if (null !== self::$loader) {
34
+ return self::$loader;
35
+ }
36
+
37
+ require __DIR__ . '/platform_check.php';
38
+
39
+ spl_autoload_register(array('ComposerAutoloaderInitbaf0960fd667a299f3f264c39b8ee711', 'loadClassLoader'), true, true);
40
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
41
+ spl_autoload_unregister(array('ComposerAutoloaderInitbaf0960fd667a299f3f264c39b8ee711', 'loadClassLoader'));
42
+
43
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
44
+ if ($useStaticLoader) {
45
+ require __DIR__ . '/autoload_static.php';
46
+
47
+ call_user_func(\Composer\Autoload\ComposerStaticInitbaf0960fd667a299f3f264c39b8ee711::getInitializer($loader));
48
+ } else {
49
+ $map = require __DIR__ . '/autoload_namespaces.php';
50
+ foreach ($map as $namespace => $path) {
51
+ $loader->set($namespace, $path);
52
+ }
53
+
54
+ $map = require __DIR__ . '/autoload_psr4.php';
55
+ foreach ($map as $namespace => $path) {
56
+ $loader->setPsr4($namespace, $path);
57
+ }
58
+
59
+ $classMap = require __DIR__ . '/autoload_classmap.php';
60
+ if ($classMap) {
61
+ $loader->addClassMap($classMap);
62
+ }
63
+ }
64
+
65
+ $loader->register(true);
66
+
67
+ if ($useStaticLoader) {
68
+ $includeFiles = Composer\Autoload\ComposerStaticInitbaf0960fd667a299f3f264c39b8ee711::$files;
69
+ } else {
70
+ $includeFiles = require __DIR__ . '/autoload_files.php';
71
+ }
72
+ foreach ($includeFiles as $fileIdentifier => $file) {
73
+ composerRequirebaf0960fd667a299f3f264c39b8ee711($fileIdentifier, $file);
74
+ }
75
+
76
+ return $loader;
77
+ }
78
+ }
79
+
80
+ function composerRequirebaf0960fd667a299f3f264c39b8ee711($fileIdentifier, $file)
81
+ {
82
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
83
+ require $file;
84
+
85
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
86
+ }
87
+ }
88
+
89
+ ```