Skip to content

Commit

Permalink
fixes subpackage issue with loading composer
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Jul 19, 2018
1 parent b759103 commit ad371f8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/php/lib/Grpc/BaseStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ public function __construct($hostname, $opts, $channel = null)
}

private static function updateOpts($opts) {
$package_config = json_decode(
file_get_contents(dirname(__FILE__).'/../../composer.json'),
true
);
if (!file_exists($composerFile = __DIR__.'/../../composer.json')) {
// for grpc/grpc-php subpackage
$composerFile = __DIR__.'/../composer.json';
}
$package_config = json_decode(file_get_contents($composerFile), true);
if (!empty($opts['grpc.primary_user_agent'])) {
$opts['grpc.primary_user_agent'] .= ' ';
} else {
Expand Down

0 comments on commit ad371f8

Please sign in to comment.