Skip to content

Commit

Permalink
Support packages with no dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed May 26, 2013
1 parent 29a61e5 commit 78b44d8
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/Clue/PharComposer/PharComposer.php
Expand Up @@ -106,15 +106,19 @@ public function getPackagesDependencies()
$pathVendor = $this->getPathVendor();

// load all installed packages (use installed.json which also includes version instead of composer.lock)
$installed = $this->loadJson($pathVendor . 'composer/installed.json');
foreach ($installed as $package) {
$dir = $package['name'] . '/';
if (isset($package['target-dir'])) {
$dir .= trim($package['target-dir'], '/') . '/';
}
if (is_file($pathVendor . 'composer/installed.json')) {
// file does not exist if there's nothing to be installed
$installed = $this->loadJson($pathVendor . 'composer/installed.json');

foreach ($installed as $package) {
$dir = $package['name'] . '/';
if (isset($package['target-dir'])) {
$dir .= trim($package['target-dir'], '/') . '/';
}

$dir = $pathVendor . $dir;
$packages []= new Package($package, $dir);
$dir = $pathVendor . $dir;
$packages []= new Package($package, $dir);
}
}

return $packages;
Expand Down

0 comments on commit 78b44d8

Please sign in to comment.