PHP code example of easyswoole / fast-cache

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

    

easyswoole / fast-cache example snippets


use EasySwoole\FastCache\Cache;

("127.0.0.1", 9501);

Cache::getInstance()->attachToServer($http);


$http->on("request", function ($request, $response) {
    $res = Cache::getInstance()->set('easyswoole', 'easyswoole');
    var_dump($res);
    $res = Cache::getInstance()->get('easyswoole');
    $response->end($res);
});

$http->start();
bash
php example.php

 php vendor/bin/co-phpunit tests