PHP code example of inspirum / mcrouter

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

    

inspirum / mcrouter example snippets


'providers' => [
  // ...
  Inspirum\Mcrouter\Providers\McrouterServiceProvider::class,
]



return [
  'shared_prefix' => '/default/shr/',
  'prefixes'      => [
    '/default/a/',
    '/default/b/',
    '/default/c/',
  ],
];

cache()->tags(['bop', 'zap'])->get('foo');

cache()->get('/default/a/foo');
cache()->get('/default/b/foo');
cache()->get('/default/c/foo');

cache()->tags(['bop', 'zap'])->get('bar1');
cache()->tags(['bop'])->get('bar2');
cache()->tags(['bop', 'zap', 'foo'])->get('bar3');
shell script
php artisan vendor:publish --provider="Inspirum\Mcrouter\Providers\McrouterServiceProvider"