oihana / php-memcached
The Oihana PHP memcached library
1.0.1
2025-08-11 10:33 UTC
Requires
- php: >=8.4
- ext-memcached: *
- oihana/php-commands: dev-main
- oihana/php-core: dev-main
- oihana/php-files: dev-main
- oihana/php-schema: dev-main
- oihana/php-standards: dev-main
- oihana/php-system: dev-main
Requires (Dev)
- mikey179/vfsstream: ^1.6
- nunomaduro/collision: ^8.8
- phpdocumentor/shim: ^3.8
- phpunit/phpunit: ^12
README
A PHP library for managing Memcached, built on top of the Oihana project libraries (such as oihana-php-commands).
๐ฆ 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
- Author : Marc ALCARAZ (aka eKameleon)
- Mail : marc@ooop.fr
- Website : http://www.ooop.fr