| @@ 132-145 (lines=14) @@ | ||
| 129 | $relativePath = null; |
|
| 130 | } |
|
| 131 | ||
| 132 | if (isset($composer["autoload"]["psr-0"])) { |
|
| 133 | $psr0 = $composer["autoload"]["psr-0"]; |
|
| 134 | foreach ($psr0 as $namespace => $paths) { |
|
| 135 | if ($relativePath != null) { |
|
| 136 | if (!is_array($paths)) { |
|
| 137 | $paths = [$paths]; |
|
| 138 | } |
|
| 139 | $paths = array_map(function($path) use ($relativePath) { |
|
| 140 | return rtrim($relativePath,'\\/').'/'.ltrim($path, '\\/'); |
|
| 141 | }, $paths); |
|
| 142 | } |
|
| 143 | $this->registerPsr0Namespace($namespace, $paths); |
|
| 144 | } |
|
| 145 | } |
|
| 146 | ||
| 147 | if (isset($composer["autoload"]["psr-4"])) { |
|
| 148 | $psr4 = $composer["autoload"]["psr-4"]; |
|
| @@ 147-160 (lines=14) @@ | ||
| 144 | } |
|
| 145 | } |
|
| 146 | ||
| 147 | if (isset($composer["autoload"]["psr-4"])) { |
|
| 148 | $psr4 = $composer["autoload"]["psr-4"]; |
|
| 149 | ||
| 150 | foreach ($psr4 as $namespace => $paths) { |
|
| 151 | if ($relativePath != null) { |
|
| 152 | if (!is_array($paths)) { |
|
| 153 | $paths = [$paths]; |
|
| 154 | } |
|
| 155 | $paths = array_map(function($path) use ($relativePath) { |
|
| 156 | return rtrim($relativePath,'\\/').'/'.ltrim($path, '\\/'); |
|
| 157 | }, $paths); |
|
| 158 | } |
|
| 159 | $this->registerPsr4Namespace($namespace, $paths); |
|
| 160 | } |
|
| 161 | } |
|
| 162 | ||
| 163 | if ($useAutoloadDev) { |
|
| @@ 164-177 (lines=14) @@ | ||
| 161 | } |
|
| 162 | ||
| 163 | if ($useAutoloadDev) { |
|
| 164 | if (isset($composer["autoload-dev"]["psr-0"])) { |
|
| 165 | $psr0 = $composer["autoload-dev"]["psr-0"]; |
|
| 166 | foreach ($psr0 as $namespace => $paths) { |
|
| 167 | if ($relativePath != null) { |
|
| 168 | if (!is_array($paths)) { |
|
| 169 | $paths = [$paths]; |
|
| 170 | } |
|
| 171 | $paths = array_map(function($path) use ($relativePath) { |
|
| 172 | return rtrim($relativePath,'\\/').'/'.ltrim($path, '\\/'); |
|
| 173 | }, $paths); |
|
| 174 | } |
|
| 175 | $this->registerPsr0Namespace($namespace, $paths); |
|
| 176 | } |
|
| 177 | } |
|
| 178 | ||
| 179 | if (isset($composer["autoload-dev"]["psr-4"])) { |
|
| 180 | $psr4 = $composer["autoload-dev"]["psr-4"]; |
|
| @@ 179-192 (lines=14) @@ | ||
| 176 | } |
|
| 177 | } |
|
| 178 | ||
| 179 | if (isset($composer["autoload-dev"]["psr-4"])) { |
|
| 180 | $psr4 = $composer["autoload-dev"]["psr-4"]; |
|
| 181 | foreach ($psr4 as $namespace => $paths) { |
|
| 182 | if ($relativePath != null) { |
|
| 183 | if (!is_array($paths)) { |
|
| 184 | $paths = [$paths]; |
|
| 185 | } |
|
| 186 | $paths = array_map(function($path) use ($relativePath) { |
|
| 187 | return rtrim($relativePath,'\\/').'/'.ltrim($path, '\\/'); |
|
| 188 | }, $paths); |
|
| 189 | } |
|
| 190 | $this->registerPsr4Namespace($namespace, $paths); |
|
| 191 | } |
|
| 192 | } |
|
| 193 | } |
|
| 194 | ||
| 195 | return $this; |
|