From 7733cd1743cc477fb4faef8674d432ad80caf812 Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Wed, 10 Sep 2014 12:55:29 +0200 Subject: [PATCH] Change name of Udp adapter in UdpAdapter, add readme.md --- README.md | 11 +++++++++++ .../Adapter/{UdpSpec.php => UdpAdapterSpec.php} | 4 ++-- src/InfluxDB/Adapter/{Udp.php => UdpAdapter.php} | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 README.md rename spec/InfluxDB/Adapter/{UdpSpec.php => UdpAdapterSpec.php} (76%) rename src/InfluxDB/Adapter/{Udp.php => UdpAdapter.php} (95%) diff --git a/README.md b/README.md new file mode 100644 index 000000000..c5380a0f5 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# InfluxDB PHP SDK +Send message to InfluxDB. + +```php +$client = new \InfluxDB\Client(); +$client->setAdapter(new \InfluxDB\Adapter\UdpAdapter()); +$client->mark("search", [ + "query" => "php" +]); +``` + diff --git a/spec/InfluxDB/Adapter/UdpSpec.php b/spec/InfluxDB/Adapter/UdpAdapterSpec.php similarity index 76% rename from spec/InfluxDB/Adapter/UdpSpec.php rename to spec/InfluxDB/Adapter/UdpAdapterSpec.php index 9f3c9f08a..1e65698b9 100644 --- a/spec/InfluxDB/Adapter/UdpSpec.php +++ b/spec/InfluxDB/Adapter/UdpAdapterSpec.php @@ -5,7 +5,7 @@ namespace spec\InfluxDB\Adapter; use PhpSpec\ObjectBehavior; use Prophecy\Argument; -class UdpSpec extends ObjectBehavior +class UdpAdapterSpec extends ObjectBehavior { function let() { @@ -14,7 +14,7 @@ class UdpSpec extends ObjectBehavior function it_is_initializable() { - $this->shouldHaveType('InfluxDB\Adapter\Udp'); + $this->shouldHaveType('InfluxDB\Adapter\UdpAdapter'); } function it_should_implement_adapter_interface() diff --git a/src/InfluxDB/Adapter/Udp.php b/src/InfluxDB/Adapter/UdpAdapter.php similarity index 95% rename from src/InfluxDB/Adapter/Udp.php rename to src/InfluxDB/Adapter/UdpAdapter.php index 5afd301fc..661e2e064 100644 --- a/src/InfluxDB/Adapter/Udp.php +++ b/src/InfluxDB/Adapter/UdpAdapter.php @@ -2,7 +2,7 @@ namespace InfluxDB\Adapter; -class Udp implements AdapterInterface +class UdpAdapter implements AdapterInterface { private $host; private $port;