PHP code example of gemini / cache-breaker

1. Go to this page and download the library: Download gemini/cache-breaker 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/ */

    

gemini / cache-breaker example snippets




declare(strict_types=1);

return [
    Gemini\CacheBreaker\Aspect\CacheableAspect::class,
];




declare(strict_types=1);

namespace App\Service;

use Gemini\CacheBreaker\Annotation\Breaker;
use Gemini\CacheBreaker\Fallback\DefaultFallback;
use Hyperf\Cache\Annotation\Cacheable;

class RedisService
{
    /**
     * @Breaker(data={"id": 1}, fallback=DefaultFallback::class)
     * @Cacheable(prefix="redis:test")
     */
    public function get()
    {
        return uniqid();
    }
}