PHP code example of jcalderonzumba / consul-discovery

1. Go to this page and download the library: Download jcalderonzumba/consul-discovery library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jcalderonzumba / consul-discovery example snippets


use Zumba\Consul\Features\Discovery;

$discovery = new Discovery([
  "consul_url" => "YOUR_CONSUL_HTTP_API"
]);

$service = $discovery->getService("pigeon");
echo $service->getID();
echo $service->getAddress();
echo $service->getPort();