oihana/php-memcached

The Oihana PHP memcached library

1.0.1 2025-08-11 10:33 UTC

This package is auto-updated.

Last update: 2025-08-11 16:28:58 UTC


README

Oihana PHP System

A PHP library for managing Memcached, built on top of the Oihana project libraries (such as oihana-php-commands).

Latest Version
Total Downloads
License

๐Ÿ“ฆ Installation

Requires PHP 8.4+

Install via Composer:

composer require oihana/php-memcached

๐Ÿš€ Quick Start

Initial setup

To run the memcached command locally, you need to create the configuration file config/config.toml.

You can do this by copying and editing the example config:

cp config/config.example.toml config/config.toml

List Memcached info

Display basic Memcached information:

bin/console command:memcached

Example output:

Command:memcached
=================

localhost:11211
---------------

+--------------------+-------+
| Name               | Value |
+--------------------+-------+
| Current cache size | 0 MB  |
| Cache used         | 0 %   |
+--------------------+-------+

โœ…  Done in 5 ms
----------------

 Thank you and see you soon!

List detailed Memcached info

Display full Memcached statistics:

bin/console command:memcached -v

Example output:

Command:memcached
=================

localhost:11211
---------------

+---------------------+-------+
| Name                | Value |
+---------------------+-------+
| Current cache size  | 0 MB  |
| Cache used          | 0 %   |
| Maximum cache size  | 64 MB |
| Total items         | 0     |
| Current connections | 2     |
| Total connections   | 10    |
| Get operations      | 0     |
| Set operations      | 0     |
+---------------------+-------+

โœ…  Done in 6 ms
----------------

 Thank you and see you soon!

Flush Memcached cache

Clear the entire Memcached cache:

bin/console command:memcached --flush

Example output:

Command:memcached
=================

Flush the cache
---------------
                                                                                                                        
 [OK] [โœ“] Flush operation succeeded                                                                                       
                                                                                                                        
โœ…  Done in 4 ms
----------------

Use composer

You can run a composer script:

composer memcache
composer memcache -- -v
composer memcache -- --verbose

composer memcache -- -f
composer memcache -- --flush 

โœ… Running Unit Tests

To run all tests:

composer test

๐Ÿงพ License

This project is licensed under the Mozilla Public License 2.0 (MPL-2.0).

๐Ÿ‘ค About the author