Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeroendesloovere/cache
This Cache PHP class allows you to cache pages and data.
https://github.com/jeroendesloovere/cache
Last synced: 2 months ago
JSON representation
This Cache PHP class allows you to cache pages and data.
- Host: GitHub
- URL: https://github.com/jeroendesloovere/cache
- Owner: jeroendesloovere
- License: mit
- Created: 2013-09-04T09:13:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-04T04:23:58.000Z (about 10 years ago)
- Last Synced: 2024-10-11T13:12:27.923Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 373 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cache PHP class
This Cache PHP class allows you to cache pages and data for a certain time.
Is a stand-alone class to create speed-win on the server.## Installation
### Using Composer
When using [Composer](https://getcomposer.org) you can always load in the latest version.
```json
{
"require": {
"jeroendesloovere/cache": "1.1.*"
}
}
```
> Check [in Packagist](https://packagist.org/packages/jeroendesloovere/cache).## Functions
### Caching page-parts
``` php
Cache::start($folder, $name, $lifetime = false, $overwrite = false);
Cache::end();
```### Caching data
``` php
Cache::setData($folder, $name, $data, $lifetime = false);
Cache::getData($folder, $name, $overwrite = false);
```### Setting cache output
``` php
Cache::setCachePath($path);
```### Setting cache file extension
``` php
Cache::setCacheExtension('.tpl');
```## Documentation
The class is well documented inline. If you use a decent IDE you'll see that each method is documented with PHPDoc.
## Contributing
It would be great if you could help us improve this class. GitHub does a great job in managing collaboration by providing different tools, the only thing you need is a [GitHub](http://github.com) login.
* Use **Pull requests** to add or update code
* **Issues** for bug reporting or code discussions
* Or regarding documentation and how-to's, check out **Wiki**
More info on how to work with GitHub on help.github.com.## License
The module is licensed under [MIT](./LICENSE.md). In short, this license allows you to do everything as long as the copyright statement stays present.