Skip to content

Commit 8df14c2

Browse files
committed
Add algolia search php client playground
1 parent 8af9749 commit 8df14c2

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed

php/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Nuno Maduro <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

php/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Installation
2+
3+
> **Requires [PHP 7.2+](https://php.net/releases/)**
4+
5+
```bash
6+
git clone https://github.com/algolia/algoliasearch-client-php-playground
7+
```
8+
9+
```bash
10+
cd algoliasearch-client-php-playground && composer update
11+
```
12+
13+
## Usage
14+
15+
1. Edit the file `bin/index.php`.
16+
2. Run the php file using: `php bin/index.php`.

php/bin/index.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
require __DIR__.'/../vendor/autoload.php';
4+
5+
(new \NunoMaduro\Collision\Provider())->register();
6+
7+
// Here goes your code:
8+
$client = \Algolia\AlgoliaSearch\SearchClient::create('..', '..');
9+
$index = $client->initIndex('contacts');

php/composer.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "algolia/algoliasearch-client-php-playground",
3+
"keywords": ["algolia", "php", "playground"],
4+
"license": "MIT",
5+
"authors": [
6+
{
7+
"name": "Nuno Maduro",
8+
"email": "[email protected]"
9+
}
10+
],
11+
"require": {
12+
"php": "^7.2",
13+
"algolia/algoliasearch-client-php": "^2.2",
14+
"nunomaduro/collision": "^2.1",
15+
"symfony/var-dumper": "^4.1"
16+
},
17+
"minimum-stability": "dev",
18+
"prefer-stable": true,
19+
"config": {
20+
"sort-packages": true,
21+
"preferred-install": "dist"
22+
}
23+
}

0 commit comments

Comments
 (0)