m-shimao / find-in-file-cache
File Cache plugin for CakePHP
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 2
Type:cakephp-plugin
Requires
- php: >=5.5
- cakephp/cakephp: ~3.3
Requires (Dev)
This package is not auto-updated.
Last update: 2025-05-10 23:06:07 UTC
README
What is it for?
It is model behavior for static models. If you want to use file cache for static model, this plugin is easy to use.
Installation
You can install this plugin into your CakePHP application using composer. The recommended way to install composer packages is:
composer require m-shimao/find-in-file-cache dev-master
Also don't forget to load the plugin in your bootstrap:
Plugin::load('FindInFileCache'); // or Plugin::loadAll();
Usage
Table
<?php
class CategoriesTable extends Table
{
public function initialize(array $config)
{
$this->addBehavior('FindInFileCache.FindInFileCache');
}
}
Config
Default Setting is below.
'className' => 'File',↲
'prefix' => 'myapp_cake_static_record_',↲
'path' => CACHE . 'static_records/',↲
'duration' => '+15 minutes',↲
'mask' => 0666,↲
If you use original setting, please edit cache section in app.php.
<?php
return [
...
'Cache' => [
...
'find-in-file' => [
'className' => 'File',↲
<type your setting>
],
...
],
...
];