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