Skip to content

Commit

Permalink
Fix autoloads not being included.
Browse files Browse the repository at this point in the history
Closes #13.
  • Loading branch information
franzliedke committed Mar 25, 2015
1 parent 305cab5 commit 498cdad
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Composer/StudioPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,18 @@ protected function autoloadFrom(array $directories)

protected function appendIncludes(array $includes)
{
$contents = "\n" . '// @generated by Composer Studio (https://github.com/franzliedke/studio)' . "\n";
$contents .= "\n" . implode("\n", $includes) . "\n";
$code = '// @generated by Composer Studio (https://github.com/franzliedke/studio)' . "\n";
$code .= "\n" . implode("\n", $includes) . "\n";

$autoloadFile = 'vendor/autoload.php';
$contents = file_get_contents($autoloadFile);

file_put_contents($autoloadFile, $contents, FILE_APPEND);
$contents = str_replace(
'return ComposerAutoloader',
"$code\nreturn ComposerAutoloader",
$contents
);

file_put_contents($autoloadFile, $contents);
}
}

0 comments on commit 498cdad

Please sign in to comment.