PHP code example of apollopy / laravel-memcached

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

    

apollopy / laravel-memcached example snippets


// config/app.php

'providers' => [
    // Illuminate\Cache\CacheServiceProvider::class,
    ApolloPY\Memcached\CacheServiceProvider::class,
]

// config/cache.php

'memcached' => [
    'driver'  => 'memcached',
    'servers' => [
        [
            'host' => '127.0.0.1',
            'port' => 11211,
            'weight' => 100,
        ],
    ],
    'persistent_id' => 'you persistent id',
    'username' => 'you username',
    'password' => 'you password',
    'options'       => [ // optional
        Memcached::OPT_COMPRESSION     => false,
        Memcached::OPT_BINARY_PROTOCOL => true,
        ...
    ],
    'check_version' => false, // optional, default true
],