Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vladahejda/nettedatabasestorage
NetteDatabase Storage
https://github.com/vladahejda/nettedatabasestorage
Last synced: about 1 month ago
JSON representation
NetteDatabase Storage
- Host: GitHub
- URL: https://github.com/vladahejda/nettedatabasestorage
- Owner: VladaHejda
- Created: 2014-05-30T13:37:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-09T22:11:05.000Z (over 10 years ago)
- Last Synced: 2024-10-27T05:11:24.753Z (2 months ago)
- Language: PHP
- Size: 168 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
NetteDatabase Storage
=====================Install
-------### #1
Download [`src/NetteDatabaseStorage.php`](src/NetteDatabaseStorage.php).
### #2
Create cache table in your database (see [`mysql.cache.sql`](assets/mysql.cache.sql) or
[`postgres.cache.sql`](assets/postgres.cache.sql), you can adapt script for another database server (not tested);
you can change table name).### #3
Instantiate `Nette\Caching\Cache`:
```php
$context = new \Nette\Database\Context(...);
$storage = new \Nette\Caching\Storages\DatabaseStorage($context, 'cache_table_name');
$cache = new \Nette\Caching\Cache($storage);
```### #4
Use it.