Skip to content

altinukshini/memcached-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using this class

I'm using this class for development use in laravel 5 on windows machine. This class simulates the real memcached php extension in windows which actually doesn't exist yet (php_memcached.dll).

Configuration in Windows machine

Before you do anything else, make sure you have memcached server installed. Here's a blog that shows how to do that (follow setp A): https://commaster.net/content/installing-memcached-windows

Assuming you have memcached server isntalled, proceed with the following.

Place memcached.php file in C:\xampp\php\pear folder

In your laravel 5 installation, edit AppServiceProvider.php and place the code below inside the boot() method.

if (!class_exists('Memcached')) {
    include ("memcached.php");
}

so it should look something like:

public function boot(Kernel $kernel)
{
    if (!class_exists('Memcached')) {
        include ("memcached.php");
    }
}

...you should be good to go!

PHP Memcached Client (simulator)

As there has no php memcached extension for windows now, it's difficult to build develop envionment, so this class will be helpful.

Inspried by: http://github.com/joonas-fi/xslib-memcached

Usage:

Just as php_memcached extension, new Memcached object and etc.

$m = new Memcached();
$m->addServer('localhost', 11211);

$m->set('foo', 'bar');
$m->get('foo');

Supported method:

  • addServer
  • addServers
  • delete
  • get
  • getOption
  • getResultCode
  • getResultMessage
  • getServerList
  • increment
  • set
  • setOption
  • setOptions
  • getVersion
  • flush

Need disable memcached extension of PHP to run PHPUnit testcase.

License: MIT

About

PHP memcached client class that simulates php_memcached.dll for windows environment.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%