https://github.com/datashaman/elasticsearch-cache
Laravel-oriented implementation of an Elasticsearch-based cache store.
https://github.com/datashaman/elasticsearch-cache
Last synced: about 1 year ago
JSON representation
Laravel-oriented implementation of an Elasticsearch-based cache store.
- Host: GitHub
- URL: https://github.com/datashaman/elasticsearch-cache
- Owner: datashaman
- License: other
- Created: 2016-07-25T15:22:53.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-01T10:58:13.000Z (almost 10 years ago)
- Last Synced: 2025-02-06T05:43:46.726Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# datashaman/elasticsearch-cache
Laravel-oriented implementation of an Elasticsearch-based cache store.
[](https://travis-ci.org/datashaman/elasticsearch-cache)
[](https://styleci.io/repos/61363628)
[](https://codeclimate.com/github/datashaman/elasticsearch-cache)
[](https://codeclimate.com/github/datashaman/elasticsearch-cache/coverage)
## Installation
Install the package from packagist.org by editing composer.json to include the following (only published on github for now):
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/datashaman/elasticsearch-cache"
}
],
"require": {
"datashaman/elasticsearch-cache": "dev-master"
}
}
Run `composer update` to install the latest package.
*NB* This is currently *ALPHA* quality software. Not for production use yet.
## Usage
Replace the `CacheServiceProvider` in `config/app.php`:
'providers' => [
...
'Illuminate\Broadcasting\BroadcastServiceProvider',
//'Illuminate\Cache\CacheServiceProvider',
'Datashaman\Elasticsearch\Cache\ElasticsearchCacheServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
...
]
Create an index to store the cache:
php artisan cache:index [index]
Index name is *laravel-cache* by default. Ensure that the laravel `prefix` matches `config/cache.php`.
In `.env` file, set `CACHE_DRIVER` to *elasticsearch*, and add the following to `config/cache.php`:
'stores' => [
...
'elasticsearch' => [
'driver' => 'elasticsearch',
'client' => [ # Optional Elasticsearch client config
],
],
...
]
Then use the `Cache` facade as you would normally.
## License
This package is licensed under the Apache2 license, summarized below:
Copyright (c) 2016 datashaman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.