Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Commit

Permalink
bf manage exception composer.json not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
GianArb committed Sep 13, 2013
1 parent 7b6bafd commit cdf23de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions module/ZfModule/src/ZfModule/Controller/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@ public function viewAction()
$composerJson = $client->api('repos')->content($vendor, $module, 'composer.json');
$composerConf = json_decode($composerJson);
$composerConf = base64_decode($composerConf->content);
$composerConf = json_decode($composerConf, true);
} catch(\Exception $e) {
$composerConf = 'No license file found for this Module';
$composerConf = 'No composer.json file found for this Module';
}

$viewModel = new ViewModel(array(
'vendor' => $vendor,
'module' => $module,
'repository' => $repository,
'readme' => base64_decode($readme->content),
'composerConf' => json_decode($composerConf, true),
'composerConf' => $composerConf,
'license' => $license,
));

Expand Down
7 changes: 6 additions & 1 deletion module/ZfModule/view/zf-module/index/view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
<?php echo $this->markdown($this->readme);?>
</div>
<div class="tab-pane" id="composer">
<?php echo $this->composerView($this->composerConf);?>
<?php if(is_array($composerConf)){
echo $this->composerView($this->composerConf);
} else {
echo $this->composerConf;
}
?>
</div>
<div class="tab-pane" id="license">
<?php echo $license;?>
Expand Down

0 comments on commit cdf23de

Please sign in to comment.