| @@ 107-120 (lines=14) @@ | ||
| 104 | $relativePath = null; |
|
| 105 | } |
|
| 106 | ||
| 107 | if (isset($composer["autoload"]["psr-0"])) { |
|
| 108 | $psr0 = $composer["autoload"]["psr-0"]; |
|
| 109 | foreach ($psr0 as $namespace => $paths) { |
|
| 110 | if ($relativePath != null) { |
|
| 111 | if (!is_array($paths)) { |
|
| 112 | $paths = [$paths]; |
|
| 113 | } |
|
| 114 | $paths = array_map(function($path) use ($relativePath) { |
|
| 115 | return rtrim($relativePath,'\\/').'/'.ltrim($path, '\\/'); |
|
| 116 | }, $paths); |
|
| 117 | } |
|
| 118 | $this->registerPsr0Namespace($namespace, $paths); |
|
| 119 | } |
|
| 120 | } |
|
| 121 | ||
| 122 | if (isset($composer["autoload"]["psr-4"])) { |
|
| 123 | $psr4 = $composer["autoload"]["psr-4"]; |
|
| @@ 122-135 (lines=14) @@ | ||
| 119 | } |
|
| 120 | } |
|
| 121 | ||
| 122 | if (isset($composer["autoload"]["psr-4"])) { |
|
| 123 | $psr4 = $composer["autoload"]["psr-4"]; |
|
| 124 | foreach ($psr4 as $namespace => $paths) { |
|
| 125 | if ($relativePath != null) { |
|
| 126 | if (!is_array($paths)) { |
|
| 127 | $paths = [$paths]; |
|
| 128 | } |
|
| 129 | $paths = array_map(function($path) use ($relativePath) { |
|
| 130 | return rtrim($relativePath,'\\/').'/'.ltrim($path, '\\/'); |
|
| 131 | }, $paths); |
|
| 132 | } |
|
| 133 | $this->registerPsr4Namespace($namespace, $paths); |
|
| 134 | } |
|
| 135 | } |
|
| 136 | ||
| 137 | if ($useAutoloadDev) { |
|
| 138 | if (isset($composer["autoload-dev"]["psr-0"])) { |
|
| @@ 138-151 (lines=14) @@ | ||
| 135 | } |
|
| 136 | ||
| 137 | if ($useAutoloadDev) { |
|
| 138 | if (isset($composer["autoload-dev"]["psr-0"])) { |
|
| 139 | $psr0 = $composer["autoload-dev"]["psr-0"]; |
|
| 140 | foreach ($psr0 as $namespace => $paths) { |
|
| 141 | if ($relativePath != null) { |
|
| 142 | if (!is_array($paths)) { |
|
| 143 | $paths = [$paths]; |
|
| 144 | } |
|
| 145 | $paths = array_map(function($path) use ($relativePath) { |
|
| 146 | return rtrim($relativePath,'\\/').'/'.ltrim($path, '\\/'); |
|
| 147 | }, $paths); |
|
| 148 | } |
|
| 149 | $this->registerPsr0Namespace($namespace, $paths); |
|
| 150 | } |
|
| 151 | } |
|
| 152 | ||
| 153 | if (isset($composer["autoload-dev"]["psr-4"])) { |
|
| 154 | $psr4 = $composer["autoload-dev"]["psr-4"]; |
|
| @@ 153-166 (lines=14) @@ | ||
| 150 | } |
|
| 151 | } |
|
| 152 | ||
| 153 | if (isset($composer["autoload-dev"]["psr-4"])) { |
|
| 154 | $psr4 = $composer["autoload-dev"]["psr-4"]; |
|
| 155 | foreach ($psr4 as $namespace => $paths) { |
|
| 156 | if ($relativePath != null) { |
|
| 157 | if (!is_array($paths)) { |
|
| 158 | $paths = [$paths]; |
|
| 159 | } |
|
| 160 | $paths = array_map(function($path) use ($relativePath) { |
|
| 161 | return rtrim($relativePath,'\\/').'/'.ltrim($path, '\\/'); |
|
| 162 | }, $paths); |
|
| 163 | } |
|
| 164 | $this->registerPsr4Namespace($namespace, $paths); |
|
| 165 | } |
|
| 166 | } |
|
| 167 | } |
|
| 168 | ||
| 169 | return $this; |
|