Skip to content

Commit

Permalink
Merge pull request clue#20 from clue-labs/examples
Browse files Browse the repository at this point in the history
Update examples and add .gitattributes to exclude dev files from exports
  • Loading branch information
clue authored Aug 6, 2024
2 parents 9c78a04 + 5b72035 commit 18cc679
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.gitattributes export-ignore
/.github/workflows/ export-ignore
/.gitignore export-ignore
/examples/ export-ignore
/phpunit.xml.dist export-ignore
/phpunit.xml.legacy export-ignore
/tests/ export-ignore
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ Let's take these projects to the next level together! 🚀
## Quickstart example

```php
use Clue\Redis\Protocol;
<?php

$factory = new Protocol\Factory();
require __DIR__ . '/vendor/autoload.php';

$factory = new Clue\Redis\Protocol\Factory();
$parser = $factory->createResponseParser();
$serializer = $factory->createSerializer();

Expand All @@ -63,6 +65,8 @@ var_dump($reply1->getValueNative()); // string(2) "OK"
var_dump($reply2->getValueNative()); // string(5) "value"
```

See also the [examples](examples/).

## Usage

### Factory
Expand Down
4 changes: 1 addition & 3 deletions example/client.php → examples/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

require __DIR__ . '/../vendor/autoload.php';

use Clue\Redis\Protocol;

$factory = new Protocol\Factory();
$factory = new Clue\Redis\Protocol\Factory();
$parser = $factory->createResponseParser();
$serializer = $factory->createSerializer();

Expand Down
5 changes: 1 addition & 4 deletions example/perf.php → examples/perf.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<?php

use Clue\Redis\Protocol\ProtocolBuffer;
use Clue\Redis\Protocol\Factory;

require __DIR__ . '/../vendor/autoload.php';

$factory = new Factory();
$factory = new Clue\Redis\Protocol\Factory();
$parser = $factory->createResponseParser();
$serializer = $factory->createSerializer();

Expand Down

0 comments on commit 18cc679

Please sign in to comment.