PHP code example of mikehaertl / flushable

1. Go to this page and download the library: Download mikehaertl/flushable library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mikehaertl / flushable example snippets


Yii::import('ext.flushable.FlushableDependency');

$dependency = new FlushableDependency('myKey');

// Cache a ActiveRecord
$dependency = new FlushableDependency($id,'Post');
$post = Post::model()->cache(3600,$dependency)->findByPk($id);

FlushableDependency::flushItem('myKey');

FlushableDependency::flushItem($id,'Post');