Skip to content

Commit

Permalink
Merge branch 'master' into update-fb-graph-api-14.0-and-change-field
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalgopnik authored Oct 25, 2023
2 parents f9dde86 + 74386de commit b6e978d
Show file tree
Hide file tree
Showing 25 changed files with 1,933 additions and 784 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Created by https://www.gitignore.io

.idea/
build/
shariff-backend-php.zip
shariff-backend-php.tar.gz
Expand All @@ -9,7 +9,7 @@ composer.phar
vendor/
.php_cs.cache

# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
# You may choose to ignore a library lock file https://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
/.phpunit.result.cache
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ php:
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1

env:
- SHARIFF_RUN_LINT=1
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ To run Shariff PHP Backend on your server you need one of these PHP versions:
* 7.2
* 7.3
* 7.4
* 8.0
* 8.1

Older versions and HHVM are not supported.

Expand All @@ -50,12 +52,12 @@ The following configuration options are available:

By default Shariff uses the Filesystem cache. By specifying a different adapter from Laminas\Cache\Storage\Adapter you can tell Shariff to use another cache. Also you can specify options for that cache adapter

| Key | Type | Description |
|-------------|------|-------------|
| `ttl` | `integer` | Time that the counts are cached (in seconds) |
| `cacheDir` | `string` | Directory used for the cache. Default: system temp directory |
| `adapter` | `string` | Name of cache adapter (e.g. Apc, Memcache, etc.) |
| `adapterOptions` | `object` | Options for the cache adapter |
| Key | Type | Description |
|-------------|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ttl` | `integer` | Time that the counts are cached (in seconds) |
| `cacheDir` | `string` | Directory used for the cache. Default: system temp directory |
| `adapter` | `string` | Name of cache adapter (e.g. Apc, Memcache, etc.) <br/>You can find an overview of all available Adapters [here](https://docs.laminas.dev/laminas-cache/v3/storage/adapter/). It is required to [install these separately](https://docs.laminas.dev/laminas-cache/v3/migration/to-version-3/#satellite-packages) through composer |
| `adapterOptions` | `object` | Options for the cache adapter |

*These option apply for the default Cache class (`LaminasCache`) only. If you implement custom caching, you can specify your own options.*

Expand Down Expand Up @@ -105,7 +107,10 @@ private static $configuration = [
]
],
'client' => [
'timeout' => 4.2
'timeout' => 4.2,
'headers' => [
'User-Agent' => 'shariff/1.0',
]
// ... (see "Client options")
],
'domains' => [
Expand Down Expand Up @@ -155,6 +160,6 @@ $options = [
"services" => ["Facebook", "Reddit", "StumbleUpon", "Flattr", "Pinterest", "AddThis", "Buffer", "Vk"]
];
$shariff = new Backend($options);
$counts = $shariff->get("http://www.heise.de/");
$counts = $shariff->get("https://www.heise.de/");
echo $counts["facebook"];
```
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@
}
],
"require": {
"php": "^7.2",
"guzzlehttp/guzzle": "^6.1",
"php": "^7.2 || ^8.0",
"guzzlehttp/guzzle": "^7.4.1",
"psr/log": "^1.0",
"laminas/laminas-cache": "^2.7"
"laminas/laminas-cache": "^3.1",
"laminas/laminas-cache-storage-adapter-filesystem": "^2.0",
"laminas/laminas-cache-storage-adapter-memory": "^2.0",
"laminas/laminas-cache-storage-deprecated-factory": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^8.5"
"phpunit/phpunit": "^9.5"
},
"config": {
"optimize-autoloader": true,
Expand Down
Loading

0 comments on commit b6e978d

Please sign in to comment.