Skip to content

Commit

Permalink
Fix for psr-0
Browse files Browse the repository at this point in the history
  • Loading branch information
jawngee committed Aug 25, 2020
1 parent 5358212 commit 90b0bcb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Source/Models/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,17 @@ public function process(string $packagePrefix, string $namespacePrefix, string $
if (isset($config['autoload'])) {
if (isset($config['autoload']['psr-0'])) {
foreach($config['autoload']['psr-0'] as $namespace => $directory) {
$tempPsr0Path = $this->path.'tmp/';
$psr0Path = trailingslashit($this->path.$directory);
mkdir($tempPsr0Path, 0755, true);
`mv {$psr0Path}* $tempPsr0Path`;

$namespacePath = ltrim(str_replace("\\", "/", $namespacePrefix), '\\');
$newPsr0Path = trailingslashit(trailingslashit($this->path.$directory).$namespacePath);
mkdir($newPsr0Path, 0755, true);
`mv {$tempPsr0Path}* $newPsr0Path`;
@rmdir($tempPsr0Path);

$config['autoload']['psr-0'][$namespacePrefix.$namespace] = $directory;
unset($config['autoload']['psr-0'][$namespace]);
}
Expand Down

0 comments on commit 90b0bcb

Please sign in to comment.